Last active
July 9, 2016 19:32
-
-
Save salortiz/e5434418ff26774eeeb7ebac20da630d to your computer and use it in GitHub Desktop.
This file contains 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
diff --git a/src/core/Str.pm b/src/core/Str.pm | |
index 1693e60..d6e5061 100644 | |
--- a/src/core/Str.pm | |
+++ b/src/core/Str.pm | |
@@ -43,9 +43,9 @@ my class Str does Stringy { # declared in BOOTSTRAP | |
nqp::findnotcclass(nqp::const::CCLASS_NUMERIC,$s,0,$chars), | |
$chars | |
) ?? nqp::atpos(nqp::radix_I(10,$s,0,0,Int),0) | |
- !! self.Numeric.Int; | |
+ !! (given self.Numeric { when Failure { $_ }; .Int }); | |
} | |
- method Num(Str:D:) { self.Numeric.Num; } | |
+ method Num(Str:D:) { given self.Numeric { when Failure { $_ }; .Num } } | |
multi method ACCEPTS(Str:D: Str:D \other) { | |
nqp::p6bool(nqp::iseq_s(nqp::unbox_s(other),$!value)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This fix 'A'.Int and 'A'.Num to propagate the failure like 'A'.Numeric