Problem
Home does not preserve a typeof exclusion after a terminating continue for a for...of binding.
type Kind = "boolean" | "number" | "object" | "string" | "array" | "null" | "integer";
declare const type: Kind | Kind[] | undefined;
declare const seen: Kind[];
for (const member of Array.isArray(type) ? type : [type]) {
if (typeof member !== "string") continue;
if (!seen.includes(member)) seen.push(member);
}TypeScript 6.0.3 and native TypeScript 7.0.2 accept this with zero diagnostics. Home reports two TS2345 diagnostics because undefined remains in member after the guard.
Scope
- Treat
continueandbreakas terminating the current statement path for post-guard narrowing, without treating them as function exits. - Preserve the literal string union after narrowing.
- Add a checker regression test.
- Re-audit the pinned Zod 4.5.2 corpus and require no new diagnostic locations versus the 602-diagnostic baseline.
Provenance
Found while validating the cross-module inherited-member work tracked by #534 against the fair Zod benchmark tracked by #548 and umbrella #416.