Project

General

Profile

Actions

Bug #10436

closed

ruby -c and ripper inconsistency: m(&nil) {}

Added by akr (Akira Tanaka) about 10 years ago. Updated 9 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
[ruby-dev:<unknown>]
Tags:

Description

m(&nil) {} というまちがったコードは
ruby -c でちゃんとエラーになるのに、
Ripper.sexp ではならないようです。

% cat z.rb 
m(&nil) {}
% ruby -c z.rb 
z.rb:1: both block arg and actual block given
% ruby -rripper -e 'p Ripper.sexp(STDIN.read)' < z.rb
[:program, [[:method_add_block, [:method_add_arg, [:fcall, [:@ident, "m", [1, 0]]], [:arg_paren, [:args_add_block, [], [:var_ref, [:@kw, "nil", [1, 3]]]]]], [:brace_block, nil, [[:void_stmt]]]]]]
% ruby -v
ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]

Files

ripper-block_dup_check-10436.patch (2.2 KB) ripper-block_dup_check-10436.patch jeremyevans0 (Jeremy Evans), 08/21/2019 03:48 AM

Related issues 1 (1 open0 closed)

Related to Ruby master - Feature #18831: Block argument to `yield`OpenActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0