Project

General

Profile

Actions

Bug #20308

closed

`it` and numbered parameters do not work in `eval`

Added by kddnewton (Kevin Newton) 9 months ago. Updated 9 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:116969]

Description

I am not sure if this is a purposeful restriction or not, so I apologize if this is not a "bug" per se.

Currently if you use it or _1 (numbered parameters) in eval they do not work with compile.c:

irb(main):001> 1.tap { eval("_1") }
(eval):1:in `block in <top (required)>': undefined local variable or method `_1' for main:Object (NameError)
Did you mean?  _

They work accidentally with prism because I didn't know this wasn't allowed. Is it a bug? Or is this on purpose?


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #18837: Not possible to evaluate expression with numbered parameters in itRejectedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0