Project

General

Profile

Actions

Bug #9083

closed

BasicObject#method_missing does not always raise NoMethodError for missing methods

Added by rits (First Last) over 10 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]
Backport:
[ruby-core:58182]

Description

def method_missing(name, *)
super
rescue NoMethodError => e

end

if the method is called without the receiver, it will raise just a NameError (variable or method missing)

the text of the error can differ depending on the presence of the receiver, but it seems counter-intuitive to not receive a NoMethodError when you are clearly attempting to call a non-existent method.

Actions

Also available in: Atom PDF

Like0
Like0