# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #120919] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=120919 >
<skids> r: role A { method pub { self!priv }; method !priv () { "OHAI".say } }; class C does A { }; C.new.pub; <camelia> rakudo-jvm a77214: OUTPUT«Nominal type check failed for parameter 'null'» <camelia> ..rakudo-parrot a77214: OUTPUT«Nominal type check failed for parameter ''; expected $?CLASS but got C instead in method priv at /tmp/eL6iqOxDYJ:1 in method pub at /tmp/eL6iqOxDYJ:1 in block at /tmp/eL6iqOxDYJ:1» <skids> r: role A { method pub { self!priv }; method !priv ($self:) { "OHAI".say } }; class C does A { }; C.new.pub; <camelia> rakudo-parrot a77214, rakudo-jvm a77214: OUTPUT«OHAI» <masak> skids: that... looks like a bug to me. at first blush. <masak> skids: looks like 'self' isn't parameterized correctly in private methods in roles. <masak> r: class A { method pub { self!priv }; method !priv { say "OH HAI" } }; A.new.pub <camelia> rakudo-parrot a77214, rakudo-jvm a77214: OUTPUT«OH HAI» <masak> skids: do you know if that's already submitted? <skids> masak: I do not. I was removing old workarounds from a year + ago and found it. * masak submits rakudobug <lue> masak: wait, how is that a bug? Seems reasonable to me. <masak> lue: note, it works in my last eval. <masak> lue: but it doesn't work in skid's first. <masak> lue: the only difference is that in skid's case, pub and !priv are in a role. <lue> masak: oh, I thought you were discussing skids' last eval. nevermind then :) [somehow I also missed the $self: in that eval] <masak> the second has a $self: <masak> the first doesn't. <masak> the fact that those two differ in their result is also suspect. <skids> At least the $self is a better workaround now than using a public method was.