summaryrefslogtreecommitdiff
path: root/test/files/neg/specification-scopes/P_2.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/specification-scopes/P_2.scala')
-rw-r--r--test/files/neg/specification-scopes/P_2.scala43
1 files changed, 23 insertions, 20 deletions
diff --git a/test/files/neg/specification-scopes/P_2.scala b/test/files/neg/specification-scopes/P_2.scala
index d59f82e90d..856e58c6fb 100644
--- a/test/files/neg/specification-scopes/P_2.scala
+++ b/test/files/neg/specification-scopes/P_2.scala
@@ -1,21 +1,24 @@
-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
+package p { // `X' bound by package clause
+import Console._ // `println' bound by wildcard import
+object Y {
+ println(s"L4: $X") // `X' refers to `p.X' here
+ locally {
+ import q._ // `X' bound by wildcard import
+ println(s"L7: $X") // `X' refers to `q.X' here
+ import X._ // `x' and `y' bound by wildcard import
+ println(s"L9: $x") // `x' refers to `q.X.x' here
+ locally {
+ val x = 3 // `x' bound by local definition
+ println(s"L12: $x") // `x' refers to constant `3' here
+ locally {
+ import q.X._ // `x' and `y' bound by wildcard import
+ println(s"L15: $x") // reference to `x' is ambiguous here
+ import X.y // `y' bound by explicit import
+ println(s"L17: $y") // `y' refers to `q.X.y' here
+ locally {
+ val x = "abc" // `x' bound by local definition
+ import p.X._ // `x' and `y' bound by wildcard import
+ println(s"L21: $y") // reference to `y' is ambiguous here
+ println(s"L22: $x") // `x' refers to string "abc" here
}}}}}}
+