# New Ticket Created by Zoffix Znet
# Please include the string: [perl #132128]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=132128 >
m: class Foo is Int {}; my Foo $x .= new: 42; say $x; say $x.WHAT;
rakudo-moar bb4579: OUTPUT: «Type check failed in assignment to $x;
expected Foo but got Int (42) in block <unit> at <tmp> line 1»
This was broken by the fix to make it correctly handle >64bit ints, but
apparently there are even articles that show how to subclass Ints:
https://irclog.perlgeek.de/perl6/2017-09-19#i_15187511
The likely fix would be Int.new changed to this:
method new (Int() \value) {
nqp::p6bindattrinvres(self.bless, Int, q|$!value|,
nqp::getattr(nqp::decont(value), Int, q|$!value|))
}
But that currently segfaults: https://rt.perl.org/Ticket/Display.html?id=132126