use Promises qw( collect deferred );
collect( deferred->resolve->promise );
throws:
Cannot resolve. Already resolved at /home/greg/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.3/Promises/Deferred.pm line 49.
It appears that the collect promise is being resolved both in the loop and at the end of the method:
Cannot resolve. Already resolved at /home/greg/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.3/Promises/Deferred.pm line 49.
Promises::Deferred::resolve('Promises::Deferred=HASH(0x23a6848)', 'ARRAY(0x23a6a10)') called at /home/greg/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.3/Promises.pm line 60
Promises::collect('Promises::Promise=HASH(0x22b5570)') called at /home/greg/test.pl line 3
A simple test case:
throws:
It appears that the
collect
promise is being resolved both in the loop and at the end of the method:I assume this is not the intended behavior.