I have code like below,myFunc requires callback which needed generic parameter.
It looks like I can pass function which not required any parameters and not getting any error notification, any idea why?
const myFunc = <T>(callback: (par: T) => void) => {
const param = ('test' as any) as T;
callback(param);
};
const callback = (par: number) => {
console.log(par);
};
myFunc<string>(callback); // Not working as suspected - OK
myFunc<string>(() => {}); // Why I do not getting any error notification here?