Skip to content

The behavior of Enumerable#each_with_index has changed in JRuby 9.1.9.0 #4610

@koic

Description

@koic

Environment

  • jruby 9.1.9.0 (2.3.3) 2017-05-15 28aa830 Java HotSpot(TM) 64-Bit Server VM 25.5-b02 on 1.8.0_05-b13 +jit [darwin-x86_64]
  • Darwin Kernel Version 13.0.2: Sun Sep 29 19:38:57 PDT 2013; root:xnu-2422.75.4~1/RELEASE_X86_64 x86_64

Expected Behavior

This is behavior of JRuby 9.1.8.0 and MRI 2.4.1 and MRI 2.5.0dev (2017-05-16 trunk 58738) .

> %i(foo bar baz).each_with_index {|v| puts v.inspect }
:foo
:bar
:baz

Actual Behavior

This is behavior of JRuby 9.1.9.0.

> %i(foo bar baz).each_with_index {|v| puts v.inspect }
[:foo, 0]
[:bar, 1]
[:baz, 2]

JRuby 9.1.9.0 returns array object. Is this intentionally changed?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions