File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1724,6 +1724,16 @@ LookupConformanceInModuleRequest::evaluate(
17241724 return getBuiltinBuiltinTypeConformance (type, builtinType, protocol);
17251725 }
17261726
1727+ // Specific handling of Copyable for pack expansions.
1728+ if (auto packExpansion = type->getAs <PackExpansionType>()) {
1729+ if (protocol->isSpecificProtocol (KnownProtocolKind::Copyable)) {
1730+ auto patternType = packExpansion->getPatternType ();
1731+ return (patternType->isTypeParameter ()
1732+ ? ProtocolConformanceRef (protocol)
1733+ : mod->lookupConformance (patternType, protocol));
1734+ }
1735+ }
1736+
17271737 auto nominal = type->getAnyNominal ();
17281738
17291739 // If we don't have a nominal type, there are no conformances.
Original file line number Diff line number Diff line change @@ -74,3 +74,9 @@ func invalidPackRef(_: each Int) {}
7474
7575// expected-error@+1 {{pack reference 'T' can only appear in pack expansion or generic requirement}}
7676func packRefOutsideExpansion< each T > ( _: each T ) { }
77+
78+ // coverage to ensure a 'repeat each' type is considered Copyable
79+ func golden< Z> ( _ z: Z ) { }
80+ func hour< each T > ( _ t: repeat each T ) {
81+ _ = repeat golden( each t)
82+ }
You can’t perform that action at this time.
0 commit comments