I can't find an explanation for what happens in the following TypeScript snippet :
const f1: () => void = () => 4; // <- OK
function f2(): void {
return 4; // <- Type 'number' is not assignable to type 'void'.
}
Why is TypeScript OK with an arrow function returning more than an explicit void, but complains on a declared function doing the same ?