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

Fix formatting of external with as attribute and _ placeholder #6970

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

shulhi
Copy link
Member

@shulhi shulhi commented Aug 24, 2024

Fix #6966

The cause of the issue had to do with how @as attribute is handled with external.

external foo: (~x: int, ~y: int) => _ = "", foo has arity of 2. However, external foo: (~x: @as(true) _, ~y: int) => _ = "", foo here has arity of 1.

It happens here,

https://github.com/rescript-lang/rescript-compiler/blob/897cc228d0c2e259dde1628f2d9ccd2305b8194d/jscomp/syntax/src/res_core.ml#L4324-L4338

@shulhi shulhi marked this pull request as ready for review August 24, 2024 22:07
@shulhi shulhi requested a review from cknitt August 25, 2024 22:47
Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

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

Great work! @cristianoc could you have a look, too?

@cknitt cknitt requested a review from cristianoc August 26, 2024 05:24
@cknitt
Copy link
Member

cknitt commented Aug 27, 2024

Ok, will merge now as I want to format jscomp/test.
If @cristianoc has any feedback, we can address it in a separate PR.

@cknitt cknitt merged commit cfd0a34 into rescript-lang:master Aug 27, 2024
20 checks passed
@shulhi shulhi deleted the fix-arrow-as-attribute-print branch August 30, 2024 11:11
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.

Reformatting to invalid code in tests
2 participants