[Issue 6511] [CTFE] Array op gives wrong result
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Aug 22 23:21:43 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6511
--- Comment #2 from bearophile_hugs at eml.cc 2011-08-22 23:21:42 PDT ---
The given code example now works. But this:
T foo(T)() {
T[1] a = [1];
a[] += a[];
return a[0];
}
static assert(foo!long() == 2); // OK
static assert(foo!int() == 2); // error
void main() {}
Gives:
test.d(3): Error: _arraySliceSliceAddass_i cannot be interpreted at compile
time, because it has no available source code
test.d(7): Error: cannot evaluate foo() at compile time
test.d(7): Error: static assert (foo() == 2) is not evaluatable at compile
time
This behaviour difference between long and int is not good. Do you prefer me to
reopen this bug or to open a new one?
--
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