Permalink
Browse files

RT #74274, sneaking in access to private attributes through the back …

…door
  • Loading branch information...
1 parent ecd8da2 commit bddc607ede58e095b64ee919e1ec0ba58ab29855 @moritz moritz committed Jan 30, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 S12-attributes/instance.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 136;
+plan 137;
=begin pod
@@ -628,6 +628,10 @@ is Foo7e.new.attr, 42, "default attribute value (1)";
# RT #108670
eval_dies_ok 'my class AccessorClash { has @.a; has &.a }',
'cannot have two attributes with same accessor name';
+# RT #74274
+eval_dies_ok q[class A { has $!a }; my $a = A.new(a => 42);
+ my $method = method { return $!a }; $a.$method()],
+ 'cannot sneak in access to private attribute through the backdoor';
done();

0 comments on commit bddc607

Please sign in to comment.