Created
March 16, 2013 19:17
-
-
Save pmichaud/5177871 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pmichaud@kiwi:~/p6/rakudo$ git diff src/core/Range.pm | |
| diff --git a/src/core/Range.pm b/src/core/Range.pm | |
| index f94036a..6c061a6 100644 | |
| --- a/src/core/Range.pm | |
| +++ b/src/core/Range.pm | |
| @@ -1,3 +1,5 @@ | |
| +my class X::Range::InvalidArg { ... } | |
| + | |
| class Range is Iterable is Cool does Positional { | |
| has $.min; | |
| has $.max; | |
| @@ -23,7 +25,9 @@ class Range is Iterable is Cool does Positional { | |
| multi method new(Whatever $min, Whatever $max, :$excludes_min, :$excludes_m | |
| fail "*..* is not a valid range"; | |
| } | |
| - | |
| + multi method new($min, Range $max, :$excludes_min, :$excludes_max) { | |
| + X::Range::InvalidArg.new(got => $max).throw; | |
| + } | |
| submethod BUILD($min, $max, $excludes_min, $excludes_max) { | |
| $!min = $min; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment