From: daniel@...42.com Date: 2020-12-10T15:03:52+00:00 Subject: [ruby-core:101395] [Ruby master Bug#17374] Refined methods aren't visible from a refinement's module Issue #17374 has been updated by Dan0042 (Daniel DeLorme). I tried testing this and immediately ran into this issue: (in latest master) ```ruby class Foo module Extension module Implementation def foo super(bar) end def bar 42 end end refine Foo do prepend Implementation end end def foo(value = :none) p value end end Foo.new.foo # => :none (ok) Foo.prepend Foo::Extension::Implementation Foo.new.foo # => :none ... not 42 as expected ``` So it appears like `Foo.prepend Foo::Extension::Implementation` has no effect. But if I just comment out the `prepend Implementation` line it works as expected. Note that there's no `using` anywhere anyway. I'm at a loss to explain what's going on here. But I think more than ever that module inclusion to define refined methods is not just "not recommended", it should be prevented by raising an error. Or at least output a warning. ---------------------------------------- Bug #17374: Refined methods aren't visible from a refinement's module https://bugs.ruby-lang.org/issues/17374#change-89155 * Author: marcandre (Marc-Andre Lafortune) * Status: Rejected * Priority: Normal * Assignee: shugo (Shugo Maeda) * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- -- https://bugs.ruby-lang.org/ Unsubscribe: