summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-04 12:15:27 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-04 12:16:31 +0900
commit28392d30451bbf13cdacf6b745eb4f5147741bdf (patch)
treebf49a105ca844d77d4b01f248fb5c5bd27d3ebfe /parse.y
parentda139317a59acb2d79f460bf92331450efa310fe (diff)
The same warning for static symbol literal
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 189731b45cd..d7261a008de 100644
--- a/parse.y
+++ b/parse.y
@@ -11758,6 +11758,7 @@ cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *l
break;
case NODE_DSYM:
+ warn_symbol:
SWITCH_BY_COND_TYPE(type, warning, "symbol ")
break;
@@ -11770,6 +11771,9 @@ cond0(struct parser_params *p, NODE *node, enum cond_type type, const YYLTYPE *l
node->nd_lit == Qfalse) {
/* booleans are OK, e.g., while true */
}
+ else if (SYMBOL_P(node->nd_lit)) {
+ goto warn_symbol;
+ }
else {
SWITCH_BY_COND_TYPE(type, warning, "")
}