-
Notifications
You must be signed in to change notification settings - Fork 463
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 deriving accessors in uncurried mode #6687
Fix deriving accessors in uncurried mode #6687
Conversation
Impressive! Ping @cristianoc who's best to review this. |
Should probably ship this in 11.1. Mind changing the base branch to that? 11.0_release |
@@ -0,0 +1,15 @@ | |||
var p = require("child_process"); |
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 think a build test is not required for this, as the issue shows with some simple files that don't compile.
Adding a file to jscomp/test
should be enough, as compile errors would be picked up.
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.
Plus the compiled output would be checked in.
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.
Ok great thanks for the feedback. I'll do that 👍🏼
7a69b50
to
a8edae4
Compare
Apologies @cristianoc made a mistake with the rebase if you are mid review, busy fixing now. |
a8edae4
to
f22be9c
Compare
Thanks @zth! Just rebased and I'll implement the changes suggested by Cristiano 👍🏼 |
Hey @cristianoc, Note I've moved the tests out of the build test folder. I also caught a bug realising I was not checking for Variants without parameters. So I've made a tweak to the derive projector file and added a test case for this. The reason I initially had it as a build test was because I wanted to show in a commit that it was failing and have a passing test that asserts the failure. Then in the following commit that fixes the behaviour invert the assertion that shows its fixed as I like reading git history that tells a story like that 😄 Out of interest is there a nice simple way to assert there should be some sort of compile failure? |
67609f4
to
55cf92e
Compare
55cf92e
to
d8cdb20
Compare
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.
Looks great
Very well done @JonoPrest! |
Thanks @zth and thanks for the review @cristianoc, very grateful for your dedication to rescript and openness to contribution 🙏🏼 |
Closes #6492
Uncurried mode breaks
deriving(accessors)
This PR converts the derived accessor functions into uncurried functions if Config is "Uncurried".
Previously (example from test added)
would error as below