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

Variant expressions with no argument are considered "simple" #1968

Merged
merged 2 commits into from
Jan 4, 2022

Conversation

gpetiot
Copy link
Collaborator

@gpetiot gpetiot commented Jan 3, 2022

Taking care of the first part of #1938: the variants, since it's not controversial. #1943 will be rebased to only take care of the lists and arrays.

CHANGES.md Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@gpetiot gpetiot merged commit a31c539 into ocaml-ppx:main Jan 4, 2022
@gpetiot gpetiot deleted the simple-variants branch January 4, 2022 10:28
@@ -313,6 +313,7 @@ module Exp = struct
| Pexp_apply
({pexp_desc= Pexp_ident {txt= Lident "not"; _}; _}, [(_, e1)]) ->
is_trivial e1
| Pexp_variant (_, None) -> true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about variant with a trivial arguments like for regular variants ? (like for Pexp_construct)

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.

3 participants