Delphi Compiler Error
E2572 RTTI visibility set constant expression of type System.TRttiVisibility expected
Reason for the Error & Solution
This occurs when using the $RTTI directive with expressions that are not from System.TRttiVisibility.
program E2572;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
{$RTTI INHERIT METHODS(vtInteger)} //E2572
TClass1 = class
A: String;
end;
{$RTTI INHERIT FIELDS(vtInteger)} //E2572
TClass2 = class
A: String;
end;
{$RTTI INHERIT PROPERTIES(vtInteger)} //E2572
TClass3 = class
A: String;
end;
begin
end.