I can confirm that class variables and properties are not accessible in RS 11.2...
Program ClassProppertyRTTI;
{$APPTYPE CONSOLE}
{$R *.res}
Uses
System.SysUtils,
System.Rtti;
Type
TMyClass = Class
Strict Private
FGoodbye: Integer;
Strict Private
Class Var FHello: String;
Strict Protected
Public
Class Property Hello: String Read FHello;
Property Goodbye : Integer Read FGoodbye;
End;
Var
C: TMyClass;
Ctx: TRTTIContext;
F : TRTTIField;
T: TRttiType;
P: TRttiProperty;
Begin
Try
C := TMyClass.Create;
Try
Ctx := TRTTIContext.Create();
T := Ctx.GetType(C.ClassInfo);
For F IN T.GetFields Do
WriteLn('Field: ', F.Name);
For P In T.GetProperties Do
WriteLn('Property: ', P.Name);
Finally
C.Free;
End;
ReadLn;
Except
On E: Exception Do
WriteLn(E.ClassName, ': ', E.Message);
End;
End.
It only outputs FGoodbye and Goodbye.
I didn't actually know this restriction in the RTTI.