New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Signature-less Methods #4985
Comments
From @zoffixznetThe error is made when the programmer assumes method declarations without a signature mean any arguments are valid and not a (). This would be common with Perl 5 programmers, I can imagine. Moreover, whe error that is shown when a call to such a method is made says it received 1 more argument than what the user provided, and it's not obvious that the one extra is the invocant. In constrast, doing the same thing with plain subroutines shows a much clearer and more informative error message. <Zoffix> m: class Foo { method bar {say "uhum"} }; Foo.new.bar: 42; |
From @lizmat
This *also* applies when there *is* a signature specified. $ 6 'class Foo { method bar() {say "uhum"} }; Foo.new.bar: 42' So, the LTAness of this error message is more generic. I’ll see if I can do something about that.
This is possible because the optimizer can figure this out at compile time. It’s not possible (yet, anyway) to do this for methods. It will probably be quite some time before we will see this type of message for method calls :-( Liz |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#127137 (status was 'open')
Searchable as RT127137$
The text was updated successfully, but these errors were encountered: