mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
queryAttributes() type-safe interface does not compile
#356
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @H2CO3 on GitHub (Jan 2, 2021).
I'm trying to use
DataStack.queryAttributes()with key paths. I have the following entity definition:I tried to call
queryAttributesin several different ways based on the documentation, but I couldn't get it to compile. Using string literals works, but I would like to use key paths.Version information: macOS 11, Swift 5.3.2.
Attempt no. 1:
Compiler error:
Attempt no. 2:
Compiler error:
Attempt no. 3:
Compiler error:
Attempt no. 4:
Compiler error:
Attempt no. 5:
Compiler error:
I've tried a few variants as well, eventually all of them resulted in some of the errors enumerated above. What am I missing?
@H2CO3 commented on GitHub (Jan 2, 2021):
It looks like the README isn't updated – using the new
\.$propertysyntax, it worked. For future reference, here's the example that showed me the correct usage:3d82ee18c7/Demo/%E2%AD%90%EF%B8%8FSources/%E2%AD%90%EF%B8%8FDemos/%E2%AD%90%EF%B8%8FModern/%E2%AD%90%EF%B8%8FTimeZonesDemo/%E2%AD%90%EF%B8%8FModern.TimeZonesDemo.MainView.swift (L105)