We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d752f41 commit d850ed6Copy full SHA for d850ed6
test/Constraints/keypath.swift
@@ -41,9 +41,10 @@ func testFunc() {
41
let _: (S) -> Int = \.i
42
_ = ([S]()).map(\.i)
43
44
+ // FIXME: A terrible error, but the same as the pre-existing key path
45
+ // error in the similar situation: 'let _ = \S.init'.
46
_ = ([S]()).map(\.init)
- // expected-error@-1 {{key path cannot refer to static member 'init()'}}
- // expected-error@-2 {{key path value type '() -> S' cannot be converted to contextual type '_'}}
47
+ // expected-error@-1 {{type of expression is ambiguous without more context}}
48
49
let kp = \S.i
50
let _: KeyPath<S, Int> = kp // works, because type defaults to KeyPath nominal
0 commit comments