Skip to content

Adding type annotation to curried function emits compiler error #7544

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

Closed
mediremi opened this issue Jun 12, 2025 · 1 comment · Fixed by #7548
Closed

Adding type annotation to curried function emits compiler error #7544

mediremi opened this issue Jun 12, 2025 · 1 comment · Fixed by #7548

Comments

@mediremi
Copy link
Contributor

Since v12.0.0-alpha.6, adding a type annotation to a curried function gives the error This function is a curried function where an uncurried function is expected:

type fn2 = (int, int) => int
let add : fn2 = (a, b) => a + b
let add5 : int => int  =  add(5, ...)
/// This function is a curried function where an uncurried function is expected

(Playground link)

cristianoc added a commit that referenced this issue Jun 13, 2025
Fixes #7544

Fix an issue in type checking partial application in the presence of user-defined function types.
The type checking code, when extracting the arity of the type annotation given to a function being applied, was expecting a concrete function type instead of looking up a possible type definition.
cristianoc added a commit that referenced this issue Jun 13, 2025
Fixes #7544

Fix an issue in type checking partial application in the presence of user-defined function types.
The type checking code, when extracting the arity of the type annotation given to a function being applied, was expecting a concrete function type instead of looking up a possible type definition.
@cristianoc
Copy link
Collaborator

Good catch. #7548

cristianoc added a commit that referenced this issue Jun 13, 2025
Fixes #7544

Fix an issue in type checking partial application in the presence of user-defined function types.
The type checking code, when extracting the arity of the type annotation given to a function being applied, was expecting a concrete function type instead of looking up a possible type definition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants