Project

General

Profile

Actions

Bug #3854

closed

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

Added by Nakilon (Victor Maslov) about 14 years ago. Updated over 13 years ago.

Status:
Rejected
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

Actions #1

Updated by naruse (Yui NARUSE) about 14 years ago

  • Status changed from Open to Rejected

=begin
It is changed on 1.9.
=end

Actions

Also available in: Atom PDF

Like0
Like0