Skip to content
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

Quick procedures with captures do not have return types inferred correctly #144

Open
brendanfh opened this issue Apr 28, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@brendanfh
Copy link
Collaborator

x := 10

f := ([x]) => x

g :: (f: () -> $R) -> R {
    return f()
}

g(f) |> println() // Should return 10
error: Error solving for polymorphic variable 'R'.
   at: /home/brendan/dev/onyx/asdf.onyx:8,10
   |
 8 |     g :: (f: () -> $R) -> R {
   |          ^
error: Unable to solve for polymorphic variable 'R', given the type '() -> unknown'.
   at: /home/brendan/dev/onyx/asdf.onyx:8,21
   |
 8 |     g :: (f: () -> $R) -> R {
   |                     ^
error: Here is where the call is located.
   at: /home/brendan/dev/onyx/asdf.onyx:12,6
    |
 12 |     g(f) |> println() // Should return 10
    |      ^
@brendanfh brendanfh added the bug Something isn't working label Apr 28, 2024
@brendanfh brendanfh added this to the v0.1.12 milestone Apr 28, 2024
@brendanfh brendanfh self-assigned this Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant