Project

General

Profile

Actions

Bug #12782

closed

Forwardable breaks on private methods in ruby 2.4

Added by jeremyevans0 (Jeremy Evans) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.4.0preview2 (2016-09-09 trunk 56129) [i386-openbsd]
[ruby-core:77341]

Description

Due to an optimization in r55376, attempting to forward to private methods no longer works in ruby 2.4. Among other things, this breaks haml template support in tilt. Example:

require 'forwardable'
class Foo
  private def foo; :foo end
  extend Forwardable
  def_delegator :itself, :foo, :bar
end
p Foo.new.bar

On ruby 2.3, this outputs :foo, on 2.4.0preview2 it raises NoMethodError. I think r55376 should be reverted, as the optimization it uses does not appear to be able to handle private method calls.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0