Issue #16855 has been updated by tenderlovemaking (Aaron Patterson).

Status changed from Open to Rejected

Eregon (Benoit Daloze) wrote in #note-1:
> I'm afraid I don't see the point of a TracePoint for this if warnings can already be hooked via `Warning.prepend SomeModuleWithWarn`.
> 
> Invoking the TracePoint regardless of $VERBOSE would be a large performance cost, and would prevent optimizations like not building the warning message or finding the file:line when $VERBOSE is `false/nil`.
> (e.g., https://github.com/oracle/truffleruby/commit/86af0e5e224680e81e3c0a287f82ca8263ca079e)
> 
> One could still speculate on the TracePoint not being used, but if DidYouMean uses it then it's pointless to speculate, it would always be used.
> 
> I think people should rather learn to use `-w`/`-d`/`$VERBOSE`, or they'll miss on lots of existing help to find such issues.

Yep, I agree. I'm closing this :)


----------------------------------------
Feature #16855: Add a tracepoint for warnings
https://bugs.ruby-lang.org/issues/16855#change-85567

* Author: tenderlovemaking (Aaron Patterson)
* Status: Rejected
* Priority: Normal
----------------------------------------
I would like to add a tracepoint for warnings.  I want to do this so that DidYouMean can suggest fixes for instance variables.  I noticed did you mean [has experimental support](https://github.com/ruby/did_you_mean/blob/master/lib/did_you_mean/experimental/ivar_name_correction.rb), but it looks very complicated.  I think if we added a tracepoint for such warnings, DidYouMean can provide more helpful warnings.

I made a pull request [here](https://github.com/ruby/ruby/pull/3106)



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