* [Caml-list] Warning: explanation needed
@ 2002-07-16 21:25 Alessandro Baretta
2002-07-16 21:37 ` John Prevost
0 siblings, 1 reply; 2+ messages in thread
From: Alessandro Baretta @ 2002-07-16 21:25 UTC (permalink / raw)
To: Ocaml
> Warning: the following methods are overriden by the
> inherited class:
> set_sub_node_context
I'm not sure I get what this means. The following is my
guess. Please, correct me if I'm wrong.
In a class with multiple inheritance, the method mentioned
in the warning is defined by multiple parent classes. Hence,
the last class from which set_sub_node_context is inherited
overrides the previously inherited definition.
Alex
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] Warning: explanation needed
2002-07-16 21:25 [Caml-list] Warning: explanation needed Alessandro Baretta
@ 2002-07-16 21:37 ` John Prevost
0 siblings, 0 replies; 2+ messages in thread
From: John Prevost @ 2002-07-16 21:37 UTC (permalink / raw)
To: Alessandro Baretta; +Cc: Ocaml
>>>>> "ab" == Alessandro Baretta <alex@baretta.com> writes:
ab> I'm not sure I get what this means. The following is my
ab> guess. Please, correct me if I'm wrong.
ab> In a class with multiple inheritance, the method mentioned in
ab> the warning is defined by multiple parent classes. Hence, the
ab> last class from which set_sub_node_context is inherited
ab> overrides the previously inherited definition.
Actually, it's more general. If there's a pre-existing definition of
the method at all, a warning is given. So:
class a =
object
method m = 1
end
class b =
object
method m = 2
end
class c =
object
method m = 3
inherit b
end
class d =
object
inherit a
inherit b
end
class e =
object
inherit b
method m = 3
end
You get the warning for classes c and d, but not for class e.
John.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-07-16 21:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-16 21:25 [Caml-list] Warning: explanation needed Alessandro Baretta
2002-07-16 21:37 ` John Prevost
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox