V version: 0.2.4
OS: Arch Linux
What did you do?
fn closure<T>(input T) fn () T {
return fn [input] () T {
return input
}
}
fn main() {
closure(123)
}
What did you expect to see?
No error.
What did you see instead?
./bug.v:4:12: error: generic function declaration must specify generic type names, e.g. foo<T>
2 |
3 | fn closure<T>(input T) fn () T {
4 | return fn [input] () T {
| ~~~~~~~~~~~~~~~~~
5 | return input
6 | }
I tried adding generic type name, but that resulted in this:
./bug.v:4:14: error: unexpected token `<`, expecting `(`
2 |
3 | fn closure<T>(input T) fn () T {
4 | return fn<T> [input] () T {
| ^
5 | return input
6 | }
V version: 0.2.4
OS: Arch Linux
What did you do?
What did you expect to see?
No error.
What did you see instead?
I tried adding generic type name, but that resulted in this: