Project

General

Profile

Actions

Bug #17271

closed

Array#[]= puts -1 at the end-component of the endless range in its exception message

Added by mrkn (Kenta Murata) about 4 years ago. Updated about 4 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
[ruby-core:100442]

Description

irb(main):001:0> [*0..5][-7..] = 1
Traceback (most recent call last):
        5: from /home/mrkn/.rbenv/versions/2.7/bin/irb:23:in `<main>'
        4: from /home/mrkn/.rbenv/versions/2.7/bin/irb:23:in `load'
        3: from /home/mrkn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/irb-1.2.4/exe/irb:11:in `<top (required)>'
        2: from (irb):1
        1: from (irb):1:in `[]='
RangeError (-7..-1 out of range)

The message should be -7.. out of range.

Actions #1

Updated by Anonymous about 4 years ago

  • Status changed from Assigned to Closed

Applied in changeset git|18cecda46e427362fa3447679e5d8a917b5d6cb6.


range.c: Fix an exception message in rb_range_beg_len

[Bug #17271]

Actions

Also available in: Atom PDF

Like0
Like0