Project

General

Profile

Actions

Feature #17743

open

Show argument types in backtrace

Added by p8 (Petrik de Heus) over 3 years ago. Updated over 3 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:102988]

Description

Given the following Ruby program:

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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0