-
Notifications
You must be signed in to change notification settings - Fork 469
Uncurried mode regression 11.0.0-rc.6 #6504
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
Comments
I think it's related to this too |
Probably related to this optimisation: where type inference gives the function unit type let fn = cb => {
cb()
}
fn(s => Js.log(#foo(s))) |
cristianoc
added a commit
that referenced
this issue
Dec 5, 2023
Fixes #6504 Uncurried functions with 1 unit argument are emitted without the parameter. This leaves a possible undefined id in the emitted code if the parameter is a variable. This PR limits the optimization to cases where the parameter is explicitly `()`, as opposed to e.g. a variable whose type is inferred to be unit.
cristianoc
added a commit
that referenced
this issue
Dec 5, 2023
Fixes #6504 Uncurried functions with 1 unit argument are emitted without the parameter. This leaves a possible undefined id in the emitted code if the parameter is a variable. This PR limits the optimization to cases where the parameter is explicitly `()`, as opposed to e.g. a variable whose type is inferred to be unit.
cristianoc
added a commit
that referenced
this issue
Dec 5, 2023
Fixes #6504 Uncurried functions with 1 unit argument are emitted without the parameter. This leaves a possible undefined id in the emitted code if the parameter is a variable. This PR limits the optimization to cases where the parameter is explicitly `()`, as opposed to e.g. a variable whose type is inferred to be unit.
cristianoc
added a commit
that referenced
this issue
Dec 5, 2023
Fixes #6504 Uncurried functions with 1 unit argument are emitted without the parameter. This leaves a possible undefined id in the emitted code if the parameter is a variable. This PR limits the optimization to cases where the parameter is explicitly `()`, as opposed to e.g. a variable whose type is inferred to be unit.
Both issues reported above have in fact the same cause -- fixed in #6507 |
cristianoc
added a commit
that referenced
this issue
Dec 5, 2023
Fixes #6504 Uncurried functions with 1 unit argument are emitted without the parameter. This leaves a possible undefined id in the emitted code if the parameter is a variable. This PR limits the optimization to cases where the parameter is explicitly `()`, as opposed to e.g. a variable whose type is inferred to be unit.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After migrating to uncurried mode I've got an unexpected runtime error:
https://rescript-lang.org/try?version=v11.0.0-rc.6&code=DYUwLgBAZgdhC8EDGAjBA+CBvAUBZKAFAJQ4C+OOshAzhhAFI0B0wA9gOaEDEUbbtYkJwB6ERADi4CACIAqjCQBDAK4cAFpABKIKCABOIRSACi+-W30AuCHQCWdGG0gATXXZggXMnEA
The text was updated successfully, but these errors were encountered: