Bug 89440 - [1.5][problems] Reference to member of parameterized type incorrectly marked as error
Summary: [1.5][problems] Reference to member of parameterized type incorrectly marked ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-29 19:23 EST by Phil Goodwin CLA
Modified: 2005-05-12 12:51 EDT (History)
0 users

See Also:


Attachments
test case (706 bytes, application/octet-stream)
2005-05-11 11:19 EDT, Olivier Thomann CLA
no flags Details
Apply on HEAD of org.eclipse.jdt.core.tests.compiler (1.80 KB, patch)
2005-05-11 14:50 EDT, Olivier Thomann CLA
no flags Details | Diff

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