Project

General

Profile

Bug #11213

defined?(super) ignores respond_to_missing?

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

Status:
Open
Priority:
Normal
Target version:
-
[ruby-dev:49013]

Description

class C0
  def method_missing *args
    p [:method_missing] + args
  end
  def respond_to_missing? *args
    true
  end
end

class C1 < C0
  def foo
    super
    defined?(super)
  end
end

p C1.new.foo

This script prints

[:method_missing, :foo]
nil

In this case, we can call super, but defined? returns nil.
It should be a bug.

Also available in: Atom PDF