| Summary: | [1.5][compiler] Casting Conversion needs to check all supertypes for conflicts | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Tim Hanson <thanson> |
| 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: | |||
Reproduced with latest. Added GenericTypeTest#test732-736. Cast check between interfaces must ensure no incompatible supertype exist. Check similar to connecting superinterfaces for a type (except for hierarchy it is a bit as no wildcard can be used). Defined and used ReferenceBinding#hasIncompatibleSuperType(...) Fixed Fixed Added more tests to cover mixed class/interface scenarii: GenericTypeTest#test738-741 Verified for 3.1 RC2 using build I20050610-0010 + JDT/Core head Verified in I20050610-1200. |
Eclipse allows the following illegal cast: interface C extends B<String>{} interface D extends B<Integer>{} interface A<T> {} interface B<T> {} class Z { public static void main(String[] args) { D d = null; C c = (C)d; // illegal } }