digitalmars.D.bugs - Inconsistency with 'throw' between in, out and invariant contracts
- Dave (7/7) Feb 11 2005 DMD v0.112, GDC v0.10, Windows, Linux.
- =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= (21/21) Feb 11 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Dave (5/26) Feb 12 2005 Yea - that's the other strange part of it.. Removing this prohibition is...
- Vathix (5/15) Feb 11 2005 I complained about this a long time ago and Walter said something like h...
DMD v0.112, GDC v0.10, Windows, Linux.
Not sure what this would be classified as (really a bug?), but invariants allow
exceptions to be thrown explicitly while in and out contracts do not.
The compiler flags any throw statements in in{} or out{} contracts as an error
with the message: "Throw statements cannot be in contracts", but allows them in
class invariant contracts.
- Dave
Feb 11 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dave wrote:
| DMD v0.112, GDC v0.10, Windows, Linux.
|
| Not sure what this would be classified as (really a bug?), but
| invariants allow exceptions to be thrown explicitly while in and out
| contracts do not.
|
| The compiler flags any throw statements in in{} or out{} contracts as
| an error with the message: "Throw statements cannot be in contracts",
| but allows them in class invariant contracts.
I'm not sure about disallowing throw in "in" and "out" contracts.
In fact "assert(0);" is a conditional throw and allowed in those contracts.
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
iD8DBQFCDTxO3w+/yD4P9tIRAnC7AJ9YPIotdVbN5B9ugcTOKeL4+cMtcgCeIH0m
t5qc1J88yTDwq/H9yLRpYfU=
=xZ21
-----END PGP SIGNATURE-----
Feb 11 2005
In article <cujja6$5ri$2 digitaldaemon.com>, =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= says...-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dave wrote: | DMD v0.112, GDC v0.10, Windows, Linux. | | Not sure what this would be classified as (really a bug?), but | invariants allow exceptions to be thrown explicitly while in and out | contracts do not. | | The compiler flags any throw statements in in{} or out{} contracts as | an error with the message: "Throw statements cannot be in contracts", | but allows them in class invariant contracts. I'm not sure about disallowing throw in "in" and "out" contracts. In fact "assert(0);" is a conditional throw and allowed in those contracts.Yea - that's the other strange part of it.. Removing this prohibition is an oversight maybe? - DaveThomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (MingW32) iD8DBQFCDTxO3w+/yD4P9tIRAnC7AJ9YPIotdVbN5B9ugcTOKeL4+cMtcgCeIH0m t5qc1J88yTDwq/H9yLRpYfU= =xZ21 -----END PGP SIGNATURE-----
Feb 12 2005
On Fri, 11 Feb 2005 22:48:07 +0000 (UTC), Dave <Dave_member pathlink.com>
wrote:
DMD v0.112, GDC v0.10, Windows, Linux.
Not sure what this would be classified as (really a bug?), but
invariants allow
exceptions to be thrown explicitly while in and out contracts do not.
The compiler flags any throw statements in in{} or out{} contracts as an
error
with the message: "Throw statements cannot be in contracts", but allows
them in
class invariant contracts.
- Dave
I complained about this a long time ago and Walter said something like he
saw no reason why you can't throw in contracts. I thought it meant he'd
lift the restriction.
Feb 11 2005









Dave <Dave_member pathlink.com> 