[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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
'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