<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 31, 2014 at 2:21 AM, Balázs Kósi <span dir="ltr">&lt;<a href="mailto:rebmekop@gmail.com" target="_blank">rebmekop@gmail.com</a>&gt;</span> wrote:<br>
<div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div></div><div class="">self undeclare: aBinding key from: bindings<br><br></div>

makes the binding #Bar =&gt; Baz to become a binding pointing to nil, and when we get back to Environment&gt;&gt;renameClass:from:to:<br></div>it uses that same binding object and just changes the binding key to the new name, so at the end we have a binding #Baz =&gt; nil<br>
</div></div></blockquote><div><br></div><div>Good catch Balázs, thanks!</div><div><br></div><div>I&#39;ve committed a test and fix to trunk.&nbsp;</div><div><br></div><div>The fix is to create an entirely new binding for the new name, rather than reusing the old binding and just chaining the key. That&#39;s a change in behaviour, but I think it&#39;s correct. That way methods that refer to the old name will now have an undeclared binding with a nil value, and the new name will correctly refer to the renamed class.&nbsp;</div>
<div><br></div><div>This avoids leaving methods in an inconsistent state where their source code doesn&#39;t match their compiled state. Methods that refer to the old name will have an undefined binding, while methods that refer to the new name will be bound to the correct class. That&#39;s how it should work at the low level&mdash;the tools should be responsible for fixing up the source code to use the new name and recompiling.</div>
<div><br></div><div>Colin</div></div></div></div>