[fpc-devel] Black List of examples that FPC won't compile, 2, 5 years later...

Maciej Izak hnb.code at gmail.com
Mon Sep 19 12:30:15 CEST 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160919/9ae3426c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compiler_patch_distance_for_black_list_19.09.2016.patch
Type: application/octet-stream
Size: 4080 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160919/9ae3426c/attachment.obj>


More information about the fpc-devel mailing list