Skip to content
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

LTA error message when a private method exists but a nonexistent public one is called (or vice versa) in Rakudo #3569

Closed
p6rt opened this issue Oct 28, 2014 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 28, 2014

Migrated from rt.perl.org#123078 (status was 'resolved')

Searchable as RT123078$

@p6rt
Copy link
Author

p6rt commented Oct 28, 2014

From @masak

<masak> m​: class C { method foo { self.bar }; method !bar { say "hey,
I'm right here!" } }; C.new.foo
<camelia> rakudo-moar 315ec6​: OUTPUT«No such method 'bar' for invocant
of type 'C'␤ in method foo [...]
<masak> this error message could be better, IMO
<masak> (just got this in a real situation during a reordering of my program)
<timotimo> right, could either be "no such public method" or it could
introspect the package and see it has that private method
<masak> I would suggest the latter
<masak> and same with the reverse situation
<masak> m​: class C { method foo { self!bar }; method bar { say "hey,
I'm right here, too!" } }; C.new.foo
<camelia> rakudo-moar 315ec6​: OUTPUT«===SORRY!=== Error while
compiling /tmp/Q4n12TMUo6␤No such private method 'bar' for invocant of
type 'C' [...]
<masak> right -- private methods are not even virtual
<BenGoldberg> m​: class C { method foo { self!bar }; submethod bar {
say "hey, I'm right here, too!" } }; C.new.foo
<camelia> rakudo-moar 315ec6​: OUTPUT«===SORRY!=== Error while
compiling /tmp/SEU5b5AYtA␤No such private method 'bar' for invocant of
type 'C' [...]
<masak> submethod != private method
<masak> but yes, that's perhaps yet another namespace to search for
things in when producing a better error message
* masak submits rakudobug for the public/private method with a
submethod on the side

@p6rt
Copy link
Author

p6rt commented Jun 10, 2017

From @MasterDuke17

Implemented in rakudo/rakudo#1091 and rakudo/rakudo#1096
Tests added in rakudo/rakudo#1097

@p6rt
Copy link
Author

p6rt commented Jun 10, 2017

@MasterDuke17 - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Jun 10, 2017
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant