digitalmars.D.bugs - [Issue 14387] New: Disallow string literals as assert conditions
- via Digitalmars-d-bugs (23/23) Apr 01 2015 https://issues.dlang.org/show_bug.cgi?id=14387
https://issues.dlang.org/show_bug.cgi?id=14387 Issue ID: 14387 Summary: Disallow string literals as assert conditions Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: schuetzm gmx.net void foo(int x) { assert("foo"); static assert("bar"); if(!isXValid(x)) assert("x has the invalid value of " ~ x.to!string); } These should be disallowed, because it's too easy to forget the `0` as first argument. Other expression that are concatenations of string literals should be kept, of course. --
Apr 01 2015