unison icon indicating copy to clipboard operation
unison copied to clipboard

Pattern match deconstruction error should say how many constructor arguments are *required*

Open kylegoetz opened this issue 7 months ago • 0 comments

This is during a pattern match, cases VCard (Version v) fns kind n bday ann pid rev ps -> ...

What's the message you're seeing?

Image

What would a better version look like?

The error message says how many arguments I supplied to a type constructor, and it only lists the arguments of the constructor.

It would be nice if the error message also said how many arguments belong to the type constructor*.

So something like

The constructor has type 
  
    model.Version -> List.Nonempty FN -> Optional CardKind -> Optional N -> Optional Birthday -> Optional Birthday -> Optional ProductId -> Optional LocalDateTime -> Optional UID -> [VCardProperty] -> VCard
  
  It has 10 arguments, but you supplied 9 arguments.

Environment (please complete the following information):

  • ucm --version release/0.5.29
  • OS/Architecture: macOS 15.0.1

kylegoetz avatar Mar 22 '25 14:03 kylegoetz