Browse thread
simple example of using ocamlbuild with C
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Axel_Poigné <axel.poigne@i...> |
| Subject: | Type checking question |
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