Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: John Prevost <j.prevost@cs.cmu.edu>
To: Alessandro Baretta <alex@baretta.com>
Cc: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Warning: explanation needed
Date: 16 Jul 2002 17:37:15 -0400 (90.087 UMT)	[thread overview]
Message-ID: <86ele3tkvo.fsf@laurelin.dementia.org> (raw)
In-Reply-To: <3D348F60.3060106@baretta.com>

>>>>> "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


      reply	other threads:[~2002-07-16 21:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-16 21:25 Alessandro Baretta
2002-07-16 21:37 ` John Prevost [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ele3tkvo.fsf@laurelin.dementia.org \
    --to=j.prevost@cs.cmu.edu \
    --cc=alex@baretta.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox