[Solved] Confusing error message

bachmeier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 7 07:03:41 PDT 2017


On Wednesday, 7 June 2017 at 13:27:05 UTC, Wulfklaue wrote:
> Some of the dmd error messages need some tweaking.
>
>> import std.datetime;
>>
>> auto t = Clock.currStdTime;
>> writeln(to!string(t));
>
> Result in:
>
>> Error: template core.time.to cannot deduce function from 
>> argument types !(string)(long), candidates are:
>> C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\time.d(1709):        core.time.to(string units, T, D)(D td) if (is(_Unqual!D == TickDuration) && (units == "seconds" || units == "msecs" || units == "usecs" || units == "hnsecs" || units == "nsecs"))
>
>
>> import std.datetime;
>> import std.conv;
>>
>> auto t = Clock.currStdTime;
>> writeln(to!string(t));
>
> Solves the issue but its strange that there is no error message 
> indicating that to! needs the std.conv included. Technically 
> one can argue that the original message mean that but its very, 
> very unclear.

Best to report it and make a suggestion of what it should say. 
Nothing will happen if you post here.

https://issues.dlang.org/


More information about the Digitalmars-d-learn mailing list