V version: V 0.1.28 a3086a2
OS: Arch Linux 5.7.6
What did you do?
Define an anonymous function that returns an error
pub struct Command {
...
pre_execute fn(cmd Command)?
execute fn(cmd Command)?
post_execute fn(cmd Command)?
...
}
What did you expect to see?
It should compile, because it does compile when returning other things (e.g. ?bool) or when adding the (optional) comma at the end of line
What did you see instead?
vlib/cli/command.v:11:10: error: unexpected `fn`, expecting `name`
9 | version string
10 | pre_execute fn(cmd Command)?
11 | execute fn(cmd Command)?
| ~~
12 | post_execute fn(cmd Command)?
13 |
Unless anyone else is working on this. I will take a look at it.
Most helpful comment
Unless anyone else is working on this. I will take a look at it.