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
Issue 13010: use VRP for static asserts #3706
Conversation
|
@yebblies Good point :) Instead, I've followed @9rnsr 's recommendation and am using VRP during constant folding of comparisons. This is actually much nicer: it can be used instead of |
Yeah, this is not right. Fixing. |
Doesn't this have the same problem? You still need to evaluate the expression, because evaluating might fail. |
Constant folding ("optimize") and VRP don't rely on CTFE and don't fully interpret the expression. |
(Ugh, still fails. Shouldn't do this at 3am.) |
Yes, but they can't fold away the failure even if they know the range of the value it returns. |
@yebblies I'm not too worried about that case since it can be figured out. I'm more worried about supposedly "dead code" that's being found in Phobos because dchar.max is 0x10FFFF. In real life, dchar can be higher than that. |
ping |
Needs more tests. |
Superseded by #5229 |
https://issues.dlang.org/show_bug.cgi?id=13010