Issue #11615 has been reported by Shugo Maeda.

----------------------------------------
Bug #11615: Forwardable fails to adjust backtrace when Exception is defined in the target class
https://bugs.ruby-lang.org/issues/11615

* Author: Shugo Maeda
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
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
```




-- 
https://bugs.ruby-lang.org/