diff --git a/src/var.c b/src/var.c index a779ddff..e667966d 100644 --- a/src/var.c +++ b/src/var.c @@ -48,10 +48,7 @@ get_var_from_proc(pic_state *pic, struct pic_proc *proc) { pic_value v; - if (! pic_proc_p(v)) { - goto typeerror; - } - if (! pic_proc_func_p(pic_proc_ptr(v))) { + if (! pic_proc_func_p(proc)) { goto typeerror; } if (pic_proc_cv_size(pic, proc) != 1) { @@ -64,8 +61,7 @@ get_var_from_proc(pic_state *pic, struct pic_proc *proc) return pic_var_ptr(v); typeerror: - pic_error(pic, "expected parameter"); - UNREACHABLE(); + pic_errorf(pic, "expected parameter, but got ~s", v); } static pic_value