Bug 114087

Summary: [1.5][compiler] Eclipse compiles code that cannot be compiled with JDK!
Product: [Eclipse Project] JDT Reporter: Ingo R. Homann <ingo.homann>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ingo R. Homann CLA 2005-10-28 07:38:24 EDT
Eclipse 3.1.0 I20050627-1435 compiles the following code. JDK1.5.0_04 does not.

import java.util.List;

class Foo
{

  static <T extends Runnable> List<List<T>> foo()
  {
    return null;
  }

}

public class CompilerBug
{

  {
    List<List> o = Foo.foo();
  }

}
Comment 1 Olivier Thomann CLA 2005-10-28 11:53:17 EDT
javac reports:
X.java:17: incompatible types; no instance(s) of type variable(s) T exist so
that java.util.List<java.util.List<T>> conforms to java.util.List<java.util.List>
found   : <T>java.util.List<java.util.List<T>>
required: java.util.List<java.util.List>
    List<List> o = Foo.foo();
                          ^
1 error
Comment 2 Philipe Mulet CLA 2005-11-04 06:36:39 EST
Tuned inference semantics to reject inference from raw type when constraint is A
== F. Added GenericTest#test867.

Releasing to 3.1.2 and 3.2 streams.
With this fix, method will be reported as not applicable (may be improved
slightly in the future).
Comment 3 Olivier Thomann CLA 2005-12-13 10:18:49 EST
Now we report the following error:
The method foo() in the type Foo is not applicable for the arguments ()

Verified for 3.2M4 in I20051212-2000
Comment 4 Olivier Thomann CLA 2006-01-09 11:08:03 EST
Verified for 3.1.2 in M20060109-0800.