Browse thread
Unexpected '_a problem
[
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: | Chris King <colanderman@g...> |
| Subject: | Re: [Caml-list] Unexpected '_a problem |
On 8/3/06, Jacques Garrigue <garrigue@math.nagoya-u.ac.jp> wrote:
> type 'a bar_t = Bar of <bar: ('a -> unit) -> unit> ;;
> let create_bar () = Bar (object method bar (_: 'a) = () end);;
> let b = create_bar ();;
> let Bar b = b;;
Okay, that got the types to work out correctly.
> If you still want to use Obj.magic, remember to put complete type
> annotions on both its input and output, as the lack of type
> information may break the compiler.
Surprisingly putting a type annotation on its output caused it to
infer a monomorphic type - I was relying on the type in the module's
signature since the type there is abstract.