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
Structural subtyping problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-03-28 (20:17)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] Structural subtyping problem
Hi,

> I'm using the structural subtyping aspects of Ocaml's object system to emulate width
> subtyping.  I've come across a problem which does not type-check, though intuitively
> it seems correct.  I reckon that the compiler may need some help in the form of type
> annotations and/or coercions, though their exact shape elludes me.

Thank you all for your assistance.  In the real-world code, the solution
based on coercion is the most straightforward to implement.  And it looks
obvious now...

Cheers,
Dario Teixeira