May 24, 2012 [Issue 8137] New: Handling of Errors should be defined | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=8137 Summary: Handling of Errors should be defined Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: major Priority: P2 Component: websites AssignedTo: nobody@puremagic.com ReportedBy: jmdavisProg@gmx.com --- Comment #0 from Jonathan M Davis <jmdavisProg@gmx.com> 2012-05-23 20:00:21 PDT --- As discussed in this thread ( http://forum.dlang.org/post/1566418.J7qGkEti3s@lyonel ), according to Walter, it is _not_ guaranteed that finally blocks, scope statements, and destructors will be run when an Error is thrown. However, the current implementation guarantees it in almost all circumstances (nothrow functions are one exception, I believe). As it stands, code is being written with the assumption that Errors _do_ trigger those constructs (especially with regards to AssertError). So, if the current behavior ever changes, it could break a lot of code. There is quite a lot of dispute in that thread about what the behavior should be (guarantee cleanup or don't guarantee cleanup). We need a decision on this and to make the implementation match that and be _guaranteed_ to match it, with the spec reflecting it. Otherwise, we have undefined behavior (which D typically tries to avoid) which quite a few programs are currently relying on and which may change in the future. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation