[Issue 7049] Multiple scope(failure) blocks don't work in @safe code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 19 20:15:37 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=7049


hsteoh at quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |hsteoh at quickfur.ath.cx
         Resolution|                            |WORKSFORME


--- Comment #2 from hsteoh at quickfur.ath.cx 2013-08-19 20:15:35 PDT ---
Seems to be fixed in git HEAD. To prove that it actually works, I expanded the
test code a bit:

----------
import std.stdio;
int count = 0;
@safe void foo() {
  scope (failure) { count++; }
  scope (failure) { count++; }
  throw new Exception("failed");
}
void main() {
    try {
        foo();
    } catch(Exception e) {
    }
    writeln(count);
}
----------

Output:
2

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


More information about the Digitalmars-d-bugs mailing list