请看以下代码片段:
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
函数?