Beluga
Beluga copied to clipboard
Improve reconstruction error message for wrong-length data constructor spines
Presently there are the errors TooManyMetaObj
and MissingMetaObj
thrown in elMetaSpine
in reconstruct.ml
when there are, respectively, too many arguments and too few arguments supplied to a data constructor.
The resulting error message shown to the user is simply "too many meta-objects supplied to data-constructor" or "too few meta-objects supplied to data-constructor".
Instead, this error message should be more informative. I suggest
Data constructor arity mismatch.
The data constructor %s is applied to
%d
arguments, but its type
@[%a@]
requires
%d