AST: Use correct functor in ProtocolConformanceRef::mapConformanceOutOfContext()

This commit is contained in:
Slava Pestov
2025-03-28 19:46:05 -04:00
parent 151b1f1873
commit ce3f6e00e8

View File

@@ -129,21 +129,13 @@ ProtocolConformanceRef::subst(Type origType, InFlightSubstitution &IFS) const {
ProtocolConformanceRef ProtocolConformanceRef::mapConformanceOutOfContext() const {
if (isConcrete()) {
return getConcrete()->subst(
[](SubstitutableType *type) -> Type {
if (auto *archetypeType = type->getAs<ArchetypeType>())
return archetypeType->getInterfaceType();
return type;
},
MapTypeOutOfContext(),
MakeAbstractConformanceForGenericType(),
SubstFlags::PreservePackExpansionLevel |
SubstFlags::SubstitutePrimaryArchetypes);
} else if (isPack()) {
return getPack()->subst(
[](SubstitutableType *type) -> Type {
if (auto *archetypeType = type->getAs<ArchetypeType>())
return archetypeType->getInterfaceType();
return type;
},
MapTypeOutOfContext(),
MakeAbstractConformanceForGenericType(),
SubstFlags::PreservePackExpansionLevel |
SubstFlags::SubstitutePrimaryArchetypes);