Merge pull request #77652 from xedin/issue-77644

[CSSimplify] Handle invalid type specializations
This commit is contained in:
Pavel Yaskevich
2024-11-18 10:14:14 -08:00
committed by GitHub
2 changed files with 8 additions and 4 deletions

View File

@@ -13935,6 +13935,13 @@ ConstraintSystem::simplifyExplicitGenericArgumentsConstraint(
} else {
// If the overload hasn't been resolved, we can't simplify this constraint.
auto overloadLocator = getCalleeLocator(getConstraintLocator(locator));
// If there was a problem resolving specialization expression
// it would be diagnosted as invalid AST node.
if (overloadLocator->directlyAt<ErrorExpr>()) {
return shouldAttemptFixes() ? SolutionKind::Error : SolutionKind::Solved;
}
auto selectedOverload = findSelectedOverloadFor(overloadLocator);
if (!selectedOverload)
return formUnsolved();