Skip to content

Commit 4802c31

Browse files
committed
Add Tests for Parameters with Uninhabited Product Types
1 parent 5bbd126 commit 4802c31

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/SILGen/functions_uninhabited_param.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@ enum E {
2727
let _: (E.Type) -> (E) -> () = { s in { e in s.f(e) } }
2828
// expected-warning@-1 {{will never be executed}}
2929
// expected-note@-2 {{'e' is of type 'E' which cannot be constructed because it is an enum with no cases}}
30+
31+
func empty_product(_ xs: (Int, String, Never)) { // expected-note {{'xs' is of type '(Int, String, Never)' which cannot be constructed because it contains 'Never' which is an enum with no cases}}
32+
print() // expected-warning{{will never be executed}}
33+
}
34+
func empty_custom_product(_ xs: (E, Int)) { // expected-note {{'xs' is of type '(E, Int)' which cannot be constructed because it contains 'E' which is an enum with no cases}}
35+
print() // expected-warning{{will never be executed}}
36+
}
37+

0 commit comments

Comments
 (0)