Project

General

Profile

Actions

Feature #15574

closed

Prohibit to pass a block on super() implicitly

Added by ko1 (Koichi Sasada) over 3 years ago. Updated almost 3 years ago.

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

Description

As described in [Feature #15554], super() (not super) pass the given block.

class C
  def foo
    p block_given?
  end
end

class C1 < C
  def foo
    super   #=> true
    super() #=> true
  end
end

C1.new.foo{}

super (without parameters) passes all passed parameters so it is no surprise to pass given block.

However, super() (with parameters. In this case, it passes 0 parameters) also pass given block implicitly.

I'm not sure who use this behavior, but I think it is simple to prohibit such implicit block passing.

Actions

Also available in: Atom PDF