Skip to content

Commit ce3f6e0

Browse files
committed
AST: Use correct functor in ProtocolConformanceRef::mapConformanceOutOfContext()
1 parent 151b1f1 commit ce3f6e0

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
@@ -129,21 +129,13 @@ ProtocolConformanceRef::subst(Type origType, InFlightSubstitution &IFS) const {
129129
ProtocolConformanceRef ProtocolConformanceRef::mapConformanceOutOfContext() const {
130130
if (isConcrete()) {
131131
return getConcrete()->subst(
132-
[](SubstitutableType *type) -> Type {
133-
if (auto *archetypeType = type->getAs<ArchetypeType>())
134-
return archetypeType->getInterfaceType();
135-
return type;
136-
},
132+
MapTypeOutOfContext(),
137133
MakeAbstractConformanceForGenericType(),
138134
SubstFlags::PreservePackExpansionLevel |
139135
SubstFlags::SubstitutePrimaryArchetypes);
140136
} else if (isPack()) {
141137
return getPack()->subst(
142-
[](SubstitutableType *type) -> Type {
143-
if (auto *archetypeType = type->getAs<ArchetypeType>())
144-
return archetypeType->getInterfaceType();
145-
return type;
146-
},
138+
MapTypeOutOfContext(),
147139
MakeAbstractConformanceForGenericType(),
148140
SubstFlags::PreservePackExpansionLevel |
149141
SubstFlags::SubstitutePrimaryArchetypes);

0 commit comments

Comments
 (0)