-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iterator doesn't seem to be matching type aliases #7567
Comments
My advice is to avoid using recursive aliases. They are slightly broken. You can use wrapper structs to achieve more or less the same result. That will probably make it work (I don't know if you control the Neo4j library). |
@jgaskins can you try doing Otherwise, without some reproducible code we can't help. |
Actually, it's super easy to reproduce: alias Rec = Int32 | Array(Rec)
a = [] of Rec
a << a
p a.each.map(&.itself).to_a |
And simpler: alias Rec = Int32 | Array(Rec)
a = uninitialized Rec
f = ->(x : Rec) {}
f.call(a.itself) I think this can be fixed, it seems to be a problem with Proc type matching and recursive aliases. |
@jgaskins Sorry for all the above noise, it was a really simple bug to fix. It'll probably be available in the next release. |
Nice work! I was going to try to get a reduced example after work today but you beat me to it! 😂 Thanks! |
Trying to use an
Iterator
to reduce memory consumption of a large result pulled back from a database (the nodes go through a few transformations before being serialized as JSON) and getting this error:In this case,
Neo4j::Type
is an alias for all of those types, includingNil
.I unfortunately don't have a reduced example for this yet. I'll see if I can find one soon.
The text was updated successfully, but these errors were encountered: