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

yarv-dev:863

From: SASADA Koichi <ko1 atdot.net>
Date: Tue, 14 Feb 2006 00:01:02 +0900
Subject: [yarv-dev:863] fixed> Re: open> error message on super

 ささだです。

sheepman wrote:
> こんにちは、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
> 

 効率がー、といつものように悩んだんですが、えいやと対応しました。

-- 
// SASADA Koichi at atdot dot net


-- 
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