TypeScript 5.7.3 control (--noEmit --strict --target es2023 --skipLibCheck):
declare const values: readonly (number[] | string[])[];
const flattened = values.flat();
const numbers: number[] = flattened;
const booleans: boolean[] = flattened;TypeScript reports TS2322 for both assignments because flattened is (string | number)[]. Fresh Home home-tsc exits 0 with no diagnostics for the same source. Both runs were supervised under the 3,840 MB guard.
packages/ts_checker/src/lib.zig currently sets the synthetic flat() result to any[] whenever the element type is a union. Its own comment says this is a fallback for missing distributive flattening. This loses type information and accepts impossible assignments. The same implementation models only default depth 1, so explicit depth and nested arrays need a matched oracle too.
Acceptance: reproduce this as a repository TypeScript 5.7.3 exact-stream fixture for readonly and mutable receivers, then implement the underlying FlatArray result semantics for union elements and supported depth forms without a permissive any[] fallback. Preserve array callback/member behavior, run focused and full checker, Program, LSP, and the expanded CLI stream audit under the memory guard. Keep #960 and #66 updated.