rescript-compiler
rescript-compiler copied to clipboard
[bug?] functors are not uncurried
module type T = {
let foo: string
}
module F = (X: T, Y: T) => {
}
module C = F({let foo = "bar"})
C.whatever()
gives error:
Type Errors
[E] Line 9, column 0:
The module C is a functor, not a structure
but it would likely be more helpful to error on the line above (could be way separated from C.whatever() in practice) and say that the functor is missing an argument.
That error message can definitely be made clearer.
I'll ruminate some on how we can make the error clearer at least. As for the actual behavior of this being curried, I've got no good answer right now. Would have to dig in the code.