www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2391] New: Character array literals are not recognized as string literals

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2391

           Summary: Character array literals are not recognized as string
                    literals
           Product: D
           Version: 2.019
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: samukha voliacable.com


pragma(msg, ['c']);

test.d(7): pragma msg string expected for message, not '['c']'

Also, __traits:
----
struct S
{
    static int x;
}

void main()
{
    S s;
    __traits(getMember, s, ['x']) = 1;
}
----
test.d(15): Error: string expected as second argument of __traits getMember
instead of ['x']


-- 
Oct 04 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2391





------- Comment #1 from samukha voliacable.com  2008-10-04 04:10 -------
In the above, S instance is unnecessary. Corrected:
----
struct S
{
    static int x;
}

void main()
{
    __traits(getMember, S, ['x']) = 1;
}
----


-- 
Oct 04 2008