Skip to content

Improve constraints of nested conditional types applied to constrained type variables #59886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Sep 7, 2024

fixes #59868

this is an extension of #56004

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Sep 7, 2024
Comment on lines +19335 to +19336
if (checkType.flags & TypeFlags.Any || distributiveConditionalConstraintIdentityStack.length !== 0 && !(inferredExtendsType.flags & TypeFlags.Never) && someType(getPermissiveInstantiation(inferredExtendsType), t => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
(extraTypes ??= []).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the core of the fix, previously only the first level of nested conditional type (in non tail-recursive scenarios) was including the instantiated true type in its extraTypes (the reasoning behind that is outlined in the comment above and in the #56004 's description)

So now we are including it at all nested levels. In other words - previously the forConstraint was only passed to the direct call of getConditionalTypeInstantiation from getConstraintOfDistributiveConditionalType but now this contextual~ information is used for all nested calls.

I've used a global variable to track this as it's not really feasible today to thread this through instantiateType here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it not feasible to thread forConstraint through instantiateType?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditional types could appear just at any deeper level of the instantiated type. It's doable to introduce some kind of InstantiationFlags and pass it down to all called functions etc but it felt more complicated to attempt doing it. It would also be fairly easy to forget to pass that down somewhere.

function f9<S extends string>(
x: IsMatchingStringInfiniteRecursionInFalseType2<S>,
) {
let t1: 1 = x; // Error
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error here changed from "Type instantiation is excessively deep and possibly infinite" to "Type '1 | 2' is not assignable to type '1'".

It feels fine here but perhaps it's not fine in general case and I should only return neverType for recursive calls when the compiler is instantiating for the true type. This change comes from the fact that I'm letting the neverType to be returned for any recursive call and this one comes from the false type.

@gabritto
Copy link
Member

gabritto commented Sep 9, 2024

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 9, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started 👀 Results
user test this ✅ Started ✅ Results
run dt ✅ Started 👀 Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

Hey @gabritto, the results of running the DT tests are ready.

There were interesting changes:

Branch only errors:

Package: frida-gum
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/frida-gum/frida-gum-tests.ts
  126:1   error  TypeScript@local expected type to be:
  NativeFunction<[number, number], [number | Int64, [number, [NativePointerValue, NativePointerValue]]]>
got:
  NativeFunction<[number, number], never>  @definitelytyped/expect
  128:5   error  TypeScript@local compile error: 
Argument of type '[Int64, (number | NativePointer[])[]]' is not assignable to parameter of type 'never'                                                       @definitelytyped/expect
  130:5   error  TypeScript@local compile error: 
Argument of type '[number, (number | NativePointer[])[]]' is not assignable to parameter of type 'never'                                                      @definitelytyped/expect
  133:1   error  TypeScript@local expected type to be:
  NativeFunction<void, [number, ...NativePointerValue[]]>
got:
  NativeFunction<void, never>                                                             @definitelytyped/expect
  135:5   error  TypeScript@local compile error: 
Argument of type '[number, NativePointer, NativeFunction<void, never>, { handle: NativePointer; }]' is not assignable to parameter of type 'never'            @definitelytyped/expect
  138:1   error  TypeScript@local expected type to be:
  NativeFunction<number, [NativePointerValue]>
got:
  NativeFunction<number, never>                                                                      @definitelytyped/expect
  144:22  error  TypeScript@local compile error: 
Argument of type '[NativePointer]' is not assignable to parameter of type 'never'                                                                             @definitelytyped/expect
  147:23  error  TypeScript@local compile error: 
Argument of type 'NativePointer[]' is not assignable to parameter of type 'never'                                                                             @definitelytyped/expect
  150:6   error  TypeScript@local compile error: 
Argument of type '[NativePointer]' is not assignable to parameter of type 'never'                                                                             @definitelytyped/expect
  153:1   error  TypeScript@local expected type to be:
  SystemFunction<number, [NativePointerValue, number]>
got:
  SystemFunction<number, never>                                                              @definitelytyped/expect
  158:21  error  TypeScript@local compile error: 
Argument of type '[NativePointer, number]' is not assignable to parameter of type 'never'                                                                     @definitelytyped/expect

✖ 11 problems (11 errors, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

Package: ramda
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/ramda/test/converge-tests.ts
   17:5   error  TypeScript@local expected type to be:
  Curry<(args_0: FormatSpec) => string>
got:
  Curry<(args_0: FormatSpec) => never>                                                                                                             @definitelytyped/expect
   26:5   error  TypeScript@local expected type to be:
  string
got:
  never                                                                                                                                                                           @definitelytyped/expect
  144:5   error  TypeScript@local expected type to be:
  Curry<(a: number, b: number) => number>
got:
  Curry<(a: number, b: number) => never>                                                                                                         @definitelytyped/expect
  153:5   error  TypeScript@local expected type to be:
  Curry<(a: number, b: number, c: number) => number>
got:
  Curry<(a: number, b: number, c: number) => <U>(b: U) => any>                                                                        @definitelytyped/expect
  153:55  error  TypeScript@local compile error: 
A spread argument must either have a tuple type or be passed to a rest parameter                                                                                                                     @definitelytyped/expect
  153:58  error  TypeScript@local compile error: 
Type 'never' must have a '[Symbol.iterator]()' method that returns an iterator                                                                                                                       @definitelytyped/expect
  162:5   error  TypeScript@local expected type to be:
  Curry<(list: readonly number[] & { length: number; }) => number>
got:
  Curry<(list: readonly number[] & { length: number; }) => ((b: number) => number) & ((a: number) => number) & number>  @definitelytyped/expect
  162:57  error  TypeScript@local compile error: 
A spread argument must either have a tuple type or be passed to a rest parameter                                                                                                                     @definitelytyped/expect
  162:60  error  TypeScript@local compile error: 
Type 'never' must have a '[Symbol.iterator]()' method that returns an iterator                                                                                                                       @definitelytyped/expect
  166:5   error  TypeScript@local expected type to be:
  number
got:
  ((b: number) => number) & ((a: number) => number) & number                                                                                                                      @definitelytyped/expect

✖ 10 problems (10 errors, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

Package: styled-components
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/styled-components/test/index.tsx
   631:38  error  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(props: { a?: number | undefined; b: number; className?: string | undefined; } & { theme?: any; } & { as?: undefined; forwardedAs?: undefined; }): ReactElement<WithOptionalTheme<{ b: number; className?: string | undefined; } & Partial<...>, any>, string | JSXElementConstructor<...>>', gave the following error.
    Type '{ b: number; color: string; }' is not assignable to type 'IntrinsicAttributes & { a?: number | undefined; b: number; className?: string | undefined; } & { theme?: any; } & { as?: undefined; forwardedAs?: undefined; }'.
      Property 'color' does not exist on type 'IntrinsicAttributes & { a?: number | undefined; b: number; className?: string | undefined; } & { theme?: any; } & { as?: undefined; forwardedAs?: undefined; }'.
  Overload 2 of 2, '(props: StyledComponentPropsWithAs<FC<{ b: number; className?: string | undefined; }>, any, { a: number; }, "a", FC<{ b: number; className?: string | undefined; }>, FC<{ b: number; className?: string | undefined; }>>): ReactElement<...>', gave the following error.
    Type '{ b: number; color: string; }' is not assignable to type 'IntrinsicAttributes & { a?: number | undefined; b: number; className?: string | undefined; } & { theme?: any; } & { as?: FC<{ b: number; className?: string | undefined; }> | undefined; forwardedAs?: FC<...> | undefined; }'.
      Property 'color' does not exist on type 'IntrinsicAttributes & { a?: number | undefined; b: number; className?: string | undefined; } & { theme?: any; } & { as?: FC<{ b: number; className?: string | undefined; }> | undefined; forwardedAs?: FC<...> | undefined; }'  @definitelytyped/expect
   664:10  error  TypeScript@local compile error: 
Unused '@ts-expect-error' directive                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             @definitelytyped/expect
   782:1   error  TypeScript@local compile error: 
Unused '@ts-expect-error' directive                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             @definitelytyped/expect
  1314:21  error  TypeScript@local compile error: 
Argument of type 'StyledComponent<"div", any, {}, never>' is not assignable to parameter of type 'StyledComponent<any, any, any, any>'.
  The types returned by 'withComponent(...)' are incompatible between these types.
    Type 'StyledComponent<any, any, object, string | number | symbol>' is not assignable to type 'StyledComponent<never, any, any, any>'.
      Type 'StyledComponent<any, any, object, string | number | symbol>' is not assignable to type 'StyledComponentBase<never, any, any, any>'.
        Types of property 'propTypes' are incompatible.
          Type 'WeakValidationMap<WithOptionalTheme<{} & Partial<{ [x: string]: any; [x: number]: any; [x: symbol]: any; }>, any>> | undefined' is not assignable to type 'undefined'.
            Type 'WeakValidationMap<WithOptionalTheme<{} & Partial<{ [x: string]: any; [x: number]: any; [x: symbol]: any; }>, any>>' is not assignable to type 'undefined'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 @definitelytyped/expect
  1315:24  error  TypeScript@local compile error: 
Argument of type 'StyledComponent<"div", any, {}, never>' is not assignable to parameter of type 'StyledComponent<any, any, any, any>'.
  The types returned by 'withComponent(...)' are incompatible between these types.
    Type 'StyledComponent<any, any, object, string | number | symbol>' is not assignable to type 'StyledComponent<never, any, any, any>'.
      Type 'StyledComponent<any, any, object, string | number | symbol>' is not assignable to type 'StyledComponentBase<never, any, any, any>'.
        Types of property 'propTypes' are incompatible.
          Type 'WeakValidationMap<WithOptionalTheme<{} & Partial<{ [x: string]: any; [x: number]: any; [x: symbol]: any; }>, any>> | undefined' is not assignable to type 'undefined'.
            Type 'WeakValidationMap<WithOptionalTheme<{} & Partial<{ [x: string]: any; [x: number]: any; [x: symbol]: any; }>, any>>' is not assignable to type 'undefined'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 @definitelytyped/expect
  1316:37  error  TypeScript@local compile error: 
Argument of type 'StyledComponent<"div", any, {}, never>' is not assignable to parameter of type 'StyledComponent<any, any, any, any>'.
  The types returned by 'withComponent(...)' are incompatible between these types.
    Type 'StyledComponent<any, any, object, string | number | symbol>' is not assignable to type 'StyledComponent<never, any, any, any>'.
      Type 'StyledComponent<any, any, object, string | number | symbol>' is not assignable to type 'StyledComponentBase<never, any, any, any>'.
        Types of property 'propTypes' are incompatible.
          Type 'WeakValidationMap<WithOptionalTheme<{} & Partial<{ [x: string]: any; [x: number]: any; [x: symbol]: any; }>, any>> | undefined' is not assignable to type 'undefined'.
            Type 'WeakValidationMap<WithOptionalTheme<{} & Partial<{ [x: string]: any; [x: number]: any; [x: symbol]: any; }>, any>>' is not assignable to type 'undefined'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 @definitelytyped/expect

✖ 6 problems (6 errors, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

You can check the log here.

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the user tests with tsc comparing main and refs/pull/59886/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@gabritto
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 62,153 62,153 ~ ~ ~ p=1.000 n=6
Types 50,242 50,242 ~ ~ ~ p=1.000 n=6
Memory used 194,175k (± 0.99%) 193,611k (± 0.89%) ~ 192,361k 195,869k p=0.378 n=6
Parse Time 1.57s (± 1.12%) 1.56s (± 1.37%) ~ 1.53s 1.58s p=0.744 n=6
Bind Time 0.85s (± 1.43%) 0.86s (± 0.88%) ~ 0.85s 0.87s p=0.555 n=6
Check Time 11.38s (± 0.69%) 11.37s (± 0.41%) ~ 11.30s 11.43s p=0.748 n=6
Emit Time 3.23s (± 0.77%) 3.25s (± 0.61%) ~ 3.22s 3.27s p=0.086 n=6
Total Time 17.03s (± 0.50%) 17.05s (± 0.44%) ~ 16.94s 17.14s p=0.872 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 7 ~ ~ ~ p=1.000 n=6
Symbols 945,753 945,753 ~ ~ ~ p=1.000 n=6
Types 410,067 410,067 ~ ~ ~ p=1.000 n=6
Memory used 1,222,752k (± 0.00%) 1,222,707k (± 0.00%) -45k (- 0.00%) 1,222,670k 1,222,739k p=0.045 n=6
Parse Time 7.91s (± 0.69%) 7.95s (± 0.74%) ~ 7.87s 8.05s p=0.334 n=6
Bind Time 2.22s (± 0.62%) 2.23s (± 0.46%) ~ 2.21s 2.24s p=0.134 n=6
Check Time 36.47s (± 0.38%) 36.44s (± 0.30%) ~ 36.27s 36.56s p=0.688 n=6
Emit Time 17.81s (± 0.66%) 17.86s (± 0.30%) ~ 17.78s 17.91s p=0.567 n=6
Total Time 64.41s (± 0.26%) 64.47s (± 0.16%) ~ 64.36s 64.64s p=0.468 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,506,932 2,506,924 -8 (- 0.00%) ~ ~ p=0.001 n=6
Types 932,998 933,020 +22 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,336,496k (± 0.00%) 2,336,496k (± 0.00%) ~ 2,336,419k 2,336,652k p=0.378 n=6
Parse Time 10.98s (± 0.25%) 10.99s (± 0.51%) ~ 10.92s 11.09s p=0.872 n=6
Bind Time 2.56s (± 0.21%) 2.56s (± 0.52%) ~ 2.54s 2.57s p=0.242 n=6
Check Time 85.20s (± 0.36%) 85.50s (± 0.51%) ~ 85.00s 86.26s p=0.230 n=6
Emit Time 0.33s (± 1.58%) 0.32s (± 1.27%) ~ 0.32s 0.33s p=0.112 n=6
Total Time 99.06s (± 0.33%) 99.37s (± 0.42%) ~ 98.87s 100.12s p=0.297 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,247,213 1,247,214 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 265,146 265,146 ~ ~ ~ p=1.000 n=6
Memory used 2,457,700k (± 5.94%) 2,397,797k (± 0.03%) ~ 2,397,059k 2,398,898k p=0.378 n=6
Parse Time 6.02s (± 1.16%) 6.02s (± 0.51%) ~ 5.98s 6.06s p=1.000 n=6
Bind Time 2.29s (± 0.46%) 2.29s (± 0.64%) ~ 2.27s 2.31s p=0.463 n=6
Check Time 41.15s (± 0.75%) 41.18s (± 0.54%) ~ 40.87s 41.45s p=0.810 n=6
Emit Time 3.99s (± 2.58%) 4.00s (± 3.10%) ~ 3.91s 4.25s p=0.810 n=6
Total Time 53.48s (± 0.56%) 53.52s (± 0.44%) ~ 53.16s 53.78s p=0.873 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,247,213 1,247,214 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 265,146 265,146 ~ ~ ~ p=1.000 n=6
Memory used 2,472,855k (± 0.04%) 2,472,668k (± 0.01%) ~ 2,472,375k 2,472,977k p=0.810 n=6
Parse Time 7.82s (± 0.58%) 7.84s (± 0.56%) ~ 7.76s 7.89s p=0.296 n=6
Bind Time 2.53s (± 1.05%) 2.54s (± 0.43%) ~ 2.52s 2.55s p=0.227 n=6
Check Time 51.28s (± 0.69%) 51.05s (± 0.57%) ~ 50.79s 51.55s p=0.230 n=6
Emit Time 5.03s (± 3.74%) 4.98s (± 3.27%) ~ 4.86s 5.31s p=0.689 n=6
Total Time 66.68s (± 0.60%) 66.41s (± 0.47%) ~ 66.05s 66.92s p=0.230 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 259,149 259,150 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 105,986 105,986 ~ ~ ~ p=1.000 n=6
Memory used 433,473k (± 0.03%) 433,561k (± 0.03%) ~ 433,402k 433,726k p=0.230 n=6
Parse Time 4.23s (± 1.01%) 4.24s (± 0.63%) ~ 4.20s 4.28s p=0.414 n=6
Bind Time 1.58s (± 0.52%) 1.58s (± 0.69%) ~ 1.57s 1.60s p=0.666 n=6
Check Time 22.40s (± 0.22%) 22.31s (± 0.41%) ~ 22.22s 22.43s p=0.196 n=6
Emit Time 2.06s (± 0.85%) 2.07s (± 0.71%) ~ 2.04s 2.08s p=0.145 n=6
Total Time 30.25s (± 0.26%) 30.21s (± 0.28%) ~ 30.13s 30.33s p=0.423 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 68 68 ~ ~ ~ p=1.000 n=6
Symbols 225,018 225,018 ~ ~ ~ p=1.000 n=6
Types 94,249 94,249 ~ ~ ~ p=1.000 n=6
Memory used 370,264k (± 0.02%) 370,295k (± 0.02%) ~ 370,208k 370,439k p=0.378 n=6
Parse Time 2.76s (± 0.23%) 2.76s (± 1.01%) ~ 2.72s 2.79s p=0.739 n=6
Bind Time 1.58s (± 1.16%) 1.56s (± 0.52%) ~ 1.55s 1.57s p=0.116 n=6
Check Time 15.74s (± 0.35%) 15.77s (± 0.19%) ~ 15.73s 15.82s p=0.419 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.08s (± 0.38%) 20.09s (± 0.27%) ~ 20.02s 20.17s p=0.936 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,041,302 3,041,302 ~ ~ ~ p=1.000 n=6
Types 1,051,790 1,051,791 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,149,771k (± 0.00%) 3,149,816k (± 0.00%) ~ 3,149,742k 3,149,937k p=0.261 n=6
Parse Time 16.96s (± 0.38%) 17.00s (± 0.33%) ~ 16.93s 17.09s p=0.518 n=6
Bind Time 5.37s (± 2.30%) 5.29s (± 0.28%) ~ 5.27s 5.31s p=0.252 n=6
Check Time 98.92s (± 0.44%) 98.92s (± 0.19%) ~ 98.61s 99.12s p=0.810 n=6
Emit Time 27.00s (± 1.10%) 26.99s (± 0.64%) ~ 26.70s 27.17s p=0.748 n=6
Total Time 148.26s (± 0.30%) 148.20s (± 0.24%) ~ 147.73s 148.69s p=0.936 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 277,022 277,022 ~ ~ ~ p=1.000 n=6
Types 112,817 112,817 ~ ~ ~ p=1.000 n=6
Memory used 426,739k (± 0.01%) 426,727k (± 0.01%) ~ 426,641k 426,806k p=0.689 n=6
Parse Time 3.30s (± 0.30%) 3.30s (± 0.38%) ~ 3.28s 3.31s p=0.931 n=6
Bind Time 1.44s (± 0.98%) 1.43s (± 0.84%) ~ 1.42s 1.45s p=0.458 n=6
Check Time 14.98s (± 0.78%) 14.95s (± 0.25%) ~ 14.88s 14.98s p=0.375 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 19.72s (± 0.68%) 19.68s (± 0.14%) ~ 19.64s 19.71s p=0.296 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 539,317 539,499 +182 (+ 0.03%) ~ ~ p=0.001 n=6
Types 178,997 179,127 +130 (+ 0.07%) ~ ~ p=0.001 n=6
Memory used 484,254k (± 0.03%) 484,331k (± 0.05%) ~ 484,130k 484,703k p=0.810 n=6
Parse Time 3.42s (± 0.44%) 3.42s (± 0.44%) ~ 3.39s 3.43s p=1.000 n=6
Bind Time 1.26s (± 0.67%) 1.26s (± 0.66%) ~ 1.25s 1.27s p=0.084 n=6
Check Time 18.32s (± 0.37%) 18.43s (± 0.42%) ~ 18.32s 18.54s p=0.065 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.99s (± 0.29%) 23.10s (± 0.31%) +0.11s (+ 0.48%) 23.02s 23.20s p=0.044 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the top 400 repos with tsc comparing main and refs/pull/59886/merge:

Something interesting changed - please have a look.

Details

actualbudget/actual

2 of 5 projects failed to build with the old tsc and were ignored

packages/loot-core/tsconfig.api.json

adonisjs/core

tsconfig.json

  • error TS2536: Type '"list"' cannot be used to index type 'Awaited<ReturnType<T["resolver"]>>'.

gvergnaud/ts-pattern

1 of 4 projects failed to build with the old tsc and were ignored

examples/one-file-demo/tsconfig.json

noodle-run/noodle

tsconfig.json

peers/peerjs

tsconfig.json

refined-github/refined-github

tsconfig.json

vuejs/pinia

5 of 7 projects failed to build with the old tsc and were ignored

tsconfig.json

@typescript-bot
Copy link
Collaborator

@gabritto Here are some more interesting changes from running the top 400 repos suite

Details

vuetifyjs/vuetify

3 of 7 projects failed to build with the old tsc and were ignored

packages/vuetify/tsconfig.json

@gabritto
Copy link
Member

gabritto commented Sep 9, 2024

@Andarist seems like a bunch of things broke because some types became never. Maybe we're being overeager in detecting circularities?

@Andarist
Copy link
Contributor Author

I have a hunch that this might be related to my comment here. I'll investigate and report back with the findings and new tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Constraints of nested conditional types applied to constrained type variables are incorrect
3 participants