Skip to content

Is @[params] obsolete? #23821

Discussion options

You must be logged in to vote

Read the note at the bottom of that section of the docs:

[!NOTE] Note the @[params] tag is used to tell V, that the trailing struct parameter can be omitted entirely, so that you can write button := new_button(). Without it, you have to specify at least one of the field names, even if it has its default value, otherwise the compiler will produce this error message, when you call the function with no parameters:

error: expected 1 arguments, but got 0.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gchumillas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants