Project

General

Profile

Actions

Bug #12984

closed

`rescue *[]` should be equivalent to `rescue` as `method_call(*[])` is equivalent to `method_call`

Added by bughit (bug hit) almost 8 years ago. Updated about 5 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
[ruby-core:78394]

Description

Splatting an empty array to a construct that takes a list is supposed to be equivalent to specifying no list

def foo
end

foo *[] #works

So rescue *[] should be equivalent to rescue

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0