Skip to content

Commit 73a218f

Browse files
committed
[Test] Add test cases for missing protocol conformance failures for
non-nominal types.
1 parent 40985b6 commit 73a218f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/Constraints/diagnostics.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ f0(i, i,
4646
i) // expected-error{{extra argument in call}}
4747

4848

49-
// Position mismatch
49+
// Cannot conform to protocols.
5050
f5(f4) // expected-error {{function type '(Int) -> Int' cannot conform to 'P2'; only struct/enum/class types can conform to protocols}}
51+
f5((1, "hello")) // expected-error {{tuple type '(Int, String)' cannot conform to 'P2'; only struct/enum/class types can conform to protocols}}
52+
f5(Int.self) // expected-error {{metatype type 'Int.Type' cannot conform to 'P2'; only struct/enum/class types can conform to protocols}}
5153

5254
// Tuple element not convertible.
5355
f0(i,

0 commit comments

Comments
 (0)