Issue #16496 has been reported by JustinFeng (Justin Feng).

----------------------------------------
Bug #16496: Numbered Parameter not parsed properly in lambda
https://bugs.ruby-lang.org/issues/16496

* Author: JustinFeng (Justin Feng)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin18]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
The space between `*` and `1` changes the lambda behaviour, looks like numbered parameter `_1` is not parsed properly

```
2.7.0 :001 > l = -> { _1 * 1 }
2.7.0 :002 > l[2]
 => 2
2.7.0 :003 > l2 = -> { _1 *1 }
2.7.0 :004 > l2[2]
Traceback (most recent call last):
        5: from /Users/justin.feng/.rvm/rubies/ruby-2.7.0/bin/irb:23:in `<main>'
        4: from /Users/justin.feng/.rvm/rubies/ruby-2.7.0/bin/irb:23:in `load'
        3: from /Users/justin.feng/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/irb-1.2.1/exe/irb:11:in `<top (required)>'
        2: from (irb):4
        1: from (irb):3:in `block in irb_binding'
ArgumentError (wrong number of arguments (given 1, expected 0))
2.7.0 :005 >
```



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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>