[Issue 12138] New: Label statement creates an unexpected scope block

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 12 03:58:42 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12138

           Summary: Label statement creates an unexpected scope block
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: jiki at red.email.ne.jp


--- Comment #0 from jiki at red.email.ne.jp 2014-02-12 03:58:37 PST ---
Running this code fails at the second enforce().
# 'Exception' may be any other class.

import std.exception;
void main() {
label: // works if the label is removed 
    scope ea = enforce(new Exception("test"), "first");
    enforce(ea, "second"); // fails here
}

I guess that the label statement internally creates a scope block which is
unexpected and that ea gets to point to something wrong.

Tested: dmd 2.065 beta 3

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


More information about the Digitalmars-d-bugs mailing list