Summary: | [1.5][compiler] Type mismatch introduced in 3.1.1 | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Robert Konigsberg <konigsberg> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | AndrewBachmann, Olivier_Thomann, stderr, thanson, trevor |
Version: | 3.1.1 | ||
Target Milestone: | 3.1.2 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Robert Konigsberg
2005-10-11 19:38:19 EDT
Consequence of fix for bug 107079. Wonder if we should force capture before inference here, or allow inferring from wildcards; but then this would contradict spec and break bug 107079 again. Note that all return type inference scenarii are broken in similar fashion: import java.util.*; public class X { List<? extends Comparator> bar() { List<? extends Comparator> l = foo(); return foo(); } <T> List<T> foo() { return null; } } Actually, I had missed one inference rule from the spec (A >> F, where A=G<? extends/super V> >> G<U>) on p. 459. Added support and GenericTypeTest#test841. Fixed, will backport to 3.1 maintenance stream. Thanks Tim for the pointer in spec. Note that in 3.1.0, code was accepted, but slightly incorrectly in the sense that T got inferred to '? extends Comparator', where it is now inferred to be 'Comparator'. Note: workaround is to write: import java.util.*; public class Foo2 { List<? extends Comparator> getFoo() { return Collections.<Comparator>emptyList(); } } Thanks for the immediate response. When (how?) do I get the maintenance release? 3.1.2 is scheduled early next year officially (details on eclipse roadmap). Now, we can post a patch on JDT/Core web page so you do not need to wait that long. Perfect! Thanks again Philippe (and thanson too!) Olivier - pls produce a preview of our 3.1.2 contribution at earliest convenience. *** Bug 112595 has been marked as a duplicate of this bug. *** You can get the jdt/core patch on the jdt/core web page to get it fixed before 3.1.2 is out. See http://www.eclipse.org/jdt/core/r3.1/main.html#updates *** Bug 114997 has been marked as a duplicate of this bug. *** Verified for 3.2M4 in I20051212-2000 Verified for 3.1.2 in M20060109-0800. *** Bug 123390 has been marked as a duplicate of this bug. *** |