Skip to content

Commit f4debf8

Browse files
committed
Fix keypath test.
The delcared type was incorrect here as opposed to the type checker incorrectly diagnosing a problem. Fix the test and add another test without a subscript operation to ensure that it works.
1 parent cf49177 commit f4debf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/expr/unary/keypath/keypath.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ func testKeyPath(sub: Sub, optSub: OptSub, x: Int) {
111111

112112
// FIXME should resolve: expected-error@+1{{}}
113113
let _: KeyPath<A, Prop> = \.optProperty!
114-
// FIXME should resolve: expected-error@+1{{}}
115-
let _: KeyPath<A, Prop?> = \.property[optSub]?.optProperty![sub]
114+
let _: KeyPath<A, Prop?> = \.property[optSub]?.optProperty!
115+
let _: KeyPath<A, A?> = \.property[optSub]?.optProperty![sub]
116116

117117
// FIXME crash let _: PartialKeyPath<C<A>> = \.value
118118
let _: KeyPath<C<A>, A> = \.value

0 commit comments

Comments
 (0)