Mea Culpa
Robert Fraser
fraserofthenight at gmail.com
Thu Mar 6 17:59:54 PST 2008
Jason House wrote:
> kov_serg wrote:
>
>> Jason House Wrote:
>> ...
>>> 2. Any simplification of forcing non-null function inputs.
>>> Example:
>>> void foo(A a, B b, C c, D d)
>>> in{
>>> assert(a !is null, "foo can't accept null for 1st parameter");
>>> assert(b !is null, "foo can't accept null for 2nd parameter");
>>> assert(c !is null, "foo can't accept null for 3rd parameter");
>>> assert(d !is null, "foo can't accept null for 4th parameter");
>>> }
>>> body{...}
>>>
>> ...
>> I wounder are rules "in" and "out" inherited for virtual function or I
>> should write them every time? Is where any posibilities to inherits such
>> rules except mixin?
>
> See http://www.digitalmars.com/d/1.0/dbc.html
> or http://www.digitalmars.com/d/2.0/dbc.html
>
> I'm not sure if I agree completely with the rules, but they make sense. I
> completely agree with those rules for interfaces, but it seems to partially
> limit use of contracts for code testing.
That part of the spec (contract inheritance) is not actually implemented
;-P. There's no inheritance of contracts using either of newest DMDs
(not sure about GDC...).
More information about the Digitalmars-d
mailing list