File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,16 @@ struct S {
6
6
init ( ) {
7
7
let _: WritableKeyPath < S , Int > = \. i // no error for Swift 3/4
8
8
9
- S ( ) [ keyPath: \. i] = 1
9
+ S ( ) [ keyPath: \S . i] = 1
10
10
// expected-error@-1 {{cannot assign to immutable expression}}
11
11
}
12
12
}
13
13
14
14
func test( ) {
15
15
let _: WritableKeyPath < C , Int > = \. i // no error for Swift 3/4
16
16
17
- C ( ) [ keyPath: \. i] = 1 // warning on write with literal keypath
17
+ C ( ) [ keyPath: \C . i] = 1 // warning on write with literal keypath
18
18
// expected-warning@-1 {{forming a writable keypath to property}}
19
19
20
- let _ = C ( ) [ keyPath: \. i] // no warning for a read
20
+ let _ = C ( ) [ keyPath: \C . i] // no warning for a read
21
21
}
Original file line number Diff line number Diff line change @@ -6,16 +6,16 @@ struct S {
6
6
init ( ) {
7
7
let _: WritableKeyPath < S , Int > = \. i // expected-error {{type of expression is ambiguous without more context}}
8
8
9
- S ( ) [ keyPath: \. i] = 1
9
+ S ( ) [ keyPath: \S . i] = 1
10
10
// expected-error@-1 {{cannot assign to immutable expression}}
11
11
}
12
12
}
13
13
14
14
func test( ) {
15
15
let _: WritableKeyPath < C , Int > = \. i // expected-error {{type of expression is ambiguous without more context}}
16
16
17
- C ( ) [ keyPath: \. i] = 1
17
+ C ( ) [ keyPath: \C . i] = 1
18
18
// expected-error@-1 {{cannot assign to immutable expression}}
19
19
20
- let _ = C ( ) [ keyPath: \. i] // no warning for a read
20
+ let _ = C ( ) [ keyPath: \C . i] // no warning for a read
21
21
}
You can’t perform that action at this time.
0 commit comments