opendylan icon indicating copy to clipboard operation
opendylan copied to clipboard

Bad error messages for incorrect arguments for <simple-closure-method>

Open cgay opened this issue 5 years ago • 0 comments

Got this run-time error. Sure would have been nice to know the type of the argument being passed to it.

Error: Attempted to call {<simple-closure-method>: ??? () => (#rest)} with 1 arguments

Looks a tad complicated to fix (for me) because it's mostly in the iep/mep/xep generation code in the back-end.

In general, perhaps it would be better to remove specific errors like <argument-count-error> and <argument-count-overflow-error> and replace them with one error class for reporting mismatched parameter lists? (Maybe such an error already exists; I didn't check.) Then the error message can always show the expected parameter list and the passed parameters, for maximum information. It could also compute other bits locally, like if the argument counts don't match, and display that as well to be explicit.

cgay avatar Feb 22 '20 18:02 cgay