File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -8393,6 +8393,13 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
8393
8393
if (path.back().is<LocatorPathElt::PackElement>())
8394
8394
path.pop_back();
8395
8395
8396
+ // This is similar to `PackElement` but locator points to the requirement
8397
+ // associted with pack expansion pattern (i.e. `repeat each T: P`) where
8398
+ // the path is something like:
8399
+ // `... -> type req # -> pack expansion pattern`.
8400
+ if (path.back().is<LocatorPathElt::PackExpansionPattern>())
8401
+ path.pop_back();
8402
+
8396
8403
if (auto req = path.back().getAs<LocatorPathElt::AnyRequirement>()) {
8397
8404
// If this is a requirement associated with `Self` which is bound
8398
8405
// to `Any`, let's consider this "too incorrect" to continue.
Original file line number Diff line number Diff line change @@ -533,8 +533,10 @@ func test_pack_expansion_to_void_conv_for_closure_result<each T>(x: repeat each
533
533
// rdar://109539394 - crash on passing multiple variadic lists to singly variadic callee
534
534
do {
535
535
func test1< each T > ( _: repeat each T ) { }
536
+ func test2< each T > ( _: repeat each T ) where repeat each T : RawRepresentable { } // expected-note {{where 'each T' = 'each T2'}}
536
537
537
538
func caller< each T1 , each T2 > ( t1: repeat each T1 , t2: repeat each T2 ) {
538
539
test1 ( repeat each t1, repeat each t2) // Ok
540
+ test2 ( repeat each t2, repeat each t1) // expected-error {{local function 'test2' requires that 'each T2' conform to 'RawRepresentable'}}
539
541
}
540
542
}
You can’t perform that action at this time.
0 commit comments