[Issue 12197] New: 'invalid array operation' errror message with valid array operation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 18 13:36:50 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12197

           Summary: 'invalid array operation' errror message with valid
                    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 2014-02-18 13:36:47 PST ---
void foo(T)(T[1] b) {
    b[] = b[] ^^ 2;
}
void main() {
    import std.stdio;
    foo([10]);
}


DMD 2.065rc1 gives:

test.d(2,9): Error: invalid array operation 'b[] = b[] ^^ 2' for element type
int
test.d(6,8): Error: template instance test.foo!int error instantiating


Expected error message:

test.d(2,11): Error: must import std.math to use ^^ operator

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list