2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-07-02 21:27:10 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2007-12-01 00:00:00 +00:00
|
|
|
* @bug 5009484
|
|
|
|
* @summary Compiler fails to resolve appropriate type for outer member
|
|
|
|
* @author Philippe P Mulet
|
2014-07-02 21:27:10 +00:00
|
|
|
* @compile/fail/ref=X.out -XDrawDiagnostics X.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class X<T> {
|
|
|
|
private T t;
|
|
|
|
X(T t) {
|
|
|
|
this.t = t;
|
|
|
|
}
|
2023-01-17 04:43:40 +00:00
|
|
|
public static void meth() {
|
2007-12-01 00:00:00 +00:00
|
|
|
new X<String>("OUTER").bar();
|
|
|
|
}
|
|
|
|
void bar() {
|
|
|
|
new X<X>(this) { // #1
|
|
|
|
void run() {
|
|
|
|
new Object() { // #2
|
|
|
|
void run() {
|
|
|
|
X x = t; // #3 <--- which t is bound ?
|
|
|
|
System.out.println(x);
|
|
|
|
}
|
|
|
|
}.run();
|
|
|
|
}
|
|
|
|
}.run();
|
|
|
|
}
|
|
|
|
}
|