Summary: | [1.5] Compiler doesn't check that bounds have methods with same return type | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
Component: | Core | Assignee: | Kent Johnson <kent_johnson> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 M5 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Olivier Thomann
2004-12-10 17:16:55 EST
Same problem when the two bounds are interfaces. interface I { Float foo(); } interface J { Integer foo(); } public class X<T extends J&I> { } javac reports in this case: X.java:9: types I and J are incompatible; both define foo(), but with unrelated return types public class X<T extends J&I> { If you replace Integer with Object, it compiles fine. Added MethodVerify test032 NOTE: javac only reports these errors when the problem type follows the bounds if the type X is defined first, then no errors are reported Verified in I20050215-2300 |