https://issues.dlang.org/show_bug.cgi?id=13228

--- Comment #4 from [email protected] ---
(In reply to Steven Schveighoffer from comment #3)

> This is not the same, because a's value isn't known at compile time, just its 
> range.

You are probably right, that example seems bad. Sorry, and thank you for
spotting the problem.


> This ER is asking for flow analysis, which I think is not on the table.

According to Walter flow analysis is on the table for the future of D. But this
ER doesn't want to ask for flow flow analysis (it's meant to work similarly to
the current value range analysis. See also below). If this ER seems to ask for
flow analysis then I have done a mistake in an example, or I have confused
ideas :-)


> Value range analysis for expressions dies at the end of an expression.

This is not longer true, this compiles:

uint x = 10;
void main() {
    immutable uint y = x % 100;
    ubyte z = y; // No errors here.
}


Now the value range of run-time immutable values is carried beyond the end of
an expression.

--

Reply via email to