<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 => int foo;<br>}<br><br>class B extends A <br>{<br> fun void bar()<br> {<br> 0 => int foo;<br><br> <<< "a", foo >>>;<br>
{<br> <<< "b", foo >>>;<br> }<br> <<< "c", foo >>>;<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>