Parent
Problem
After #671, the pinned Zod 4.5.2 corpus has 374 diagnostics / 369 unique identities. Ten remaining TS7006 identities in locale files share an array-property flow shape.
A fair same-file reduction shows the core fault without Zod names or imports:
type Primitive = string | number | null | undefined;
interface A { options?: Primitive[] }
interface B { options?: never }
declare const issue: A | B;
if (issue.options) {
issue.options.map((value) => value);
}TypeScript 6.0.3 and the native preview accept this. ReleaseFast Home incorrectly retains never | Primitive[], reports TS2339 on .map, and then TS7006 on value. The stronger Array.isArray(issue.options) && issue.options.length > 0 form also reports false TS2339 for both length and map, loses the callback type, and misses the intended invalid-use diagnostics.
Requirements
- Remove impossible
neverbranches through normal union/flow semantics after truthy property narrowing. - Preserve the declared array element type and normal array members; do not special-case
options,map, locales, or Zod. - Do not add a depth cap, diagnostic suppression, source-text heuristic, or widening workaround.
- Add focused checker coverage for the minimal truthy union and a strict invalid-control oracle covering the
Array.isArraychain. - Require exact TypeScript 6/native/Home diagnostic-code parity on the invalid control, full checker and Program suites, ReleaseFast, formatting/diff checks, and the repository Pickier baseline.
- Run the pinned 106-file Zod 4.5.2 graph twice against the exact #671 parent and reject any added diagnostic identity.
- Document accepted/rejected evidence in
docs/docs/TS_PERFORMANCE.mdand summarize it in the README table.