E2262 implements 節の取得メソッドは,%s 呼び出し規約にしたがう必要があります (Delphi)

提供: RAD Studio
移動先: 案内検索

エラーと警告のメッセージ(Delphi) への移動

呼び出し規約が正しくない取得メソッドまたは設定メソッドをコンパイラが検出しました。


program Produce;
type
  I0 = interface
  end;

  T0 = class(TInterfacedObject, I0)
    function getter : I0; cdecl;
    property p0 : I0 read getter implements I0;
  end;

function T0.getter : I0;
begin
end;
end.


{ この例では,関数 getter の cdecl でエラーが発生する }


program Solve;
type
  I0 = interface
  end;

  T0 = class(TInterfacedObject, I0)
    function getter : I0;
    property p0 : I0 read getter implements I0;
  end;

function T0.getter : I0;
begin
end;
end.


{ この問題の唯一の解決策は,プロパティ取得メソッド宣言から不正な呼び出し規約を削除すること }