Skip to content

Improve error message for optional arguments mismatches #13034

@dbuenzli

Description

@dbuenzli

I spent little but somehow too much time alpha renaming these expressions to see where the problem could be before realizing it was simply an optional vs non optional issue (maybe I'm tired).

Could maybe the error message be improved to directly mention optionability differences ?

       Values do not match:
         val v3 :
           ?fold:('a, 'b) Vec.fold ->
           ?make:('b -> 'b -> 'b -> 'a) -> 'b t -> 'a t
       is not included in
         val v3 :
           fold:('v3, 'a) Vec.fold ->
           make:('a -> 'a -> 'a -> 'v3) -> 'a t -> 'v3 t
       The type
         ?fold:('a, 'b) Vec.fold ->
         ?make:('b -> 'b -> 'b -> 'a) -> 'b t -> 'a t
       is not compatible with the type
         fold:('c, 'd) Vec.fold ->
         make:('d -> 'd -> 'd -> 'c) -> 'd t -> 'c t

(OCaml v4.14.1)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions