Project

General

Profile

Actions

Bug #13090

closed

Cannot use return statement in lambdas using instance_eval (MRI 2.4)

Added by decuplet (Nikita Shilnikov) almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
[ruby-core:78917]

Description

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


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #12628: change block/env structsClosedko1 (Koichi Sasada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0