# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #116226] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=116226 >
<doy> r: role Foo { method bar { "ROLE:" ~ (self.defined ?? "D" !! "U") } }; class Bar does Foo { method bar { "CLASS:" ~ (self.defined ?? "D" !! "U") ~ "-" ~ self.Foo::bar } }; say Bar.new.bar <p6eval> rakudo c8de2e: OUTPUT«CLASS:D-ROLE:U» <doy> ^^ bug? <doy> or is there another way i'm supposed to be doing that call <masak> doy: in-ter-es-ting. <masak> doy++ * masak submits rakudobug <masak> r: role Foo { method bar { say self.WHICH } }; class Bar does Foo { method bar { say self.WHICH; self.Foo::bar } }; Bar.new.bar <p6eval> rakudo c8de2e: OUTPUT«Bar|549956910Foo» <masak> I'd argue 'self' should still be the original invocant, even in the role method. <doy> agreed <masak> r: role Foo { method baz { say self.WHICH } }; class Bar does Foo { method bar { say self.WHICH; self.baz } }; Bar.new.bar <p6eval> rakudo c8de2e: OUTPUT«Bar|1974449900Bar|1974449900» <masak> ...and it's particular to the self.Role::meth syntax. bingo.