Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make Num.new better suitable for subclassing. japhb++ and sorear++
  • Loading branch information
moritz committed Aug 10, 2012
1 parent 8f97220 commit e5e9e79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Num.pm
Expand Up @@ -17,8 +17,8 @@ my class Num does Real {
nqp::fromnum_I(nqp::unbox_n(self), Int);
}

multi method new() { nqp::p6box_n(0) }
multi method new($n as Num) { $n }
multi method new() { nqp::box_n(0, self) }
multi method new($n) { nqp::box_n($n.Num, self) }

multi method perl(Num:D:) {
my $res = self.Str;
Expand Down

0 comments on commit e5e9e79

Please sign in to comment.