-
Notifications
You must be signed in to change notification settings - Fork 471
Fix issue with ast conversion on functions with attributes on arguments. #7761
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
Conversation
Now that function attributes and first-argument attributes are split, they need to be re-joined in the old parse tree. This means that after a ppx, both will be on the first argument.
@@ -1 +1 @@ | |||
type fn = (~foo: string) => int | |||
type fn = (@as("something") ~foo: string) => int |
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.
This commit illustrates the difference.
This should fix the original issue, but needs testing just in case.
Hmm, I believe the original report was part of a record field, so would that be covered by this? Looking at the mapper I'm not sure, does that always pass that code path? |
The record field is after jsx runs. The original code only has an external with a function type. |
Right! Got it! Thanks! |
That said, it would be good to test it with the original example and one ppx. |
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/win32-x64
commit: |
Hello @reebalazs, could you give |
@nojaf @cristianoc Tested it out with my repo: I can confirm that it works. Thank you both! |
No description provided.