adjust infinite type substitution workaround

resolves rdar://124697829

Co-authored-by: Slava Pestov <spestov@apple.com>
This commit is contained in:
Kavon Farvardin
2024-03-25 20:20:22 -07:00
parent 53a5b86fbf
commit 6cd5468cce
2 changed files with 10 additions and 7 deletions

View File

@@ -118,13 +118,6 @@ ProtocolConformanceRef::subst(Type origType, InFlightSubstitution &IFS) const {
return ProtocolConformanceRef::forInvalid();
}
// If the type has been fully substituted and the requirement is for
// an invertible protocol, just do a module lookup. This avoids an infinite
// substitution issue by recognizing that these protocols are very simple
// (see rdar://119950540 for the general issue).
if (!substType->hasTypeParameter() && proto->getInvertibleProtocolKind())
return proto->getModuleContext()->lookupConformance(substType, proto);
// Check the conformance map.
// FIXME: Pack element level?
return IFS.lookupConformance(origType->getCanonicalType(), substType, proto,