Bug 104198 - typing problem with import static, generics and enum
Summary: typing problem with import static, generics and enum
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1.1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-18 04:29 EDT by Rémi Forax CLA
Modified: 2005-07-18 11:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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