-
Notifications
You must be signed in to change notification settings - Fork 464
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
Fix issues where pipe "->" processing eats up attributes in 1 arity function #5585
Conversation
@cristianoc I'm not sure, but I think here needs same fix as #5581 https://github.com/rescript-lang/rescript-compiler/blob/e7c408ee63b86327bde3783a68cf673d475b4c8f/jscomp/frontend/ast_exp_apply.ml#L180 Am I correct? If so, I'm gonna add commits to keep the attributes and |
jscomp/frontend/ast_exp_apply.ml
Outdated
@@ -128,6 +128,12 @@ let app_exp_mapper (e : exp) (self : Bs_ast_mapper.mapper) (fn : exp) | |||
pexp_loc = e.pexp_loc; | |||
pexp_attributes = e.pexp_attributes; | |||
} | |||
| Pexp_ident _ -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand this.
It does not seem only about attributes.
Apart from attributes, what else changes without this case?
Is this case perhaps handled somewhere below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got your point. I think this commit change handles in more comprehensive cases. 16a42b7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it's handled below in:
| _ -> Ast_compatible.app1 ~loc fn new_obj_arg
and can be handled as
{(Ast_compatible.app1 ~loc fn new_obj_arg) with pexp_attributes = e.pexp_attributes}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got your point. I think this commit change handles in more comprehensive cases. 16a42b7
perfect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems same, doesn't it?
Ast_compatible.app1 ~loc ~attrs:e.pexp_attributes fn new_obj_arg
It's a good question. |
I wonder whether |
So don't even try to find an example: it does not exist. Unless the example is written in |
Understood. Do you want me to remove the destruct part or leave for now? |
Maybe leave it as it is and create a reminder issue. |
Got it. I've tried and think the tests need to be fixed too. Even though those test are |
I think this PR is done now. |
I had a look and while the |
I've done it in a separate PR, which can be looked at with calm -- don't need to do it now. |
The other thing is, the comments suggest that |
This is ready to merge right? |
This PR is the following PR to #5581 and fixes same issue in the single arity function.