[ruby-dev:48713] [ruby-trunk - Bug #10436] [Open] ruby -c and ripper inconsistency: m(&nil) {}

From: akr@...
Date: 2014-10-28 01:24:56 UTC
List: ruby-dev #48713
Issue #10436 has been reported by Akira Tanaka.

----------------------------------------
Bug #10436: ruby -c and ripper inconsistency: m(&nil) {}
https://bugs.ruby-lang.org/issues/10436

* Author: Akira Tanaka
* Status: Open
* Priority: Normal
* Assignee:=20
* Category:=20
* Target version:=20
* ruby -v: ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
m(&nil) {} =E3=81=A8=E3=81=84=E3=81=86=E3=81=BE=E3=81=A1=E3=81=8C=E3=81=A3=
=E3=81=9F=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AF
ruby -c =E3=81=A7=E3=81=A1=E3=82=83=E3=82=93=E3=81=A8=E3=82=A8=E3=83=A9=E3=
=83=BC=E3=81=AB=E3=81=AA=E3=82=8B=E3=81=AE=E3=81=AB=E3=80=81
Ripper.sexp =E3=81=A7=E3=81=AF=E3=81=AA=E3=82=89=E3=81=AA=E3=81=84=E3=82=88=
=E3=81=86=E3=81=A7=E3=81=99=E3=80=82

```
% cat z.rb=20
m(&nil) {}
% ruby -c z.rb=20
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]
```




--=20
https://bugs.ruby-lang.org/

In This Thread

Prev Next