E2532 メソッド '%s' の異なる型引数から一般型パラメータを推論できません(Delphi)

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

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

これらは、一般型メソッドが、パラメータの値を基にその型を推測できなかった場合に発生します。


program E2532;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  TMyGenClass = class
    class procedure X<T>(A: T; B: T);  overload;
  end;

{ TSmoke }

class procedure TMyGenClass.X<T>(A: T; B: T);
begin
//
end;


begin
  TMyGenClass.X(1, '8'); //E2532 Fix: if the type constraint is the same for both, use the same type of parameters
end.