You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Besides other RT #124909 issues, FETCH can get called more than once.
I am sorry but I don't know how to open the issue for just that test file.
use v6;
#`{{
The problem is that with an $.attr type of Int FETCH is called twice
for one access to $.attr.
If you take away the type of Int $f_count returns 1 and bug goes away
According to timotimo "rakudo doesn't guarantee how often FETCH is called"
http://irclog.perlgeek.de/perl6/2015-09-25#i_11276252
}}
use Test;
plan 1;
our $f_count = 0;
class C {
has Int $.attr is rw;
method attr returns Int is rw {
return Proxy.new(
FETCH => -> $self {$f_count++; 42 },
STORE => -> $self, Int $new {},
);
}
}
my C $c .= new;
my $a = $c.attr;
is($f_count, 1, 'fetch called more than once can be unexpected');
The text was updated successfully, but these errors were encountered:
ronaldxs
changed the title
rakudo doesn't guarantee how often FETCH is called
rakudo doesn't guarantee how often FETCH is called for S12-attributes/mutators.t
Sep 25, 2015
Besides other RT #124909 issues, FETCH can get called more than once.
I am sorry but I don't know how to open the issue for just that test file.
The text was updated successfully, but these errors were encountered: