Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2016-09

Black List of examples that FPC won't compile, 2, 5 years later...

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Maciej Izak

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

Reply by email

Maciej Izak
to Maciej Izak

2016-09-19 12:30 GMT+02:00 Maciej Izak :

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

Reply by email