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
What is this?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-11-18 (19:21)
From: skaller <skaller@m...>
Subject: Re: What is this?
I wrote:
> Can anyone see this error?
> This expression has type int but is here used with type unit
>   method run_file filename : int =
>         Py_exec_module.exec_file (self:>interpreter_t)

I have found the error. While I updated the interface for the module
correctly, (that is, the class type) I did not update the 
abstract interface containing the more abstract class type
to which the 'self' is coerced in the indicated term: in the class type
method 'run_file' has return type 'unit'. Because the inference engine
has not
yet deduced the type of 'run_file' for class type 'py_interpreter', it
the information from the coercion to assume it returns 'unit', then
an error when later finding it actually returns an 'int'.

John Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia
homepage: http://www.maxtal.com.au/~skaller
voice: 61-2-9660-0850