diff options
author | yui-knk <spiketeika@gmail.com> | 2023-10-10 21:06:54 +0900 |
---|---|---|
committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2023-10-13 07:35:24 +0900 |
commit | 2794a8fef65eb16767c2f46f8f5058c10b4591b9 (patch) | |
tree | eb3c9acb6133587990cb10505c234809a6d6773f /parse.y | |
parent | dcee3cc6ce026707e2eb142b117de445b723eecc (diff) | |
download | ruby-2794a8fef65eb16767c2f46f8f5058c10b4591b9.tar.gz |
[Bug #19919] Warn class variable assignment and constant declaration in condition
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1835,6 +1835,10 @@ get_nd_value(struct parser_params *p, NODE *node) return RNODE_DASGN(node)->nd_value; case NODE_MASGN: return RNODE_MASGN(node)->nd_value; + case NODE_CVASGN: + return RNODE_CVASGN(node)->nd_value; + case NODE_CDECL: + return RNODE_CDECL(node)->nd_value; default: compile_error(p, "unexpected node: %s", parser_node_name(nd_type(node))); return 0; @@ -14044,6 +14048,8 @@ assign_in_cond(struct parser_params *p, NODE *node) case NODE_DASGN: case NODE_GASGN: case NODE_IASGN: + case NODE_CVASGN: + case NODE_CDECL: break; default: |