[前][次][番号順一覧][スレッド一覧][生データ]

yarv-dev:846

From: sheepman <sheepman sheepman.sakura.ne.jp>
Date: Sun, 12 Feb 2006 16:08:27 +0900
Subject: [yarv-dev:846] open> error message on super

こんにちは、sheepman です。
superを呼んで、親クラスに対応するメソッドが無かった時の
エラーメッセージが ruby-1.9 と違って非常に分かりにくいです。

$ cat t.rb
class A
end

class B
  def hoge
    super
  end
end

B.new.hoge

$ ./miniruby -v t.rb
ruby 1.9.0 (2006-02-09) [i686-linux]
YARVCore 0.3.3 (rev: 382) [opts: ]
t.rb:6:in `method_missing': undefined method `hoge' for #<B:0x40297578> (NoMethodError)
        from t.rb:6:in `hoge'
        from t.rb:10:in `<main>'

$ ruby-1.9 t.rb
t.rb:6:in `hoge': super: no superclass method `hoge' (NoMethodError)
        from t.rb:10

-- 
sheepman / TAMURA Takashi
sheepman sheepman.sakura.ne.jp http://sheepman.parfait.ne.jp/

-- 
ML: yarv-dev quickml.atdot.net
使い方: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]

->     846 2006-02-12 16:08 [sheepman sheepman.sa] open> error message on super            
       863 2006-02-14 00:01 ┗[ko1 atdot.net       ] fixed> Re: open> error message on super
       884 2006-02-14 19:06  ┗[sheepman sheepman.sa] close> error message on super