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

           Summary: sum(int[]) should return a int
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from [email protected] 2014-02-15 01:44:01 PST ---
import std.algorithm: sum;
void main() {
    int[] arr1;
    auto arr2 = new int[arr1.sum];
}


With dmd 2.065beta3 gives:

test3.d(4,25): Error: cannot implicitly convert expression (sum(arr1)) of type
long to uint

It seems a sum(int[]) gives a long. 99% of the cases this is not what I need.

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

Reply via email to