[Issue 10306] New: Array ^^ operator doesn't support complex expressions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jun 8 14:58:05 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10306
Summary: Array ^^ operator doesn't support complex expressions
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: diagnostic, rejects-valid
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 2013-06-08 14:58:04 PDT ---
import std.math;
void main() {
double[3] a, b, c;
double[3] r1 = (a[] - b[]) * c[]; // line 4, OK
double[3] aux = a[] - b[]; // OK
double[3] r2 = aux[] ^^ 2; // OK
double[3] r3 = (a[] - b[]) ^^ 2; // line 7, error
double[3] r4 = (a[] - b[])[] ^^ 2; // line 8, error
}
dmd 2.064alpha gives:
temp.d(7): Error: incompatible types for ((a[] - b[]) ^^ (cast(double)2)):
'double[]' and 'double'
If you comment out line 7 you receive:
temp.d(8): Error: Array operation a[] - b[] not implemented
I'd like the ^^ array op support a complex expression as in line 4.
Also the error messages are a little confusing.
--
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