Bug 129129

Summary: [1.5][compiler] nested generic type in combination with 'extends' confuse compiler
Product: [Eclipse Project] JDT Reporter: Tobias Riemenschneider <tobys>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.