Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for optional arguments mismatches #13034

Open
dbuenzli opened this issue Mar 16, 2024 · 0 comments
Open

Improve error message for optional arguments mismatches #13034

dbuenzli opened this issue Mar 16, 2024 · 0 comments
Assignees

Comments

@dbuenzli
Copy link
Contributor

dbuenzli commented Mar 16, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants