Bug 114087 - [1.5][compiler] Eclipse compiles code that cannot be compiled with JDK!
Summary: [1.5][compiler] Eclipse compiles code that cannot be compiled with JDK!
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1.2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-28 07:38 EDT by Ingo R. Homann CLA
Modified: 2006-01-09 11:08 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 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.