After #617, the pinned Zod 4.5.2 graph has 383 TS7006 diagnostics. The dominant cluster is 258 diagnostics in src/v4/classic/schemas.ts, primarily prototype method implementations passed to the imported core.$constructor generic through a homomorphic ProtoOf<t> mapped type.
A focused four-file strict NodeNext reduction isolates the general failure. The exported function receives an optional mapped prototype argument:
type ProtoOf<T> = {
[K in keyof T]?: T[K] extends (...args: infer A) => infer R
? (...args: A) => R
: T[K];
} & ThisType<T>;When the explicit local type argument has both clone(): this and parse(data: string): number, one polymorphic this member prevents Home from contextually typing the unrelated parse implementation passed through the imported function. TypeScript 6.0.3 and native TypeScript 7.0.2 report exactly TS2339 for data.missing and TS2322 for a string return. Parent Home instead reports three TS7006 errors and four false TS2345 errors, while missing the required TS2339 and TS2322. Namespace-qualified and direct imports fail identically.
Root cause: indexed-access substitution conservatively preserved every T[K] when the concrete substituted object contained any polymorphic-this member, even when the exact selected member was independent. Imported generic instances also needed normalization before object-literal relation and diagnostic traversal. Resolve only exact selected members that do not themselves contain polymorphic this; keep direct polymorphic this[K] deferred. Normalize generic instances at the object relation/diagnostic boundary without changing normal assignability.
Do not special-case Zod, method names, or source spelling, and do not suppress diagnostics.
Required controls:
- imported function reached through a barrel in namespace-qualified and direct forms;
- explicit local type argument containing a polymorphic this-returning member and an unrelated ordinary method;
- a matching type without the polymorphic member to prove the existing path remains intact;
- deliberate missing-property and wrong-return implementations matching the reference diagnostic codes;
- local/shadowed function names must not borrow imported Program facts;
- repeated prepared-owner queries must not reparse or check owners;
- exact same-parent Zod 4.5.2 ReleaseFast A/B with two deterministic runs, normalized diagnostic-set comparison, and zero additions before any timing claim.