Issue #8062 has been updated by randoum (Benjamin Sinclaire).


(sorry I just realized my CTRL+C bug sometimes)
ruby -v:  ruby 1.9.3p327 (2012-11-10 revision 37606) [i686-linux]

----------------------------------------
Feature #8062: Argument error stack trace to specify the 'called' method 
https://bugs.ruby-lang.org/issues/8062#change-37454

Author: randoum (Benjamin Sinclaire)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


**Note**
Feature request about the stack trace generated by Ruby, the step by step bellow is using Rails, but if I'm not wrong this is Ruby related.

**Request**
When an ArgumentError exception is raised, the stack trace should display the 'called' method, it actually display only the 'caller' method. This would be great help for debugging

**Background for the step by step**
Rails define a method named 'fields_for' in module ActionView::Helpers::FormHelper, I'll be writing my step by step depending on that but it should be possible to reproduce in any similar situation

**Step by step**
1- Create a module called 'MyModule' and create a method called 'fields_for'

2- In an view, write do code with the following statement 'form_for @mymodel { |f| f.submit }'

3- Execute the code, and see that the top line of the stack trace after the exception is raised is: 
  (gem) actionpack-3.2.12/lib/action_view/helpers/form_helper.rb:378:in `form_for'

This is actually the line in Rails module that perform the call to the method 'fields_for'
But there is no way to understand that Ruby trying to call the method from my module instead of the method from Rails module
A good solution would be to display the name and position of the 'called' method in the stack trace, so the last line of the stack trace would clearly indicate that we have a naming conflict

ruby-v:   (gem) actionpack-3.2.12/lib/action_view/helpers/form_helper.rb:378:in `form_for'

Sorry if it looks confuse, I can't find a better way to explain it, I hope you guys got the picture

Many thanks for your time



-- 
http://bugs.ruby-lang.org/