Skip to content

Conversation

HaraldJoerg
Copy link

This is not severe. The error message of a bad signature can be a bit misleading:
tnamed06 and tnamed07 both have a positional parameter before a named one, which causes a compilation error as it should. With an initializer, the error message is a bit off.

sub tnamed06 (:$x,$y) { ... } 

correctly says:

Positional parameter follows named parameter at (eval nnn) line 1, near "$y"

If the positional parameter has an initializer, then the error report should be the same. Instead, it reports starting with the last token from the initializer:

sub tnamed07 (:$x,$y = $ARGV[0])
Positional parameter follows named parameter at (eval 475) line 1, near \"])

tnamed01 and tnamed07 both have a positional parameter before
a named one.  With an initializer, the error message is a bit off...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant