Skip to content

Commit 6093baf

Browse files
[tests] Fix diagnostic (TODO)
1 parent 49e8eee commit 6093baf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/type/subclass_composition.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ func basicSubtyping(
105105
let _: Derived = baseAndP2 // expected-error {{cannot convert value of type 'Base<Int> & P2' to specified type 'Derived'}}
106106
let _: Derived & P2 = baseAndP2 // expected-error {{value of type 'Base<Int> & P2' does not conform to specified type 'Derived & P2'}}
107107

108-
// TODO(diagnostics): Diagnostic regression, better message is `value of type 'Unrelated' does not conform to 'Derived & P2' in coercion`
109-
let _ = Unrelated() as Derived & P2 // expected-error {{cannot convert value of type 'Unrelated' to type 'Derived' in coercion}}
108+
let _ = Unrelated() as Derived & P2 // expected-error {{value of type 'Unrelated' does not conform to 'Derived & P2' in coercion}}
110109
let _ = Unrelated() as? Derived & P2 // expected-warning {{always fails}}
111110
let _ = baseAndP2 as Unrelated // expected-error {{cannot convert value of type 'Base<Int> & P2' to type 'Unrelated' in coercion}}
112111
let _ = baseAndP2 as? Unrelated // expected-warning {{always fails}}

0 commit comments

Comments
 (0)