Issue #6195 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned


----------------------------------------
Bug #6195: String#[] ?????????? Range ???渡????????????????
https://bugs.ruby-lang.org/issues/6195#change-25959

Author: mrkn (Kenta Murata)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-03-23 trunk 35121) [x86_64-darwin11.3.0]


以???????????? String#[] ??対???????????????????????????????????????以???????????????????? Range (beg > end) ???渡???????????空?????????????????????

  "1"[1..0] #=> ""
  "1"[1..-1] #=> ""
  "123"[2..1] #=> ""
  "123"[2..-2] #=> ""

???????????????????????????????????????????大???????????? nil ??????????????

  "1"[2..0] #=> nil
  "1"[2..-1] #=> nil
  "123"[4..1] #=> nil
  "123"[4..-2] #=> nil

?????????????????????rb_range_beg_len ???????起?????????????????
??????????????????????????????????????????????????????????????????????? nil ??????????????????????????????????????



-- 
http://bugs.ruby-lang.org/