[Issue 6136] New: Vector operation array[]^^ not supported yet

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 9 13:46:52 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6136

           Summary: Vector operation array[]^^ not supported yet
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2011-06-09 13:42:19 PDT ---
void main() {
    int[3] A = [1, 2, 3];
    int[3] B;
    B[] = A[] * 2; // OK
    assert(B == [2, 4, 6]);
    B[] = A[] * A[]; // OK
    assert(B == [1, 4, 9]);
    B[] = A[] ^^ 2; // Error
    assert(B == [1, 4, 9]);
    B[] = A[] ^^ A[]; // Error
    assert(B == [1, 4, 27]);
}


DMD 2.053 gives:
test.d(8): Error: incompatible types for ((A[]) ^^ (2)): 'int[]' and 'int'
test.d(10): Error: incompatible types for ((A[]) ^^ (A[])): 'int[]' and 'int[]'

-- 
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