зеркало из https://github.com/github/ruby.git
Fix the warning message for dynamic symbol literal in condition
This commit is contained in:
Родитель
e25ad5475c
Коммит
da139317a5
2
parse.y
2
parse.y
|
@ -11758,7 +11758,7 @@ cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *l
|
|||
break;
|
||||
|
||||
case NODE_DSYM:
|
||||
SWITCH_BY_COND_TYPE(type, warning, "string ")
|
||||
SWITCH_BY_COND_TYPE(type, warning, "symbol ")
|
||||
break;
|
||||
|
||||
case NODE_LIT:
|
||||
|
|
|
@ -1073,7 +1073,7 @@ eom
|
|||
assert_warning(/literal in condition/) do
|
||||
eval('1 if :foo')
|
||||
end
|
||||
assert_warning(/literal in condition/) do
|
||||
assert_warning(/symbol literal in condition/) do
|
||||
eval('1 if :"#{"foo".upcase}"')
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче