The problem was actually in setting values in (Bag|Mix)Hash. The problem could be golfed to:
my $b = BagHash.new; $b<a> = 42; $b.total Fixed in https://github.com/rakudo/rakudo/commit/4c813666df . Tests needed > On 13 May 2017, at 12:27, Jan-Olof Hendig (via RT) > <perl6-bugs-follo...@perl.org> wrote: > > # New Ticket Created by Jan-Olof Hendig > # Please include the string: [perl #131303] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=131303 > > > > # the system > dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6 -v > This is Rakudo version 2017.04.3-238-g50d5ac327 built on MoarVM version > 2017.04-64-g6d5ea042 > implementing Perl 6.c. > > # the problem > dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6 -e 'say bag(<a a b c a > d>) (-) bag(<a a b c c>) == bag(<a d>)' > P6opaque: get_boxed_ref could not unbox for the representation '20' of type > Scalar > in block <unit> at -e line 1 > > # Alexdaniel++ quickly dug up the following > 12:15:17 +bisectable6 | AlexDaniel, Bisecting by exit code (old=2015.12 > new=50d5ac3). Old exit code: 0 > 12:15:26 +bisectable6 | AlexDaniel, bisect log: > https://gist.github.com/ea9b1f5cafac02e57b9a7d2d3eb01b8c > 12:15:26 +bisectable6 | AlexDaniel, (2017-05-11) > https://github.com/rakudo/rakudo/commit/788e6de6dc6b90e2938451afbf80e31a591b1550 >