The below code is accepted by TypeScript, in strict mode, though I don't want it to be. The function's value argument is legitimately an unknown or an any type: it's allowed to be anything at this stage, as it's being proxied along.
However, due to unknown matching, and the allowed reduction in the number of arguments, the test call is accepted.
interface Mine { x: number }
function handle(
field: number,
onChange: (field:Mine, value: unknown) => void,
) {
}
function testCall() {
handle(123, (value: unknown) => {})
}
Is there any way to reject functions that accept fewer arguments than expected? Or is there a way to reject implicit conversions to unknown?