Project

General

Profile

Actions

Bug #11211

closed

defined(foo.bar) calls respond_to_missing? everytime

Added by ko1 (Koichi Sasada) almost 9 years ago. Updated over 8 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.

Actions #1

Updated by ko1 (Koichi Sasada) almost 9 years ago

  • 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) almost 9 years ago

  • 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) over 8 years ago

  • 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) over 8 years ago

  • 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: Atom PDF

Like0
Like0Like0Like0Like0