Project

General

Profile

Actions

Bug #22007

closed

Inconsistent type checking on rescue

Bug #22007: Inconsistent type checking on rescue

Added by zenspider (Ryan Davis) about 1 month ago. Updated 8 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:125311]

Description

this works fine (but I don't think it should):

begin
  raise "nope"
rescue RuntimeError, /why am I allowed?/, "or me?" => e
  # yay
end

whereas this version shows a type error, which seems right:

begin
  begin
    raise "nope"
  rescue /why am I NOT allowed/, "if I was allowed before?" => e
    p e
  end
rescue TypeError => te
  p te
end

I think all the args on rescue should be checked to be Module

Actions

Also available in: PDF Atom