• KOBAYASHI Shuji's avatar
    Unify `eql?` receiver in `Hash` according to Ruby · bc929656
    KOBAYASHI Shuji authored
    ### Example
    
      ```ruby
      # example.rb
      class A
        def eql?(o)
          p self.class
          super
        end
        def hash
          1
        end
      end
    
      class B < A; end
    
      h = {A.new => 1}
      h[B.new]
      ```
    
    #### Before this patch:
    
      ```console
      $ bin/mruby example.rb
      A
      ```
    
    #### After this patch (same as Ruby)
    
      ```console
      $ bin/mruby example.rb
      B
      ```
    bc929656
hash.c 33.7 KB