Skip to content

Commit

Permalink
Add missing Str.substr(Any x) candidate
Browse files Browse the repository at this point in the history
Fixes #1624, tests needed.
  • Loading branch information
lizmat committed Mar 18, 2018
1 parent 2a0b90f commit 15ccfd3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Str.pm6
Expand Up @@ -2775,6 +2775,9 @@ my class Str does Stringy { # declared in BOOTSTRAP
multi method substr(Str:D: Regex:D, $) {
die "You cannot use a Regex on 'substr', did you mean 'subst'?" # GH 1314
}
multi method substr(Str:D: \start) {
self.substr(start.Int)
}
multi method substr(Str:D: \start, \want) {
nqp::istype(want,Whatever) || want == Inf
?? self.substr(start)
Expand Down

0 comments on commit 15ccfd3

Please sign in to comment.