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
make D great again #15568
make D great again #15568
Conversation
Thanks for your pull request and interest in making D better, @adamdruppe! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
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
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#15568" |
Description + changelog/issue# please. |
https://issues.dlang.org/show_bug.cgi?id=14835 less directly: https://issues.dlang.org/show_bug.cgi?id=16201 It is hard to use D's metaprogramming capabilities without this warning issuing a false positive and forcing you to degrade the code to work around it. |
So if this fixes any of those, the commit message should say so, you know the drill. |
Alternative: disable it for scopes that use static if and static foreach. |
This warning sounds great and useful in theory, but: I can think of maybe one occasion where it actually helped me prevent a buggy program from compiling. On the other hand I could regularly tell tales how it gets in my way. Unlike with bigger C projects (at least a bunch that I’ve run into), most D projects are written in a “no warnings” way. This is established well enough that even DUB defaults to emitting the — So, let’s say, I’ve hit the warning because I’ve added temporary debugging code to my program. Maybe a quick Bonus points if you know the DUB equivalent for |
This isn't just a problem with unittest
{
assert(cond1);
assert(cond2);
} If the compiler is able to constant-fold |
Another interesting finding is that the warning is not emitted for code like this: return;
assert(false); You wouldn’t (have to) special case this if the thing weren’t kinda low-value in the first place. |
This is pretty much a linting rule that we are forced to use without just disabling all the warnings. I think this is worth keeping, if we have a way to select which rule to warn us. |
Test suite has to be updated. |
cd3cb7e
to
ce11c37
Compare
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.
Discussed in the September monthly meeting, remove warning but leave code in for now
again, changelog entry or issues fixed please. |
merge conflict |
Third commit does more than convert tabs to spaces. Maybe squash the commits and make use of the |
Yeah something went wrong when rebasing on top of #15623 |
Don't forget to merge with squash. |
No description provided.