mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 03:59:27 +02:00
48 lines
497 B
ObjectPascal
48 lines
497 B
ObjectPascal
{ %opt=-Sen }
|
|
program notusedbug;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
uses
|
|
Classes, SysUtils
|
|
{ add your units here };
|
|
|
|
type
|
|
TA = class
|
|
private
|
|
FC: integer;
|
|
end;
|
|
|
|
{ TB }
|
|
|
|
TB = class
|
|
private FA: TA;
|
|
public
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
end;
|
|
|
|
{ TB }
|
|
|
|
constructor TB.Create;
|
|
begin
|
|
FA := TA.Create;
|
|
FA.FC := 4;
|
|
writeln(FA.FC);
|
|
end;
|
|
|
|
destructor TB.Destroy;
|
|
begin
|
|
FA.Free;
|
|
inherited Destroy;
|
|
end;
|
|
|
|
var
|
|
b: TB;
|
|
|
|
begin
|
|
b := TB.Create;
|
|
b.Free;
|
|
end.
|
|
|