Bug 89440

Summary: [1.5][problems] Reference to member of parameterized type incorrectly marked as error
Product: [Eclipse Project] JDT Reporter: Phil Goodwin <phil.goodwin>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
test case
none
Apply on HEAD of org.eclipse.jdt.core.tests.compiler none

Description Phil Goodwin CLA 2005-03-29 19:23:01 EST
public interface SampleClass<V> {
  public static enum Stuff{FIRST, SECOND, THIRD};
}

import com.google.bigtable.SampleClass.Stuff;

public class SampleClass2 {
  public void doSomething(Stuff thing) {
    
  }
}

public class SampleClass3 {
  public void doSomething() {
    SampleClass2 sample = new SampleClass2();
    sample.doSomething(SampleClass.Stuff.FIRST);
  }
}

Gives the error:
"The method doSomething(SampleClass.Stuff) in the type SampleClass2 is not
applicable for the arguments (SampleClass<V>.Stuff)"

I think that SampleClass and SampleClass<V> are equivelent and that this should
not be an error.
Comment 1 Philipe Mulet CLA 2005-04-18 18:33:52 EDT
Added GenericTypeTest#test619
Comment 2 Philipe Mulet CLA 2005-04-18 18:35:42 EDT
Fixed by tuning semantics for creating raw enclosing types (along with fix for
bug 84973).
Fix will be released along with changes for bug 84496
Comment 3 Philipe Mulet CLA 2005-04-21 09:12:17 EDT
Released
Comment 4 Olivier Thomann CLA 2005-05-11 11:19:23 EDT
Created attachment 20979 [details]
test case

This test case still reports a problem
Comment 5 Olivier Thomann CLA 2005-05-11 11:34:38 EDT
Reopen as the attached test case is still failing.
Comment 6 Olivier Thomann CLA 2005-05-11 14:50:00 EDT
Created attachment 20996 [details]
Apply on HEAD of  org.eclipse.jdt.core.tests.compiler

The problem has to do with incremental compilation. If you compile the three
classes all together, there is no error, but if you define them one by one,
then it doesn't work.
You can reproduce in Eclipse by making a change to SampleClass3 and then
compile it.
Comment 7 Philipe Mulet CLA 2005-05-11 17:27:47 EDT
Binary scenario is a consequence of poor substitution of enum constant from
binary type.

Fixed by treating specially enum constants in ParameterizedFieldBinding
constructor (field type gets set with param declaring class).

Released GenericTypeTest#test650.
Fixed
Comment 8 Olivier Thomann CLA 2005-05-12 12:51:37 EDT
Verified in I20050510-0010 + JDT/Core HEAD 05/12