Summary: scope(success) in nothrow/@safe functions causes
                    compile errors
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD

--- Comment #0 from David Eckardt <> 2012-03-31 
05:19:31 PDT ---
Example code:

module test;

@safe int f() {
    scope(success) {/* ... */}
    return 3;

nothrow int g() {
    scope(success) {/* ... */}
    return 3;

DMD reports these compile-time errors:

Error: can only catch class objects derived from Exception in @safe code, not

Error: object.Throwable is thrown but not caught test.d(8): Error: function
test.g 'g' is nothrow yet may throw

When using scope(exit) instead, the example code compiles successfully.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to