File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ package P { // `X' bound by package clause
2+ import Console ._ // `println' bound by wildcard import
3+ object A {
4+ println(" L4: " + X ) // `X' refers to `P.X' here
5+ object B {
6+ import Q ._ // `X' bound by wildcard import
7+ println(" L7: " + X ) // `X' refers to `Q.X' here
8+ import X ._ // `x' and `y' bound by wildcard import
9+ println(" L8: " + x) // `x' refers to `Q.X.x' here
10+ object C {
11+ val x = 3 // `x' bound by local definition
12+ println(" L12: " + x) // `x' refers to constant `3' here
13+ locally {
14+ import Q .X ._ // `x' and `y' bound by wildcard import
15+ // println("L14: " + x) // reference to `x' is ambiguous here
16+ import X .y // `y' bound by explicit import
17+ println(" L16: " + y) // `y' refers to `Q.X.y' here
18+ locally {
19+ val x = " abc" // `x' bound by local definition
20+ import P .X ._ // `x' and `y' bound by wildcard import
21+ // println("L19: " + y) // reference to `y' is ambiguous here
22+ println(" L20: " + x) // `x' refers to string ``abc'' here
23+ }
24+ }
25+ }
26+ }
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments