-
Notifications
You must be signed in to change notification settings - Fork 456
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
Submodule functor call is curried, but the target function is uncurried #7245
Comments
…ctor invocation bug - rescript-lang/rescript#7245
…ctor invocation bug - rescript-lang/rescript#7245
…ctor invocation bug - rescript-lang/rescript#7245
Here's a small example: module Make = (T: {}, Q: {}) => {
module Eq = (E: {}, A: {}) => {}
}
module M = Make({}, {})
module EQ = M.Eq({}, {}) produces function Make(T, Q) {
let Eq = (E, A) => ({});
return {
Eq: Eq
};
}
function Eq(E, A) {
return {};
}
let M = {
Eq: Eq
};
let EQ = M.Eq({})({}); Seems like a certain level of nesting is required to observe this. |
@cristianoc : is this issue hard to fix? it was working on v12-alpha.3 and before so the bug was introduced recently. thanks a lot. |
Perhaps one could always emit functors as functions taking one argument at a time, unless there are some issue that could come with that. |
Something like this: #7273 |
@dsiu could you try to install the package from CI and see if it works for you? |
@cristianoc sure thing. Will revert back once I tested it. Thanks! |
@cristianoc, I'm happy to report that #7273 fixes the problem. I ran it against my larger code base, and it only changes the module functor invocations, not any other code. I think it is good to go. Thanks again. |
I am porting bs-bastet to modern ReScript (v12+) (WIP at https://github.com/dsiu/rescript-bastet/tree/rescript-v12)
In
[email protected]
(alpha.4
and later), the generated js for nested module functor invocation is incorrect.The line:
is assuming
M.eq
is curried whileM.eq
is defined as:which clearly isn't curried.
The error is:
In
rescript@11
, the error line was compiled to :which runs correctly.
Playground link for test code
Test Code
Thank you for filing! Check list:
The text was updated successfully, but these errors were encountered: