Skip to content

Commit 4a2d139

Browse files
committed
[Diagnostics] NFC: Add a test-case for rdar://108977234
1 parent 440bc39 commit 4a2d139

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/Constraints/pack-expansion-expressions.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,15 @@ func test_pack_expansions_with_closures() {
332332
takesVariadicFunction { y in fn(x, y) } // Ok
333333
takesVariadicFunction { y, z in fn(y, z) } // Ok
334334
}
335+
336+
// rdar://108977234 - invalid error non-pack type instead of missing `Hashable` conformance
337+
func testEscapingCapture<each T>(_ t: repeat each T) -> () -> [AnyHashable] {
338+
return {
339+
var result = [AnyHashable]()
340+
repeat result.append(each t) // expected-error {{argument type 'each T' does not conform to expected type 'Hashable'}}
341+
return result
342+
}
343+
}
335344
}
336345

337346
// rdar://107151854 - crash on invalid due to specialized pack expansion

0 commit comments

Comments
 (0)