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

Misleading suggestion in .substr error message for positive index values in Rakudo #5282

Closed
p6rt opened this issue Apr 30, 2016 · 5 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Apr 30, 2016

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

Searchable as RT128039$

@p6rt
Copy link
Author

p6rt commented Apr 30, 2016

From @masak

<TimToady> m​: ''.substr(5).say
<camelia> rakudo-moar 1acf80​: OUTPUT«(HANDLED) Start argument to
substr out of range. Is​: 5, should be in 0..0; use *5 if you want to
index relative to the end [...]
<TimToady> the *5 is a bug
* masak submits rakudobug
<masak> m​: say "a".substr(7)
<camelia> rakudo-moar 1acf80​: OUTPUT«(HANDLED) Start argument to
substr out of range. Is​: 7, should be in 0..1; use *7 if you want to
index relative to the end [...]

@p6rt
Copy link
Author

p6rt commented Apr 30, 2016

From @lizmat

Fixed with d7698f3de2eb3c326aa , tests needed.

On 30 Apr 2016, at 17​:02, Carl Mäsak (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by "Carl Mäsak"
# Please include the string​: [perl #​128039]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=128039 >

<TimToady> m​: ''.substr(5).say
<camelia> rakudo-moar 1acf80​: OUTPUT«(HANDLED) Start argument to
substr out of range. Is​: 5, should be in 0..0; use *5 if you want to
index relative to the end [...]
<TimToady> the *5 is a bug
* masak submits rakudobug
<masak> m​: say "a".substr(7)
<camelia> rakudo-moar 1acf80​: OUTPUT«(HANDLED) Start argument to
substr out of range. Is​: 7, should be in 0..1; use *7 if you want to
index relative to the end [...]

@p6rt
Copy link
Author

p6rt commented Apr 30, 2016

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

@p6rt
Copy link
Author

p6rt commented Jul 4, 2016

From @zoffixznet

Thank you.

Tests added in Raku/roast@b4254c2fdd

@p6rt
Copy link
Author

p6rt commented Jul 4, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant