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

Can't index custom-made Match object in $/ in Rakduo #1344

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

Can't index custom-made Match object in $/ in Rakduo #1344

p6rt opened this issue Oct 6, 2009 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 6, 2009

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

Searchable as RT69596$

@p6rt
Copy link
Author

p6rt commented Oct 6, 2009

From @masak

<masak> rakudo​: class MyMatch does Associative { method
postcircumfix​:<{ }> { "foo" } }; $/ = MyMatch.new; say $0
<p6eval> rakudo f845cc​: OUTPUT«get_pmc_keyed() not implemented in
class 'MyMatch' [...]
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented May 30, 2010

From @moritz

On Tue Oct 06 07​:15​:11 2009, masak wrote​:

<masak> rakudo​: class MyMatch does Associative { method
postcircumfix​:<{ }> { "foo" } }; $/ = MyMatch.new; say $0
<p6eval> rakudo f845cc​: OUTPUT«get_pmc_keyed() not implemented in
class 'MyMatch' [...]
* masak submits rakudobug

Works (with [ ] instead of { }), just needs tests.

@p6rt
Copy link
Author

p6rt commented May 30, 2010

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

@p6rt
Copy link
Author

p6rt commented May 30, 2010

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

@p6rt p6rt closed this as completed May 30, 2010
@p6rt
Copy link
Author

p6rt commented May 30, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S02-names_and_variables/varnames.t

commit 2079135f0c3fc502685dd42c6e7ab6997166508a
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun May 30 15​:14​:14 2010 +0000

  [t/spec] tests for RT #​69596, aliasing $0 into custom match objects
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;30997 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S02-names_and_variables/varnames.t b/t/spec/S02-names_and_variables/varnames.t
index ff097d2..a05852c 100644
--- a/t/spec/S02-names_and_variables/varnames.t
+++ b/t/spec/S02-names_and_variables/varnames.t
@@ -2,7 +2,7 @@ use v6;
 
 use Test;
 
-plan 6;
+plan 8;
 
 # L<S02/Names and Variables/special variables of Perl 5 are going away>
 
@@ -16,5 +16,16 @@ eval_lives_ok 'my proto $/', 'as can $/';
 eval_dies_ok 'my $f!ao = "beh";', "normal varnames can't have ! in their name";
 eval_dies_ok 'my $fo:o::b:ar = "bla"', "var names can't have colons in their names either";
 
+{
+    class MyMatch {
+        method postcircumfix:<[ ]>($x) {
+            "foo$x";
+        }
+    }
+    $/ = MyMatch.new;
+    is $0, 'foo0', 'Aliasing of $0 into $/ (1)';
+    is $4, 'foo4', 'Aliasing of $0 into $/ (2)';
+}
+
 
 # vim: ft=perl6

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant