As in the example, if I have a type definition for a void function, a function that returns a boolean passes through that type check.
Is this is a bug or is there a valid reason for this? Is there a workaround?
type ReturnsVoid = () => void
type ReturnsNumber = () => number
const a: ReturnsVoid = () => { }
// Surprisingly there is no error
const b: ReturnsVoid = () => { return false; }
// Error - expected
const c: ReturnsNumber = () => { return false; }
// Error - expected
const d: void = false;