From: Kenta Murata Date: 2010-03-08T16:56:14+09:00 Subject: [ruby-core:28554] Re: [Bug #2945] Regexp#=== is failed by an exception when the exception is occurred in method_missing Hi, On 2010/03/08, at 15:46, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [ruby-core:28552] [Bug #2945] Regexp#=== is failed by an exception when the exception is occurred in method_missing" > on Mon, 8 Mar 2010 15:32:24 +0900, Kenta Murata writes: > > |When an exception is occurred in method_missing, > |Regexp#=== is failed by the exception. > |Is this valid behavior? > > I think so. What makes you think it's invalid? I think the present behavior is unfortunate the following case. I don't expect raising exception, but printing 2. o1 = Object.new class << o1 def method_missing(*args) raise "XXX" end end case o1 when /aaa/ puts 1 when o puts 2 end #=> `method_missing': XXX (RuntimeError) -- Kenta Murata OpenPGP FP = FA26 35D7 4F98 3498 0810 E0D5 F213 966F E9EB 0BCC E-mail: mrkn@mrkn.jp twitter: http://twitter.com/mrkn/ blog: http://d.hatena.ne.jp/mrkn/