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 breaking primitive declaration with attributes #1640

Merged
merged 1 commit into from
Nov 15, 2017

Conversation

IwanKaramazow
Copy link
Contributor

fixes #1639

/* before */
[@bs.val] external imul : (int, int) => int =
  "Math.imul";

/* after */
[@bs.val] external imul : (int, int) => int = "Math.imul";

@chenglou
Copy link
Member

Aha, so did I diagnose right? Is it because it thought attributes were part of "first part"?

Ping me if you think it's ready to merge

[@bs.val] external imul : (int, int) => int =
"Math.imul";
[@bs.val]
external imul : (int, int) => int = "Math.imul";
Copy link
Member

@jordwalke jordwalke Nov 15, 2017

Choose a reason for hiding this comment

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

This is exactly how I'd want it to break.
Next, imagine if we drop the [ ] for "simple enough" attributes:

@bs.val
external imul : (int, int) => int = "Math.imul";

This breaking pattern makes a lot of sense in that case.

@jordwalke jordwalke merged commit fb3b7e0 into reasonml:master Nov 15, 2017
@IwanKaramazow
Copy link
Contributor Author

@chenglou Indeed, attributes where attached to the first part (all stuff up to =), which resulted in the printing going the wrong road.

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.

External with annotation line break logic wrong now
4 participants