<div dir="ltr">Hi,<div><br></div><div><span style="font-size:12.8px">reminder:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Essence: </span><a href="http://bugs.freepascal.org/file_download.php?file_id=19514&type=bug" target="_blank" style="font-size:12.8px">http://bugs.<wbr>freepascal.org/file_download.<wbr>php?file_id=19514&type=bug</a><br></div><div><div style="font-size:12.8px"><span class="gmail-il">Examples</span>: <a href="http://bugs.freepascal.org/file_download.php?file_id=19513&type=bug" target="_blank">http://bugs.<wbr>freepascal.org/file_download.<wbr>php?file_id=19513&type=bug</a></div><div style="font-size:12.8px">Bugtracker: <a href="http://bugs.freepascal.org/view.php?id=25607" target="_blank">http://bugs.<wbr>freepascal.org/view.php?id=<wbr>25607</a></div><div>Prev. discussion: </div><div><a href="http://lists.freepascal.org/fpc-devel/2014-January/033232.html">http://lists.freepascal.org/fpc-devel/2014-January/033232.html</a><br></div><div><br></div><div>During my work on Generics.Collections, SmartPointers and NewPascal.org initiative, I have decided to split my work on many parts to be as close as possibly to original FPC trunk by sending patches and improvements (all is listed here <a href="http://newpascal.org/compass.html">http://newpascal.org/compass.html</a> ). </div><div><br></div><div>One of most important parts is fix for bug #25607. FPC has problem with calculating "distance" for methods with default parameter. Patch is attached here and in #25607.</div><div><br></div><div>We have small difference with Delphi implementation for example:</div><div><br></div><div>===code begin===</div><div><div>type</div><div> TA = class</div><div> constructor Create(A: Integer = 0); overload; virtual;</div><div> end;</div><div> </div><div> TB = class(TA)</div><div> constructor Create(A: Integer); overload; override;</div><div> end;</div><div> </div><div> TClassB = class of TB;</div><div><br></div><div>constructor TA.Create(A: Integer = 0);</div><div>begin</div><div> WriteLn('TA.Create');</div><div>end;</div><div> </div><div>constructor TB.Create(A: Integer);</div><div>begin</div><div> WriteLn('TB.Create');</div><div>end;</div><div><br></div><div>var</div><div> B: TB;</div><div> ClassB: TClassB;</div><div>begin</div><div> B := TB.Create; </div><div> </div><div> B.Create; </div><div> </div><div> ClassB := TB;</div><div> ClassB.Create;</div></div><div>==code end===</div><div><br></div><div>Output for Delphi:</div><div><div>TA.Create</div><div>TB.Create</div><div>TB.Create</div></div><div><br></div><div>Output for FPC with my patch:</div><div><div>TB.Create</div><div>TB.Create</div><div>TB.Create</div></div><div><br></div><div>Seems like Delphi implementation is buggy (override should work for "Create" in presented context too).</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>