Permalink
Browse files

[t/spec] regression tests for RT #61100

git-svn-id: http://svn.pugscode.org/pugs@24195 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent b3aadc7 commit e913c98c19c1b130551ab5245fdc6e72c714f8fe moritz committed Dec 7, 2008
Showing with 17 additions and 1 deletion.
  1. +17 −1 S12-attributes/instance.t
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 72;
+plan 76;
=begin pod
@@ -317,4 +317,20 @@ is eval('Foo9.new.attr'), 42, "default attribute value (3)";
}
}
+{
+ class WHAT_ref { };
+ class WHAT_test {
+ has WHAT_ref $.a;
+ has WHAT_test $.b is rw;
+ }
+ my $o = WHAT_test.new(a => WHAT_ref.new(), b => WHAT_test.new());
+ is $o.a.WHAT, 'WHAT_ref', '.WHAT on attributes';
+ is $o.b.WHAT, 'WHAT_test', '.WHAT on attributes of same type as class';
+ my $r = WHAT_test.new();
+ #?rakudo 2 todo 'RT #61100'
+ lives_ok {$r.b = $r}, 'type check on recursive data structure';
+ is $r.b.WHAT, 'WHAT_test', '.WHAT on recursive data structure';
+
+}
+
# vim: ft=perl6

0 comments on commit e913c98

Please sign in to comment.