use v6;
class X {
has @.add;
method add {
say 'before';
@.add.push( 42 );
say 'ever after';
}
}
my $v = X.new;
$v.add;
say "hi";
Accidentally I created the same method name as one of the attributes.
This will print 'before' a *lot* of times and never get to 'ever after'.
I am not sure what should happen,
but maybe Rakudo should notice that and give an error message.
regards
Gabor
Thread Next