Date: Wed, 17 Nov 1999 10:13:49 +1100
From: skaller <skaller@maxtal.com.au>
To: caml-list@inria.fr
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
'interpreter_t',
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
uses
the information from the coercion to assume it returns 'unit', then
reports
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
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:28 MET