Skip to content

Commit a7dbfe4

Browse files
author
Sima Nerush
committed
Add tests
1 parent e971f81 commit a7dbfe4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/Constraints/pack-expansion-expressions.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,3 +604,20 @@ func test_that_expansions_are_bound_early() {
604604
})
605605
}
606606
}
607+
608+
// https://github.com/apple/swift/issues/66393
609+
do {
610+
struct S<each T> {
611+
var property: (repeat each T) -> Void { // expected-note {{'property' declared here}}
612+
get {}
613+
}
614+
615+
func method(_: repeat each T) {} // expected-note {{'method' declared here}}
616+
}
617+
S<Int, Bool>().method((5, true))
618+
// expected-error@-1 {{value pack expansion at parameter #0 expects 2 separate arguments; remove extra parentheses to change tuple into separate arguments}}
619+
620+
S<Int, Bool>().property((5, true))
621+
// expected-error@-1 {{value pack expansion at parameter #0 expects 2 separate arguments; remove extra parentheses to change tuple into separate arguments}}
622+
// expected-error@-2 {{cannot pass value pack expansion to non-pack parameter of type 'repeat each T'}}
623+
}

0 commit comments

Comments
 (0)