<div dir="ltr"><div>I encountered a strange case where a variable was changing value within the scope of an if statement, because I had a superclass with an identical variable name. I am able to reproduce it with this simple case:<br>
<br><span style="font-family:courier new,monospace">class A <br>{<br>    10000 =&gt; int foo;<br>}<br><br>class B extends A <br>{<br>    fun void bar()<br>    {<br>        0 =&gt; int foo;<br><br>        &lt;&lt;&lt; &quot;a&quot;, foo &gt;&gt;&gt;;<br>
        {<br>            &lt;&lt;&lt; &quot;b&quot;, foo &gt;&gt;&gt;;<br>        }<br>        &lt;&lt;&lt; &quot;c&quot;, foo &gt;&gt;&gt;;<br>    }<br>}</span><br><br></div>Prints out:<br><span style="font-family:courier new,monospace"><br>
a 0 <br>b 10000 <br>c 0 </span><br></div>