dmd
dmd copied to clipboard
bitfields: add bitoffsetof, bitwidth, isBitfield
Adds bitfield introspection capabilities as described:
https://github.com/WalterBright/documents/blob/master/bitfields.md
Thanks for your pull request, @WalterBright!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#16444"
Awesome! Thanks for doing this, it'll be a real help.
That covers one of the major issues I outlined in my original post.
@jmdavis This should address the introspection concerns and help you with your work on traits.
As for the "Needs Spec PR" there's a 2+ year old PR for bitfield documentation:
https://github.com/dlang/dlang.org/pull/3190
You would still need to add those properties & trait to that PR
@RazvanN7 why was this merged without a spec PR for the traits?
@thewilsonator Walter has complained about this PR stalling other work. The bitfields DIP hasn't been accepted yet so it might be the case that all of this is reverted anyway. Once the DIP is accepted we can take care of the spec PR, or if it gets rejected then no harm was done.
I agree that the best approach here would have been to also have a spec PR, however, I took Walter's annoyance into account and decided to merge this as is.