Skip to content

Commit c948c8a

Browse files
committed
Add a test case for returning a closure that captures a pack
1 parent e51b666 commit c948c8a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/SILGen/variadic-generic-closures.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,12 @@ public struct UsesG<each Input> {
1212
public init<E>(builder: (repeat G<each Input>) -> E) {}
1313
}
1414
UsesG<Int, String, Bool> { a, b, c in 0 }
15+
16+
// rdar://107367324
17+
func returnVariadicClosure<each T, R>(f: @escaping (repeat each T) -> R) -> (repeat each T) -> R {
18+
{ (t: repeat each T) -> R in
19+
let tuple = (repeat each t)
20+
print(tuple)
21+
return f(repeat each t)
22+
}
23+
}

0 commit comments

Comments
 (0)