-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 and test datatype field reflection #14777
Conversation
True, but there is much to be said for this API over
ouch. I think we should deprecate |
ouch is right. but it's trivial to lift the rest of that computation into the same let block that is computing |
Still, |
agreed. i'll switch the PR. |
b37c955
to
64b396b
Compare
updated per discussion |
|
||
@deprecate field_offset(x::DataType, idx) fieldoffset(x, idx+1) | ||
@noinline function fieldoffsets(x::DataType) | ||
depwarn("fieldoffsets deprecated. use `map(idx->fieldoffset(x, idx), 1:nfields(x))` instead", :fieldoffsets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is deprecated
`field_offset` was untested, undocumented, unexported, and incorrect (off-by-one error in implementation) `fieldoffset` just isn't particularly optimal, since it has to allocate a new array each time also make minor cleanup and test-coverage enhancements to related reflection methods
64b396b
to
abd3a91
Compare
fix and test datatype field reflection
replaces field_offset with corrected, tested, an documented method
fieldoffset
this function was untested, undocumented, unexported, and incorrect (off-by-one error in implementation)see 30a44c9#commitcomment-15624022