Skip to content

Commit 35a64c9

Browse files
committed
AST: Use correct functor in ProtocolConformanceRef::mapConformanceOutOfContext()
1 parent 1424e0d commit 35a64c9

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/AST/ProtocolConformanceRef.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,13 @@ ProtocolConformanceRef::subst(Type origType, InFlightSubstitution &IFS) const {
127127
ProtocolConformanceRef ProtocolConformanceRef::mapConformanceOutOfContext() const {
128128
if (isConcrete()) {
129129
return getConcrete()->subst(
130-
[](SubstitutableType *type) -> Type {
131-
if (auto *archetypeType = type->getAs<ArchetypeType>())
132-
return archetypeType->getInterfaceType();
133-
return type;
134-
},
130+
MapTypeOutOfContext(),
135131
MakeAbstractConformanceForGenericType(),
136132
SubstFlags::PreservePackExpansionLevel |
137133
SubstFlags::SubstitutePrimaryArchetypes);
138134
} else if (isPack()) {
139135
return getPack()->subst(
140-
[](SubstitutableType *type) -> Type {
141-
if (auto *archetypeType = type->getAs<ArchetypeType>())
142-
return archetypeType->getInterfaceType();
143-
return type;
144-
},
136+
MapTypeOutOfContext(),
145137
MakeAbstractConformanceForGenericType(),
146138
SubstFlags::PreservePackExpansionLevel |
147139
SubstFlags::SubstitutePrimaryArchetypes);

0 commit comments

Comments
 (0)