Skip to content
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

Calling some methods on Match.orig causes NPA #1377

Closed
p6rt opened this issue Oct 25, 2009 · 6 comments
Closed

Calling some methods on Match.orig causes NPA #1377

p6rt opened this issue Oct 25, 2009 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Oct 25, 2009

Migrated from rt.perl.org#70003 (status was 'resolved')

Searchable as RT70003$

@p6rt
Copy link
Author

p6rt commented Oct 25, 2009

From @moritz

15​:37 <@​moritz_> rakudo​: 'a' ~~ /a/; say ($/.orig).rindex('a', 1)
15​:37 <+p6eval> rakudo 49e62f​: OUTPUT«Null PMC access in
find_method()␤in Main
  (file src/gen_setting.pm, line 295)␤»

Likely cause​:

15​:35 <@​moritz_> rakudo​: 'a' ~~ /a/; say $/.orig.PARROT
15​:35 <+p6eval> rakudo 49e62f​: OUTPUT«CodeString␤»

@p6rt
Copy link
Author

p6rt commented Nov 14, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S05-match/capturing-contexts.t

commit ad5306eaedfd60179a505fce0b2203f0c07712c1
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sat Nov 14 05​:05​:15 2009 +0000

  [t/spec] Test for RT 70003​: $/.orig produces CodeString
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;29080 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S05-match/capturing-contexts.t b/t/spec/S05-match/capturing-contexts.t
index 93f0e37..8f97ae9 100644
--- a/t/spec/S05-match/capturing-contexts.t
+++ b/t/spec/S05-match/capturing-contexts.t
@@ -102,6 +102,13 @@ is_run( q{'aa' ~~ /(.)$1/},
     is $/, 'RT', 'Matched as intended in void context';
 }
 
+# RT #70003
+{
+    'a' ~~ /a/;
+    #?rakudo skip 'RT 70003'
+    is ($/.orig).rindex('a'), 0, 'rindex() works on $/.orig';
+}
+
 done_testing;
 
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Nov 14, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 5, 2010

From @moritz

Needs better tests. Right now the example fail()s, but this fails too​:

'blablubb' ~~ /a/; say ($/.orig).rindex('a', 1)
===SORRY!===
Substring 'a' not found in 'blablubb'

@p6rt
Copy link
Author

p6rt commented Oct 1, 2011

From @moritz

Tests are better now, and passing.

@p6rt
Copy link
Author

p6rt commented Oct 1, 2011

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Oct 1, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant