Summary: | [1.5][compiler] lenient subclass checking with interdependent type variables | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Tom Hofmann <eclipse> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 M5 | ||
Hardware: | PC | ||
OS: | Linux-GTK | ||
Whiteboard: |
Description
Tom Hofmann
2005-01-25 10:06:40 EST
Actually the solution eclipse finds seems correct as well - it resolves both Q and L to java.lang.Number. This fulfills both "L extends Q" as well as "Integer isa Number" and "Number isa Number" for the parameters. Not sure what the spec says. During type inference, we indeed infer that Q is Number and not Integer. Unfortunately, spec says we should not be that clever. We did check the variable bound (L extends Q) in first inference pass, to collect possible candidates; but we should only consider doing so in a later stage, when there was no match for Q. Adjusted type argument inference support to defer bound check to later stage. So if candidate is found during method argument inference, it will prevail. Added GenericTypeTest#test494. Fixed Verified in I20050214 |