Skip to content

Instantly share code, notes, and snippets.

@maciej-izak

maciej-izak/E01.pas

Last active Dec 8, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.