English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Recursive subtyping issue
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-03-01 (13:28)
From: Goswin von Brederlow <goswin-v-b@w...>
Subject: Re: [Caml-list] Recursive subtyping issue
"David Allsopp" <dra-news@metastack.com> writes:

> external foo_of_bar : bar -> foo = "%identity"
> in *both* the .ml and .mli file for the module in question. I'm virtually certain that ocamlopt eliminates calls to the %identity primitive.

Where is that documented? I would have written

let foo_of_bar (x : bar) = (x :> foo)

and hoped the inlining would eliminate it.