Community
Participate
Working Groups
3.1rc1 This should fail: import java.util.*; public class Y { public static void main(String[] args) { List<String> l = (List<String>)Collections.emptyList(); } } Generic method invocation only looks at the expected type when in the context of Assignment Conversion, not Casting Conversion.
Credits for finding this defect go to Tim Hanson.
Added GenericTypeTest#test704. Impacted other existing tests (171&396). Fix is to stop setting expected type in CastExpressions. Fixed
Verified for 3.1 RC2 using build N20050607-0010 + JDT/Core HEAD
Verified for 3.1 RC2 using build I20050610-0010