February 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6278



--- Comment #10 from Walter Bright <bugzilla@digitalmars.com> 2012-02-01 00:46:33 PST ---
(In reply to comment #9)
> Exceptions thrown in contracts are supposed to be recoverable,

No, they are supposed to exit the program. The thing with in contracts is not that they're recoverable, it's that they assume that a failing in contract is not leaving the program in an invalid state.

I agree this is a hole in the safety system, which is why I'm not closing it. I'm just getting it to not be a regression. I do not know what a completely correct fix would look like at the moment.

One possibility would be to allow only pure code in a contract. Pure code cannot modify global state, and so when it throws it wouldn't be leaving something outside of the contract in an invalid state.

We've talked about making in/out contracts pure before, I've been concerned that they'd be too restrictive. Maybe require them to be pure when in safe mode?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6278



--- Comment #11 from github-bugzilla@puremagic.com 2012-02-01 00:54:26 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/dc7916071b60739dcc8c09e43ff3da5218b42ff2
partially fix Issue 6278 - Regression(2.054 beta): 'in' contract inheritance
doesn't work with safe code

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6278


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|regression                  |normal


--- Comment #12 from Walter Bright <bugzilla@digitalmars.com> 2012-02-01 00:56:01 PST ---
The bug is now that the in contracts can swallow any Errors and leave the program in an invalid state.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »