Bug 104198

Summary: typing problem with import static, generics and enum
Product: [Eclipse Project] JDT Reporter: Rémi Forax <forax>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rémi Forax CLA 2005-07-18 04:29:34 EDT
the following code doesn't compile with eclipse :

AbstractTest.java:
package test;

public abstract class AbstractTest<Z> {
  
  public abstract MyEnum m(Z z);
  
  public enum MyEnum {
    A,B
  }
}

Test.java:
package test;

import static test.AbstractTest.MyEnum.*;

public class Test extends AbstractTest<String> {
  @Override
  public MyEnum m(String s) {
    return A; // <--- here
  }
}

This corectly compile without the import static or
without the generics.

The infered type of A is AbstractTest<Z>.MyEnum
and not AbstractTest.MyEnum.
It seems that eclipse doesn't considere that
enum {} is a static context (the enum must not
parametrized by Z) in case of static import.
 
Rémi Forax
Comment 1 Philipe Mulet CLA 2005-07-18 10:54:04 EDT
Which build are you using ? It works fine for me.
Comment 2 Philipe Mulet CLA 2005-07-18 10:54:27 EDT
Checked with Eclipse 3.1.0.
Comment 3 Philipe Mulet CLA 2005-07-18 10:59:18 EDT
Cannot reproduce.
Comment 4 Philipe Mulet CLA 2005-07-18 11:00:04 EDT
Added StaticImportTest#test034
Comment 5 Rémi Forax CLA 2005-07-18 11:15:03 EDT
(In reply to comment #1)
> Which build are you using ? It works fine for me.

 I20050627-1300

but works fine with :

 I20050627-1435

ok, thanx