From: alex.wayfer@... Date: 2021-03-15T22:37:53+00:00 Subject: [ruby-core:102875] [Ruby master Feature#17674] Proposal: `Method#source_location` or `Method#owner` for refined methods Issue #17674 has been updated by AlexWayfer (Alexander Popov). xtkoba (Tee KOBAYASHI) wrote in #note-3: > The example code in #note-2 does not seem to refine `Range#cover?`. This method is defined natively in `range.c`, and so the behavior is expected (`Method#source_location` should return `nil`). Sorry, you're correct, I didn't understand the code from #note-1 correctly. (I don't see an ability to close this issue by myself) ---------------------------------------- Feature #17674: Proposal: `Method#source_location` or `Method#owner` for refined methods https://bugs.ruby-lang.org/issues/17674#change-90935 * Author: AlexWayfer (Alexander Popov) * Status: Open * Priority: Normal ---------------------------------------- Inspired by https://bugs.ruby-lang.org/issues/15504#note-17 I'm working on a gem with Ruby refinements, and some methods are invented in new Ruby versions like 2.5 or 3.0, and I'd like to define in this gem should I refine a method or not. So��� current behavior of `Method#source_location` returns `nil` for core and/or refined methods. I think, refinements should be caught by this method. Also I didn't know about `Method#owner`, but it can be a case for refinements too. -- https://bugs.ruby-lang.org/ Unsubscribe: