[Issue 2156] New: A string initialized to [] in a template is not recognized as string
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jun 19 09:28:17 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2156
Summary: A string initialized to [] in a template is not
recognized as string
Product: D
Version: 1.031
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: samukha at voliacable.com
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;" ~ [])
--
More information about the Digitalmars-d-bugs
mailing list