-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix restack for struct with undef fields #498
Conversation
this is the kind of 'fix' I had in mind, but it's not very pretty
Thanks for giving a shot at it! Yeah, we may need something like this. I'm a bit worried that it stresses the compiler too much (esp. for a large struct), though. We can also check if all fields are |
Codecov Report
@@ Coverage Diff @@
## master #498 +/- ##
==========================================
- Coverage 93.40% 92.50% -0.90%
==========================================
Files 32 32
Lines 2214 2215 +1
==========================================
- Hits 2068 2049 -19
- Misses 146 166 +20
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I think I only have to check the last field, which is why I made that the outer loop in the original pull request. This version is now just the outer if, where I return x if it contains uninitialized fields |
@tkf - should I change it to check every field, or are you fine with just checking the last field - which should also tell us if it's a fully or partially initialized struct? |
Ah, good point! I think this works. Can you add a test in https://github.com/JuliaFolds/Transducers.jl/blob/master/test/test_restack.jl ? I think it's good to go then. |
something like this? I want to use transducers in my own package, I'm getting promising results so far :) |
Thanks! LGTM! Good to know that it works in your package :) |
this is the kind of 'fix' I had in mind, but it's not very pretty
close #497