[ruby-dev:52239] [Ruby Feature#9755] Thread::Backtrace::Location#defined_class
Issue #9755 has been updated by shugo (Shugo Maeda). Status changed from Assigned to Rejected Now that a `Location` has a method entry ([Feature #16495]), `defined_class` can be implemented without adding extra information. However, I'm closing this issue because I no longer remember the use case. ---------------------------------------- Feature #9755: Thread::Backtrace::Location#defined_class https://bugs.ruby-lang.org/issues/9755#change-118028 * Author: shugo (Shugo Maeda) * Status: Rejected * Assignee: ko1 (Koichi Sasada) ---------------------------------------- I'd like Thread::Backtrace::Location#defined_class. ```ruby class X def foo p caller_locations.first.defined_class #=> Y end end class Y def bar X.new.foo end end Y.new.bar ``` nobu created a patch: https://github.com/nobu/ruby/compare/backtrace-self%2Bclass But this patch has two problems: 1. The patch adds Thread::Backtrace::Location#self, but it's weird that a location has self. 2. Thread::Backtrace::Location#class conflicts with Kernel#class. So I proposed defined_class as the method name. -- https://bugs.ruby-lang.org/
participants (1)
-
shugo (Shugo Maeda)