Continued looking at properties in D - interfaces and constraints
Mike Parker via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Oct 11 23:59:19 PDT 2016
On Wednesday, 12 October 2016 at 06:20:05 UTC, mikey wrote:
> On Sunday, 9 October 2016 at 14:06:42 UTC, Antonio Corbi wrote:
>> 1. Inheritance with contracts is evaluated in a special way,
>> 'in contracts' in the base and derived method (property) are
>> or-ed, so if one of them passses, the contract is believed to
>> have succeeded. As you don't have a contract in the
>> base-method: "@property void width(int width)", I think that
>> the compiler assumes that its empty contract is always true.
>
>
> Doesn't sound right to me. "Or"ing contracts with different
> inherited methods can't possibly be a feature. I'll create a
> bug report for it.
https://dlang.org/spec/contracts.html#in_out_inheritance
More information about the Digitalmars-d-learn
mailing list