-
-
Notifications
You must be signed in to change notification settings - Fork 939
Closed
Milestone
Description
We encountered a bug in dry-types where JRuby does not behave the same way as MRI. I spent some time trying to reproduce it in non-dry-types environment and I think I have a minimal reproducible example now (although still quite convoluted):
class Inner
def call(input)
result = input.each_with_object([]) { |x, arr| arr << x * 2 }
yield(result)
end
end
class Outer
def initialize(inner) = @inner = inner
def call(input, &block)
@inner.call(input) { |output = input| block.call(output) }
end
end
input = [1, 2, 3]
p Outer.new(Inner.new).call(input) { |x| x }On Ruby 3.4.1 it returns [2, 4, 6], while in JRuby it just returns 2.
Environment Information
Provide at least:
- JRuby version: 10.0.2.0
- Operating system and platform : Linux 6.18.6-arch1-1
Expected Behavior
- JRuby and MRI behave the same way, returning
[2, 4, 6].
Actual Behavior
- JRuby returns different data structure.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels