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


<felher> nom: role R { my method !foo() { say 42 } }; class C does R {
method bar() { self!foo() } }; C.bar
<p6eval> rakudo a8086d: OUTPUT«42␤»
<masak> nom: role R1 { method !foo { say "R1" } }; role R2 { method
!foo { say "R2" } }; class C does R1 does R2 { method bar { self!foo()
} }; say C.new.bar
<p6eval> rakudo a8086d: OUTPUT«Private method 'foo' not found on type
C␤  in method dispatch:<!> at src/gen/CORE.setting:777␤  in method bar
at /tmp/diNxcNUBGu:1␤  in block <anon> at /tmp/diNxcNUBGu:1␤␤»
<masak> huh!
<masak> nom: role R1 { method !foo { "R1" } }; class C does R1 {
method bar { self!foo() } }; say C.new.bar
<p6eval> rakudo a8086d: OUTPUT«R1␤»
<masak> so... if private methods in a role collide... none of them
gets installed?
<jnthn> masak: Yeah, I've found the issue
<jnthn> masak: RoleToRoleApplier doesn't copy private methods
<masak> oh.
<masak> then why did felher's oneliner work?
<jnthn> masak: Because RoleToRoleApplier never gets used there
<jnthn> masak: Because only one role is being applied
<masak> aaaaaaah.
<jnthn> So we don't need to compute the summation.
* masak submits rakudobug
<jnthn> masak: OK. Testing a patch locally for it.

Reply via email to