JDK-7034913 cleaned up the rules for determining return types and throws clauses of method invocations that reference multiple maximally specific abstract methods. javac behavior needs to be reviewed to check if it is aligned with these rules.
Some specific areas to look into:
- Are subtype returns preferred over return-type-substitutable returns?
- Is the most specific method (and the source of the return type) required to have a subsignature of all others?
- Is anything about the algorithm encounter-order dependent?
- If there is no preferred method (as defined), does an ambiguity error occur?
- Are type variables adapted before making comparisons?
- Is there any difference from the function type algorithm (9.9)? Is the code shared?
The tests appearing in JDK-7034913 are probably worth adding to our test suite.