Issue #22007 has been updated by zenspider (Ryan Davis). The actual place where this showed up is in `assert_raises(*exp)` (edited for succinctness): ```ruby def assert_raises *exp msg = "#{exp.pop}.\n" if String === exp.last exp << StandardError if exp.empty? begin yield rescue *exp => e pass # count assertion return e # ... ``` where the bug report in question passed: `assert_raises(StandardError, %regexp%) { ... }` and the regexp went off into the aether w/o a word. so in the case of lazy evaluation, you're already evaluating exp and then splatting the results into the rescue. At that point, does it actually cost much more to determine that one of the args is a literal (or whatever sort of checks we want to do)? ---------------------------------------- Bug #22007: Inconsistent type checking on rescue https://bugs.ruby-lang.org/issues/22007#change-117069 * Author: zenspider (Ryan Davis) * Status: Open * ruby -v: 4.0.2 * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- this works fine (but I don't think it should): ```ruby begin raise "nope" rescue RuntimeError, /why am I allowed?/, "or me?" => e # yay end ``` whereas this version shows a type error, which seems right: ```ruby 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` -- https://bugs.ruby-lang.org/