Thoughts about in contract inheritance

Stewart Gordon smjg_1998 at
Wed Feb 29 10:06:01 PST 2012

On 29/02/2012 17:01, Timon Gehr wrote:
> The official website, or You have to click on "See
> example". It is at the first bulb of "Power".

But the comment "// <-- assumed to inherit contract" isn't actually there, so what's 
"quite explicit" about it?  Besides, the interface declaration there isn't allowed by the 


> Language level contracts as in D are (basically) a way to introduce runtime checks into
> interfaces. If the interface is redefined then that potentially breaks all code that
> implements the interface, even if this is not explicitly stated in form of contracts.

You mean the fault lies on the part of the library creator for widening the in contract of 
a non-final method?

> Obviously there can be additional changes without redefining what an existing part of the
> API does.

So you consider illegal inputs to a function to be part of the API?


More information about the Digitalmars-d mailing list