-
Bug
-
Resolution: Fixed
-
P4
-
repo-valhalla
-
generic
-
generic
The following code:
public class X {
static class G<T> {}
public static void main(String [] args) {
Object [] oa = new X[] { new X() };
if (!(oa instanceof IdentityObject))
throw new AssertionError("Arrays are broken");
Object o = new G<String>();
if (!(o instanceof IdentityObject))
throw new AssertionError("Parameterized type are broken");
}
}
fails to compile with:
X.java:5: error: incompatible types: Object[] cannot be converted to IdentityObject
if (!(oa instanceof IdentityObject))
^
1 error