To: Francois.Pottier at inria.fr Cc: lablgtk at kaba.or.jp Subject: Re: Misc questions In-Reply-To: <20030922100602.B31077 at pauillac.inria.fr> References: <20030922085521.A30725 at pauillac.inria.fr> <20030922165104L.garrigue@kurims.kyoto-u.ac.jp> <20030922100602.B31077@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030922171934X.garrigue at kurims.kyoto-u.ac.jp> Date: Mon, 22 Sep 2003 17:19:34 +0900 From: Jacques Garrigue Lines: 41 From: Francois Pottier > On Mon, Sep 22, 2003 at 04:51:04PM +0900, Jacques Garrigue wrote: > > > > OK. Gobject.obj is contravariant. Since for variants [`treemodel] is a > > subtype of [`treemodel|`liststore], then a (liststore obj) is a > > subtype of a (treemodel obj). > > Hmm, I do see that > > [`treemodel|`liststore] obj <: [`treemodel] obj > > is valid. But I still don't see why > > [`treemodel] obj <: tree_model obj > > should be valid -- which was my original question :) I see: there was a bug, since tree_model is an abbreviation of [`treemodel] obj, and (tree_model obj) is just meaningless. So you will have to fix it by replacing the definition of RowReference.create by this one: external create : [> `treemodel ] Gtk.obj -> Gtk.tree_path -> Gtk.row_reference = "ml_gtk_tree_row_reference_new" When you see a bug, call it a bug :) (I suggested a coercion because I believed list_store#model would return a [`treemodel|`liststore] obj. But this is not the case anyway.) > > You have to use ocamlbrowser to see all the contents directly. > > Aah! I see. So browsing the .mli files by hand doesn't tell you all > of the truth. That is subtle. This is only for the Gtk* modules, and they have no .mli to start with. But considering all the inheritance going around, this is useful with classes too... Jacques