Summary: | [1.5][compiler] Inconsistency with Sun JDK | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Richard Hyatt <rhyatt> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 RC2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Richard Hyatt
2005-05-25 17:42:53 EDT
Reproduced in 3.1rc1 Reduced testcase: public class X { public static <V, P extends Persistent<V>> P createDataObject(V value) { return null; } public static void testCreateDataObject(Object v) { Persistent d = createDataObject(v); } private interface Persistent<V> { public V getValueObject(); } } Problem comes from inference using expected return type which did not perform substitution of variable (P) upper bound (Persistent<V> --> Persistent<Object>). Added GenericTypeTest#test710. Also, the unchecked warning from javac looks like a bug. Inference should figure P is Persistent<Object>, and this needs no unchecked warning (guessing it infers raw Persistent instead). Fixed Verified for 3.1 RC2 using build N20050607-0010 + JDT/Core HEAD Verified with I20050610-0010 |