Skip to content

Refinements vs. respond_to? regression in 9.3.0.0 #6859

@palkan

Description

@palkan

Environment Information

  • JRuby version: jruby 9.3.0.0 (2.6.8) 2021-09-17 85c20e7 OpenJDK 64-Bit Server VM 25.302-b08 on 1.8.0_302-b08 +jit [linux-x86_64]

Expected Behavior

Here is an example code:

using(Module.new do
  refine Hash do
    def deconstruct_keys(_)
      self
    end
  end
end)

a = { a: 1, b: [2, 3] }

puts a.deconstruct_keys([:a])
puts a.respond_to?(:deconstruct_keys)

Expected output:

{:a=>1, :b=>[2, 3]}
true

Actual Behavior

Actual output:

{:a=>1, :b=>[2, 3]}
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions