考虑以下代码提取:
type
MyIntf = interface
procedure Work(param: OleVariant);
end;
MyClass<T> = class
procedure MyWork(param: T);
end;
var
intf: MyIntf;
procedure MyClass<T>.MyWork(param: T);
begin
//compiler error: E2010 Incompatible types: 'OleVariant' and 'T'
intf.Work(param);
end;
如上所示,这无法使用错误消息进行编译。我怎么能从我的泛型类中调用该Work
函数?