Just another example of missing string interpolation

Walter Bright newshound2 at digitalmars.com
Fri Oct 20 19:58:44 UTC 2023


On 10/20/2023 9:52 AM, Steven Schveighoffer wrote:
> Just another whacked mole? What about the Exception problem?
> 
> ```d
> throw new Exception(i"Invalid integer value in $file: $val");
> ```

You'll get an exception message:

     Exception at FILE(LINE): Invalid integer value in %s: %s

which is pretty much a nothingburger as a problem.

YAIDIP can also call the wrong function if you're not careful to make sure the 
right one is in scope. YAIDIP is also going to match any template that has a 
first argument of type T with a weird struct that frankly few users will know 
exists.

Anything that generates tuples is going to have minor issues with overload matching.


More information about the Digitalmars-d mailing list