Skip to content

TS2590: "Expression produces a union type that is too complex to represent" on generics types #2683

@victorgarciaesgi

Description

@victorgarciaesgi

Steps to reproduce

Repository: https://github.com/victorgarciaesgi/regle/tree/FRONT/experimental/tsgo
Branch: experimental/tsgo

  1. Run npx corepack enable pnpm to install the correct package manager
  2. Run nvm use
  3. Run pnpm install
  4. Run pnpm run build to build all monorepo packages

Then run pnpm run typecheck --filter="@regle/core"
Or pnpm run typecheck --filter="@regle/rules"

Behavior with typescript@5.9

No type error, inference works well as it can be seen here in playground

Behavior with tsgo

tsgo produces the same error on a lot of generics, saying Expression produces a union type that is too complex to represent.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions