Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any.tail(Callable) violates Iterator protocol #6354

Closed
p6rt opened this issue Jun 21, 2017 · 3 comments
Closed

Any.tail(Callable) violates Iterator protocol #6354

p6rt opened this issue Jun 21, 2017 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 21, 2017

Migrated from rt.perl.org#131617 (status was 'resolved')

Searchable as RT131617$

@p6rt
Copy link
Author

p6rt commented Jun 21, 2017

From @zoffixznet

The "Died" message should never occur​:

  m​: my $s = Seq.new​: class :​: does Iterator { has @​!stuff = <a b c>; has $!ded = 1; method pull-one { $!ded or die; @​!stuff ?? shift @​!stuff !! $!ded-- && IterationEnd } }.new; say $s.tail​: *-10
  rakudo-moar 86e7b2​: OUTPUT​: «Died␤ in method pull-one at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»

Looks like a check that .skip-at-least was successful is missing[^1].

[1] https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/Any-iterable-methods.pm#L1889-L1890
[2] https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/List.pm#L1289-L1298

@p6rt
Copy link
Author

p6rt commented Feb 10, 2018

From @zoffixznet

On Wed, 21 Jun 2017 11​:46​:46 -0700, cpan@​zoffix.com wrote​:

The "Died" message should never occur​:

m​: my $s = Seq.new​: class :​: does Iterator { has @​!stuff = <a b c>;
has $!ded = 1; method pull-one { $!ded or die; @​!stuff ?? shift
@​!stuff !! $!ded-- && IterationEnd } }.new; say $s.tail​: *-10
rakudo-moar 86e7b2​: OUTPUT​: «Died␤ in method pull-one at <tmp> line
1␤ in block <unit> at <tmp> line 1␤␤»

Looks like a check that .skip-at-least was successful is missing[^1].

[1]
https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/Any-
iterable-methods.pm#L1889-L1890
[2]
https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/List.pm#L1289-
L1298

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@2cc7b6317e98592
Test​: Raku/roast@3e60598fea0d92307

@p6rt
Copy link
Author

p6rt commented Feb 10, 2018

@zoffixznet - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Feb 10, 2018
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant