# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #123078] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=123078 >
<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