author | jlahoda |
Thu, 09 Oct 2014 10:08:52 +0200 | |
changeset 26993 | 513b2cae81c3 |
parent 25310 | a2e7f254f886 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
25310
a2e7f254f886
8046770: .out files for assert, boxing, and overload tests in tools/javac dir
sogoel
parents:
5520
diff
changeset
|
2 |
* @test /nodynamiccopyright/ |
10 | 3 |
* @bug 5009484 |
4 |
* @summary Compiler fails to resolve appropriate type for outer member |
|
5 |
* @author Philippe P Mulet |
|
25310
a2e7f254f886
8046770: .out files for assert, boxing, and overload tests in tools/javac dir
sogoel
parents:
5520
diff
changeset
|
6 |
* @compile/fail/ref=X.out -XDrawDiagnostics X.java |
10 | 7 |
*/ |
8 |
||
9 |
public class X<T> { |
|
10 |
private T t; |
|
11 |
X(T t) { |
|
12 |
this.t = t; |
|
13 |
} |
|
14 |
public static void main(String[] args) { |
|
15 |
new X<String>("OUTER").bar(); |
|
16 |
} |
|
17 |
void bar() { |
|
18 |
new X<X>(this) { // #1 |
|
19 |
void run() { |
|
20 |
new Object() { // #2 |
|
21 |
void run() { |
|
22 |
X x = t; // #3 <--- which t is bound ? |
|
23 |
System.out.println(x); |
|
24 |
} |
|
25 |
}.run(); |
|
26 |
} |
|
27 |
}.run(); |
|
28 |
} |
|
29 |
} |