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

Slicing a range no longer produces Nils like it should ( (2..1)[^10] ) #5944

Closed
p6rt opened this issue Dec 30, 2016 · 4 comments
Closed

Slicing a range no longer produces Nils like it should ( (2..1)[^10] ) #5944

p6rt opened this issue Dec 30, 2016 · 4 comments

Comments

@p6rt
Copy link

@p6rt p6rt commented Dec 30, 2016

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

Searchable as RT130449$

@p6rt
Copy link
Author

@p6rt p6rt commented Dec 30, 2016

From @AlexDaniel

Code​:
say (2..1)[^10]

Result (2015.12,2016.02)​:
(Nil Nil Nil Nil Nil Nil Nil Nil Nil Nil)

Result (2016.03,HEAD)​:
Index out of range. Is​: 0, should be in 0..-1
  in block <unit> at /tmp/1dJcD1E1Wz line 1

Actually thrown at​:
in block <unit> at /tmp/1dJcD1E1Wz line 1

Bisectable points to rakudo/rakudo@7cbf2d3

It seems that most things produce Nils in similar cases, so the previous behavior was correct. For example, (2,3,4)[^5] will give (2 3 4 Nil Nil), I don't see any reason for ranges to behave differently (especially to error out with an error message like this…)

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 1, 2017

From @zoffixznet

On Thu, 29 Dec 2016 17​:40​:46 -0800, alex.jakimenko@​gmail.com wrote​:

Code​:
say (2..1)[^10]

Result (2015.12,2016.02)​:
(Nil Nil Nil Nil Nil Nil Nil Nil Nil Nil)

Result (2016.03,HEAD)​:
Index out of range. Is​: 0, should be in 0..-1
in block <unit> at /tmp/1dJcD1E1Wz line 1

Actually thrown at​:
in block <unit> at /tmp/1dJcD1E1Wz line 1

Bisectable points to
rakudo/rakudo@7cbf2d3

It seems that most things produce Nils in similar cases, so the
previous behavior was correct. For example, (2,3,4)[^5] will give (2 3
4 Nil Nil), I don't see any reason for ranges to behave differently
(especially to error out with an error message like this…)

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@c5e54ef
Tests​: Raku/roast@88106f4

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 1, 2017

The RT System itself - Status changed from 'new' to 'open'

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 1, 2017

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

Loading

@p6rt p6rt closed this Jan 1, 2017
@p6rt p6rt added the regression label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant