https://issues.dlang.org/show_bug.cgi?id=3147
Andrei Alexandrescu and...@erdani.com changed:
What|Removed |Added
Version|2.038 |D2
--
http://d.puremagic.com/issues/show_bug.cgi?id=3147
Walter Bright bugzi...@digitalmars.com changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=3147
yebblies yebbl...@gmail.com changed:
What|Removed |Added
CC||bearophile_h...@eml.cc
http://d.puremagic.com/issues/show_bug.cgi?id=3147
--- Comment #11 from bearophile_h...@eml.cc 2011-06-16 05:30:16 PDT ---
This example was in bug 5528:
void main() {
uint i = 10;
ubyte x1 = i % ubyte.max;
ulong l = 10;
uint x2 = l % uint.max;
}
--
Configure issuemail:
http://d.puremagic.com/issues/show_bug.cgi?id=3147
kenn...@gmail.com changed:
What|Removed |Added
Keywords||patch
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=3147
--- Comment #8 from kenn...@gmail.com 2011-06-12 11:06:25 PDT ---
*** Issue 6000 has been marked as a duplicate of this issue. ***
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this
http://d.puremagic.com/issues/show_bug.cgi?id=3147
kenn...@gmail.com changed:
What|Removed |Added
CC||dfj1es...@sneakemail.com
---
http://d.puremagic.com/issues/show_bug.cgi?id=3147
--- Comment #2 from Sobirari Muhomori dfj1es...@sneakemail.com 2010-11-16
13:40:52 PST ---
Some asserts for modulus and shifts
---
byte b;
short s;
int i;
long l;
static assert(is(typeof(s%b)==byte));
static assert(is(typeof(i%s)==short));
http://d.puremagic.com/issues/show_bug.cgi?id=3147
--- Comment #3 from Andrei Alexandrescu and...@metalanguage.com 2010-11-16
13:54:16 PST ---
The point is not to ascribe the smallest static type to the result. That would
break compatibility with C in many ways. All that happens is the
http://d.puremagic.com/issues/show_bug.cgi?id=3147
--- Comment #4 from Sobirari Muhomori dfj1es...@sneakemail.com 2010-11-16
14:01:34 PST ---
---
l = cast(int)(s%b);
l = cast(short)(s%b);
---
What's the difference?
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
http://d.puremagic.com/issues/show_bug.cgi?id=3147
--- Comment #5 from Sobirari Muhomori dfj1es...@sneakemail.com 2010-11-16
14:22:01 PST ---
In any case
---
static if(__traits(compiles, s=b+b))
{
static assert(__traits(compiles, b=s%b));
static assert(__traits(compiles, s=sb));
http://d.puremagic.com/issues/show_bug.cgi?id=3147
--- Comment #6 from Sobirari Muhomori dfj1es...@sneakemail.com 2010-11-16
22:03:08 PST ---
There should be ints in shift asserts
---
static if(__traits(compiles, s=b+b))
{
static assert(__traits(compiles, b=i%b));
static
12 matches
Mail list logo