Skip Menu |
Report information
Id: 131845
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: cpan [at] zoffix.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Binding a Seq to a `@` variable tries to consume it first
Download (untitled) / with headers
text/plain 934b
Since Seq is not a Positional type, *binding* it to a `@` variable is typecheck error: 13:26 m: my @a := Seq.new: class :: does Iterator {method pull-one {IterationEnd}}.new; 13:26 camelia rakudo-moar abf1cf: OUTPUT: «Type check failed in binding; expected Positional but got Seq ($(().Seq))? in block <unit> at <tmp> line 1??» However, it appears the code is trying to consume the entire Seq, before generating the error: 13:26 Zoffix m: my @a := Seq.new: class :: does Iterator {method pull-one {42}}.new; # hang 13:27 camelia rakudo-moar abf1cf: OUTPUT: «(timeout)» 13:31 Zoffix m: my @a := 1…?; # but this one has `is-lazy` set 13:31 camelia rakudo-moar abf1cf: OUTPUT: «Type check failed in binding; expected Positional but got Seq (?)? in block <unit> at <tmp> line 1??» Perhaps it thinks it's gonna do assignment and consumes non-lazy Seqs in preparation for it, but then the binding happens and then it throws?
Not sure if this info is relevant now, but the hang was introduced in (2016-02-18) https://github.com/rakudo/rakudo/commit/9983c2c8434ed81c532a5706996f284283b48d0a

On 2017-08-05 06:33:14, cpan@zoffix.com wrote:
Show quoted text
> Since Seq is not a Positional type, *binding* it to a `@` variable is
> typecheck error:
>
> 13:26 m: my @a := Seq.new: class :: does Iterator {method
> pull-one {IterationEnd}}.new;
> 13:26 camelia rakudo-moar abf1cf: OUTPUT: «Type check failed in
> binding; expected Positional but got Seq ($(().Seq))? in block <unit>
> at <tmp> line 1??»
>
> However, it appears the code is trying to consume the entire Seq,
> before generating the error:
>
> 13:26 Zoffix m: my @a := Seq.new: class :: does Iterator {method
> pull-one {42}}.new; # hang
> 13:27 camelia rakudo-moar abf1cf: OUTPUT: «(timeout)»
> 13:31 Zoffix m: my @a := 1…?; # but this one has `is-lazy` set
> 13:31 camelia rakudo-moar abf1cf: OUTPUT: «Type check failed in
> binding; expected Positional but got Seq (?)? in block <unit> at
> <tmp> line 1??»
>
>
> Perhaps it thinks it's gonna do assignment and consumes non-lazy Seqs
> in preparation for it, but then the binding happens and then it
> throws?


RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 722b
On Sun, 06 Aug 2017 18:52:07 -0700, alex.jakimenko@gmail.com wrote: Show quoted text
> Not sure if this info is relevant now, but the hang was introduced in > (2016-02-18) > https://github.com/rakudo/rakudo/commit/9983c2c8434ed81c532a5706996f284283b48d0a
Yes, very relevant. It's the .perl that hangs and even in non-hanging cases it has the potential to perform huge amounts of work, just to throw it all-but-first-score of chars. I see a bunch of other exceptions use .perl and are probably subject to the same issue. I'd say this is another face of some meta ticket for "Errors of Rakudo — The Full Picture"; discussion for which is currently happening on this ticket: https://rt.perl.org/Ticket/Display.html?id=131877#txn-1480778


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org