> On 27 May 2017, at 19:33, Marcel Timmerman <mt1...@gmail.com> wrote: > In perl6 version 2017.04.3-287-g3e7675a built on MoarVM version > 2017.04-64-g6d5ea04 > implementing Perl 6.c. I observe the following; > > my Num $num = Inf; > my FatRat $f = $num.FatRat; > Type check failed in assignment to $f; expected FatRat but got > Rational[Num,Int] (?) > in block <unit> at <unknown file> line 1 > > Inf.WHAT; # (Num) > Inf.FatRat.WHAT # (Rational[Num,Int]) > > It boils down to not converting to FatRat while a defined number does; > my Num $num = 2.3e3; > $num.FatRat.WHAT; # (FatRat) > > > This is the same for NaN. > > If this is defined behavior, then there is no way to set NaN or Inf for > FatRat (and for Rat too). Is there another way to accomplish this?
This feels like a bug. Could you rakudobug it so it won’t fall through the cracks? FWIW, the golf is: $ 6 'dd FatRat.new(Inf)' Type check failed in binding to parameter 'nu'; expected Int but got Num (Inf) in block <unit> at -e line 1