Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make a range with Real min coerce the max to to Real too
  • Loading branch information
moritz committed May 8, 2012
1 parent ad3a7b6 commit cc19e25
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/Range.pm
Expand Up @@ -8,6 +8,12 @@ class Range is Iterable does Positional {
multi method new($min, $max, :$excludes_min, :$excludes_max) {
nqp::create(self).BUILD($min, $max, $excludes_min, $excludes_max)
}
multi method new(Real $min, $max, :$excludes_min, :$excludes_max) {
nqp::create(self).BUILD($min, $max.Real, $excludes_min, $excludes_max)
}
multi method new(Real $min, Whatever $max, :$excludes_min, :$excludes_max) {
nqp::create(self).BUILD($min, $Inf, $excludes_min, $excludes_max)
}
multi method new($min, Whatever $max, :$excludes_min, :$excludes_max) {
nqp::create(self).BUILD($min, $Inf, $excludes_min, $excludes_max)
}
Expand Down

0 comments on commit cc19e25

Please sign in to comment.