[Issue 22051] compiler allows compilation of malformed writefln statement, causing run-time crashes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 20 09:58:44 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22051

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
The specifier is only checked if you pass it has a template value parameter,
like this:

---
import std.stdio;

void main (){
   bool myvar = true;
   writefln!"Bool: % "(myvar);
}   
---

otherwise a run-time error is the only way to get it checked.
The string literal gives the impression that it is verifiable it could very
well be something build from random sources.

--


More information about the Digitalmars-d-bugs mailing list