【问题标题】:Is this a bug in Delphi 2009?这是 Delphi 2009 中的错误吗?
【发布时间】:2008-11-03 22:39:01
【问题描述】:

它看起来确实像一个错误,但我只有试用版,所以它可能已经修复。

ITestInterface = interface
  ['{9445CED8-4DBA-4EDB-9897-60980B438BE4}']
  procedure Foo1;
  procedure Foo2;
end;

TTest = class(TInterfacedObject, ITestInterface)

end;

以上内容将无法编译。但以下是!

ITestInterface<t> = interface
  ['{9445CED8-4DBA-4EDB-9897-60980B438BE4}']
  procedure Foo1;
  procedure Foo2;
end;

TTest<T> = class(TInterfacedObject, ITestInterface<T>)

end;

编辑:我刚刚发现如果您尝试实例化 TTest,它将失败。所以有点不一致,但还不错!

【问题讨论】:

    标签: delphi generics interface delphi-2009


    【解决方案1】:

    是的,一个错误。 http://qc.codegear.com/ 是报告错误的地方。

    【讨论】:

    • 因为我只有试用版,我不确定这个问题是否已经在完整版本中得到修复。
    猜你喜欢
    • 1970-01-01
    • 2014-08-09
    • 1970-01-01
    • 2010-12-15
    • 1970-01-01
    • 1970-01-01
    • 2010-12-15
    • 1970-01-01
    • 2011-05-05
    相关资源
    最近更新 更多