[Issue 10307] New: Bad error message for not supported array operation
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jun 8 15:03:12 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10307
Summary: Bad error message for not supported array operation
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: diagnostic
Severity: minor
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2013-06-08 15:03:11 PDT ---
Currently this array operation is not a supported because there is no explicit
allocation of the modified array:
import std.math;
double sum(double[] data) {
double result = 0.0;
foreach (d; data)
result += d;
return result;
}
void main() {
double[2] a = [2.0, 3.0];
assert(sum(a[] ^^ 2) == 13.0);
}
dmd 2.064alpha gives this error message:
test.d(10): Error: Array operation a[] ^^ 2L not implemented
I suggest to improve the error message.
--
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