[swift-evolution] Smart KeyPaths
rparada at mac.com
Wed Mar 22 09:37:02 CDT 2017
> On Mar 22, 2017, at 9:30 AM, Vladimir.S <svabox at gmail.com> wrote:
> let path = @Bag.things.name
> bag at path
> bag at .things.name
> bag at Bag.things.name
It sounds like the @ character is serving two different purposes which confused me at first.
If I understood correctly, you are using it to get the key path but also to apply the key path to the bag struct and get the corresponding value.
More information about the swift-evolution