Skip to content

Perf regression: conditional type assignability #43485

Closed
@amcasey

Description

@amcasey

Repro

npm install @types/react

index.ts

type Stuff<T> =
    T extends keyof JSX.IntrinsicElements
        ? JSX.IntrinsicElements[T]
        : any;

function F<T, U>(p1: Stuff<T>, p2: Stuff<U>) {
    p1 = p2; // Error
}

tsc index.ts --noEmit --skipLibCheck --extendedDiagnostifcs

Effect

Check time increased from ~0.5s in b2d1f53 to ~7.0s in 2643e65 (aka #30639).

Repro is reduced from a variance check of React's ComponentProps.

Metadata

Metadata

Assignees

Labels

Domain: PerformanceReports of unusually slow behaviorFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions