type Equal = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? true : false; type Expect = T; import type { Point, LogEntry } from './src/main.js'; type Case1 = Expect>; type Case2 = Expect>; type Case3 = Expect>; // 元组长度固定为 2 // @ts-expect-error: 三元组不能赋给二元组 const tooLong: Point = [1, 2, 3]; // 位置类型必须匹配 // @ts-expect-error: 第二个元素必须是 number const wrongType: Point = [1, '2']; export { tooLong, wrongType };