D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3087 - std.range.retro.opIndex out of range
Summary: std.range.retro.opIndex out of range
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P4 normal
Assignee: Andrei Alexandrescu
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2009-06-22 23:51 UTC by Sam Hu
Modified: 2015-06-09 01:27 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Sam Hu 2009-06-22 23:51:05 UTC
static if (isRandomAccessRange!(R) && hasLength!(R))
        ref ElementType!(R) opIndex(uint n)
        {
            return _input[_input.length - n + 1];
        }

Shouldn't it be _input.length-(n+1) ?
Comment 1 Andrei Alexandrescu 2009-08-27 23:40:51 UTC
Correct, thanks!