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

Printfoo(()) as foo() + update parser #1560

Merged
merged 1 commit into from
Oct 30, 2017

Conversation

IwanKaramazow
Copy link
Contributor

@IwanKaramazow IwanKaramazow commented Oct 27, 2017

Fixes #1550

@@ -4702,6 +4702,10 @@ class printer ()= object(self:'self)
method constructor_expression ?(polyVariant=false) ~arityIsClear stdAttrs ctor eo =
let (implicit_arity, arguments) =
match eo.pexp_desc with
| Pexp_construct ( {txt= Lident "()"},_) ->
(* `foo() is a polymorphic variant that contains a single unit construct as expression
Copy link
Member

Choose a reason for hiding this comment

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

Great comment

@chenglou
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants