Skip to content

Commit 44c6ad6

Browse files
committed
Test: Update swift 4 keypath tests to reflect changed error message
1 parent 6a7c378 commit 44c6ad6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/expr/unary/keypath/keypath.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ func testKeyPathSubscript(readonly: Z, writable: inout Z,
301301
sink = readonly[keyPath: rkp]
302302
sink = writable[keyPath: rkp]
303303

304-
readonly[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is a read-only key path}}
305-
writable[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is a read-only key path}}
304+
readonly[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is read-only}}
305+
writable[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is read-only}}
306306
readonly[keyPath: wkp] = sink // expected-error{{cannot assign through subscript: 'readonly' is a 'let' constant}}
307307
writable[keyPath: wkp] = sink
308308
readonly[keyPath: rkp] = sink
@@ -401,8 +401,8 @@ func testKeyPathSubscriptMetatype(readonly: Z.Type, writable: inout Z.Type,
401401
sink = readonly[keyPath: rkp]
402402
sink = writable[keyPath: rkp]
403403

404-
readonly[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is a read-only key path}}
405-
writable[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is a read-only key path}}
404+
readonly[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is read-only}}
405+
writable[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is read-only}}
406406
readonly[keyPath: wkp] = sink // expected-error{{cannot assign through subscript: 'readonly' is a 'let' constant}}
407407
writable[keyPath: wkp] = sink
408408
readonly[keyPath: rkp] = sink
@@ -421,8 +421,8 @@ func testKeyPathSubscriptTuple(readonly: (Z,Z), writable: inout (Z,Z),
421421
sink = readonly[keyPath: rkp]
422422
sink = writable[keyPath: rkp]
423423

424-
readonly[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is a read-only key path}}
425-
writable[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is a read-only key path}}
424+
readonly[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is read-only}}
425+
writable[keyPath: kp] = sink // expected-error{{cannot assign through subscript: 'kp' is read-only}}
426426
readonly[keyPath: wkp] = sink // expected-error{{cannot assign through subscript: 'readonly' is a 'let' constant}}
427427
writable[keyPath: wkp] = sink
428428
readonly[keyPath: rkp] = sink

0 commit comments

Comments
 (0)