Skip to content

Commit ce81060

Browse files
committed
Sema: Remove a usage of ArchetypeType::getRoot()
1 parent d4d8557 commit ce81060

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,10 +1007,9 @@ static Type replaceArchetypesWithTypeVariables(ConstraintSystem &cs,
10071007
return found->second;
10081008

10091009
if (auto archetypeType = dyn_cast<ArchetypeType>(origType)) {
1010-
auto root = archetypeType->getRoot();
1011-
// For other nested types, fail here so the default logic in subst()
1010+
// For nested types, fail here so the default logic in subst()
10121011
// for nested types applies.
1013-
if (root != archetypeType)
1012+
if (!archetypeType->getInterfaceType()->is<GenericTypeParamType>())
10141013
return Type();
10151014

10161015
auto locator = cs.getConstraintLocator({});

0 commit comments

Comments
 (0)