Accesing a strict private field using the RTTI

前端 未结 3 2064
后悔当初
后悔当初 2021-01-03 02:19

consider this simple code

{$APPTYPE CONSOLE}

uses
  Rtti,
  SysUtils;

type
  {$M+}
  TFoo = class
  strict private
    class var Field1 : Integer;
    fiel         


        
3条回答
  •  耶瑟儿~
    2021-01-03 03:03

    By definition, strict private is only visible in the scope of the class itself. They should still be accessible with Hallvard's hack #5, though (except for class fields, I think).

提交回复
热议问题