www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2156



--- Comment #1 from yebblies <yebblies gmail.com> 2011-06-30 17:34:35 EST ---
*** Issue 2391 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 30 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2156


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |yebblies gmail.com
           Platform|x86                         |All
            Summary|A string initialized to []  |[] and null should be
                   |in a template is not        |accepted where a
                   |recognized as string        |compile-time string is
                   |                            |required
         OS/Version|Windows                     |All


--- Comment #2 from yebblies <yebblies gmail.com> 2011-06-30 18:04:49 EST ---
Fix for D2

https://github.com/D-Programming-Language/dmd/pull/180

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 30 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2156


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au


--- Comment #3 from yebblies <yebblies gmail.com> 2011-08-11 02:28:19 EST ---
*** Issue 6462 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 10 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2156


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


--- Comment #4 from Walter Bright <bugzilla digitalmars.com> 2011-09-02
14:01:04 PDT ---
https://github.com/D-Programming-Language/dmd/commit/842db08516f0606ea9b278d179f8f7c51776f805

https://github.com/D-Programming-Language/dmd/commit/ff1965347d6ff2b0c3ebb71ff7c06254aba38c66

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 02 2011