Having some difficulty writing a generic function with an optional parameter
type Action<TParameters = undefined> = (parameters: TParameters) => void
const A: Action = () => console.log('Hi :)')
// This works as expected
const B: Action<string> = (word: string) => console.log('Hello', word)
// Works as expected
const C: Action<string> = (word: number) => console.log('Hello', word)
// Error, which is expected
const D: Action<string> = () => console.log('Hello')
// Unexpectedly no error here
const E: Action<string> = (word) => console.log('Hello', word)
// No error as anticipated, but the type inference for `word` is `any`, why?