Project

General

Profile

Actions

Bug #11211

closed

defined(foo.bar) calls respond_to_missing? everytime

Bug #11211: defined(foo.bar) calls respond_to_missing? everytime

Added by ko1 (Koichi Sasada) over 10 years ago. Updated almost 10 years ago.

Status:
Closed
Target version:
-
[ruby-dev:49011]

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.

Updated by ko1 (Koichi Sasada) over 10 years ago Actions #1

  • 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.

Updated by usa (Usaku NAKAMURA) over 10 years ago Actions #2 [ruby-dev:49159]

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) almost 10 years ago Actions #3 [ruby-dev:49390]

  • 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.

Updated by usa (Usaku NAKAMURA) almost 10 years ago Actions #4 [ruby-dev:49396]

  • 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.

Actions

Also available in: PDF Atom