Project

General

Profile

Actions

Bug #20680

closed

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

Added by Earlopain (A S) 2 months ago. Updated 2 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

Also available in: Atom PDF

Like0
Like0