Project

General

Profile

Actions

Bug #13370

closed

instance_exec occurs "no receiver given (ArgumentError)"

Added by ta1kt0me (hiroki tokutomi) about 7 years ago. Updated about 7 years ago.

Status:
Rejected
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 1 (0 open1 closed)

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

Updated by nobu (Nobuyoshi Nakada) about 7 years ago

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

Updated by nobu (Nobuyoshi Nakada) about 7 years ago

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

It was a bug in 2.4.0.

Actions

Also available in: Atom PDF

Like0
Like0Like0