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

bitfields: add bitoffsetof, bitwidth, isBitfield #16444

Merged
merged 1 commit into from
May 8, 2024

Conversation

WalterBright
Copy link
Member

Adds bitfield introspection capabilities as described:

https://github.com/WalterBright/documents/blob/master/bitfields.md

@dlang-bot
Copy link
Contributor

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"

@rikkimax
Copy link
Contributor

rikkimax commented May 5, 2024

Awesome! Thanks for doing this, it'll be a real help.

That covers one of the major issues I outlined in my original post.

@LightBender
Copy link
Contributor

@jmdavis This should address the introspection concerns and help you with your work on traits.

Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a changelog entry

@thewilsonator thewilsonator added Needs Changelog A changelog entry needs to be added to /changelog Needs Spec PR A PR updating the language specification needs to be submitted to dlang.org labels May 5, 2024
@WalterBright WalterBright force-pushed the bitfieldIntro2 branch 2 times, most recently from 7ed42ab to 7872730 Compare May 6, 2024 00:26
@WalterBright WalterBright requested a review from ibuclaw as a code owner May 6, 2024 00:26
@WalterBright WalterBright removed the Needs Changelog A changelog entry needs to be added to /changelog label May 6, 2024
@WalterBright
Copy link
Member Author

As for the "Needs Spec PR" there's a 2+ year old PR for bitfield documentation:

dlang/dlang.org#3190

@thewilsonator
Copy link
Contributor

You would still need to add those properties & trait to that PR

@RazvanN7 RazvanN7 merged commit 0466791 into dlang:master May 8, 2024
42 checks passed
@thewilsonator
Copy link
Contributor

@RazvanN7 why was this merged without a spec PR for the traits?

@RazvanN7
Copy link
Contributor

RazvanN7 commented May 9, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Spec PR A PR updating the language specification needs to be submitted to dlang.org
Projects
None yet
6 participants