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

Null PMC access when assigning to an attribute of a type object in Rakudo #1218

Closed
p6rt opened this issue Aug 10, 2009 · 5 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 10, 2009

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

Searchable as RT68370$

@p6rt
Copy link
Author

p6rt commented Aug 10, 2009

From @masak

Rakudo a948cae​:

$ perl6 -e 'class A { has $!a; method foo() { $!a = 42 } }; A.foo'
Null PMC access in getprop()

Should probably be a readonly-related error or something instead
(because type objects aren't writeable).

@p6rt
Copy link
Author

p6rt commented Aug 10, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S12-attributes/instance.t

commit 93c0f5aef4ded4abcb4397deb630eba51f6f412e
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Mon Aug 10 15​:50​:12 2009 +0000

  [t/spec] Test for RT #​68370
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;27948 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S12-attributes/instance.t b/t/spec/S12-attributes/instance.t
index aa9be08..18bebc1 100644
--- a/t/spec/S12-attributes/instance.t
+++ b/t/spec/S12-attributes/instance.t
@@ -2,7 +2,7 @@ use v6;
 
 use Test;
 
-plan 128;
+plan 129;
 
 =begin pod
 
@@ -531,4 +531,16 @@ is eval('Foo7e.new.attr'), 42,              "default attribute value (1)";
     is C.new.s, 6, "Test class include another class which inherited from same role";
 }
 
+# RT #68370
+{
+    class RT68370 {
+        has $!a;
+        method rt68370 { $!a = 68370 }
+    }
+
+    #?rakudo todo 'RT #68370 -- Null PMC Access in getprop()'
+    dies_ok { RT68370.rt68370() },
+        'dies: modify instance attribute via class method call';
+}
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Aug 10, 2009

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

@p6rt
Copy link
Author

p6rt commented Aug 25, 2009

From @jnthn

On Mon Aug 10 03​:47​:23 2009, masak wrote​:

Rakudo a948cae​:

$ perl6 -e 'class A { has $!a; method foo() { $!a = 42 } }; A.foo'
Null PMC access in getprop()

Should probably be a readonly-related error or something instead
(because type objects aren't writeable).

This is a dupe of another ticket I just resolved (though this ticket
carried the test I'd already found :-)). Anyway, this now prints​:

Type objects do not have state, but you tried to access attribute $!a

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Aug 25, 2009

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

@p6rt p6rt closed this as completed Aug 25, 2009
@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