Discussion:
Black List of examples that FPC won't compile, 2, 5 years later...
(too old to reply)
Maciej Izak
2016-09-19 10:30:15 UTC
Permalink
Raw Message
Hi,

reminder:

Essence: http://bugs.freepascal.org/file_download.php?file_id=19514&type=bug
Examples: http://bugs.freepascal.org/file_download.
php?file_id=19513&type=bug
Bugtracker: http://bugs.freepascal.org/view.php?id=25607
Prev. discussion:
http://lists.freepascal.org/fpc-devel/2014-January/033232.html

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 http://newpascal.org/compass.html ).

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.

We have small difference with Delphi implementation for example:

===code begin===
type
TA = class
constructor Create(A: Integer = 0); overload; virtual;
end;

TB = class(TA)
constructor Create(A: Integer); overload; override;
end;

TClassB = class of TB;

constructor TA.Create(A: Integer = 0);
begin
WriteLn('TA.Create');
end;

constructor TB.Create(A: Integer);
begin
WriteLn('TB.Create');
end;

var
B: TB;
ClassB: TClassB;
begin
B := TB.Create;

B.Create;

ClassB := TB;
ClassB.Create;
==code end===

Output for Delphi:
TA.Create
TB.Create
TB.Create

Output for FPC with my patch:
TB.Create
TB.Create
TB.Create

Seems like Delphi implementation is buggy (override should work for
"Create" in presented context too).
--
Best regards,
Maciej Izak
Maciej Izak
2016-09-19 18:45:54 UTC
Permalink
Raw Message
Patch is attached here and in #25607.
I forgot to remove "objdef: tobjectdef;" local variable from calc_distance
function in the patch. -,-
--
Best regards,
Maciej Izak
Loading...