Shortcut evaluation for hierarchy of in contracts

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Jul 2 18:56:45 PDT 2011


On 7/2/11 8:02 PM, Walter Bright wrote:
> On 7/2/2011 4:04 PM, Andrei Alexandrescu wrote:
>> On 7/1/11 6:32 PM, Robert Jacques wrote:
>>> No. I think the current behavior is correct. In fact, if anything, D
>>> shouldn't allow you to define an in contract on any override method. A
>>> Sub is a Base and therefore must be able to handle all inputs that are
>>> valid for a Base.
>>
>> That is a sensible enhancement.
>
> This would throw out the whole idea of 'loosening'.

I mean disallow an override to add an "in" contract where the overridden 
method had a body but no "in" contract.

Andrei


More information about the Digitalmars-d mailing list