On Saturday, 21 April 2012 at 13:52:20 UTC, Kagamin wrote:
The Little Willy example applies to D just fine. When served wrong drink, Little Willy has little choice but to throw an exception. This seems like a strengthening of a Customer's contract, doesn't it? It doesn't matter how the typecheck is done technically. And this strengthening seems to be inevitable in practice.
It's not inevitable, it's wrong design. While each square is a rectangle in mathematics this is not necessarily true in an object oriented model. Cheers, Famous
