declare type KeyGetter = (obj: unknown) => string
// 取自 lodash
declare const identity: {
<T>(value: T): T
(): undefined
}
declare const identity2: {
<T>(value: T): T
}
declare const identity3: {
(): undefined
}
let a: KeyGetter = identity // 为啥没报错?!类型不安全了吧
let b : KeyGetter = identity2 // 正常报错
let c: KeyGetter = identity3 // 正常报错
第一个 identity 类型是什么意思?不是一个重载吗?