www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6785] New: Wrong error message from pragma(msg) of failed instantiation

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

           Summary: Wrong error message from pragma(msg) of failed
                    instantiation
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



This is wrong D2 code (there is no foo):


void main() {
    enum int x = 1;
    pragma(msg, foo!x);
}


DMD 2.056head gives a partially wrong error message, that contains a "__error":

test.d(3): Error: template instance foo!(x) template 'foo' is not defined
__error

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 07 2011
next sibling parent Don <nospam nospam.com> writes:
On 08.10.2011 00:41, d-bugmail puremagic.com wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=6785

             Summary: Wrong error message from pragma(msg) of failed
                      instantiation
             Product: D
             Version: D2
            Platform: x86
          OS/Version: Windows
              Status: NEW
            Keywords: diagnostic
            Severity: minor
            Priority: P2
           Component: DMD
          AssignedTo: nobody puremagic.com
          ReportedBy: bearophile_hugs eml.cc



 This is wrong D2 code (there is no foo):


 void main() {
      enum int x = 1;
      pragma(msg, foo!x);
 }


 DMD 2.056head gives a partially wrong error message, that contains a "__error":

 test.d(3): Error: template instance foo!(x) template 'foo' is not defined
 __error
[Replying in the ng, because bugzilla is down] The "__error" isn't part of the error message. It's coming from the pragma(msg): it's printing foo!x, and that's an error, so it prints "__error". The real bug is that the pragma msg is still displayed, even when an error occurs while evaluating it. Maybe it should give an error test.d(3): Error: template instance foo!(x) template 'foo' is not defined test.d(3): Error: parameter for pragma(msg) must be a string
Oct 08 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6785


Don <clugdbug yahoo.com.au> changed:

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



The "__error" isn't part of the error message. It's coming from the
pragma(msg): it's printing foo!x, and that's an error, so it prints "__error".

The real bug is that the pragma msg is still displayed, even when an error
occurs while evaluating it. Maybe it should give an error of the form:

test.d(3): Error: template instance foo!(x) template 'foo' is not defined
test.d(3): Error: parameter for pragma(msg) must be a string

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


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |bugzilla digitalmars.com



18:01:20 PST ---
https://github.com/D-Programming-Language/dmd/pull/775

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 29 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6785


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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