--- Comment #3 from 2012-03-02 00:35:52 PST ---
(In reply to comment #2)
> (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
> executed.
> 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.

Yesterday I was sleepy and wasn't able to understand it. But even now I fail to
see the issue.
First fun accepts any instance that is of class A or a subclass of A. And
independent of this whenever you call all in contracts must be checked
using based on a's dynamic type.

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

Reply via email to