- When an applicability test fails (ie: during LUB) we don't want that
   to bubble up and fail the process, simply to discard the candidate
   and move forward. If no matching candidate is found, the inference
   will fail anyway.
This commit is contained in:
Juan Martín Sotuyo Dodero
2024-04-27 20:50:13 -03:00
parent b510f77a79
commit 0a7a52f228

View File

@ -577,7 +577,12 @@ public final class Infer {
// we only test it can reduce, we don't commit inferred types at this stage
InferenceContext ctxCopy = infCtx.copy();
LOG.applicabilityTest(ctxCopy, m);
ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8());
try {
ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8());
} catch (ResolutionFailedException | IllegalArgumentException ignored) {
// applicability test failed for this candidate, but continue with others
return null;
}
// if unchecked conversion was needed, update the site for invocation pass
if (ctxCopy.needsUncheckedConversion()) {