Skip to content
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

restack errors on partially initialized structs #497

Closed
maartenvd opened this issue Oct 14, 2021 · 1 comment · Fixed by #498
Closed

restack errors on partially initialized structs #497

maartenvd opened this issue Oct 14, 2021 · 1 comment · Fixed by #498
Labels
bug Something isn't working

Comments

@maartenvd
Copy link
Contributor

minimal working example:


julia> using Transducers

julia> struct test
       a
       b
       test(x) = new(x);
       end

julia> t =test(3)
test(3, #undef)

julia> Transducers.restack(t)
ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/Transducers/q4vZD/src/AutoObjectsReStacker.jl:37 [inlined]
 [2] restack(x::test)
   @ Transducers.AutoObjectsReStacker ~/.julia/packages/Transducers/q4vZD/src/AutoObjectsReStacker.jl:16
 [3] top-level scope
   @ REPL[8]:1


I think these kind of objects are 'proper' julia objects. It's probably only a matter of filtering out the fieldnames that are defined in restack.

@tkf
Copy link
Member

tkf commented Oct 14, 2021

Right, this shouldn't throw.

@tkf tkf added the bug Something isn't working label Oct 14, 2021
maartenvd added a commit to maartenvd/Transducers.jl that referenced this issue Oct 15, 2021
this is the kind of 'fix' I had in mind, but it's not very pretty
@tkf tkf closed this as completed in #498 Oct 20, 2021
tkf pushed a commit that referenced this issue Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants