https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112019-11-13T06:37:25ZRuby Issue Tracking SystemRuby master - Bug #16332: `defined?` constant access on `nil` is inconsistent with normal constant accesshttps://redmine.ruby-lang.org/issues/16332?journal_id=826612019-11-13T06:37:25Zdylants (Dylan Thacker-Smith)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="Avoid top-level search for nested constant reference from nil in defined? Fixes [Bug #16332] Co..." href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/ac112f2b5dc7e16ccde8f048be80946187a033b0">git|ac112f2b5dc7e16ccde8f048be80946187a033b0</a>.</p>
<hr>
<p>Avoid top-level search for nested constant reference from nil in defined?</p>
<p>Fixes [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: `defined?` constant access on `nil` is inconsistent with normal constant access (Closed)" href="https://redmine.ruby-lang.org/issues/16332">#16332</a>]</p>
<p>Constant access was changed to no longer allow top-level constant access<br>
through <code>nil</code>, but <code>defined?</code> wasn't changed at the same time to stay<br>
consistent.</p>
<p>Use a separate defined type to distinguish between a constant<br>
referenced from the current lexical scope and one referenced from<br>
another namespace.</p>