Project

General

Profile

Actions

Bug #20680

closed

No "void context" warning for literals/etc. in ensure block

Added by Earlopain (Earlopain _) 4 months ago. Updated 4 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:118866]

Description

Providing this code, I would expect ruby to emit a void context warning:

begin
  foo
rescue
  bar
ensure
  42
end

ensure blocks don't return a value unless return is used explicitly. Am I right in my assumption that this should theoretically emit a warning?

Actions #1

Updated by nobu (Nobuyoshi Nakada) 4 months ago

  • Status changed from Open to Closed

Applied in changeset git|620ce3807b51e126bfb41b9b87ff7b33584058f2.


[Bug #20680] ensure block is always void context

Actions

Also available in: Atom PDF

Like0
Like0