[#78633] ruby/spec needs help from CRuby committers — Benoit Daloze <eregontp@...>

Currently, ruby/spec is maintained mostly by individuals and enjoys the

13 messages 2016/12/13

[ruby-core:78923] [Ruby trunk Bug#13090] Cannot use return statement in lambdas using instance_eval (MRI 2.4)

From: nobu@...
Date: 2016-12-31 05:15:08 UTC
List: ruby-core #78923
Issue #13090 has been updated by Nobuyoshi Nakada.

Description updated
Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED

----------------------------------------
Bug #13090: Cannot use return statement in lambdas using instance_eval (MRI 2.4)
https://bugs.ruby-lang.org/issues/13090#change-62339

* Author: Nikita Shilnikov
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
* Backport: 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED
----------------------------------------
Hello,

I'm pretty sure I've found a bug after running specs for dry-initializer gem on MRI 2.4. 
I managed to find the minimal code to reproduce the issue:

MRI 2.3.3

```
$ ruby -e "instance_eval(&lambda { |_| return })"
$
```

MRI 2.4.0-p0

```
$ ruby -e "instance_eval(&lambda { |_| return })"
-e:1:in `block in <main>': unexpected return (LocalJumpError)
	from -e:1:in `instance_eval'
	from -e:1:in `<main>'
```

I _think_ lambda has been converted to an ordinary proc, but I didn't check it.

Best regards,
Nikita



-- 
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>

In This Thread

Prev Next