Bug 129129 - [1.5][compiler] nested generic type in combination with 'extends' confuse compiler
Summary: [1.5][compiler] nested generic type in combination with 'extends' confuse com...
Status: RESOLVED DUPLICATE of bug 127583
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-23 04:54 EST by Tobias Riemenschneider CLA
Modified: 2006-02-24 07:23 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Riemenschneider CLA 2006-02-23 04:54:59 EST
The following piece of code is compiled by 3.2M5's compiler without problems, but javac produces an error.
####
class Test<T> {

  static void a(Class<? extends Test<?>> c) {}

  static void b(Test<?> t) {
    Test.a(t.getClass());
  }
}
####
Sun's javac produces the following error when compile the listed piece of code
####
Test.java:6: a(java.lang.Class<Test<?>>) in Test cannot be applied to (java.lang.Class<capture of ? extends Test>)
                Test.a(t.getClass());
                    ^
1 error
####
When the 'extends' is removed, 3.2M5's compiler produces the correct error
####
The method a(Class<Test<?>>) in the type Test is not applicable for the arguments (Class<capture-of ? extends Test>)
####
Comment 1 Philipe Mulet CLA 2006-02-23 05:54:05 EST
This got resolved just after M5. The IBuild from 02/21 has this fix.
Added GenericTypeTest#test923


*** This bug has been marked as a duplicate of 127583 ***
Comment 2 Tobias Riemenschneider CLA 2006-02-24 07:23:19 EST
(In reply to comment #1)
> This got resolved just after M5. The IBuild from 02/21 has this fix.
> Added GenericTypeTest#test923
> *** This bug has been marked as a duplicate of 127583 ***

Is the reminded fix removed between IBuild from 02/21 and IBuild from 02/23 (related to comment #10 for bug 127583). While IBuild from 02/21 for Linux correctly detects the incorrect code, IBuild from 02/23 for Linux and Windows does not realize it.