Summary: | [1.5][compiler] Phantom erasure collision error. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Ed Merks <Ed.Merks> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | VERIFIED DUPLICATE | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | give.a.damus | ||||
Version: | 3.3 | ||||||
Target Milestone: | 3.2.2 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Ed Merks
2006-12-08 14:10:07 EST
Created attachment 55330 [details]
The project that illustrates the problem.
This is happening in the I20051205-1200 build, too. Added disabled regression test in org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#test1094. Right now we report: ---------- 1. ERROR in D:\tests_sources\example\src\ExampleFactoryImpl.java (at line 1) public class ExampleFactoryImpl implements ExampleFactory { ^^^^^^^^^^^^^^^^^^ The type ExampleFactoryImpl must implement the inherited abstract method ExampleFactory.createCrazy() ---------- 2. ERROR in D:\tests_sources\example\src\ExampleFactoryImpl.java (at line 2) public <O extends Other, T extends O> Crazy<O, T> createCrazy() { ^^^^^^^^^^^^^ Name clash: The method createCrazy() of type ExampleFactoryImpl has the same erasure as createCrazy() of type ExampleFactory but does not override it ---------- javac 1.5.0 compiles it fine. Also fails with 3.2.0 and 3.2.1. This is not a regression. The problem is at the end of BinaryTypeBinding.initializeTypeVariable() : var.superInterfaces = bounds == null ? Binding.NO_SUPERINTERFACES : bounds; if (firstBound == null) { firstBound = var.superInterfaces.length == 0 ? null : var.superInterfaces[0]; var.modifiers |= ClassFileConstants.AccInterface; <<<< } var.firstBound = firstBound; In the source case, we do not tag the modifiers with AccInterface when the firstBound is an interface. Why are we doing it here? When should a TypeVariableBinding think its an interface? Another case of bug 162991 *** This bug has been marked as a duplicate of bug 162991 *** Activated GenericTypeTest#test1094 in HEAD and released it in R3_2_maintenance stream. verified for 3.2.2 using build M20070112-1200 |