http://d.puremagic.com/issues/show_bug.cgi?id=7803
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
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from David Eckardt <[email protected]> 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
'object.Throwable'
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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------