1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

parse.y: refine assign_in_cond warning

* parse.y (assign_in_cond): refine a warning message for
  assignment of a literal in conditinal expression.
  [ruby-core:85872] [Bug #14562]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-03-01 04:10:25 +00:00
parent 9244cfa1f6
commit c9ecea33da
2 changed files with 2 additions and 2 deletions

View file

@ -9585,7 +9585,7 @@ assign_in_cond(struct parser_params *p, NODE *node)
if (!node->nd_value) return 1; if (!node->nd_value) return 1;
if (is_static_content(node->nd_value)) { if (is_static_content(node->nd_value)) {
/* reports always */ /* reports always */
parser_warn(p, node->nd_value, "found = in conditional, should be =="); parser_warn(p, node->nd_value, "found `= literal' in conditional, should be ==");
} }
return 1; return 1;
} }

View file

@ -408,7 +408,7 @@ class TestRubyOptions < Test::Unit::TestCase
t.puts " end" t.puts " end"
t.puts "end" t.puts "end"
t.flush t.flush
warning = ' warning: found = in conditional, should be ==' warning = ' warning: found `= literal\' in conditional, should be =='
err = ["#{t.path}:1:#{warning}", err = ["#{t.path}:1:#{warning}",
"#{t.path}:4:#{warning}", "#{t.path}:4:#{warning}",
] ]