https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112016-06-30T03:51:53ZRuby Issue Tracking SystemRuby master - Feature #12534: Refinements: refine modules as wellhttps://redmine.ruby-lang.org/issues/12534?journal_id=594242016-06-30T03:51:53Zshevegen (Robert A. Heiler)shevegen@gmail.com
<ul></ul><p>Interesting. I was not aware of this.</p>
<p>It is however mentioned in the documentation:</p>
<p><a href="http://ruby-doc.org/core-2.3.1/doc/syntax/refinements_rdoc.html" class="external">http://ruby-doc.org/core-2.3.1/doc/syntax/refinements_rdoc.html</a></p>
<p>Quote:</p>
<p>"Refinements only modify classes, not modules so the argument must be a class."</p>
<p>As to why, I don't know either. Perhaps the documentation can add some words<br>
to briefly state whether this is on purpose or not.</p> Ruby master - Feature #12534: Refinements: refine modules as wellhttps://redmine.ruby-lang.org/issues/12534?journal_id=595502016-07-08T07:18:10Zshugo (Shugo Maeda)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li><li><strong>Assignee</strong> set to <i>shugo (Shugo Maeda)</i></li></ul><p>There is an implementation difficulty when refining modules and calling <code>super</code> in that refinement.</p>
<p>One solution is prohibiting <code>super</code> in a refinement for a module.<br>
Other proposals (and patches) are welcome.</p> Ruby master - Feature #12534: Refinements: refine modules as wellhttps://redmine.ruby-lang.org/issues/12534?journal_id=604102016-09-07T08:03:51Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>I understand the implementation difficulty. If we prohibit <code>super</code> in refined methods in Modules, is it possible to refine modules?<br>
If it's reasonably possible, I'd like to accept this.</p>
<p>Matz.</p> Ruby master - Feature #12534: Refinements: refine modules as wellhttps://redmine.ruby-lang.org/issues/12534?journal_id=606172016-09-23T11:46:38Zshugo (Shugo Maeda)
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul><p>Applied in changeset r56213.</p>
<hr>
<ul>
<li>eval.c (rb_mod_refine): refine modules as well.<br>
<a href="/issues/12534">[ruby-core:76199]</a> [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Refinements: refine modules as well (Closed)" href="https://redmine.ruby-lang.org/issues/12534">#12534</a>]</li>
</ul>