On 12/05/2014 02:39 PM, Joseph Rushton Wakeling via Digitalmars-d-learn wrote:

> In other words, the lack of explicit in-contract on Deriv.foo is being
> taken as an _empty_ in-contract, which is being interpreted as per the
> rule that a derived class can have a less restrictive contract than its
> base (cf. TDPL pp.329-331).

This is a known problem with contract inheritance. The following bug report mentions the ugly hack of defining assert(0) as the derived's 'in' contract:

  https://issues.dlang.org/show_bug.cgi?id=6856

Ali

Reply via email to