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:
parent
9244cfa1f6
commit
c9ecea33da
2 changed files with 2 additions and 2 deletions
2
parse.y
2
parse.y
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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}",
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue