Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created October 4, 2016 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dogbert17/89a6b2e5888259e5deae2b6df6f8f300 to your computer and use it in GitHub Desktop.
Save dogbert17/89a6b2e5888259e5deae2b6df6f8f300 to your computer and use it in GitHub Desktop.
Comment on RT #128655
I believe that I have encountered the same bug under different circumstances. With the help of hackedNODE and others on #perl6
it seems as if the problem described below also suffers from the wrong multi candidate being called. In fact, it seems to happen
with any sub with int/Int multis.
dogbert@dogbert-VirtualBox ~ $ perl6 -v
This is Rakudo version 2016.09-122-gc6c0e69 built on MoarVM version 2016.09-13-g34c375a
implementing Perl 6.c.
# the problem
dogbert@dogbert-VirtualBox ~ $ perl6 -e 'my int $i = 2482111348; say $i; $i = $i div 2; say $i'
2482111348
-906427974
# run the same snippet with --optimize=0
dogbert@dogbert-VirtualBox ~ $ perl6 --optimize=0 -e 'my int $i = 2482111348; say $i; $i = $i div 2; say $i'
2482111348
1241055674
# also works with --optimize=1
dogbert@dogbert-VirtualBox ~ $ perl6 --optimize=1 -e 'my int $i = 2482111348; say $i; $i = $i div 2; say $i'
2482111348
1241055674
A discussion wrt this particular problem can be found here: https://irclog.perlgeek.de/perl6/2016-10-04#i_13335782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment