# New Ticket Created by  Moritz Lenz 
# Please include the string:  [perl #121626]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=121626 >


<moritz> r: my $a = []; my $role = role { has $.cool = "yeah" }; $a does
         $role; say $a.cool
<camelia> rakudo-parrot 9ff0bc: OUTPUT«yeah␤»
<camelia> ..rakudo-jvm 9ff0bc: OUTPUT«Nominal type check failed for
          parameter 'null'␤  in method  at /tmp/tmpfile:1␤  in block  at
          gen/jvm/CORE.setting:993␤  in method BUILD_LEAST_DERIVED at
          gen/jvm/CORE.setting:951␤  in sub infix:<does> at
          gen/jvm/CORE.setting:16514␤  in sub infix:<d…»
<camelia> ..rakudo-moar 9ff0bc: OUTPUT«Type check failed in binding
          <anon>; expected '<anon>' but got 'Array+{<anon>}'␤  in method
          at /tmp/tmpfile:1␤  in block  at src/gen/m-CORE.setting:993␤
          in method BUILD_LEAST_DERIVED at src/gen/m-CORE.setting:951␤
          in sub infix:<does> at src/gen/…»


But this one works:

<moritz> r: my $a = []; $a does role { has $.cool = "yeah" }; say $a.cool
<camelia> rakudo-parrot 9ff0bc, rakudo-jvm 9ff0bc, rakudo-moar 9ff0bc:
OUTPUT«yeah␤»

This cases test failures in t/spec/S14-roles/anonymous.t

Reply via email to