Issue #11211 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: DONE
Backported into `ruby_2_2` branch at r52768.
The patch to vm_insnhelper.c (vm_defined) in r52768 was applied to insns.def (defined) on `ruby_2_2`.
----------------------------------------
Bug #11211: defined(foo.bar) calls respond_to_missing? everytime
https://bugs.ruby-lang.org/issues/11211#change-55114
* Author: Koichi Sasada
* Status: Closed
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* ruby -v: 2.3dev
* Backport: 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: DONE
----------------------------------------
```ruby
class C
def respond_to_missing? *args
p args
end
def existing_method; end
end
p defined?(C.new.existing_method)
```
This script prints
```
[:existing_method, false]
"method"
```
even though exsiting_method is defiend.
It should be a bug.
--
https://bugs.ruby-lang.org/