Here's an interesting bug from Rakudo, that I ran into today. Take this code block:
my $item-type;
$item-type = do given $ii {
when .key ~~ / ^ '-' / { 'GTK::SeparatorMenuItem' }
# !!! #
when .value<toggled>:exists |
.value<check>:exists |
.value<toggle>:exists { 'GTK::CheckMenuItem' }
# !!! #
default { 'GTK::MenuItem' }
}
Looks innocent enough! However when I tried to compile the module that contained this, I got the following error:
===SORRY!===
MVMArray: Index out of bounds
I know for sure it is tied to the when statement between the "# !!! #" comments, but I'm not sure why. I will probably have to re-write this into something else, though.
Just thought I should share.