aboutsummaryrefslogtreecommitdiff
path: root/tests/repl/imports.check
blob: 12056280f021084a1d12fdbdf8520b1dfc81a51e (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
25
26
27
28
scala> import scala.collection.mutable
import scala.collection.mutable
scala> val buf = mutable.ListBuffer[Int]()
val 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
-- [E007] Type Mismatch Error: <console>:11:7 ----------------------------------
11 |buf += xs
   |       ^^
   |       found:    scala.collection.immutable.List[Int](o.xs)
   |       required: Int
   |       
scala> buf ++= xs
val res1: scala.collection.mutable.ListBuffer[Int] = ListBuffer(1, 2, 3)
scala> import util.foo
-- Error: <console>:8:12 -------------------------------------------------------
8 |import util.foo
  |            ^^^
  |            foo is not a member of util
scala> import util.foo.bar
-- [E008] Member Not Found Error: <console>:8:12 -------------------------------
8 |import util.foo.bar
  |       ^^^^^^^^
  |      value `foo` is not a member of util.type - did you mean `util.Left`?
scala> :quit