From: eregontp@... Date: 2020-12-07T18:58:40+00:00 Subject: [ruby-core:101290] [Ruby master Bug#17374] Refined methods aren't visible from a refinement's module Issue #17374 has been updated by Eregon (Benoit Daloze). Assignee set to shugo (Shugo Maeda) marcandre (Marc-Andre Lafortune) wrote in #note-3: > They can be defined in different `refine` blocks and it still works: Yes, because they are `refine` under the same "refinement namespace" module. And each `refine` is basically `using` all other `refine` in the same "refinement namespace" module. The set of refinements that apply are captured at `def` time. In the original example, there is no way to know that Implementation will be followed by `refine`, and that the methods declared there should be affected. What you are asking is I think dynamic rebinding, because what should happen if: ```ruby module R1 refine Foo do prepend Foo::Implementation end end module R2 refine Foo do prepend Foo::Implementation end end ``` A given (lexical) call site should have a fixed set of used refinements (important for reasoning and performance). That wouldn't hold for `Foo::Extension::Implementation#foo`, it could be either of R1 or R2 for the same call site. ---------------------------------------- Bug #17374: Refined methods aren't visible from a refinement's module https://bugs.ruby-lang.org/issues/17374#change-88974 * Author: marcandre (Marc-Andre Lafortune) * Status: Open * Priority: Normal * Assignee: shugo (Shugo Maeda) * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- -- https://bugs.ruby-lang.org/ Unsubscribe: