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-16 (18:37)
From: skaller <skaller@m...>
Subject: What is this?
Can anyone see this error?
File "py_interp.ml", line 477, characters 6-545:
This expression has type int but is here used with type unit
[exception SystemExit of int]

  method run_file filename : int =
        ignore (environment # set_attr (PyString "__name__") (PyString
        ignore (environment # set_attr (PyString "__file__") (PyString
        Py_exec_module.exec_file (self:>interpreter_t)
          (Py_exec.py_exec (self:>interpreter_t)
      | SystemExit n -> n
      | x -> 
        print_endline ("Error Near line " ^ (string_of_int (fst
        flush stdout;
        self#py_raise x;
        0 (* dummy value *)


This method is NOT called anywhere in the module.
I cannot see where the inference engine gets the
idea that the expression should have type unit.

[That message is really annoying. It should read
" .. but is used _somewhere else_ with type .."
since it always means that. It would be nice
to know where that somewhere else is, since half the
time, that is where the error is]

John Skaller, mailto:skaller@maxtal.com.au
1/10 Toxteth Rd Glebe NSW 2037 Australia
homepage: http://www.maxtal.com.au/~skaller
downloads: http://www.triode.net.au/~skaller