Shortcut evaluation for hierarchy of in contracts

Walter Bright newshound2 at digitalmars.com
Fri Jul 1 00:41:15 PDT 2011


On 6/30/2011 3:42 AM, Jens Mueller wrote:
> The shortcut evaluation is specified in TDPL. That's why I assume the
> behavior is intended.

The behavior is both intended and crucial to the notion of contract inheritance.

The 'in' contract must pass at least one of the 'in' contracts of its 
inheritance hierarchy.
Derived functions "loosen" the requirements for input.

The 'out' contract must pass all of the 'out' contracts.
Derived functions "tighten" the requirements for output.


More information about the Digitalmars-d mailing list