Bug 2156 – [] and null should be accepted where a compile-time string is required

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2008-06-19T11:28:00Z
Last change time
2014-02-24T15:59:42Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
samukha

Comments

Comment #0 by samukha — 2008-06-19T11:28:15Z
template Foo() { const char[] Foo = []; } static assert (Foo!() == ""); // ok pragma(msg, Foo!()); // fails (1) mixin("int i;" ~ Foo!()); // fails (2) void main() { } ---- Error messages without line or file: (1) pragma msg string expected for message, not '[]' (2) attribute argument to mixin must be a string, not ("int i;" ~ [])
Comment #1 by yebblies — 2011-06-30T00:34:35Z
*** Issue 2391 has been marked as a duplicate of this issue. ***
Comment #2 by yebblies — 2011-06-30T01:04:49Z
Comment #3 by yebblies — 2011-08-10T09:28:19Z
*** Issue 6462 has been marked as a duplicate of this issue. ***
Comment #4 by bugzilla — 2011-09-02T14:01:04Z