[
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: | Till Varoquaux <till.varoquaux@g...> |
| Subject: | coercions issues |
I still can't wrap my head around the whole polymorphic variant of
Ocaml (although I am making steady progresses). Anyways here is my
latest sore point:
This expression cannot be coerced to type
O.o Ast.T.expr O.m = O.o Ast.T.expr Mon.m;
it has type O.o Ast_js.T.expr Mon.m but is here used with type
O.o Ast.T.expr O.m = O.o Ast.T.expr Mon.m
Type
O.o Ast_js.T.expr =
[ `Binop of To.binop * To.expr * To.expr
| `Cst of To.constant
| `Ecall of To.ident * To.arg list
| `Fun of To.ident list * To.bloc
| `Lval of To.lvalue
| `Unop of To.unop * To.expr ]
is not compatible with type
O.o Ast.T.expr =
[ `Binop of To.binop * To.expr * To.expr
| `Cst of To.constant
| `Ecall of To.ident * To.arg list
| `Epos of Ast.location * To.expr
| `Fun of To.ident list * To.bloc
| `Lval of To.lvalue
| `Unop of To.unop * To.expr ]
The first variant type does not allow tag(s) `Epos
I am a little confused as to why this coercion is impossible... It
looks like a simple upward cast to me.
Cheers,
Till