<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Should it not be simply forbidden to redefine a variable like that in a sub-class ?</div><div>When you assign instead of declare, the problem disappears.</div><div>So perhaps, instead of 'fixing' the bug, we should forbid this kind of use of scope (chuck should throw an error if you try) ?&nbsp;</div><div><br></div><div>Casper</div><div><br></div><div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">class <span style="color: #000000">A</span>&nbsp;</div><div style="margin: 0px; font-size: 13px; font-family: Monaco;">{</div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; <span style="color: #de9210">10000</span> <span style="color: #000000">=&gt;</span> int <span style="color: #000000">foo;</span></div><div style="margin: 0px; font-size: 13px; font-family: Monaco;">}</div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255); min-height: 17px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">class <span style="color: #000000">B</span> extends <span style="color: #000000">A</span>&nbsp;</div><div style="margin: 0px; font-size: 13px; font-family: Monaco;">{</div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; fun void <span style="color: #000000">bar()</span></div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; <span style="color: #000000">{</span></div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(114, 158, 18);"><span style="color: #0433ff">&nbsp; &nbsp; &nbsp; &nbsp; </span>// 0 =&gt; int foo;</div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #de9210">0</span> <span style="color: #000000">=&gt;</span> <span style="color: #000000">foo;</span></div><p style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255); min-height: 17px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000">&lt;&lt;&lt;</span> <span style="color: #515151">"a"</span><span style="color: #000000">,</span> <span style="color: #000000">foo</span> <span style="color: #000000">&gt;&gt;&gt;;</span></div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000">{</span></div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000">&lt;&lt;&lt;</span> <span style="color: #515151">"b"</span><span style="color: #000000">,</span> <span style="color: #000000">foo</span> <span style="color: #000000">&gt;&gt;&gt;;</span></div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000">}</span></div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000">&lt;&lt;&lt;</span> <span style="color: #515151">"c"</span><span style="color: #000000">,</span> <span style="color: #000000">foo</span> <span style="color: #000000">&gt;&gt;&gt;;</span></div><div style="margin: 0px; font-size: 13px; font-family: Monaco; color: rgb(4, 51, 255);">&nbsp; &nbsp; <span style="color: #000000">}</span></div><div style="margin: 0px; font-size: 13px; font-family: Monaco;">}</div><div style="margin: 0px; font-size: 13px; font-family: Monaco; min-height: 17px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: Monaco;">B b;</div><div style="margin: 0px; font-size: 13px; font-family: Monaco;">b.bar();</div><div style="margin: 0px; font-size: 13px; font-family: Monaco;"><br></div><div apple-content-edited="true">
<div style="font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><font color="#787878">Casper Schipper</font></div><div><font color="#787878"><a href="mailto:casper.schipper@gmail.com">casper.schipper@gmail.com</a></font></div><div><font color="#787878"><a href="http://www.casperschipper.nl">www.casperschipper.nl</a></font></div><div><font color="#787878">+316 52322590</font></div></div>
</div>
<br></div></body></html>