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

           Summary: Array sum operation in function template
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from [email protected] 2013-06-20 15:43:39 PDT ---
void foo(T)(in int[] V1, in T V2) {
    int[2] R;
    R[] = V1[] + V2[];
}
void main() {
    immutable int[] V = [10, 20];
    foo(V, V);
}


DMD 2.064alpha gives:

test.d(3): Error: invalid array operation R[] = V1[] + cast(const(int)[])V2[]
(did you forget a [] ?)
test.d(7): Error: template instance test1.foo!(immutable(int)[]) error
instantiating


I am not sure, but I think that code should compile.

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

Reply via email to