Skip to content

Commit

Permalink
class attribute cannot be initialized using .=, RT #74850
Browse files Browse the repository at this point in the history
  • Loading branch information
bbkr committed Jul 15, 2012
1 parent 0577148 commit 84fa0c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion S12-class/attributes.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 21;
plan 22;

# L<S12/Fancy method calls/"For a call on your own private method">

Expand Down Expand Up @@ -115,4 +115,10 @@ eval_dies_ok q[
}
], 'no attr access for sub inside class';

# RT 74850
{
try { eval 'class A {}; class B { has A $.foo .= new }' };
ok "$!" ~~ /'Cannot use .= to initialize an attribute'/, 'class attribute cannot be initialized using .=';
}

# vim: ft=perl6

1 comment on commit 84fa0c2

@bbkr
Copy link
Contributor Author

@bbkr bbkr commented on 84fa0c2 Jul 16, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throws X::AdHoc

Please sign in to comment.