deadalnix <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #2 from deadalnix <> 2012-03-01 07:40:10 PST ---
(In reply to comment #1)
> Can you elaborate why the static type must be considered? What's the problem
> with using the dynamic type?

The problem is simple. Let's consider a class A and a subclass B.

Then a function as this :

void fun(A a) {;

If passed an element of type B, fun will work, because B is a subclass of A. If's contract is different than's, then's in contract is

It is a bug, because fun has no knowledge weither it manipulate an element of
type A or an element of type B. It means that fun must respect the in contract
provided by, because in other case, it may or may no work, depending on
how fun in called, which isn't a reliable behavior.

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

Reply via email to