convex icon indicating copy to clipboard operation
convex copied to clipboard

Improve error: `recur` without recursion point

Open helins opened this issue 4 years ago • 3 comments

Currently produces this error which is not very informative:

(recur 42)

;; ERROR (RECUR)
;; Recur:

helins avatar May 12 '21 12:05 helins

Should be something like: 'recur' occurred outside a loop or function body.

mikera avatar May 13 '21 01:05 mikera

Arguably we should be able to detect this as a compile error, though that would probably need some additional compiler context.

mikera avatar May 13 '21 01:05 mikera

I am always advocating for failing fast (ie. at compilation if possible). However this one should not happen very often, probably not much outside of learning or messing around in the sandbox. A better error message should suffice, at least for now.

helins avatar May 31 '21 18:05 helins