From: Run Paint Run Run Date: 2009-10-27T04:21:41+09:00 Subject: [ruby-core:26333] [Bug #2281] Class#inherited Produces Misleading Error Message Bug #2281: Class#inherited Produces Misleading Error Message http://redmine.ruby-lang.org/issues/show/2281 Author: Run Paint Run Run Status: Open, Priority: Low Category: core ruby -v: ruby 1.9.2dev (2009-10-25 trunk 25456) [i686-linux] $ cat -n /tmp/inherited.rb 1 def Object.inherited 2 end 3 4 class C 5 end $ ruby -vw /tmp/inherited.rb ruby 1.9.2dev (2009-10-25 trunk 25456) [i686-linux] /tmp/inherited.rb:4:in `
': wrong number of arguments (1 for 0) (ArgumentError) If this scenario must raise an exception, could it report the line number of the _inherited_ hook's definition and, preferably, the hook's name? It is undesirable for class definitions to be fatal. (I realise that this problem can be generalised to other callbacks). ---------------------------------------- http://redmine.ruby-lang.org