www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17263] New: Issue diagnostic if mandatory template parameter


          Issue ID: 17263
           Summary: Issue diagnostic if mandatory template parameter is
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: acehreli yahoo.com

import std.algorithm : map;

void main() {
    [1, 2].map(i => i);

Error: template std.algorithm.iteration.map cannot deduce function from
argument types !()(int[], void), candidates are:
       std.algorithm.iteration.map(fun...) if (fun.length >= 1)
Makefile:142: recipe for target 'deneme' failed

The programmer forgot to put ! after map. It would be much better if the error
message said something like

  "Missing mandatory template arguments for


Mar 17 2017