我有此代码:
class testClass1 {
public a : number = 1;
};
class testClass2 {
public b : number = 2;
};
interface InterfaceTest<A,T> {(a : A) : T};
function wrapper<A,B>(func : InterfaceTest<A,B>) {
return 0;
}
wrapper<testClass1, testClass2>(implementation);
wrapper(implementation);
这两个对包装器的调用都没有警告,但是我希望第二个包装器调用产生警告,因为没有将类型赋予函数调用。
我该如何实现?