const f = <T extends Input['type']>( data: DataType<T>
): Input => ({ type, data }) 代码将在typescript中失败,如下所示 Type '{ type: "a" | "b"; data: "x" | "y" | "z"; }' is not assignable to t
如果一个函数的一个参数是两个类型的并集,我如何才能正确地推断返回类型?我已经尝试了以下条件类型,但它不起作用(参见typescript错误的内联注释): TypeScript Playground type Status = 'statusType'
type GoalActivityassignable to type '"goalActi