Merge pull request #75647 from slavapestov/fix-issue-74858

Sema: Fix crash with SpecializeExpr around something that's not a type
This commit is contained in:
Slava Pestov
2024-08-02 18:42:17 -04:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -13980,6 +13980,8 @@ ConstraintSystem::simplifyExplicitGenericArgumentsConstraint(
decl = bound->getDecl();
for (auto argType : bound->getDirectGenericArgs()) {
auto *typeVar = argType->getAs<TypeVariableType>();
if (!typeVar)
return SolutionKind::Error;
auto *genericParam = typeVar->getImpl().getGenericParameter();
openedTypes.push_back({genericParam, typeVar});
}