Bug 122331 - [1.5][compiler] Erroneous Compiler Error (re: generics and scoping of innerclasses)
Summary: [1.5][compiler] Erroneous Compiler Error (re: generics and scoping of innercl...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-29 13:20 EST by steve francolla CLA
Modified: 2006-02-03 14:02 EST (History)
0 users

See Also:


Attachments
original example class files. (1.64 KB, application/zip)
2006-02-03 13:54 EST, steve francolla CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description steve francolla CLA 2005-12-29 13:20:46 EST
I have a set of classes coded as defined here.  A full set of compileable class files are available at the attached url (until this bug is resolved).

1   //A.java:
2   public class A<T extends A<T>> extends SomeArbitraryClass<T> {
3   
4     public static class B {
5 
6       protected void set(C val) { ... }
7
8       protected class C { ... }
9     }
10  }
11
12  //ObjThatExtendsB.java
13  public class ObjThatExtendsB extends A.B {
14
15    protected void doSomeSetting() {
16      super.set(new ObjThatExtendsC());       //compile error is on this  super.set() call.
17    }
18
19    protected class ObjThatExtendsC extends C { ... }
20  }

This code compiles error-free in Sun 1.5.0_05 but produces the following problem in Eclipse, regarding line 16 above:

  "The method set(A<T>.B.C) in the type A.B is not applicable for 
   the arguments (ObjThatExtendsB.ObjThatExtendsC)"

Since B is a static inner class, should not Eclipse realize extensions B.C independent of A<T>?

I've coded the simple work-around but this is still an issue seeing as the sun compiler handles the code well.

SF
Comment 1 Olivier Thomann CLA 2006-01-03 20:33:42 EST
This is fixed in HEAD, but not in 3.1 maintenance.
Might be a good candidate for 3.1.2
Comment 2 Philipe Mulet CLA 2006-01-05 06:15:27 EST
I suspect it got fixed by merging generic and parameterized bindings, which isn't planned to be backported. So, if this is the case, it would need to be solved differently for 3.1.2.
Comment 3 Philipe Mulet CLA 2006-02-02 18:32:43 EST
No action planned for 3.1.x. It works fine in 3.2 recent drops.

Olivier - pls add a testcase in HEAD for this. 
Comment 4 Olivier Thomann CLA 2006-02-03 13:48:22 EST
Added org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test899.
Closing as WORKSFORME since fixed in HEAD, but no changes were made relative to this bug.
Comment 5 steve francolla CLA 2006-02-03 13:54:38 EST
Created attachment 34103 [details]
original example class files.

For archiving's sake, here are the original example class files.
Comment 6 Olivier Thomann CLA 2006-02-03 13:57:22 EST
the test899 reflects exactly your test case.
Comment 7 steve francolla CLA 2006-02-03 14:02:15 EST
Thought it might -- will keep in mind going forward, thanks!