mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sil-combine] Fix a subtle bug in getConformanceAndConcreteType related to handling of inherited conformances
This fixes a couple of tests and some of the compatibility suite projects. rdar://problem/31815540, rdar://problem/31838976
This commit is contained in:
@@ -794,10 +794,13 @@ getConformanceAndConcreteType(FullApplySite AI,
|
||||
if (Requirement->inheritsFrom(Protocol)) {
|
||||
// If Requirement != Protocol, then the abstract conformance cannot be used
|
||||
// as is and we need to create a proper conformance.
|
||||
return std::make_tuple(Conformance.isAbstract()
|
||||
? ProtocolConformanceRef(Protocol)
|
||||
: Conformance,
|
||||
ConcreteType, ConcreteTypeDef);
|
||||
return std::make_tuple(
|
||||
Conformance.isAbstract()
|
||||
? ProtocolConformanceRef(Protocol)
|
||||
: ProtocolConformanceRef(
|
||||
Conformance.getConcrete()->getInheritedConformance(
|
||||
Protocol)),
|
||||
ConcreteType, ConcreteTypeDef);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user