[Issue 3147] Incorrect value range propagation for addition
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 7 08:07:26 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3147
Rob Jacques <sandford at jhu.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sandford at jhu.edu
--- Comment #1 from Rob Jacques <sandford at jhu.edu> 2009-07-07 08:07:25 PDT ---
Additionally, propagation doesn't work for
byte, ubyte, bool and char.
for operations + * - / % >>
Also
byte x,y;
short z;
z = x<<1; // Error: cannot implicitly convert expression (cast(int)x << 1)
of type int to byte
z = x << y; // compiles
// Repeat for >>>
Also
ubyte x,y=10;
ubyte z;
z = -y; // compiles
Inconsistancies:
byte x,y;
short z;
z += x; //compiles, z = z + x doesn't
x += y; //compiles, x = x + y doesn't
x++; //compiles, x = x+1, doesn't
++x; //compiles, x = x+1, doesn't
x = x + 1; // Error: cannot implicitly convert expression (cast(int)x + 1)
of type int to byte
// Again repeat for the other operations/type combos
also
byte[] x, y, z;
z[] = x[] * z[]; //compiles
// repeat for other array operation and type combos
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list