Skip to content

Add error message for static assert in bitmanip.d#6282

Merged
dlang-bot merged 1 commit intodlang:masterfrom
crimaniak:master
Mar 17, 2018
Merged

Add error message for static assert in bitmanip.d#6282
dlang-bot merged 1 commit intodlang:masterfrom
crimaniak:master

Conversation

@crimaniak
Copy link
Contributor

Static assert, checking the number of bits for a field with the type
bool, did not have an error message.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @crimaniak! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

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.

@crimaniak crimaniak requested a review from andralex as a code owner March 15, 2018 20:53
std/bitmanip.d Outdated
static if (is(T == bool))
{
static assert(len == 1);
static assert(len == 1, "'"~name~"' definition problem: type 'bool' is allowed only for single-bit fields");
Copy link
Contributor

Choose a reason for hiding this comment

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

spaces around ~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, but in fact, this file has complete anarchy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes we try to gradually create consistency whenever it comes up. Though there's the idea of using dfmt to format the git diff automatically.

@wilzbach
Copy link
Contributor

So we use backticks since a while for colorized output. So it would be great to use them here as well instead of the normal single quotes. Also don't forget to squash everything into one commit (though we could do that for you if you run into problems)

Thanks.

@JackStouffer
Copy link
Contributor

Backticks work for static assert? I thought it was only for DMD's messages?

@crimaniak
Copy link
Contributor Author

Sorry guys, I can not find the documentation. Where can I read, how and in what messages do the backticks work?

@wilzbach
Copy link
Contributor

I don't know of any documentation documenting this :/
However, it does work:

https://run.dlang.io/is/AM3P5i

@crimaniak
Copy link
Contributor Author

About squashing: I read some documentation but I never did it before, only local before any push, so this time it will better if you just use merge with squashing.

@wilzbach
Copy link
Contributor

wilzbach commented Mar 17, 2018

So I squashed everything for you and split the message in two lines as it was over 120 chars (the reason for the CircleCI failure).

edit: and changed the wording slightly as "only" is an adverb and should be after the first auxiliary verb):

https://dictionary.cambridge.org/grammar/british-grammar/adjectives/only

Static assert, checking the number of bits for a field with the type
bool, did not have an error message.
@dlang-bot dlang-bot merged commit 6947d80 into dlang:master Mar 17, 2018
@crimaniak
Copy link
Contributor Author

Thanks for fixing my commit and message text! (I am not native English speaker).

@JackStouffer
Copy link
Contributor

I think that’s true for half of the D contributors :)

@wilzbach
Copy link
Contributor

... even for myself ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants