mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 20:19:26 +02:00

* adjusted test trtti10.pp due to renamed RecInitTable field Original commit message: Public interface for init table for records in TypInfo: * Rename RecInitTable to RecInitInfo (because it is special kind of PTypeInfo for init table of record). Has more sense in practical usage. + New structure TRecInitData (and related PRecInitData) to handle data for (init) type info for records (aka init table) + New structure TInitManagedField and pointer type PInitManagedField (for init table) + Special helper property RecInitData to get PRecInitData for tkRecord + test attached git-svn-id: trunk@35134 -
36 lines
466 B
ObjectPascal
36 lines
466 B
ObjectPascal
program trtti12;
|
|
|
|
{$MODE DELPHI}
|
|
|
|
uses
|
|
TypInfo;
|
|
|
|
type
|
|
PFoo = ^TFoo;
|
|
TFoo = packed record
|
|
public
|
|
B: Byte;
|
|
W: Word;
|
|
L: LongWord;
|
|
S: string;
|
|
I: IInterface;
|
|
A: TArray<byte>;
|
|
end;
|
|
|
|
var
|
|
td: PTypeData;
|
|
id: PRecInitData;
|
|
begin
|
|
td := GetTypeData(TypeInfo(TFoo));
|
|
|
|
id := td.RecInitData;
|
|
if id.Terminator <> nil then
|
|
Halt(1);
|
|
|
|
if td.ManagedFldCount <> 6 then
|
|
Halt(2);
|
|
|
|
if id.ManagedFieldCount <> 3 then
|
|
Halt(3);
|
|
end.
|