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


--- Comment #1 from Ali Cehreli <acehreli yahoo.com> 2011-11-03 14:29:20 PDT ---
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



--- Comment #2 from Ali Cehreli <acehreli yahoo.com> 2011-11-03 14:31:47 PDT ---
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


--- Comment #3 from Don <clugdbug yahoo.com.au> 2012-09-26 01:30:46 PDT ---
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