"Walter Bright" <newshou...@digitalmars.com> wrote in message news:iuju03$27ip$1...@digitalmars.com... > The 'in' contract must pass at least one of the 'in' contracts of its > inheritance hierarchy. > Derived functions "loosen" the requirements for input.
This might be the recommended way to do it, but this is not enforced by the compiler, just assumed. To enforce this, the compiler should give an error if a base function's precondition passes but a derived precondition does not. The requirement is not really that any 'in' contract passing is good enough, it's just assumed that all preconditions on inherited functions will pass if the base contract does.