Skip to content
Permalink
Browse files

Always coerce first argument to &round to Numeric.

Fixes #1745.
  • Loading branch information...
jkramer committed Jul 4, 2018
1 parent 5ec2c96 commit e547811a3060900548a8688043a0643d06afbe24
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/core/Numeric.pm6
@@ -197,9 +197,8 @@ multi sub ceiling($a) { $a.Numeric.ceiling }
multi sub ceiling(Numeric $a) { $a.ceiling }

proto sub round($, $?, *%) is pure {*}
multi sub round($a) { $a.Numeric.round }
multi sub round(Numeric $a) { $a.round }
multi sub round(Numeric $a, $scale) { $a.round($scale) }
multi sub round(Numeric() $a) { $a.round }
multi sub round(Numeric() $a, $scale) { $a.round($scale) }

proto sub infix:<+>($?, $?, *%) is pure {*}
multi sub infix:<+>($x = 0) { $x.Numeric }

0 comments on commit e547811

Please sign in to comment.
You can’t perform that action at this time.