Project

General

Profile

Actions

Feature #15574

closed

Prohibit to pass a block on super() implicitly

Added by ko1 (Koichi Sasada) about 5 years ago. Updated over 4 years ago.

Status:
Rejected
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

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0