https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112015-04-27T23:47:53ZRuby Issue Tracking SystemRuby master - Bug #11103: Reassignment in if block that is not ran, causes variable to become nilhttps://redmine.ruby-lang.org/issues/11103?journal_id=522622015-04-27T23:47:53Zrecursive-madman (Recursive Madman)recursive.madman@gmx.de
<ul></ul><p>Ruby is behaving as it should here. Your confusion is between local variables and method calls.<br>
Before that 'if' block <code>mock_input</code> resolves to the "mock_input" <em>method</em> of your class. The 'if' block then declares a variable with the same name, shadowing the method.</p> Ruby master - Bug #11103: Reassignment in if block that is not ran, causes variable to become nilhttps://redmine.ruby-lang.org/issues/11103?journal_id=522642015-04-28T00:27:58Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul>