Issue #12984 has been updated by bughit (bug hit).

Status changed from Closed to Feedback

I stopped getting email notifications from bugs.ruby-lang.org, to whom should I report this?

I am going to reopen this because I did not have a chance to address your comment. And I made an argument that so far has not been addressed.

>  It should not mean rescue only exception classes in the array, unless the array is empty

That's not consistent with the meaning of splatting an empty array, whereas the opposite is.

In a construct that takes a coma separated list, splatting an empty array produces a void list (no values)

so `rescue *[Class1, Class2]` translates to `rescue Class1, Class2`
`rescue *[Class1]` translates to `rescue Class1`
and `rescue *[]` to a plain `rescue` which does not mean rescue nothing

That would be logical and consistent.

There is no explicit syntax for rescue nothing which would be something like `rescue()`, so `rescue *[]` has to mean `rescue` and not the non-existent `rescue()`

----------------------------------------
Bug #12984: `rescue *[]` should be equivalent to `rescue` as `method_call(*[])` is equivalent to `method_call`
https://bugs.ruby-lang.org/issues/12984#change-81404

* Author: bughit (bug hit)
* Status: Feedback
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
splatting an empty array to a construct that takes a list is suppose to be equivalent to specifying no list

```ruby
def foo
end

foo *[] #works

```

so `rescue *[]` should be equivalent to `rescue`

```ruby
begin
  raise 'error' #Uncaught exception
rescue *[]
  puts 'caught'
end
```




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>