From af4ba5c12a54cff78cb46832132e7dc8c4fd86cc Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 23 Jun 2017 11:56:48 +0000 Subject: parse.y: should not warn op method call * parse.y (void_expr_gen): should warn operator expression style calls only, but not method style calls. [Fix GH-1660] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index f565581c39..7b45d5b246 100644 --- a/compile.c +++ b/compile.c @@ -3644,11 +3644,12 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret, /* method dispatch */ case NODE_CALL: + case NODE_OPCALL: case NODE_VCALL: case NODE_FCALL: case NODE_ATTRASGN:{ const int explicit_receiver = - (type == NODE_CALL || + (type == NODE_CALL || type == NODE_OPCALL || (type == NODE_ATTRASGN && !private_recv_p(node))); if (!lfinish[1] && (node->nd_args || explicit_receiver)) { @@ -5237,6 +5238,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp break; } case NODE_CALL: + case NODE_OPCALL: /* optimization shortcut * "literal".freeze -> opt_str_freeze("literal") */ @@ -5363,7 +5365,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp } #endif /* receiver */ - if (type == NODE_CALL || type == NODE_QCALL) { + if (type == NODE_CALL || type == NODE_OPCALL || type == NODE_QCALL) { CHECK(COMPILE(recv, "recv", node->nd_recv)); if (type == NODE_QCALL) { lskip = NEW_LABEL(line); -- cgit v1.2.3