delphi - 'initialization' 部分中匿名方法的奇怪错误

标签 delphi anonymous-methods

该装置无法在 XE2 Update 3 中编译,并出现错误“内部错误:SY6315”。在XE中则不存在这样的问题。

unit Test;

interface

uses
  SysUtils;

var
  Proc: TProc;

implementation

initialization
   Proc := procedure
    var ByteArr: array of Byte;
    begin
      SetLength(ByteArr, 10);
    end;

end.

有人遇到过这个问题吗?

更新:我已提交质量控制报告:QC#102888 .

最佳答案

看起来像一个编译器错误,这是使用 TBytes 的解决方法

   Proc := procedure
    var
     ByteArr: TBytes;
    begin
      SetLength(ByteArr, 10);
    end;

关于delphi - 'initialization' 部分中匿名方法的奇怪错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9005008/

相关文章:

c# - 如何在匿名方法中产生返回?

delphi - 永久 "File not found"

delphi - WinInet HttpQueryInfo 可以返回原始字节吗? (带有 unicode 字符的 HTTP header )

java - 匿名监听器是否与弱引用不兼容?

c# Action<T> 如何处理匿名方法

delphi - 有人可以向我解释一下匿名方法吗?

delphi - Delphi 中模块化编程的最佳方法

delphi - 如何实现Delphi的ToolsAPI的IOTAProjectCompileNotifier?

c# - Delphi中加载C# DLL找不到依赖库DLL

c# - 装箱和拆箱 : Why doesn't this delegate match?