< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #12984 has been updated by bug hit.
bug hit wrote:
> Nobuyoshi Nakada wrote:
> > It's similar to:
> >
> > ```ruby
> > super(*[])
> > ```
>
> I guess there's some similarity. But super has a very explicit definition. Only a naked super is auto-forwarding, any attempt to pass args turns it into manual super. So `super(*[])` is equivalent to `super()`, which makes sense, because by doing `super(*array)` you are clearly trying to call explicit super.
The difference between rescue and super is that there is such a thing as an explicit empty `super()` that passes nothing, but there is no corresponding explicit empty `rescue()` that rescues nothing, and so rescue *[] manifests something that isn't supposed to exist.
----------------------------------------
Bug #12984: `rescue *[]` should be equivalent to `rescue` as `method_call(*[])` is equivalent to `method_call`
https://bugs.ruby-lang.org/issues/12984#change-61777
* Author: bug hit
* Status: Open
* Priority: Normal
* Assignee:
* 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>