Project

General

Profile

Feature #11337

Allow rescue without begin inside blocks

Added by rosenfeld (Rodrigo Rosenfeld Rosas) about 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
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

Is duplicate of Ruby trunk - Feature #7882: Allow rescue/else/ensure in do..endClosed
Has duplicate Ruby trunk - Feature #12906: do/end blocks work with ensure/rescue/elseClosed

History

#1 [ruby-core:76639] Updated by rosenfeld (Rodrigo Rosenfeld Rosas) about 1 year 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.

#2 Updated by shyouhei (Shyouhei Urabe) about 1 year ago

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

#3 [ruby-core:76648] Updated by shyouhei (Shyouhei Urabe) about 1 year ago

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

#4 [ruby-core:76662] Updated by duerst (Martin Dürst) about 1 year ago

On 2016/08/02 10:54, shyouhei@ruby-lang.org 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.

#5 [ruby-core:76686] Updated by rosenfeld (Rodrigo Rosenfeld Rosas) about 1 year 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 :)

#6 [ruby-core:76687] Updated by rosenfeld (Rodrigo Rosenfeld Rosas) about 1 year ago

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

#7 [ruby-core:76701] Updated by shyouhei (Shyouhei Urabe) about 1 year ago

  • Status changed from Open to Closed

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

#8 [ruby-core:76731] Updated by duerst (Martin Dürst) about 1 year ago

On 2016/08/04 04:23, rr.rosas@gmail.com 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.

#9 Updated by shyouhei (Shyouhei Urabe) 9 months ago

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

Also available in: Atom PDF