Summary: | [1.5][compiler] Problem when implementing generic interface with method that has enum parameter | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Emerson Murphy-Hill <captain.emerson> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | markus.kell.r, philippe_mulet |
Version: | 3.1 | ||
Target Milestone: | 3.1.1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Emerson Murphy-Hill
2005-06-22 19:48:45 EDT
Looks like a compiler problem. May be related to bug 100546, since enums are implicitly static. javac accepts this code *** Bug 101473 has been marked as a duplicate of this bug. *** Philippe: we are getting thrown off because the 2 methods appear to have different parameters. The method myMethod from MyClass has a ParameterizedType myEnum, but the method myMethod from MyInterface#RAW has myEnum#RAW as its parameter. Should MyClass.myMethod pick up myEnum as a Parameterized type? It looks like it should be a raw type... We have the same problem with raw member types. class Y implements I { // is not I.M#RAW but is Parameterized M inside I#RAW public void x(M value) {} } interface I<T> { class M {} void x(M value); } Philippe: Please look at ParamaterizedTypeBinding.memberTypes() It is not overridden in RawTypeBinding. Why should a RawTypeBinding's member types not be raw types also? Actually, the bug comes from the other side. The reference to non-generic member of raw type should be a ParameterizedTypeBinding with raw enclosing type, and null arguments (denoting these special constructs). Problem comes from Scope.substitute(...) of a generic type. Added GenericTypeTest#test819-820. Fixed in 3.1.x and 3.2.0 streams. Verified in I20050920-0010 for 3.2M2 Verified using M20050923-1430 for 3.1.1 |