[Issue 6511] New: [CTFE] Array op gives wrong result
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Aug 16 13:49:06 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6511
Summary: [CTFE] Array op gives wrong result
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2011-08-16 13:49:05 PDT ---
T foo(T)() {
T[1] a = [1];
a[] += a[];
return a[0];
}
static assert(foo!ulong() == 2); // error
static assert(foo!long() == 2); // error
void main() {
assert(foo!ulong() == 2); // OK
assert(foo!long() == 2); // OK
}
DMD gives:
test.d(6): Error: static assert (1LU == 2LU) is false
--
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