Avatar
Avatar
Iceman
@swift-6.2 struct S { var hoge: Int! } let aa: KeyPath<S, Int> = \S.hoge let ii: KeyPath<S, Int!> = \S.hoge let uu: KeyPath<S, Int?> = \S.hoge print(aa, ii, uu)
exit status 1 with stderr:<stdin>:6:23: error: using '!' is not allowed here 4 | 5 | let aa: KeyPath<S, Int> = \S.hoge 6 | let ii: KeyPath<S, Int!> = \S.hoge | |- error: using '!' is not allowed here | `- note: use '?' instead 7 | let uu: KeyPath<S, Int?> = \S.hoge 8 | print(aa, ii, uu)