Project

General

Profile

Actions

Feature #11337

closed

Allow rescue without begin inside blocks

Added by rosenfeld (Rodrigo Rosenfeld Rosas) over 8 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

Updated by rosenfeld (Rodrigo Rosenfeld Rosas) over 7 years ago

Could you please close this one? It seems it's a duplicate of issue #7882.

issue #12623 seems to be yet another recent request for the same feature and should probably be closed as a duplicate of #7882 as well.

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

  • Is duplicate of Feature #7882: Allow rescue/else/ensure in do..end added

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

Issues linked. I guess those duplicated issues synchronizes their status each other so I don't close them (am I correct?).

Updated by duerst (Martin Dürst) over 7 years ago

On 2016/08/02 10:54, wrote:

I guess those duplicated issues synchronizes their status each other so I don't close them (am I correct?).

I guess it depends on how you linked them. If it's just 'related', then
the status of each is independent. If it's 'depends on', then you can
close one without closing the other, but not the other way round. But
I'm not sure this is enforced.

Updated by rosenfeld (Rodrigo Rosenfeld Rosas) over 7 years ago

http://www.redmine.org/projects/redmine/wiki/RedmineIssues

"duplicates - Links issues so that closing one, will close the other (e.g. closing A will close B)
For example, if issue B duplicates A:

  • closing B will leave A open
  • closing A will automatically close B

duplicated by - Reciprocal of duplicates.
For example, if issue A is duplicated by issue B:

  • closing B will leave A open
  • closing A will automatically close B"

I'm not sure I completely understand this but it seems to be possible to close the duplicates without closing the original even though they would be automatically closed if using the right relation :)

Updated by rosenfeld (Rodrigo Rosenfeld Rosas) over 7 years ago

If I understood it correctly, this issues currently duplicates #7882 which means closing this one would keep the other open.

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

  • Status changed from Open to Closed

Hmm.. Thank you for the check. It is complicated than I thought. Closing this one anyway.

Updated by duerst (Martin Dürst) over 7 years ago

On 2016/08/04 04:23, wrote:

http://www.redmine.org/projects/redmine/wiki/RedmineIssues

I'm not sure I completely understand this but it seems to be possible to close the duplicates without closing the original even though they would be automatically closed if using the right relation :)

Well, I guess closing the duplicate is done because it's recognized as a
duplicate and no longer needed. Closing the original means that the
problem itself is solved, so it would be wrong to keep the duplicates open.

Regards, Martin.

Actions #9

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

  • Has duplicate Feature #12906: do/end blocks work with ensure/rescue/else added
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0