Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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,
10/1 Toxteth Rd Glebe NSW 2037 Australia
voice: 61-2-9660-0850