mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Produce specialized conformances to AnyObject for bound generic types.
Fixes rdar://31910351 (SR-4750)
This commit is contained in:
@@ -159,7 +159,13 @@ ProtocolConformanceRef::subst(Type origType,
|
||||
SmallVector<ProtocolConformance *, 1> lookupResults;
|
||||
classDecl->lookupConformance(classDecl->getParentModule(), proto,
|
||||
lookupResults);
|
||||
return ProtocolConformanceRef(lookupResults.front());
|
||||
auto *conf = lookupResults.front();
|
||||
auto subMap = substType->getContextSubstitutionMap(
|
||||
conf->getDeclContext()->getParentModule(), conf->getDeclContext());
|
||||
if (!subMap.empty())
|
||||
conf = substType->getASTContext().getSpecializedConformance(substType,
|
||||
conf, subMap);
|
||||
return ProtocolConformanceRef(conf);
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid conformance substitution");
|
||||
|
||||
Reference in New Issue
Block a user