Kindelia icon indicating copy to clipboard operation
Kindelia copied to clipboard

Calling a fun that doesn't exist returns `Not IO term`

Open kings177 opened this issue 2 years ago • 2 comments

When deploying this:

run {
  ask x = (Call 'a10000000000' []);
  (Done x)
}

it returns:

ERROR: 'FUN:a10000000000:91fd' is not an IO term

since "a10000000000" is not an existent fun, shouldn't it just return something like:

ERROR: Couldn't find 'FUN:a10000000000'

cc @steinerkelvin

kings177 avatar Sep 29 '22 22:09 kings177

When I added this error check, there was really no way to no if a name had been defined before or not (maybe checking if arity was defined for it? this would be clumsy). As I am adding statement indexes, this becomes much easier to fix.

o-santi avatar Oct 03 '22 17:10 o-santi

The problem here is actually that when Funs do not reduce they just stay stuck (exactly as in the original HVM). So we would need to (a) make this a runtime error, or (b) make an error specific on call (ugly).

(a) would be something like RuntimeError::FunDoesNotReduce { name, arg_prts: [...] }

steinerkelvin avatar Oct 03 '22 17:10 steinerkelvin