Beluga icon indicating copy to clipboard operation
Beluga copied to clipboard

Improve reconstruction error message for wrong-length data constructor spines

Open tsani opened this issue 4 years ago • 0 comments

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

tsani avatar Jan 24 '20 14:01 tsani