Issue #17743 has been updated by Eregon (Benoit Daloze).


How would your format when the method takes multiple arguments?
Should we show the value or just the class?

I think in general this can be useful, but at the same time it's not nearly as useful as a debugger,
and it can be a significant performance overhead for JITs/VMs which would then need to collect all frames and arguments in every exception's backtrace, as well as a copy of the arguments array (instead of just [call site bci/node, called method name/target]).

----------------------------------------
Feature #17743: Show argument types in backtrace
https://bugs.ruby-lang.org/issues/17743#change-91065

* 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:
```
hi.rb:6:in `message': undefined method `name' for nil:NilClass (NoMethodError)
	from hi.rb:2:in `say_hi' called with NilClass
	from hi.rb:9:in `<main>' called with NilClass
```

Inspired by the following Twitter thread: https://twitter.com/lzsthw/status/1374350046909628423




-- 
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>