<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/07/36697edcbab46980a4c2ab388bb49492"
  from="John Prevost &lt;j.prevost@c...&gt;"
  author="John Prevost"
  date="2002-07-16T21:30:32"
  subject="Re: [Caml-list] Warning: explanation needed"
  prev="2002/07/559d8c8c619d2fdc4d87eb6f282dca61"
  next="2002/07/30f01411c409ed781c4bc76264d690f4"
  prev-in-thread="2002/07/559d8c8c619d2fdc4d87eb6f282dca61"
  prev-thread="2002/07/ef445170aabc78ef9d83bf0884c13ff5"
  next-thread="2002/07/e97792a8a64614e000b7a7096a57651b"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Warning: explanation needed">
<msg 
  url="2002/07/559d8c8c619d2fdc4d87eb6f282dca61"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T21:18:48"
  subject="[Caml-list] Warning: explanation needed">
<msg 
  url="2002/07/36697edcbab46980a4c2ab388bb49492"
  from="John Prevost &lt;j.prevost@c...&gt;"
  author="John Prevost"
  date="2002-07-16T21:30:32"
  subject="Re: [Caml-list] Warning: explanation needed">
</msg>
</msg>
</thread>

<contents>
&gt;&gt;&gt;&gt;&gt; "ab" == Alessandro Baretta &lt;alex@baretta.com&gt; writes:

    ab&gt; I'm not sure I get what this means. The following is my
    ab&gt; guess. Please, correct me if I'm wrong.

    ab&gt; In a class with multiple inheritance, the method mentioned in
    ab&gt; the warning is defined by multiple parent classes. Hence, the
    ab&gt; last class from which set_sub_node_context is inherited
    ab&gt; 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

</contents>

</message>

