Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
After the repr updates, we correctly have native num attrs initialize…
…d to NaN. However, Num.new() seems to be expected to give back zero, so add an explicit new that makes this happen. Means we regress no spectests now after reprapi2.
  • Loading branch information
jnthn committed Nov 1, 2011
1 parent 95135c3 commit 666f399
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Num.pm
Expand Up @@ -13,6 +13,9 @@ my class Num {
nqp::p6box_i(nqp::unbox_n(self));
}

multi method new() { nqp::p6box_n(0) }
multi method new($n as Num) { $n }

multi method perl(Num:D:) {
my $res = self.Str;
if $res.index('e').defined {
Expand Down

0 comments on commit 666f399

Please sign in to comment.