Skip to content

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

Merged
gpetiot merged 2 commits intoocaml-ppx:masterfrom
gpetiot:pun-labelled-args
Jul 30, 2021
Merged

Handle punned labelled arguments with type constraint in function applications (ocaml#10434)#1756
gpetiot merged 2 commits intoocaml-ppx:masterfrom
gpetiot:pun-labelled-args

Conversation

@gpetiot
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

hhugo commented Aug 2, 2021

#633

@nojb
Copy link
Copy Markdown
Contributor

nojb commented Aug 2, 2021

#633

Thanks!

@nojb
Copy link
Copy Markdown
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
Copy Markdown
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.

4 participants