Bug #4299: no warning: found = in conditional, should be ==
http://redmine.ruby-lang.org/issues/show/4299

起票者: Kazuhiro NISHIYAMA
ステータス: Open, 優先度: Normal
カテゴリ: core
ruby -v: ruby 1.9.3dev (2011-01-20 trunk 30614) [i686-linux]

http://d.hatena.ne.jp/nagachika/20110119/ruby_trunk_changes_30595_30603
で知ったのですが、右辺の種類によっては「warning: found = in conditional, should be ==」が出ないことがあるようです。

% ruby-trunk -ve '!_=""'
ruby 1.9.3dev (2011-01-20 trunk 30614) [i686-linux]
-e:1: warning: found = in conditional, should be ==
% ruby-trunk -ve '!_=1' 
ruby 1.9.3dev (2011-01-20 trunk 30614) [i686-linux]
-e:1: warning: found = in conditional, should be ==
% ruby-trunk -ve '!_={}'    
ruby 1.9.3dev (2011-01-20 trunk 30614) [i686-linux]
% ruby-trunk -ve '!_=[]'
ruby 1.9.3dev (2011-01-20 trunk 30614) [i686-linux]
%


----------------------------------------
http://redmine.ruby-lang.org