* extend TParamFlag by pfConstRef which is set for constref parameters

* extend test trtti9.pp accordingly

git-svn-id: trunk@35175 -
This commit is contained in:
svenbarth 2016-12-20 21:37:07 +00:00
parent 1553aa5639
commit 2acf542737
2 changed files with 6 additions and 3 deletions

View File

@ -55,7 +55,7 @@ unit typinfo;
TMethodKind = (mkProcedure,mkFunction,mkConstructor,mkDestructor,
mkClassProcedure,mkClassFunction,mkClassConstructor,
mkClassDestructor,mkOperatorOverload);
TParamFlag = (pfVar,pfConst,pfArray,pfAddress,pfReference,pfOut);
TParamFlag = (pfVar,pfConst,pfArray,pfAddress,pfReference,pfOut,pfConstRef);
TParamFlags = set of TParamFlag;
TIntfFlag = (ifHasGuid,ifDispInterface,ifDispatch,ifHasStrGUID);
TIntfFlags = set of TIntfFlag;

View File

@ -7,7 +7,7 @@ uses
type
PProcedureParam = ^TProcedureParam;
TProc = procedure(var A: Integer; S: String); stdcall;
TProc = procedure(var A: Integer; S: String; constref U: UnicodeString); stdcall;
function TestParam(Param: PProcedureParam; Flags: TParamFlags; ParamType: Pointer; Name: ShortString): Boolean;
begin
@ -27,7 +27,7 @@ begin
halt(2);
if Data^.ProcSig.ResultType <> nil then
halt(3);
if Data^.ProcSig.ParamCount <> 2 then
if Data^.ProcSig.ParamCount <> 3 then
halt(4);
Param := Data^.ProcSig.GetParam(0);
if not TestParam(Param, [pfVar], TypeInfo(Integer), 'A') then
@ -35,4 +35,7 @@ begin
Param := Data^.ProcSig.GetParam(1);
if not TestParam(Param, [], TypeInfo(String), 'S') then
halt(6);
Param := Data^.ProcSig.GetParam(2);
if not TestParam(Param, [pfConstRef], TypeInfo(UnicodeString), 'U') then
halt(7);
end.