[CSSimplify] Detect and diagnose attempts to specialize non-generic types/aliases

This commit is contained in:
Pavel Yaskevich
2023-06-27 15:49:19 -07:00
parent 40169c74ee
commit 2bbda09043
2 changed files with 16 additions and 2 deletions

View File

@@ -13658,8 +13658,15 @@ ConstraintSystem::simplifyExplicitGenericArgumentsConstraint(
}
}
if (openedGenericParams.empty())
return SolutionKind::Error;
if (openedGenericParams.empty()) {
if (!shouldAttemptFixes())
return SolutionKind::Error;
return recordFix(AllowConcreteTypeSpecialization::create(
*this, type1, getConstraintLocator(locator)))
? SolutionKind::Error
: SolutionKind::Solved;
}
assert(openedGenericParams.size() == genericParams->size());