Project

General

Profile

Bug #13370

instance_exec occurs "no receiver given (ArgumentError)"

Added by ta1kt0me (hiroki tokutomi) over 3 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:80372]

Description

ArgumentError occurs in 2.4.1 on below code. It's the same in trunk.

class Foo
  def one
    puts 1
  end
end

Foo.new.instance_exec(&:one)
# => ArgumentError: no receiver given

But it's differece behavior with 2.4.0 . Is this expected ?

# 2.4.0
Foo.new.instance_exec(&:one)
# 1
# => nil

Related issues

Related to Ruby master - Bug #13074: When executing instance_exec with symbol.to_proc, it ignores first argument.ClosedActions
#1

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Related to Bug #13074: When executing instance_exec with symbol.to_proc, it ignores first argument. added

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Status changed from Open to Rejected
  • Description updated (diff)

It was a bug in 2.4.0.

Also available in: Atom PDF