[ruby-core:102988] [Ruby master Feature#17743] Show argument types in backtrace
From:
petrik@...
Date:
2021-03-24 09:05:36 UTC
List:
ruby-core #102988
Issue #17743 has been reported by p8 (Petrik de Heus).
----------------------------------------
Feature #17743: Show argument types in backtrace
https://bugs.ruby-lang.org/issues/17743
* Author: p8 (Petrik de Heus)
* Status: Open
* Priority: Normal
----------------------------------------
Given the following Ruby program:
``` ruby
def say_hi(person)
puts message(person)
end
def message(person)
"hi: #{person.name}"
end
say_hi(nil)
```
It would be helpful if the backtrace contained the types of the argumets:
```
Traceback (most recent call last):
2: from hi.rb:9:in `<main>' called with NilClass
1: from hi.rb:2:in `say_hi' called with NilClass
hi.rb:6:in `message': undefined method `name' for nil:NilClass (NoMethodError)
```
Inspired by the following Twitter thread: https://twitter.com/lzsthw/status/1374350046909628423
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>