Posting on behalf of dogbert17:

----------------------------

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

Reply via email to