630 – Obscure, unimplemented features related to in/out contracts

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 630 - Obscure, unimplemented features related to in/out contracts
Summary: Obscure, unimplemented features related to in/out contracts
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 major
Assignee: Walter Bright
URL: http://www.digitalmars.com/d/dbc.html
Keywords: rejects-valid, spec
Depends on:
Blocks: 511 677
Show dependency tree / graph
Reported: 2006年12月02日 20:34 UTC by Stewart Gordon
Modified: 2014年02月15日 13:18 UTC (History)
0 users

See Also:
smjg: d1.0blocker?


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Stewart Gordon 2006年12月02日 20:34:24 UTC
Issue 302 talks of a long-unimplemented part of D: inheritance of in/out contracts. This is about some lesser-known DBC features that are in the D spec.
"The compiler can be adjusted to verify that every in and inout parameter is referenced in the in { }, and every out and inout parameter is referenced in the out { }."
Admittedly, this seems pointless (leading to convoluted code just to use all the variables), but it's there.
"The in-out statement can also be used inside a function, for example, it can be used to check the results of a loop:"
There are workarounds for this, but that doesn't excuse anything.
I vaguely recall Walter mentioning an intention to remove these from the spec, but nothing's happened about this either way.
Comment 1 Matti Niemenmaa 2006年12月03日 03:03:37 UTC
"The in-out statement can also be used inside a function, for example, it can
be used to check the results of a loop:"
It is noted in the spec that "[t]his is not implemented at this time." The parameter-checking paragraph could use such a comment as well.
Comment 2 Lars Ivar Igesund 2006年12月03日 03:47:45 UTC
(In reply to comment #1)
> It is noted in the spec that "[t]his is not implemented at this time." The
> parameter-checking paragraph could use such a comment as well.
> 
The spec has for a long time been the documentation for the compiler, which is the wrong way to do it. The spec is a spec, and whether there exists a compiler that implements it or not, should not be part of it. DMD's own documentation, should mention it though.
Comment 3 Stewart Gordon 2006年12月03日 06:08:09 UTC
Whether DMD's documentation mentions it doesn't alter the fact that the fact that DMD doesn't implement it is a bug. Because DMD is supposed to be a D compiler, not a some-subset-of-D compiler.
Comment 4 Walter Bright 2006年12月27日 01:59:29 UTC
Fixed DMD 0.178


AltStyle によって変換されたページ (->オリジナル) /