Project

General

Profile

Bug #3854

Adress to str[str.size] is now valid?

Added by Nakilon (Victor Maslov) over 9 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
Backport:
[ruby-core:32492]

Description

=begin
C:\Users\Naki>irb
irb(main):001:0> s = ''; 10.times { s[s.size]='-' }; s
=> "----------"
irb(main):002:0> RUBY_DESCRIPTION
=> "ruby 1.9.2p0 (2010-08-18) [i386-mingw32]"

C:\Documents and Settings_Oo>irb
irb(main):001:0> s = ''; 10.times { s[s.size]='-' }; s
IndexError: index 0 out of string
from (irb):1:in []='
from (irb):1
from (irb):1:in
times'
from (irb):1
irb(main):002:0> RUBY_VERSION
=> "1.8.6"
irb(main):003:0> RUBY_PATCHLEVEL
=> 287
=end

History

#1

Updated by naruse (Yui NARUSE) over 9 years ago

  • Status changed from Open to Rejected

=begin
It is changed on 1.9.
=end

Also available in: Atom PDF