SILCombine: Fix update of substitution map when substituting opened opaque archetypes

When performing the substitution of the 'concrete' type that happens to
be an opened archetype we need to force the substitution to actually
call the conformance remapping function.

rdar://62202282
SR-12571
This commit is contained in:
Arnold Schwaighofer
2020-04-27 09:24:15 -07:00
parent c80776bd1a
commit b5f5495e98
4 changed files with 97 additions and 3 deletions

View File

@@ -122,7 +122,8 @@ ProtocolConformanceRef::subst(Type origType,
// Opened existentials trivially conform and do not need to go through
// substitution map lookup.
if (substType->isOpenedExistential())
if (substType->isOpenedExistential() &&
!options.contains(SubstFlags::ForceSubstituteOpenedExistentials))
return *this;
auto *proto = getRequirement();