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 breaks encapsulation when calling a method from another class #1304
Comments
From @masak<masak> rakudo: class A { has |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S12-attributes/inheritance.t commit f66cda4035ab6680f222c1f32b724786b40832b8 [t/spec] tests for RT #69260, private attributes leaking to parent class Inline Patchdiff --git a/t/spec/S12-attributes/inheritance.t b/t/spec/S12-attributes/inheritance.t
index da9eadc..17531e9 100644
--- a/t/spec/S12-attributes/inheritance.t
+++ b/t/spec/S12-attributes/inheritance.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 3;
+plan 5;
# test relation between attributes and inheritance
@@ -25,4 +25,20 @@ class Artie61500 {
eval_dies_ok 'class Artay61500 is Artie61500 { method bomb { return $!p } }',
'Compile error for subclass to access private attribute of parent';
+class Parent {
+ has $!priv = 23;
+ method get { $!priv };
+}
+
+class Child is Parent {
+ has $!priv = 42;
+}
+
+#?rakudo 2 todo 'RT 69260'
+is Child.new().Parent::get(), 23,
+ 'private attributes do not leak from child to parent class (1)';
+
+is Child.new().get(), 23,
+ 'private attributes do not leak from child to parent class (2)';
+
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @masak<masak> star: class A { method foo {} }; class B { method foo { say "OH HAI" } }; my $b-foo = |
From @jnthnOn Mon Sep 21 06:38:21 2009, masak wrote:
Now:
Probably worth a test to make sure it dies rather than does what it used to. /jnthn |
From @moritzThis is already tested in S12-class/inheritance.t: dies_ok { $foo_bar.Unrelated::something() }, |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#69260 (status was 'resolved')
Searchable as RT69260$
The text was updated successfully, but these errors were encountered: