--- Comment #17 from deadalnix <> 2012-05-03 13:44:36 PDT ---
(In reply to comment #15)
> fizbuzzA(A a) {
>; //'s in contract is valid
> }
> If an instance of B is passed to fizbuzzA, then the will call,
> and either's in contract or's in contract must be valid.
> There is no error or invalid corner case here.
> I suspect that you think the contracts are checked based on static typing -
> they are not, they are done using the virtual type.

We are all well aware that the behavior you describe is the current behavior.
However we do think it is not optimal and can be improved because of the corner
case mentioned.

As you can see in given code, fizbuzzA is an invalid piece of code waiting to
explode in your face. And this is what you want to avoid, why we use so much
stuff like contracts and unit tests (and, as far as I am concerned in my
professional work, code review and static analysis tools).

The later the bug is discovered, the more expansive it is to fix, and, if it
goes in production, the more damage it can do. We want to avoid as much as we
can the risk of having a piece of code waiting to explode deep in the codebase.

fizzbuzzA is the typical example of the function that will cost you quite a
lot. It is flawed, and waiting to crash the application at any moment. We want
to detect that ASAP, and in contract should tell us that ASAP.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to