[ruby-core:120619] [Ruby master Bug#21030] Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1

Issue #21030 has been reported by johnnyshields (Johnny Shields). ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030 * Author: johnnyshields (Johnny Shields) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by zverok (Victor Shepelev). Assignee set to zverok (Victor Shepelev) Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: UNKNOWN ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-111451 * Author: johnnyshields (Johnny Shields) * Status: Open * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: UNKNOWN ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by zverok (Victor Shepelev). Confirmed, looking into it. ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-111452 * Author: johnnyshields (Johnny Shields) * Status: Open * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: UNKNOWN ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by johnnyshields (Johnny Shields). May I confirm this will be patched in Ruby 3.4.2? ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-111455 * Author: johnnyshields (Johnny Shields) * Status: Closed * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: UNKNOWN ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by nobu (Nobuyoshi Nakada). 3.4.2 is not scheduled yet. ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-111456 * Author: johnnyshields (Johnny Shields) * Status: Closed * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: UNKNOWN ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by johnnyshields (Johnny Shields). May we mark this as 3.4 backport? I'm hesitant to upgrade my app to 3.4 without this fix. ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-111827 * Author: johnnyshields (Johnny Shields) * Status: Closed * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: UNKNOWN ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by jamesst20 (James St-Pierre). According to the changelogs for v3.4.2, this wasn't included? https://github.com/ruby/ruby/releases/tag/v3_4_2 ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-112065 * Author: johnnyshields (Johnny Shields) * Status: Closed * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: UNKNOWN ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONE ruby_3_4 commit:6d2c7d4304bbf8450d31b624f5dc40a92e44f00b. ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-112174 * Author: johnnyshields (Johnny Shields) * Status: Closed * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONE ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by jamesst20 (James St-Pierre). jamesst20 (James St-Pierre) wrote in #note-8:
According to the changelogs for v3.4.2, this wasn't included?
To add more details, this fix was also not included in v3.4.3. The fix: https://github.com/ruby/ruby/commit/f56f3eaae55cc6f8d9e79862ee73a9ffb53d6077 It appears to be included in v3.5.0 Preview 1, this probably mean Ruby v3.4 will be a forever buggy version to avoid. ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-112893 * Author: johnnyshields (Johnny Shields) * Status: Closed * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONE ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by Eregon (Benoit Daloze). @jamesst20 https://github.com/ruby/ruby/commit/6d2c7d4304bbf8450d31b624f5dc40a92e44f00b is in 3.4.3 though. And I don't see any revert in https://github.com/ruby/ruby/compare/v3_4_2...v3_4_3 Are you sure it's not fixed in 3.4.3? ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-112895 * Author: johnnyshields (Johnny Shields) * Status: Closed * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONE ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/

Issue #21030 has been updated by johnnyshields (Johnny Shields). I also verified the fix in 3.4.3 in my app. The behavior is correct. ---------------------------------------- Bug #21030: Bug: #step with Range<ActiveSupport::Duration> behavior broken on Ruby 3.4.1 https://bugs.ruby-lang.org/issues/21030#change-112896 * Author: johnnyshields (Johnny Shields) * Status: Closed * Assignee: zverok (Victor Shepelev) * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONE ---------------------------------------- Issue also filed at: https://github.com/rails/rails/issues/54199 ### System configuration **Rails version**: 7.1.5.1 **Ruby version**: 3.3.4 (works) vs 3.4.1 (broken) ### What's broken Calling `#step` then `#to_a` on a `Range` whose beginning/end values are the same is expected to return an `Array` wrapping the `Range`'s singular value. In other words, `(x..x).step(n).to_a` should return `[x]` -- note this is also the same as `(x..x).to_a` The following case breaks on Ruby 3.4.1 related to `ActiveSupport::Duration` class, where it returns an empty array. It works on Ruby 3.3. Both tested with Rails 7.1.5.1. It's very easy to reproduce. I'm unsure if this is a Ruby bug or a Rails bug so I'm filing it in both places. The upgrade of Ruby is what produces the difference. ```ruby require 'active_support/all' # version 7.1.5.1 int = 100 dur = 100.seconds # ActiveSupport/Duration # The bug (dur..dur).step(10).to_a # => Ruby 3.3 returns [100 seconds] - CORRECT # => Ruby 3.4 returns [] - INCORRECT (int..dur).step(10).to_a # => Ruby 3.3 returns [100] - CORRECT # => Ruby 3.4 returns [] - INCORRECT # Note the following cases work correctly on both Ruby versions: (int..int).step(10).to_a #=> [100] (int..dur).to_a #=> [100] # Range with non-equivalent values also works fine on different versions: dur2 = 120.seconds (dur..dur2).step(10).to_a #=> [100 seconds, 110 seconds, 120 seconds] (int..dur2).step(10).to_a #=> [100, 110, 120] ``` -- https://bugs.ruby-lang.org/
participants (6)
-
Eregon (Benoit Daloze)
-
jamesst20 (James St-Pierre)
-
johnnyshields (Johnny Shields)
-
k0kubun (Takashi Kokubun)
-
nobu (Nobuyoshi Nakada)
-
zverok (Victor Shepelev)