Skip to content

Commit de729e2

Browse files
committed
[CSSimplify] Adjust typalias declaration handling for generic specialization
1 parent b9b21fc commit de729e2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13607,14 +13607,12 @@ ConstraintSystem::simplifyExplicitGenericArgumentsConstraint(
1360713607
return nullptr;
1360813608

1360913609
auto genericParams = genericContext->getGenericParams();
13610-
if (!genericParams || genericParams->size() == 0) {
13610+
if (!genericParams) {
1361113611
// If declaration is a non-generic typealias, let's point
1361213612
// to the underlying generic declaration.
1361313613
if (auto *TA = dyn_cast<TypeAliasDecl>(decl)) {
13614-
if (TA->isGeneric())
13615-
return nullptr;
13616-
if (auto underlying = TA->getUnderlyingType()->getAnyNominal())
13617-
return getGenericParams(underlying);
13614+
if (auto *UGT = TA->getUnderlyingType()->getAs<AnyGenericType>())
13615+
return getGenericParams(UGT->getDecl());
1361813616
}
1361913617
}
1362013618

@@ -13625,7 +13623,7 @@ ConstraintSystem::simplifyExplicitGenericArgumentsConstraint(
1362513623
return SolutionKind::Error;
1362613624

1362713625
auto genericParams = getGenericParams(decl);
13628-
if (!genericParams || genericParams->size() == 0) {
13626+
if (!genericParams) {
1362913627
// FIXME: Record an error here that we're ignoring the parameters.
1363013628
return SolutionKind::Solved;
1363113629
}

0 commit comments

Comments
 (0)