You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…rror
Problem: Vim9: using default value in lambda gives confusing error.
Solution: Pass "default_args" on the first pass to get the arguments.
(closesvim#8455)
Describe the bug
In Vim9 script, a confusing error is given when we try to declare an optional argument in a lambda.
To Reproduce
Run this shell command:
E1181
is raised:Expected behavior
A different error is raised, like this one:
Or this one:
Environment
Additional context
The current error message is misleading. We can use an underscore in a lambda:
And in a regular function, we can use an optional argument after
_
:The issue is simply that the
optional_argument = value
syntax is not supported in a lambda.Same issue when we wrongly use the
?type
syntax (which is only valid when specifying the type of a funcref; not the type of a lambda's argument):The text was updated successfully, but these errors were encountered: