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

Handle punned labelled arguments with type constraint in function applications (ocaml#10434) #1756

Merged
merged 2 commits into from
Jul 30, 2021

Conversation

gpetiot
Copy link
Collaborator

@gpetiot gpetiot commented Jul 30, 2021

Update the parser with ocaml/ocaml#10434

Accept labelled argument punning with type constraint in pexp_apply

For example, function application of the form foo ~(x:int) instead of the explicit foo ~x:(x:int).

No diff with test_branch.sh

@gpetiot gpetiot merged commit 10902c1 into ocaml-ppx:master Jul 30, 2021
@gpetiot gpetiot deleted the pun-labelled-args branch July 30, 2021 13:00
@nojb
Copy link
Contributor

nojb commented Aug 2, 2021

Hello, naive question: how does ocamlformat handle the dependency on the OCaml version in order to avoid using a syntax that is not understood by "old" OCaml versions (such as the one used by this PR)?

@hhugo
Copy link
Collaborator

hhugo commented Aug 2, 2021

#633

@nojb
Copy link
Contributor

nojb commented Aug 2, 2021

#633

Thanks!

@nojb
Copy link
Contributor

nojb commented Aug 2, 2021

#633

Thanks!

So do I understand correctly that you cannot use the syntax ~x:(x : ...) together with the next release of ocamlformat unless you are running the version of OCaml that includes that syntax (at the moment, only trunk I think)?

@gpetiot
Copy link
Collaborator Author

gpetiot commented Aug 3, 2021

I've opened #1759 to take care of this

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

Successfully merging this pull request may close these issues.

None yet

4 participants