Walter Bright:
There's a forward reference going on. We cannot semantically evaluate s=x until we semantically evaluate the rest of the function in order to know that x is or is not reassigned.
A first step to improve the situation is to propagate the range of const/immutable values inside a function:
void main() {
uint x = 1000;
immutable y = x % 256;
ubyte z = y; // currently error.
}
Bye,
bearophile
