fpc/tests/test/terecs_u1.pp
paul 52cd624a76 compiler: fix static fields creation and access for records
+ extend test to check class constructor/destructor for records and static fields access

git-svn-id: branches/paul/extended_records@16545 -
2010-12-11 07:48:13 +00:00

52 lines
722 B
ObjectPascal

{ %norun }
unit terecs_u1;
{$mode delphi}
interface
type
HWND = integer;
TFoo = record
hWnd : HWND;
private
F1: Integer;
F2: Byte;
public
type
TBar = Integer;
const
C: TBar = 1;
var
F3: TBar;
F4: Byte;
class var
F5: TBar;
function Test(n: TBar): TBar;
class function Test1(n: TBar): TBar;
class constructor Create;
class destructor Destroy;
end;
implementation
function TFoo.Test(n: TBar): TBar;
begin
Result := F3 + F4 + n;
end;
class function TFoo.Test1(n: TBar): TBar;
begin
Result := C + n;
end;
class constructor TFoo.Create;
begin
F5 := 6;
end;
class destructor TFoo.Destroy;
begin
WriteLn('TFoo.Destroy');
end;
end.