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
Accessing enum element in another module causes null PMC access #772
Comments
From @mathw[matthew@asymptote form]$ perl6 -e "module M { enum E <a b> }; M::E::a" |
From @masak<jnthn> masak: Rather too many tickets than too few. |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S02-builtin_data_types/enum.t commit 38295f658dd60105e7564f6101d89f08304cd0e9 [t/spec] Test for RT #63826 Inline Patchdiff --git a/t/spec/S02-builtin_data_types/enum.t b/t/spec/S02-builtin_data_types/enum.t
index e7e71bf..5a78959 100644
--- a/t/spec/S02-builtin_data_types/enum.t
+++ b/t/spec/S02-builtin_data_types/enum.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 30;
+plan 40;
# L<S12/Enums>
{
my %hash; eval '%hash = enum «:Mon(1) Tue Wed Thu Fri Sat Sun»';
@@ -108,3 +108,35 @@ is %hash.values, (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'), '
%hash = ();
+# RT #63826
+{
+ class EnumClass { enum C <a b c> }
+ #?rakudo todo 'RT #63826'
+ lives_ok { EnumClass::C::a }, 'can refer to enum element in class';
+ #?rakudo skip 'RT #63826'
+ is EnumClass::C::a, 0, 'enum element in class has the right value';
+
+ module EnumModule { enum M <a b c> }
+ #?rakudo todo 'RT #63826'
+ lives_ok { EnumModule::M::a }, 'can refer to enum element in module';
+ #?rakudo skip 'RT #63826'
+ is EnumModule::M::b, 1, 'enum element in module has the right value';
+
+ package EnumPackage { enum P <a b c> }
+ #?rakudo todo 'RT #63826'
+ lives_ok { EnumPackage::P::a }, 'can refer to enum element in package';
+ #?rakudo skip 'RT #63826'
+ is EnumPackage::P::c, 2, 'enum element in package has the right value';
+
+ role EnumRole { enum R <a b c> }
+ #?rakudo todo 'RT #63826'
+ lives_ok { EnumRole::R::a }, 'can refer to enum element in role';
+ #?rakudo skip 'RT #63826'
+ is EnumRole::R::a, 0, 'enum element in role has the right value';
+
+ grammar EnumGrammar { enum G <a b c> }
+ #?rakudo todo 'RT #63826'
+ lives_ok { EnumGrammar::G::a }, 'can refer to enum element in grammar';
+ #?rakudo skip 'RT #63826'
+ is EnumGrammar::G::b, 1, 'enum element in grammar has the right value';
+} |
The RT System itself - Status changed from 'new' to 'open' |
From @bbkrOn head build (past Kiev) it's: [15:39] <bbkr> rakudo: module M { enum E <a b> }; M::E::a; |
From @moritzIn nom, the Null PMC access is gone, and the tests (now in |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#63826 (status was 'resolved')
Searchable as RT63826$
The text was updated successfully, but these errors were encountered: