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
Rakudo lets you define a sub over an enum value if you do it in an eval #782
Comments
From @masak<bacek> rakudo: enum A <a>; say a; eval 'sub a { "O HI" }'; say a |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S02-names/our.t commit d176c5c8b7b9b5d92ed952f701ed2d740a5610e0 [t/spec] Test for RT #63882 Inline Patchdiff --git a/t/spec/S02-names/our.t b/t/spec/S02-names/our.t
index db8de18..1627adc 100644
--- a/t/spec/S02-names/our.t
+++ b/t/spec/S02-names/our.t
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 3;
+plan 7;
# L<S02/Names/Symbols in the current package>
@@ -13,3 +13,15 @@ plan 3;
#?rakudo skip 'Null PMC access in invoke()'
is OUR::eval_born(), 5, 'call to eval-born sub works';
}
+
+# RT #63882
+{
+ enum A <a b c>;
+ is c, 2, 'c is 2 from enum';
+ eval 'sub c { "sub c" }';
+ ok $! !~~ Exception, 'can define sub c in eval after c defined in enum';
+ #?rakudo todo 'sub in eval shadows enum'
+ is c, 2, 'c is still 2 from enum';
+ #?rakudo skip 'OUR::subname() does not work'
+ is OUR::c(), 'sub c', 'sub c called with OUR:: works';
+} |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzThe relevant tests pass now, closing ticket. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#63882 (status was 'resolved')
Searchable as RT63882$
The text was updated successfully, but these errors were encountered: