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
<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/Q4n12TMUo6No 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/SEU5b5AYtANo 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
Migrated from rt.perl.org#123078 (status was 'resolved')
Searchable as RT123078$
The text was updated successfully, but these errors were encountered: