https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112013-12-12T06:10:45ZRuby Issue Tracking SystemRuby master - Bug #9242: Rdoc detection of aliaseshttps://bugs.ruby-lang.org/issues/9242?journal_id=436172013-12-12T06:10:45ZHanmac (Hans Mackowiak)hanmac@gmx.de
<ul></ul><p>Array#map and Array#collect are not real aliases<br>
both methods are defined with the excact same method body function but both are not calling each other,<br>
so changeing one method doe not break the other</p> Ruby master - Bug #9242: Rdoc detection of aliaseshttps://bugs.ruby-lang.org/issues/9242?journal_id=436192013-12-12T06:53:27Zzzak (zzak _)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>drbrain (Eric Hodel)</i> to <i>zzak (zzak _)</i></li></ul><p>Alias detection was updated in the pre-release of RDoc 4.1.0, can you try to test it?</p>
<p>If it's these methods are using the same method, we can easily fix this by adding another signature to the call-seq example. What do you think?</p> Ruby master - Bug #9242: Rdoc detection of aliaseshttps://bugs.ruby-lang.org/issues/9242?journal_id=436202013-12-12T13:09:35Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul><li><strong>Assignee</strong> changed from <i>zzak (zzak _)</i> to <i>drbrain (Eric Hodel)</i></li><li><strong>Target version</strong> set to <i>2.6</i></li></ul><p>As Hanmac noted, they aren't real aliases:</p>
<p>$ grep rb_ary_collect array.c<br>
rb_ary_collect(VALUE ary)<br>
rb_ary_collect_bang(VALUE ary)<br>
rb_define_method(rb_cArray, "collect", rb_ary_collect, 0);<br>
rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0);<br>
rb_define_method(rb_cArray, "map", rb_ary_collect, 0);<br>
rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0);</p>
<p>But I guess this is for performance reasons (can someone confirm?). I suppose RDoc should treat these as aliases.</p> Ruby master - Bug #9242: Rdoc detection of aliaseshttps://bugs.ruby-lang.org/issues/9242?journal_id=436212013-12-12T13:19:45Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul></ul><p>There really shouldn't be a difference between using <code>rb_define_alias</code> and using the same <code>rb_define_method</code>.</p>
<p>In Ruby, <code>Array.instance_method(:map) == Array.instance_method(:collect)</code> returns true (even when not defined using rb_define_alias), and they should be treated as aliases.</p>
<p>Moreover, the problem isn't there, since Array#find_index and index are not defined using rb_define_alias either but the generated doc sees them as aliases.</p> Ruby master - Bug #9242: Rdoc detection of aliaseshttps://bugs.ruby-lang.org/issues/9242?journal_id=452672014-02-19T01:06:55Zzzak (zzak _)
<ul><li><strong>Category</strong> changed from <i>doc</i> to <i>lib</i></li></ul> Ruby master - Bug #9242: Rdoc detection of aliaseshttps://bugs.ruby-lang.org/issues/9242?journal_id=689202017-12-25T18:15:13Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>2.6</i></del>)</li></ul> Ruby master - Bug #9242: Rdoc detection of aliaseshttps://bugs.ruby-lang.org/issues/9242?journal_id=815112019-09-11T00:03:34Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Backport</strong> deleted (<del><i>1.9.3: UNKNOWN, 2.0.0: UNKNOWN</i></del>)</li></ul><p>This is still an issue in the master branch. I've added a pull request for rdoc that will treat <code>rb_define_method</code> to the same C function as an alias (similar to <code>rb_define_alias</code>): <a href="https://github.com/ruby/rdoc/pull/742" class="external">https://github.com/ruby/rdoc/pull/742</a></p> Ruby master - Bug #9242: Rdoc detection of aliaseshttps://bugs.ruby-lang.org/issues/9242?journal_id=845142020-03-06T21:31:01Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul>