Test: Add a todo about a regression introduced by generic mismatch diagnostic

This commit is contained in:
Sam Lazarus
2019-06-13 00:09:06 -04:00
parent 122a68c217
commit cd0cc3c2c4

View File

@@ -21,7 +21,7 @@ func test() {
}
// SR-7339
class Some<T, V> {
class Some<T, V> { // expected-note {{'V' declared as parameter to type 'Some'}}
init(keyPath: KeyPath<T, ((V) -> Void)?>) {
}
}
@@ -31,6 +31,9 @@ class Demo {
}
// FIXME: This error is better than it was, but the diagnosis should break it down more specifically to 'here's type.
// TODO(diagnostics): Fix this regression, we want the following error message ideally
// "cannot convert value of type 'ReferenceWritableKeyPath<Demo, (() -> Void)?>' to expected argument type 'KeyPath<_, ((_) -> Void)?>'"
let some = Some(keyPath: \Demo.here)
// expected-error@-1 {{cannot convert value of type 'ReferenceWritableKeyPath<Demo, (() -> Void)?>' to expected argument type 'KeyPath<_, ((_) -> Void)?>'}}
// expected-error@-1 {{generic parameter 'V' could not be inferred}}
// expected-note@-2 {{explicitly specify the generic arguments to fix this issue}}