Skip to content

Commit

Permalink
initialization of class attribute using .= should work
Browse files Browse the repository at this point in the history
IRC discussion in RT #74850
  • Loading branch information
bbkr committed Jul 16, 2012
1 parent e9acfaf commit 506d0a5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions S12-class/attributes.t
Expand Up @@ -116,10 +116,12 @@ eval_dies_ok q[
], 'no attr access for sub inside class';

# RT 74850
#?niecza skip "Can't test the failure this way"
#?niecza skip "Unhandled exception: Unable to resolve method ctxzyg in type Method"
#?rakudo skip "Cannot use .= to initialize an attribute"
{
try { eval 'class A {}; class B { has A $.foo .= new }' };
ok "$!" ~~ /'Cannot use .= to initialize an attribute'/, 'class attribute cannot be initialized using .=';
class A { };
class B { has A $.foo .= new };
isa_ok B.new.foo, A, 'class attribute can be initialized using .=';
}

# vim: ft=perl6

0 comments on commit 506d0a5

Please sign in to comment.