aboutsummaryrefslogtreecommitdiff
path: root/tests/repl/imports.check
blob: 2e8d5dcf967f53e2f8db2a96ef7e6c618978e8d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
scala> import scala.collection.mutable
import scala.collection.mutable
scala> val buf = mutable.ListBuffer[Int]()
buf: scala.collection.mutable.ListBuffer[Int] = ListBuffer()
scala> object o { val xs = List(1, 2, 3) }
defined module o
scala> import o._
import o._
scala> buf += xs
-- [E006] Type Mismatch Error: <console> -------------------------------------------------------------------------------
10:buf += xs
          ^^
          found:    scala.collection.immutable.List[Int](o.xs)
          required: String
          
-- [E006] Type Mismatch Error: <console> -------------------------------------------------------------------------------
10:buf += xs
   ^^^^^^^^^
   found:    String
   required: scala.collection.mutable.ListBuffer[Int]
   
scala> buf ++= xs
res1: scala.collection.mutable.ListBuffer[Int] = ListBuffer(1, 2, 3)
scala> :quit