Ambiguity error reporting

Bill Baxter dnewsgroup at billbaxter.com
Wed Jul 11 11:33:03 PDT 2007


Georg Wrede wrote:
> BCS wrote:
>> How about:
>>
>> Test.d(158): function Test.put called with argument types:
>> (char[4])
>> matches at least:
> 
> This change would be small, but it would be immensely helpful.
> 
> The current error reporting gives the (possibly subliminal, but still as 
> misleading) impression that there is *exactly one* ambiguity.
> 
> 
> But counting or enumerating all the possible matches is, IMHO, not 
> worthwhile, /especially/ with the above change. The first ambiguity 
> coupled with "at least" should be enough to point the programmer well 
> into the right directon.
> 
> Still, if Walter decides it is *trivial to implement a realiably 
> comprehensive* (as in no omissions, ever) list, then ok, do it. But 
> either "the first only" or "all", never "found these" and just when the 
> beginning programmer learns to rely upon the list, suddenly there are a 
> lot more matches that didn't get reported this particular time. That 
> only confuses and p***** off people.
> 

I think the ideal would be for it to list the first 5 or so, then say 
... "and N others" if there are more.  5 would cover most common cases, 
and still not completely fill up your scrollback buffer for the unusual 
cases.



More information about the Digitalmars-d mailing list