Project

General

Profile

Actions

Feature #4299

closed

no warning: found = in conditional, should be ==

Added by znz (Kazuhiro NISHIYAMA) almost 14 years ago. Updated about 12 years ago.

Status:
Closed
Target version:
[ruby-dev:43083]

Description

=begin
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]
%
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0