https://issues.dlang.org/show_bug.cgi?id=21689

anonymous4 <dfj1es...@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |spec
             Status|NEW                         |RESOLVED
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=21298
         Resolution|---                         |INVALID

--- Comment #1 from anonymous4 <dfj1es...@sneakemail.com> ---
Umm, contract programming is a system with goals and rules to achieve those
goals. If you want to make assertions without much metaphysics, you can do it
with assert expression:

interface I {
    int func(int x);
}

class CI : I {
    int func(int x)
    {
        assert(x > 0);
        return x*x;
    }
}

I agree with issue 21298, restriction of the contract in the subtype is a
programming mistake and should be rejected by the compiler.

--

Reply via email to