Closed
Description
How come this code fails...
type T = {
[p: string]: string
}
function f(t: T) { }
f([]) // Index signature is missing in type 'undefined[]'.
...and even this one...
type T<S> = {
[p: string]: S
}
function f<S>(t: T<S>) { }
f([]) // Index signature is missing in type 'undefined[]'.
...but this one doesn't?
type T = {
[p: string]: any
}
function f(t: T) { }
f([])
I'm sorry if this has been pointed out before; it's difficult for me to look for related issues.