Spell checking errors can be hilarious

Walter Bright newshound2 at digitalmars.com
Wed Oct 14 04:05:40 UTC 2020


On 10/13/2020 7:16 PM, Steven Schveighoffer wrote:
> void main()
> {
>      auto x = to!string(1);
> }
> 
> Error: template instance to!string template to is not defined
> 
> BUT you do this instead:
> 
>      auto x = 1.to!string;
> 
> And you get:
> 
> Error: no property to for type int, perhaps import std.conv; is needed?
> 
> Clearly, something is not triggering, it should be the same suggestion for both 
> cases. (FWIW, if this bug wasn't present, the gentlemen trying out D in the 
> stream would have immediately imported std.conv and have been done)

A case can always be concocted to show this either way. The two expressions are 
equivalent, but they place different emphasis. I.e. the first places emphasis on 
to being a function, the second places emphasis on to being a property.

There isn't winning with this.


More information about the Digitalmars-d mailing list