Why does Format reject procedure address arguments starting with XE4

前端 未结 2 1020
一生所求
一生所求 2020-12-20 20:26

Consider this program:

{$APPTYPE CONSOLE}

uses
  System.SysUtils;

procedure Foo;
begin
end;

type
  TProcedure = procedure;

const
  FooConst: TProcedure =         


        
2条回答
  •  温柔的废话
    2020-12-20 21:14

    I believe that this is a compiler bug and have submitted a QC report: QC#127814.

    As a work around you can use either of the following:

    1. Use addr() rather than the @ operator.
    2. Cast @FooVar or @FooConst to Pointer, e.g. Pointer(@FooVar).

提交回复
热议问题