aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/specification-scopes/P_2.scala
diff options
context:
space:
mode:
authorSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
committerSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
commit9ef5f6817688f814a3450126aa7383b0928e80a0 (patch)
tree5727a2f7f7fd665cefdb312af2785c692f04377c /tests/untried/neg/specification-scopes/P_2.scala
parent194be919664447631ba55446eb4874979c908d27 (diff)
downloaddotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.gz
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.bz2
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.zip
add tests from scala/test/files/{pos,neg}
with explicit Unit return type
Diffstat (limited to 'tests/untried/neg/specification-scopes/P_2.scala')
-rw-r--r--tests/untried/neg/specification-scopes/P_2.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/untried/neg/specification-scopes/P_2.scala b/tests/untried/neg/specification-scopes/P_2.scala
new file mode 100644
index 000000000..d59f82e90
--- /dev/null
+++ b/tests/untried/neg/specification-scopes/P_2.scala
@@ -0,0 +1,21 @@
+package P { // 'X' bound by package clause
+ import Console._ // 'println' bound by wildcard import
+ object A {
+ println("L4: "+X) // 'X' refers to 'P.X' here
+ object B {
+ import Q._ // 'X' bound by wildcard import
+ println("L7: "+X) // 'X' refers to 'Q.X' here
+ import X._ // 'x' and 'y' bound by wildcard import
+ println("L8: "+x) // 'x' refers to 'Q.X.x' here
+ object C {
+ val x = 3 // 'x' bound by local definition
+ println("L12: "+x); // 'x' refers to constant '3' here
+ { import Q.X._ // 'x' and 'y' bound by wildcard
+ println("L14: "+x) // reference to 'x' is ambiguous here
+ import X.y // 'y' bound by explicit import
+ println("L16: "+y); // 'y' refers to 'Q.X.y' here
+ { val x = "abc" // 'x' bound by local definition
+ import P.X._ // 'x' and 'y' bound by wildcard
+ println("L19: "+y) // reference to 'y' is ambiguous here
+ println("L20: "+x) // 'x' refers to string ''abc'' here
+}}}}}}