Bug #11211
closed
defined(foo.bar) calls respond_to_missing? everytime
Added by ko1 (Koichi Sasada) about 9 years ago.
Updated over 8 years ago.
Description
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.
- Status changed from Open to Closed
Applied in changeset r50737.
- vm_insnhelper.c (vm_defined): skip respond_to_missing? when
a method is available.
[Bug #11211]
- test/ruby/test_defined.rb: add a test for this fix.
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED
- 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
.
- Backport changed from 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: DONE to 2.0.0: WONTFIX, 2.1: DONE, 2.2: DONE
ruby_2_1 r52802 merged revision(s) 50737.
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0