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
| ^