Skip to content

Commit 15b1222

Browse files
committed
Tests that order matters in import nullification
1 parent 99655e3 commit 15b1222

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

test/files/neg/yimports-order.check

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
yimports-order.scala:9: error: not found: value Map
2+
def f() = Map("hello" -> "world")
3+
^
4+
yimports-order.scala:9: error: value -> is not a member of String
5+
def f() = Map("hello" -> "world")
6+
^
7+
yimports-order.scala:10: error: not found: value println
8+
def g() = println(f())
9+
^
10+
three errors found

test/files/neg/yimports-order.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
package top {
3+
package middle {
4+
class C {
5+
def c() = println("hello, world")
6+
}
7+
import Predef.{Map => _}
8+
object Test {
9+
def f() = Map("hello" -> "world")
10+
def g() = println(f())
11+
}
12+
}
13+
}

test/files/pos/yimports-order-b.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
package top {
3+
package middle {
4+
import bottom.B.b
5+
class C {
6+
def p() = println("hello, world")
7+
def f = b // comment me to see Predef exclusion
8+
}
9+
}
10+
}
11+
12+
package bottom {
13+
import Predef.{Set => _}
14+
object B {
15+
def b = Set(42)
16+
}
17+
}

0 commit comments

Comments
 (0)