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(
1724
1724
return getBuiltinBuiltinTypeConformance (type, builtinType, protocol);
1725
1725
}
1726
1726
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
+
1727
1737
auto nominal = type->getAnyNominal ();
1728
1738
1729
1739
// 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) {}
74
74
75
75
// expected-error@+1 {{pack reference 'T' can only appear in pack expansion or generic requirement}}
76
76
func 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