* [ruby-dev:50971] [Ruby master Bug#11213] defined?(super) ignores respond_to_missing? [not found] <redmine.issue-11213.20150602195939.17@ruby-lang.org> @ 2020-11-17 12:20 ` nobu 0 siblings, 0 replies; only message in thread From: nobu @ 2020-11-17 12:20 UTC (permalink / raw) To: ruby-dev Issue #11213 has been updated by nobu (Nobuyoshi Nakada). https://github.com/ruby/ruby/pull/3777 ---------------------------------------- Bug #11213: defined?(super) ignores respond_to_missing? https://bugs.ruby-lang.org/issues/11213#change-88543 * Author: ko1 (Koichi Sasada) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * ruby -v: 2.3dev * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- ```ruby 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. -- https://bugs.ruby-lang.org/ ^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-17 12:21 UTC | newest] Thread overview: (only message) (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <redmine.issue-11213.20150602195939.17@ruby-lang.org> 2020-11-17 12:20 ` [ruby-dev:50971] [Ruby master Bug#11213] defined?(super) ignores respond_to_missing? nobu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).