类型是有兼容性的。 type A = { demo?:string } type B = { demo:string str:string } // B 类型能满足 A 类型属性要求,所以 B 类型的值能赋值给 A 类型的变量。
类型是有兼容性的。