typinfo.GetPropInfo() support helper types directly
Original Reporter info from Mantis: Simon Ameis @SAmeis
-
Reporter name: Simon Ameis
Original Reporter info from Mantis: Simon Ameis @SAmeis
- Reporter name: Simon Ameis
Description:
The function GetPropInfo() returns property information for classes, class instances or "raw" type information. There should be a implementation which supports helper types.
Additional information:
This is a example how it should compile, but doesn't yet (Message: project1.lpr(25,27) Error: Incompatible type for arg no. 1: Got "TCH", expected "TClass"):
program Project1;
{$mode objfpc}{$H+}
uses
classes, typinfo;
type
TCH = class helper for TPersistent
private
function GetX: String;
published
property X: String read GetX;
end;
function TCH.GetX: String;
begin
Result := 'Hello World';
end;
var
x: TPersistent;
pinfo: PPropInfo;
begin
x := TPersistent.Create;
pinfo := GetPropInfo(TCH, 'X');
writeln(GetStrProp(x, pinfo));
x.Free;
readln;
end.
Mantis conversion info:
- Mantis ID: 22638
- Version: 2.7.1