mauke / Function-Parameters

Function::Parameters - define functions and methods with parameter lists ("subroutine signatures")
https://metacpan.org/pod/Function::Parameters
18 stars 19 forks source link

Better error message for slurpy in the wrong place. #18

Closed schwern closed 7 years ago

schwern commented 9 years ago
$ perl -wle 'use Function::Parameters; fun foo(@that, $this) {}'
In fun foo: I was expecting ")" after "@that", not "$this" at -e line 1.

How about "Slurpy @that must come at the end"?

$ perl -wle 'use Function::Parameters; fun foo($this, @that, @foo) {}'
In fun foo: I was expecting ")" after "@that", not "@foo" at -e line 1.

How about "There is already a slurpy, @that. @foo is an extra"?

mauke commented 7 years ago

I changed the error message. It's not exactly what you suggested but at least it mentions "slurpy parameter" now, which I hope is more helpful.