From: Masaki Fukushima Date: 2000-06-23T00:27:31+09:00 Subject: [ruby-dev:10107] method_missing & super (Re: [ruby-ext:01125] Re: Lightflow with Rub/Python) 福嶋です。 rubyのバグのような気もするので、ruby-devに振ります。 以下のスクリプトでsuperを呼ぶところの挙動がおかしいような気がしま す。 class Foo def foo(arg0, *args, &block) p ['Foo', arg0, args, block] end end a = Foo.new def a.foo(arg0, *args, &block) p ['a', arg0, args, block] super(arg0, *args) end a.foo(1,2,3) b = Foo.new def b.foo(arg0, *args, &block) p ['b', arg0, args, block] super(arg0, *args, &block) end b.foo(1,2,3) 出力: ["a", 1, [2, 3], nil] ["Foo", 1, [2, 3], nil] ["b", 1, [2, 3], nil] super2.rb:17:in `foo': wrong # of arguments(0 for 1) (ArgumentError) from super2.rb:17:in `foo' from super2.rb:19 aとbの違いは、superを呼ぶときに &blockを付けてるかどうかだけです。 1.4系、1.5系、とちらでも起きます。 --- 福嶋正機