defined?(super) ignores respond_to_missing?
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.
Updated by ko1 (Koichi Sasada) about 4 years ago
However it is difficult because we can't call
self.respond_to_missing? directly because we should ignore
(1) Ignore this issue as a spec (or known issue)
super (it has compatibility issue)
(3) Introduce something special to call
My recommendation is (1).