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
sub &prefix:<[~]> is being unexpectedly hidden by class definition. #1771
Comments
From @finanalystOn its own, class B executes as expectedly: class B {method n { return [~] gather for ^4 {.say;take 'b'}}};my B When another class using reduction ~ is in front of it, even if it is
|
From @jnthnOn Thu May 20 22:07:16 2010, richardh wrote:
Fixed now:
Given to moritz++ for spectest coverage. Thanks, Jonathan |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S03-metaops/reduce.t commit 80cda339998f067ff095ec9e3ffbfcd3093ca367 [t/spec] tests for RT #75234, using a metaop in one class hides it from a second class Inline Patchdiff --git a/t/spec/S03-metaops/reduce.t b/t/spec/S03-metaops/reduce.t
index 1a0de91..f3d2c4e 100644
--- a/t/spec/S03-metaops/reduce.t
+++ b/t/spec/S03-metaops/reduce.t
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 83;
+plan 86;
=begin pod
@@ -210,4 +210,20 @@ is( ([\R~] 'a'..*).batch(8).join(', '), 'a, ba, cba, dcba, edcba, fedcba, gfedcb
is [^^](0, 0, 17), (0 ^^ 0 ^^ 17), '[^^] mix 6';
}
+# RT #75234
+# rakudo had a problem where once-used meta operators weren't installed
+# in a sufficiently global location, so using a meta operator in class once
+# makes it unusable further on
+{
+ class A {
+ method m { return [~] gather for ^3 {take 'a'} }
+ }
+ class B {
+ method n { return [~] gather for ^4 {take 'b'}}
+ }
+ is A.new.m, 'aaa', '[~] works in first class';
+ is B.new.n, 'bbbb', '[~] works in second class';
+ is ([~] 1, 2, 5), '125', '[~] works outside class';
+}
+
# vim: ft=perl6 |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#75234 (status was 'resolved')
Searchable as RT75234$
The text was updated successfully, but these errors were encountered: