Project

General

Profile

Actions

Feature #11337

closed

Allow rescue without begin inside blocks

Added by rosenfeld (Rodrigo Rosenfeld Rosas) almost 9 years ago. Updated over 7 years ago.

Status:
Closed
Target version:
-
[ruby-core:69887]

Description

While it's possible to have rescue's without begin in method definitions it's not possible to have the same facility inside blocks. For example, this is currently not possible:

1.times do
  abc
rescue
  p 'error'
end

But this is possible

def a
  abc
rescue
  p 'error'
end

Would it be possible to also allow rescue without begin inside blocks too?


Related issues 2 (0 open2 closed)

Is duplicate of Ruby master - Feature #7882: Allow rescue/else/ensure in do..endClosedmatz (Yukihiro Matsumoto)Actions
Has duplicate Ruby master - Feature #12906: do/end blocks work with ensure/rescue/elseClosednobu (Nobuyoshi Nakada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0