I believe dmd looks for up to two errors when looking for a candidate match. I 
agree that for single letter variables that doesn't make a lot of sense. Even 
for two letter symbols it probably doesn't make much sense either.

spir Wrote:

> PS: for got to ask: is there any kind of namespace in D -- especially one 
> kind usable for module export?
> 
> Hello,
> 
> 
> dmd has a helpful feature, trying to guess which id may have been wrongly 
> typed -- provided the error actually was a typo:
>       __trials__.d(20): Error: undefined identifier goo, did you mean 
> variable foo?
> 
> But in numerous cases, the source of the error is not a typo, which leads to 
> confusing messages such as:
>       __trials__.d(19): Error: undefined identifier i, did you mean alias to?
> 
> I have no idea how dmd guesses possible names. But surely there is a kind of 
> probability evaluation used to rank possible guesses. If I'm right, then dmd 
> should not output its best guess in every case, but only when its probability 
> value is higher than a given threshold (to be carefully defines).
> 
> Also, the case above probably reveals some kind of bug, since it is hard to 
> imagine how "to" can ever be the best guess for "i" (and there is no alias in 
> the test case). PS: "alias to" is only guessed when the module imports 
> std.conv:to. Still, how to guess "to" from "i"? Finally, should the guessing 
> feature exclude (unqualfied) imported symbols?
> 
> 
> Denis
> -- -- -- -- -- -- --
> vit esse estrany ☣
> 
> spir.wikidot.com
> 

Reply via email to