--- Comment #6 from kenn...@gmail.com 2011-07-13 13:09:26 PDT ---
(In reply to comment #5)
> Hm, I take it back. This doesn't compile on D2, so maybe range propagation
> isn't smart enough.
There is no way VRP will support this. After the statement 'int x = 1', the
information that 'x == 1' is lost. We don't have data flow analysis. So in the
expression '1 / x', x is treated as having the complete range of 'int'.
In the current implementation of VRP, since the divisor contains 0, the result
will be the complete range, so '1 / x' still gives the complete range of 'int',
not [-1, 1].
> int x = 1;
> byte b = 1 / x;
> Same error reported
> Now I really don't know why D2 passes the array operation...
> I still think the right solution is allowing casting in an array expression.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------