New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rindex fails on non-string invocant #300
Comments
From @pmichaudThe rindex method added in r30858 has a bug: $ ./parrot perl6.pbc
Pm |
From @moritzPatrick R. Michaud (via RT) wrote:
Added a (skipped) test to t/spec/S29-str/rindex.t Moritz -- |
The RT System itself - Status changed from 'new' to 'open' |
From @bacekOn Sun Sep 07 09:32:01 2008, pmichaud wrote:
Hello. There is a patch for casting non-Strings to String. But I'm not quite -- |
From @bacekrindex.patchdiff --git a/languages/perl6/src/builtins/any-str.pir b/languages/perl6/src/builtins/any-str.pir
index f5c4bf2..3e2a387 100644
--- a/languages/perl6/src/builtins/any-str.pir
+++ b/languages/perl6/src/builtins/any-str.pir
@@ -106,7 +106,16 @@ the size of that file down and to emphasize their generic,
goto done
substring_search:
- pos = self.'reverse_index'(substring, pos)
+ $I0 = self.'isa'('String')
+ if $I0 goto self_string
+ $P0 = new 'String'
+ $S0 = self
+ $P0 = $S0
+ goto do_search
+ self_string:
+ $P0 = self
+ do_search:
+ pos = $P0.'reverse_index'(substring, pos)
if pos < 0 goto fail
done:
|
From @moritzOn Sun Sep 07 21:40:06 2008, bacek wrote:
Well, we need a cast somehow, I don't see why it should be wrong Applied as r30947, thank you. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#58644 (status was 'resolved')
Searchable as RT58644$
The text was updated successfully, but these errors were encountered: