-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathimportFromObj
29 lines (29 loc) · 1.01 KB
/
importFromObj
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
29
scala> 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 object o
scala> import o._
scala> buf += xs
-- [E007] Type Mismatch Error: -------------------------------------------------
1 | buf += xs
| ^^
| Found: (o.xs : List[Int])
| Required: Int
|
| longer explanation available when compiling with `-explain`
1 error found
scala> buf ++= xs
val res0: scala.collection.mutable.ListBuffer[Int] = ListBuffer(1, 2, 3)
scala> import util.foobar
-- [E008] Not Found Error: -----------------------------------------------------
1 | import util.foobar
| ^^^^^^
| value foobar is not a member of util
1 error found
scala> import util.foobar.bar
-- [E008] Not Found Error: -----------------------------------------------------
1 | import util.foobar.bar
| ^^^^^^^^^^^
| value foobar is not a member of util
1 error found