为什么一个function可以extends Record<string, any>?

const foo = () => {}
type Test1 = typeof foo extends Record<string, any> ? 1 : 2  // Test1为1
type Test2 = typeof foo extends Record<string, unknown> ? 1 : 2 // Test2为2
//为什么这个函数可以extends Record呢...
//为什么函数可以extends Record<string, any>,又不能extends Record<string, unknown>
阅读 1.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题