It seems that in the given example, even if a function is defined to return void, a function returning a boolean still passes through the type check. Is this a bug or is there a legitimate reason for this behavior? Are there any workarounds available?
type ReturnsVoid = () => void
type ReturnsNumber = () => number
const a: ReturnsVoid = () => { }
// Surprisingly, there is no error
const b: ReturnsVoid = () => { return false; }
// Error - as expected
const c: ReturnsNumber = () => { return false; }
// Error - as expected
const d: void = false;