[ruby/prism] Warn void regardless of eval

https://github.com/ruby/prism/commit/48ba434fa4
This commit is contained in:
Kevin Newton 2024-04-12 10:22:13 -04:00 committed by git
parent 5f2bcbb6d4
commit c553d34835

View File

@ -1326,8 +1326,6 @@ pm_void_statement_check(pm_parser_t *parser, const pm_node_t *node) {
*/
static void
pm_void_statements_check(pm_parser_t *parser, const pm_statements_node_t *node) {
if (parser->parsing_eval) return;
assert(node->body.size > 0);
for (size_t index = 0; index < node->body.size - 1; index++) {
pm_void_statement_check(parser, node->body.nodes[index]);