Summary: Disallow map() of void function
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from 2011-03-19 07:11:03 PDT ---
This code compiles with no errors (DMD 2.052), but in my opinion it has to
raise a compile-time error, because map() must statically refuse functions that
return void:

import std.algorithm;
void foo() {}
void main() {
    int[] data = [1, 2, 3];
    map!((int i){ return foo(); })(data);

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to