-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
5.0
-
generic
-
solaris_8
The following program is correct but rejected by javac:
X.java:3: X cannot be dereferenced
String s = new X().foo().bar();
^
/////////////////////////////////////////
public class X {
public static void main(String[] args) {
String s = new X().foo().bar();
}
<V extends X> V foo() {
return null;
}
String bar() {
return "";
}
}
X.java:3: X cannot be dereferenced
String s = new X().foo().bar();
^
/////////////////////////////////////////
public class X {
public static void main(String[] args) {
String s = new X().foo().bar();
}
<V extends X> V foo() {
return null;
}
String bar() {
return "";
}
}
- duplicates
-
JDK-5003431 java.lang.Object cannot be dereferenced
-
- Closed
-