mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
add a Copyable conformance for PackExpansionType
This commit is contained in:
@@ -1724,6 +1724,16 @@ LookupConformanceInModuleRequest::evaluate(
|
||||
return getBuiltinBuiltinTypeConformance(type, builtinType, protocol);
|
||||
}
|
||||
|
||||
// Specific handling of Copyable for pack expansions.
|
||||
if (auto packExpansion = type->getAs<PackExpansionType>()) {
|
||||
if (protocol->isSpecificProtocol(KnownProtocolKind::Copyable)) {
|
||||
auto patternType = packExpansion->getPatternType();
|
||||
return (patternType->isTypeParameter()
|
||||
? ProtocolConformanceRef(protocol)
|
||||
: mod->lookupConformance(patternType, protocol));
|
||||
}
|
||||
}
|
||||
|
||||
auto nominal = type->getAnyNominal();
|
||||
|
||||
// If we don't have a nominal type, there are no conformances.
|
||||
|
||||
Reference in New Issue
Block a user