-
Notifications
You must be signed in to change notification settings - Fork 465
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
Compiler bug in applying an uncurried function when the function has a signature #6742
Comments
You can even simplify it down to this: module Bla: {
let array: ('a => 'b, Js.Array.t<'a>) => Js.Array.t<'b>
} = {
let array = (encoder, arr) => Js.Array.map(encoder, arr)
} I think the issue comes from the fact that The right error message should be like this:
|
I am trying to wrap my brain around this, but if we have a function with one argument what is the difference between curried and uncurried. Is it that the function is potentially partially applied? And I thought the stdlib would be all uncurried with the uncurried setting turned on. How would I know what is curried vs uncurried? Isn't the switch just compiling everything as uncurried? I think it's strange that there is a possibility of anything being curried when the flag is turned on - I think it's way more consistent that this is a system-wide thing. About deprecating |
A unary curried function that returns a unary curried function is what's called a binary curried function. |
Understood. I didn't know that the stdlib is still curried in uncurried mode, perhaps we can do something to make this clear? I think it's pretty weird to be honest, why would you want this to be curried? But at least it would be great to fix the error so that it's clear that the difference is that one function is curried and the other is not. That would make me track down this bug way easier :) |
This becomes non-existent in V12. OK to close? |
This causes a compile error that the interface doesn't match the signature even though the types are exactly the same in the error. Without the signature it compiles just fine.
Some pointers:
So it seems to be a bug in using externals in uncurried mode because the issue is not present when the
map
function is not an externalThe text was updated successfully, but these errors were encountered: