Actions
Bug #11615
closedForwardable fails to adjust backtrace when Exception is defined in the target class
Description
Forwardable fails to adjust backtrace when Exception is defined in the target class as follows:
$ cat t.rb
require "forwardable"
class Foo
extend Forwardable
def_delegator :bar, :baz
class Exception
end
end
Foo.new.baz
$ ruby t.rb
/home/shugo/local/lib/ruby/2.3.0/forwardable.rb:183:in `baz': undefined local variable or method `bar' for #<Foo:0x007fe48a6e65b0> (NameError)
Did you mean? baz
from t.rb:12:in `<main>'
Without the definition of Foo::Exception, backtrace is shown as follows:
$ ruby t.rb
t.rb:12:in `<main>': undefined local variable or method `bar' for #<Foo:0x007f455d9d1c38> (NameError)
Did you mean? baz
Actions
Like0
Like0