Summary: | [1.5][compiler] Incorrect generics behaviour | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Evans <evans.armitage> |
Component: | Core | Assignee: | Kent Johnson <kent_johnson> |
Status: | VERIFIED NOT_ECLIPSE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | Olivier_Thomann, philippe_mulet |
Version: | 3.4 | ||
Target Milestone: | 3.5 RC1 | ||
Hardware: | PC | ||
OS: | All | ||
Whiteboard: |
Description
Evans
2009-05-11 09:36:54 EDT
This compiles fine on JDK7b57. d:\tests_sources>javac X.java d:\tests_sources>java -version java version "1.7.0-ea" Java(TM) SE Runtime Environment (build 1.7.0-ea-b57) Java HotSpot(TM) Client VM (build 16.0-b02, mixed mode) It doesn't compile on JDK6 build 1.6.0_14-ea-b05. d:\tests_sources>javac X.java X.java:8: cannot find symbol symbol : method valueOf(int) location: bound of type variable T new X<Integer>().addThem(40, 2); ^ Fatal Error: Unable to find method valueOf It compiles and runs on eclipse using JRE for 1.6.0_06 though. I don't have jdk7 yet so I didn't test there. Does that mean it's a Sun bug fixed in JDK 7? Generic inference is supposed to use boxing conversion when applicable, so yes it should work. Closing as NOT_ECLIPSE since this is fixed in javac 7 & may eventually get backported to a java 6 build Verified for 3.5RC1 using I20090511-2000. |