Here my generic function defc
export function defc<T extends Record<string,any> >(f:(a:T)=>void){
return function(a:T){
return f(a)
}
}
The goal of the function is to mark functions to enforce correct return type.
my problem is that when i use it, i don’t get the needed implicitly has an 'any' type
const foo=defc(function({bar}){//wanted warnings: Binding element 'bar' implicitly has an 'any' type.ts(7031)
console.log(bar)
})
my question is: is there a way to changed defc
to get the warning?