Browse thread
Is this a bug?
[
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: | Eric Cooper <ecc@c...> |
| Subject: | Re: [Caml-list] Is this a bug? |
It certainly seems to be a bug. Here's a smaller example:
type intopt = int option
let foo ?flag () = let (_ : intopt) = flag in ()
prints as
val foo : ?flag:<hidden> -> unit -> unit = <fun>
It still seems to be typed correctly:
# foo ~flag:17 ();;
- : unit = ()
# foo ~flag:"x" ();;
This expression has type string but is here used with type int
# let bar ?(flag=0) () = ();;
val bar : ?flag:int -> unit -> unit = <fun>
# [foo; bar];;
- : (?flag:<hidden> -> unit -> unit) list = [<fun>; <fun>]
The bug is also present when you run "ocamlc -i ..."
--
Eric Cooper e c c @ c m u . e d u