mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Hack around edge case due to broken abstract conformance representation
A substitution map might store an abstract conformance even if the replacement type is an archetype that conforms concretely via a superclass requirement. This is because when we build the substitution map, if the archetype is represented by a type parameter, we don't have enough information to know if it will conform abstractly or concretely.
This commit is contained in:
@@ -638,6 +638,9 @@ SubstitutionMap::combineSubstitutionMaps(SubstitutionMap firstSubMap,
|
||||
// Some combination of storing substitution maps in BoundGenericTypes
|
||||
// as well as for method overrides would solve this, but for now, just
|
||||
// punt to module lookup.
|
||||
if (substType->isTypeParameter())
|
||||
return ProtocolConformanceRef(proto);
|
||||
|
||||
return proto->getParentModule()->lookupConformance(substType, proto);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user