Skip to content

Commit

Permalink
Use the new nqp::fromI_I in Int.new
Browse files Browse the repository at this point in the history
The op will create a new Int using the value of the given Int, but
remove any mix-ins.
  • Loading branch information
MasterDuke17 committed Oct 27, 2017
1 parent f40babb commit 6cb7ebf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Int.pm
Expand Up @@ -28,11 +28,11 @@ my class Int does Real { # declared in BOOTSTRAP
multi method new( \value) { self.new: value.Int }
multi method new(int \value) {
# rebox the value, so we get rid of any potential mixins
nqp::div_I(nqp::decont(value), 1, self)
nqp::fromI_I(nqp::decont(value), self)
}
multi method new(Int:D \value = 0) {
# rebox the value, so we get rid of any potential mixins
nqp::div_I(nqp::decont(value), 1, self)
nqp::fromI_I(nqp::decont(value), self)
}

multi method perl(Int:D:) {
Expand Down

0 comments on commit 6cb7ebf

Please sign in to comment.