Skip to content

Commit c298997

Browse files
committed
AST: Use ArchetypeType::getExistentialType() in a couple of places
1 parent 1b1963e commit c298997

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

lib/AST/Type.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,7 @@ Type TypeBase::typeEraseOpenedArchetypesWithRoot(
645645
for (auto replacementType :
646646
opaque->getSubstitutions().getReplacementTypes()) {
647647
if (replacementType->hasOpenedExistentialWithRoot(root)) {
648-
Type interfaceType = opaque->getInterfaceType();
649-
auto genericSig =
650-
opaque->getDecl()->getOpaqueInterfaceGenericSignature();
651-
return genericSig->getNonDependentUpperBounds(interfaceType);
648+
return opaque->getExistentialType();
652649
}
653650
}
654651
}

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,10 +2174,7 @@ static Type typeEraseExistentialSelfReferences(Type refTy, Type baseTy,
21742174
for (auto replacementType :
21752175
opaque->getSubstitutions().getReplacementTypes()) {
21762176
if (hasErasedGenericParameter(replacementType)) {
2177-
Type interfaceType = opaque->getInterfaceType();
2178-
auto genericSig =
2179-
opaque->getDecl()->getOpaqueInterfaceGenericSignature();
2180-
return genericSig->getNonDependentUpperBounds(interfaceType);
2177+
return opaque->getExistentialType();
21812178
}
21822179
}
21832180
}

0 commit comments

Comments
 (0)