Thread overview | |||||
---|---|---|---|---|---|
|
February 06, 2005 invariant doesn't throw InvariantException | ||||
---|---|---|---|---|
| ||||
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Wrong invariants don't throw a InvariantExceptions (as documented). In fact there is no type "InvariantException" in Phobos. test case: http://dstress.kuehne.cn/run/invariant_25.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCBgE83w+/yD4P9tIRAluuAKDKJ/R9+gwNZRN7UlX3xoZZgAIE/wCgs3rs XTk7hMp1R6JGlmJrJNa1ne8= =IiYV -----END PGP SIGNATURE----- |
February 06, 2005 Re: invariant doesn't throw InvariantException | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | Thomas Kuehne wrote: > Wrong invariants don't throw a InvariantExceptions (as documented). > In fact there is no type "InvariantException" in Phobos. Isn't this the same as with "InException" and "OutException" ? They also throw simple AssertError, when they *should* throw the appropriate Exception type according to the Contract docs. (and neither InException nor OutException class exist in Phobos) Of course, the documentation even says "AssertException", when in reality it throws "AssertError", so the spec is outdated... (even when it comes to the most basic contract, that is: assert) There also seem to be no way to turn the Phobos contracts on, save for compiling a debug version of Phobos yourself, with the DFLAGS setting of -release omitted ? The default library has no contracts. http://www.digitalmars.com/d/dbc.html --anders |
February 07, 2005 Re: invariant doesn't throw InvariantException | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Anders F Björklund schrieb am Sun, 06 Feb 2005 16:50:42 +0100: > Thomas Kuehne wrote: > >> Wrong invariants don't throw a InvariantExceptions (as documented). In fact there is no type "InvariantException" in Phobos. > > Isn't this the same as with "InException" and "OutException" ? > > They also throw simple AssertError, when they *should* throw the appropriate Exception type according to the Contract docs. (and neither InException nor OutException class exist in Phobos) > > Of course, the documentation even says "AssertException", when in reality it throws "AssertError", so the spec is outdated... (even when it comes to the most basic contract, that is: assert) Added to DStress http://dstress.kuehne.cn/run/in_out_body_05.d http://dstress.kuehne.cn/run/in_out_body_06.d http://dstress.kuehne.cn/run/in_out_body_07.d http://dstress.kuehne.cn/run/in_out_body_08.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCB2ND3w+/yD4P9tIRAppnAKCMWkQjpadKy3WSZkoIUIEpGOSoGwCfU2Tk Ovy0Zqr+q53TgUr+qaXyXgk= =ywcv -----END PGP SIGNATURE----- |
Copyright © 1999-2021 by the D Language Foundation