mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Reference to member 'sum' cannot be resolved without a contextual type #248
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 @asadali737 on GitHub (Dec 27, 2018).
I was using CoreStore for a very long time. Today I just updated in to the newest version. It things get little bit complicated for me. I am unable to resolve the error.
This is my class, according to new CoreStore version.
Now somewhere in code I need to get sum of
xyzfrom database. I read the docs and following is the code for it.let sum = transaction.queryValue(From<Temp>().select(.sum(\Temp.xyz)))But I am getting following error on this line. Please help me to solve it.
Reference to member 'sum' cannot be resolved without a contextual typeCocoa Pod version: 1.5.3
CoreStore version: 5.3.1
Previously I was using following code to get the sum
if let sum = transaction.queryValue(From<Temp>(), Select<Int>(.sum("xyz")), Where("abc = ' '")) { }@JohnEstropia commented on GitHub (Jan 16, 2019):
Sorry I missed responding to this. Looks like I missed adding a generic-resolved method for this. For now you can try writing