What are (were) the most difficult parts of D?

Paul Backus snarwin at gmail.com
Thu May 12 19:00:25 UTC 2022


On Thursday, 12 May 2022 at 18:07:05 UTC, H. S. Teoh wrote:
> On Thu, May 12, 2022 at 09:04:09AM -0700, Ali Çehreli via 
> Digitalmars-d-learn wrote:
>> Error: template `std.algorithm.iteration.sum` cannot deduce 
>> function from
>> argument types `!()(int[3])`
>> /usr/include/dlang/dmd/std/algorithm/iteration.d(7234): 
>> Candidates are:
>> `sum(R)(R r)`
>>   with `R = int[3]`
>>   must satisfy the following constraint:
>> `       isInputRange!R`
>> 
>> WHAT? :) But the clue is on the last line above.
> [...]
>
> Seriously though, that error message is horrendously ugly.  I 
> mean I've seen it thousands of times by now, so I know what it 
> means and where to look for the actual problem. But it's 
> eminently unfriendly to someone who doesn't already know the 
> language very well.

Good news: starting from DMD 2.099, this error message has been 
reworded. Instead of "cannot deduce function...". it now says:

Error: none of the overloads of template 
`std.algorithm.iteration.sum` are callable using argument types 
`!()(int[3])`


More information about the Digitalmars-d-learn mailing list