Skip to content

Commit e52857a

Browse files
committed
Add test for sub-optimal diagnostic
We should not emit diagnostics that talk about '<<error type>>'; also, the complaint about the 'var' parameter is totally bogus, because the parameter is declared 'inout'.
1 parent 7268918 commit e52857a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/Constraints/same_types.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,16 @@ func test8a<
153153
func rdar19137463<T where T.a == T>(_ t: T) {} // expected-error{{'a' is not a member type of 'T'}}
154154
rdar19137463(1)
155155

156+
157+
// FIXME: Terrible diagnostic
158+
159+
struct Brunch<U : Fooable where U.Foo == X> { } // expected-note{{requirement specified as 'U.Foo' == 'X' [with U = BadFooable]}}
160+
161+
struct BadFooable : Fooable {
162+
typealias Foo = DoesNotExist // expected-error{{use of undeclared type 'DoesNotExist'}}
163+
var foo: Foo { while true {} }
164+
}
165+
166+
func bogusInOutError(d: inout Brunch<BadFooable>) {} // expected-error{{parameters may not have the 'var' specifier}}
167+
// expected-error@-1{{'Brunch' requires the types '<<error type>>' and 'X' be equivalent}}
168+

0 commit comments

Comments
 (0)