www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2156] New: A string initialized to [] in a template is not recognized as string

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 digitalmars.com
        ReportedBy: samukha 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;" ~ [])


-- 
Jun 19 2008