feat(frontends/lean/builtin_cmds): generate better error message when vm_eval result is a function
This commit is contained in:
parent
8bccfc23da
commit
a2c1372d45
1 changed files with 3 additions and 1 deletions
|
|
@ -667,9 +667,11 @@ static environment compile_cmd(parser & p) {
|
|||
|
||||
static void vm_eval_core(bool is_IO, vm_state & s, name const & main) {
|
||||
if (is_IO) s.push(mk_vm_simple(0)); // push the "RealWorld" state
|
||||
vm_decl d = *s.get_decl(main);
|
||||
if (!is_IO && d.get_arity() > 0)
|
||||
throw exception("vm_eval result is a function");
|
||||
s.invoke_fn(main);
|
||||
if (is_IO) {
|
||||
vm_decl d = *s.get_decl(main);
|
||||
if (d.get_arity() == 0) {
|
||||
/* main returned a closure, it did not process RealWorld yet.
|
||||
So, we force the execution. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue