www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2456] New: "cannot put catch statement inside finally block"

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

           Summary: "cannot put catch statement inside finally block"
           Product: D
           Version: 1.030
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: fvbommel wxs.nl


I get an error ("cannot put catch statement inside finally block") on the
following code:
----
module test;

extern(C) int printf(char*, ...);

void verify() {}

void main() {
    scope(success) {
        scope(failure)
            printf("Verification failed!\n");
        verify();
    }

}
----
(GDC allows this without complaining)

Also, this error doesn't print a source location.


-- 
Nov 15 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2456


Ali Cehreli <acehreli yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |acehreli yahoo.com



I hit the same problem with dmd 2.056. Here is a simpler code:

void main()
{
    scope(exit) try{} catch {}
}

Notes:

1) In this case the line number is printed correctly in the error message.

2) It is the same issue with scope(success)

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




Please disregard my previous comment. I am talking about something else.

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
                 CC|                            |clugdbug yahoo.com.au
            Version|1.030                       |D1 & D2
            Summary|"cannot put catch statement |"cannot put catch statement
                   |inside finally block"       |inside finally block",
                   |                            |missing line number



Applies also to D2.060. Has no line number in the error message in D1 or D2.

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