Bug 15614 – more helpful error messages when bang omiitted

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-27T01:02:34Z
Last change time
2024-12-13T18:46:42Z
Assigned to
No Owner
Creator
Laeeth
Moved to GitHub: dmd#17745 →

Comments

Comment #0 by laeeth — 2016-01-27T01:02:34Z
import std.stdio; import std.string; import std.process; import std.algorithm; import std.array:array; import std.typecons:Tuple; import std.file:exists; enum whitelists=[ "/etc/mail/spamassassin/sent_whitelist.txt", "/etc/mail/spamassassin/vcard_whitelist.txt" ]; enum postgreyWhitelistPath="/etc/postfix/postgrey_whitelist_clients.local"; int main(string[] args) { bool all=false; string result; foreach(file;whitelists) { result~=(cast(string)std.file.read(file)) .splitLines .map(a=>a.extractDomain) .array .sort .uniq .filter(a=>(a.length>0)) .join("\n"); } std.file.write(postgreyWhitelistPath,result); return 0; } string extractDomain(string entry) { return entry; } simple.d(22): Error: template std.algorithm.iteration.map cannot deduce function from argument types !()(string[], void), candidates are: /usr/include/dlang/dmd/std/algorithm/iteration.d(431): std.algorithm.iteration.map(fun...) if (fun.length >= 1) Perhaps we could check if it would compile if a ! were added to the parameters and if so say "did you mean ...?" Yes, one quickly gets used to it, but it's one more needless friction for people learning the language.
Comment #1 by robert.schadek — 2024-12-13T18:46:42Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17745 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB