Community
Participate
Working Groups
class Test<A> { interface MyInt<K> { K getKey(); } class MyEntry implements MyInt<A> { public A getKey() { return null; } public boolean equals(Object o) { if(!(o instanceof MyEntry)) return false; MyEntry m = (MyEntry) o; return m.getKey().equals(getKey()); } } } The error message at "instanceof MyEntry" has its arguments swapped: > "Cannot perform instanceof check against parameterized type Test<A>.MyEntry. should be "MyEntry" -> ^^^^^^^^^^^^^^^ > Use the form MyEntry instead since further generic type information will be ^^^^^^^ <- should be "Test<A>.MyEntry" > erased at runtime".
Oops, the arguments are not really swapped. The first argument is actually OK, but the second argument should be the erased type-qualified type, i.e.: "Use the form Test.MyEntry instead ...".
Created attachment 164036 [details] Proposed fix + regression test
Released for 3.6M7. Regression test added in: org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#test1460
Verified for 3.6M7 using build I20100424-2000.