<div dir="ltr">Ian, why do you have that innermost scope? that&#39;s not intended use of syntax I think.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 6, 2014 at 9:00 AM, Ian South-Dickinson <span dir="ltr">&lt;<a href="mailto:ian.southd@gmail.com" target="_blank">ian.southd@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br></div>