变量声明为 string | number,当前已收窄为 string,为什么稍后赋值 42 仍可通过编译?

来自 类型收窄
TypeScript 6 进阶 3分钟

变量声明为 string | number,当前已收窄为 string,为什么稍后赋值 42 仍可通过编译?

报告错误