Project

General

Profile

Actions

Bug #10687

closed

ArgumentError in certain cases of instance_exec (new bug in 2.2)

Added by Anonymous about 9 years ago. Updated about 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
Backport:
[ruby-core:67282]

Description

a.rb:


foo = ->(a = nil) do
  p(a)
end
instance_exec(["a", "b", "c", "d"], &foo)
#=> rvm use 2.1 && ruby -v && ruby a.rb 
Using /home/micaeked/.rvm/gems/ruby-2.1.5
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
["a", "b", "c", "d"]
#=> rvm use 2.2 && ruby -v && ruby a.rb 
Using /home/micaeked/.rvm/gems/ruby-2.2.0
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
a.rb:1:in `block in <main>': wrong number of arguments (4 for 0..1) (ArgumentError)
	from a.rb:5:in `instance_exec'
	from a.rb:5:in `<main>'

Files

relaxed.patch (654 Bytes) relaxed.patch hanachin (Seiei Miyagi), 03/15/2015 01:16 PM
test_lambda_relaxed.rb (10.6 KB) test_lambda_relaxed.rb hanachin (Seiei Miyagi), 03/15/2015 01:17 PM

Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #12568: wrong ArgumentError if an array is given for instance_exec with optional argumentClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0