Bug 8137 – Handling of Errors should be defined

Status
NEW
Severity
major
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-23T20:00:21Z
Last change time
2024-12-15T15:21:58Z
Keywords
spec
Assigned to
No Owner
Creator
Jonathan M Davis
Moved to GitHub: dlang.org#4019 →

Comments

Comment #0 by issues.dlang — 2012-05-23T20:00:21Z
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.
Comment #1 by robert.schadek — 2024-12-15T15:21:58Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4019 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB