From: "Axel Poigné" <axel.poigne@iais.fraunhofer.de>
To: Caml Mailing List <caml-list@yquem.inria.fr>
Subject: Type checking question
Date: Thu, 10 Jan 2008 13:35:45 +0100 [thread overview]
Message-ID: <DD23A248-5A38-44FB-AA7A-2989F9245FB8@iais.fraunhofer.de> (raw)
In-Reply-To: <9f09a07a0801100005n5061a656ubbf7620e48e298ee@mail.gmail.com>
Hello
why does this work
#class xxx (x:int) =
object(self)
val mutable _x = x
method get = _x
end;;
class xxx : int -> object val mutable _x : int method
get : int end
#class yyy (x:int) =
object(self)
inherit xxx x
method set y = _x <- y
end;;
class yyy :
int ->
object val mutable _x : int method get : int method set : int ->
unit end
#class zzz (x:xxx) =
object(self)
method get = x#get
end;;
class zzz : xxx -> object method get : int endlet yy =
new yyy 8;;
#let zz = new zzz((yy:yyy):>xxx);;
val zz : zzz = <obj>
#zz#get;;
- : int = 8
I would expect that yy is of not type yyy = int -> ...
Axel
next prev parent reply other threads:[~2008-01-10 12:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-09 23:47 simple example of using ocamlbuild with C Ashish Agarwal
2008-01-10 8:05 ` [Caml-list] " Matthieu Dubuget
2008-01-10 12:35 ` Axel Poigné [this message]
2008-01-10 12:56 ` [Caml-list] Type checking question Jacques GARRIGUE
2008-01-10 15:35 ` Axel Poigné
2008-01-10 16:25 ` [Caml-list] simple example of using ocamlbuild with C Ashish Agarwal
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=DD23A248-5A38-44FB-AA7A-2989F9245FB8@iais.fraunhofer.de \
--to=axel.poigne@iais.fraunhofer.de \
--cc=caml-list@yquem.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