Project

General

Profile

Actions

Bug #2049

closed

String#upto: Possible Regression

Added by runpaint (Run Paint Run Run) almost 13 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.2dev (2009-09-03 trunk 24741) [i686-linux]
Backport:
[ruby-core:25380]

Description

=begin
Prior to r24562:

a = []
"25".upto("5") { |s| a << s }
a #=> ["25"]

Now:

a = []
"25".upto("5") { |s| a << s }
a #=> []

IOW, previously when the argument was a stringified number that was less than self and the argument was shorter than self, self was yielded to the block. Now the argument's numerical value is all that matters, so in this example nothing is yielded.

Presumably this is intentional because the new behaviour makes more sense than the previous, but as it broke a RubySpec, I'd just like to confirm before I fix the failing example.
=end


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #2179: 1.9.2において block のスコープがおかしいときがあるClosed10/06/2009Actions
Actions #1

Updated by yugui (Yuki Sonoda) almost 13 years ago

  • Assignee set to matz (Yukihiro Matsumoto)
  • Target version set to 1.9.2

=begin

=end

Actions #2

Updated by naruse (Yui NARUSE) over 12 years ago

  • Status changed from Open to Closed

=begin

=end

Actions

Also available in: Atom PDF