Continued looking at properties in D - interfaces and constraints
mikey via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Oct 11 23:20:05 PDT 2016
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.
More information about the Digitalmars-d-learn