You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks like a bug. Could you provide a small example to reproduce this?
You might need to include the bloom filter import in the same file as the code that is doing the deserialization. Some times Nim is confusing with imports.
On Thu, Sep 22, 2022, at 3:02 AM, srozb wrote:
Hi,
I was trying to serialize and deserialize bloom filter object <https://github.com/dizzyliam/flower/blob/main/src/flower.nim#L17>, and deserialization gives me the following error during the compilation:
`flatty-0.3.4/flatty.nim(171, 23) Error: for a 'var' type a variable needs to be passed; but 'uint64(x.capacity)' is immutable
code causing the issue is:
proc importFlatty*(srcPath: string): Bloom =
result = srcPath.readFile().fromFlatty(Bloom)
and it works perfectly the opposite way (`toFlatty`).
Is that a bug or me doing something wrong?
—
Reply to this email directly, view it on GitHub <#34>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAA6X7EC2ACXKX6RL6BNPKTV7QVFHANCNFSM6AAAAAAQS4IFWI>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
import flower, flatty
var
bloom =newBloom(10, 0.01)
bl =fromFlatty(toFlatty(bloom), Bloom)
nim c -r test.nim
/Users/slawek/tmp/bloombug/test.nim(5, 18) template/generic instantiation of `fromFlatty` from here
/Users/slawek/.nimble/pkgs/flatty-0.3.4/flatty.nim(291, 4) template/generic instantiation of `fromFlatty` from here
/Users/slawek/.nimble/pkgs/flatty-0.3.4/flatty.nim(171, 23) Error: for a 'var' type a variable needs to be passed; but 'uint64(x.capacity)' is immutable
Tested with flatty [0.3.4] and flower [1.0.0]. Imports included in the same file.
Activity
treeform commentedon Sep 26, 2022
srozb commentedon Sep 27, 2022
Here's the minimal example:
Tested with
flatty [0.3.4]andflower [1.0.0]. Imports included in the same file.Deserialize platform specific uint. Fixes treeform#34.
Default uint support. Fixes treeform#34.
treeform commentedon May 25, 2026
Thank you for your issue. I have been working on flatty for a bunch of things, and I think I have fixed this in this PR: #52
Feel free to re-open the issue if it still happens to you.