Skip to content

Instantly share code, notes, and snippets.

@maciej-izak
Last active December 8, 2016 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maciej-izak/f312ff683406e2b16003ee67ee1a95d1 to your computer and use it in GitHub Desktop.
Save maciej-izak/f312ff683406e2b16003ee67ee1a95d1 to your computer and use it in GitHub Desktop.
FPC black list
program E01;
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}
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;
B.Free;
ClassB := TB;
B := ClassB.Create;
B.Free;
ReadLn;
end.
program E02;
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}
type
TA = class
constructor Create(A: Integer = 0); overload;
end;
TB = class(TA)
constructor Create(A: Integer); overload;
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;
B.Free;
ClassB := TB;
B := ClassB.Create;
B.Free;
ReadLn;
end.
program E03;
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}
type
T0 = class
class procedure Foo;
end;
TA = class(T0)
class procedure Foo(A: Integer = 0); overload; virtual;
end;
TB = class(TA)
class procedure Foo(A: Integer); overload; override;
end;
TClassB = class of TB;
class procedure T0.Foo();
begin
WriteLn('T0.Foo');
end;
class procedure TA.Foo(A: Integer = 0);
begin
WriteLn('TA.Foo');
end;
class procedure TB.Foo(A: Integer);
begin
WriteLn('TB.Foo');
end;
var
B: TB;
ClassB: TClassB;
begin
TB.Foo;
B := TB.Create;
B.Foo;
B.Free;
ClassB := TB;
ClassB.Foo;
ReadLn;
end.
program E04;
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}
type
T0 = class
class procedure Foo;
end;
TA = class(T0)
class procedure Foo(A: Integer = 0); overload;
end;
TB = class(TA)
class procedure Foo(A: Integer); overload;
end;
TClassB = class of TB;
class procedure T0.Foo();
begin
WriteLn('T0.Foo');
end;
class procedure TA.Foo(A: Integer = 0);
begin
WriteLn('TA.Foo');
end;
class procedure TB.Foo(A: Integer);
begin
WriteLn('TB.Foo');
end;
var
B: TB;
ClassB: TClassB;
begin
TB.Foo;
B := TB.Create;
B.Foo;
B.Free;
ClassB := TB;
ClassB.Foo;
ReadLn;
end.
program E05;
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}
type
T0 = class
procedure Foo;
end;
TA = class(T0)
procedure Foo(A: Integer = 0); overload; virtual;
end;
TB = class(TA)
procedure Foo(A: Integer); overload; override;
end;
TClassB = class of TB;
procedure T0.Foo();
begin
WriteLn('T0.Foo');
end;
procedure TA.Foo(A: Integer = 0);
begin
WriteLn('TA.Foo');
end;
procedure TB.Foo(A: Integer);
begin
WriteLn('TB.Foo');
end;
var
B: TB;
ClassB: TClassB;
begin
B := TB.Create;
B.Foo;
B.Free;
ReadLn;
end.
program E06;
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}
type
T0 = class
procedure Foo;
end;
TA = class(T0)
procedure Foo(A: Integer = 0); overload;
end;
TB = class(TA)
procedure Foo(A: Integer); overload;
end;
TClassB = class of TB;
procedure T0.Foo();
begin
WriteLn('T0.Foo');
end;
procedure TA.Foo(A: Integer = 0);
begin
WriteLn('TA.Foo');
end;
procedure TB.Foo(A: Integer);
begin
WriteLn('TB.Foo');
end;
var
B: TB;
ClassB: TClassB;
begin
B := TB.Create;
B.Foo;
B.Free;
ReadLn;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment