Thread overview
[Issue 7998] New: static assert message string printing problem
Aug 01, 2012
Ellery Newcomer
Nov 18, 2012
Walter Bright
April 27, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7998

           Summary: static assert message string printing problem
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2012-04-27 05:09:10 PDT ---
This code:

import std.conv: to;
void main() {
    //static assert(false, "some message");
    static assert(false, to!string(1) ~ " some message");
}


Shows (dmd 2.060alpha):

test.d(4): Error: static assert  ['1',' ','s','o','m','e','
','m','e','s','s','a','g','e']


While uncommenting the first static assert gives a more correct printing of the error message:

test2.d(3): Error: static assert  "some message"


This problem has shown up in code like:

import std.array: uninitializedArray;
void main() {
    auto a = uninitializedArray!(int)(1);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7998


Ellery Newcomer <ellery-newcomer@utulsa.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra@gmail.com


--- Comment #1 from Ellery Newcomer <ellery-newcomer@utulsa.edu> 2012-07-31 17:43:31 PDT ---
*** Issue 8481 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: -------
November 18, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7998



--- Comment #2 from github-bugzilla@puremagic.com 2012-11-17 19:32:57 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/829a34f065a32b10efe02a73880470e063389958 Fix issue 7998 static assert message string printing problem

https://github.com/D-Programming-Language/dmd/commit/3f5c67c254db4f9c4ba8a061e6c394bb992e8e35 Merge pull request #1290 from donc/bug7998staticassertmsg

7998 static assert message string printing problem

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 18, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7998


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED
         OS/Version|Windows                     |All


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