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 fea720f commit c62b7eaCopy full SHA for c62b7ea
test/Constraints/keypath_swift_5.swift
@@ -5,9 +5,17 @@ struct S {
5
6
init() {
7
let _: WritableKeyPath<S, Int> = \.i // expected-error {{type of expression is ambiguous without more context}}
8
+
9
+ S()[keyPath: \.i] = 1
10
+ // expected-error@-1 {{cannot assign to immutable expression}}
11
}
12
13
14
func test() {
15
let _: WritableKeyPath<C, Int> = \.i // expected-error {{type of expression is ambiguous without more context}}
16
17
+ C()[keyPath: \.i] = 1
18
19
20
+ let _ = C()[keyPath: \.i] // no warning for a read
21
0 commit comments