summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2024-05-31 08:22:40 -0700
committerGitHub <noreply@github.com>2024-05-31 08:22:40 -0700
commit89486c79bb59216dbbbdff69a2c81cb387f64c5f (patch)
tree652773343005d1b40cf3a28f015d3d1a25c735d0 /parse.y
parent8e2a6435e4f80f3c84cb7d8ac6d7a059d5969e1b (diff)
Make error messages clear blocks/keywords are disallowed in index assignment
Blocks and keywords are allowed in regular index. Also update NEWS to make this more clear. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index fe2909c25c..1f12203e27 100644
--- a/parse.y
+++ b/parse.y
@@ -13658,10 +13658,10 @@ aryset_check(struct parser_params *p, NODE *args)
}
}
if (kwds && nd_type_p(kwds, NODE_HASH) && !RNODE_HASH(kwds)->nd_brace) {
- yyerror1(&kwds->nd_loc, "keyword arg given in index");
+ yyerror1(&kwds->nd_loc, "keyword arg given in index assignment");
}
if (block) {
- yyerror1(&block->nd_loc, "block arg given in index");
+ yyerror1(&block->nd_loc, "block arg given in index assignment");
}
}