kkshinkai
(Kk Shinkai)
1
I am reading the syntax definition of key path in Swift Reference - key-path-expression.
key-path-expression → \ type_opt . key-path-components
In this definition, it is easy to see that a key path contains at least one dot character ., but
\[Int][0]
is legal, why?
1 Like
krilnon
(Kyle Murray)
2
Seems like a bug to me at a glance, worth reporting over on Feedback Assistant.
If I remember correctly, we wrote this part of the grammar before keypaths supported subscripts; seems plausible that we missed this formulation when going back to update it.
3 Likes
xwu
(Xiaodi Wu)
4
Has it been filed as a bug via the instructions above? If not, it’s unlikely that anyone is going to fix it.
1 Like