Why does a void function pass as a plain object? Is there a good reason for this, or is it a bug?
type PlainObject = { [key: string]: any };
const foo = (value: PlainObject) => { }
const voidFn: () => void = () => { };
// Error as expected
foo(false);
foo(3);
foo('test');
foo ({ test: true }) // ok - expected usage
foo(voidFn); // Why does it not trigger an error?
The problem occurs only if the value is any. If it was { [key: string]: string }; for instance, the error would occur.