Community
Participate
Working Groups
Attached is a test case that shows the bug w/ the respective Eclipse project files, etc. I've also included the files inline because they are so small: public class ClassA { public ClassA() { String[] strings = new String[] { "test" }; // this fails Object obj = ClassB.doSomething((String)strings[0]); // this works fine String intermediate = ClassB.doSomething((String)strings[0]); Object obj1 = intermediate; } } public class ClassB { public static <TargetType extends Serializable> TargetType doSomething(String value) { return (TargetType)value; } }
Created attachment 17664 [details] Test case showing the bug
Forgot to include that this is against build I20050201-0800
We use expected type (from assignment LHS: Object) in place of type variable erasure (Serializable). We should be using the most specific of the 2.
Added GenericTypeTest#test510. Fixed
Verified in I20050330-0500