Skip to content

Avoid pulling object function property augmentations when resolving intersections' properties #54753

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

Conversation

Andarist
Copy link
Contributor

fixes #54345

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jun 23, 2023
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

You are right, skipObjectFunctionPropertyAugment should be used on a different layer.

@sandersn sandersn self-assigned this Jul 19, 2023
@sandersn sandersn requested a review from ahejlsberg July 19, 2023 22:12
@Andarist Andarist changed the title Exclude global property augmentations when relating properties of intersected types Avoid pulling object function property augmentations when resolving intersections' properties Jul 22, 2023
@Andarist Andarist requested a review from sandersn July 22, 2023 08:48
@Andarist
Copy link
Contributor Author

You are right, skipObjectFunctionPropertyAugment should be used on a different layer.

Done.

@Andarist Andarist force-pushed the avoid-global-augmentations-when-relating-props-of-intersections branch from 9f37b5e to 6727033 Compare July 22, 2023 11:21
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

The results look right now but I don't understand why the two code changes are different.

@@ -13483,7 +13483,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
for (const current of type.types) {
for (const prop of getPropertiesOfType(current)) {
if (!members.has(prop.escapedName)) {
const combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.escapedName);
const combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.escapedName, /*skipObjectFunctionPropertyAugment*/ !!(type.flags & TypeFlags.Intersection));
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 this unconditional here but has a fallback in the getPropertyOfType code?

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 resolves "own" members of the intersection so we never want to pull from function property augment here.

The other place is responsible for getting a name out of all accessible properties, it prioritizes its own ones but has to fallback to the ones from the augment to account for this:

interface Test1 { toString: null | 'string'; }
type Test2 = Test1 & { optional?: unknown };
declare const source: Test1;
const target: Test2 = { ...source };

const toString = target.toString; // own one, augment is avoided here
const hasOwn = target.hasOwnProperty; // not an own member but it should still be accessible

I pushed out this (hasOwn bit) as an extra thing in the added test case.

@sandersn
Copy link
Member

@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot run dt
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 25, 2023

Heya @sandersn, I've started to run the perf test suite on this PR at d641df8. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 25, 2023

Heya @sandersn, I've started to run the extended test suite on this PR at d641df8. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 25, 2023

Heya @sandersn, I've started to run the parallelized Definitely Typed test suite on this PR at d641df8. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 25, 2023

Heya @sandersn, I've started to run the diff-based top-repos suite on this PR at d641df8. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 25, 2023

Heya @sandersn, I've started to run the diff-based user code test suite on this PR at d641df8. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@sandersn Here are the results of running the user test suite comparing main and refs/pull/54753/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

bcryptjs

/mnt/ts_downloads/bcryptjs/tsconfig.json

  • [NEW] error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?
    • /mnt/ts_downloads/bcryptjs/node_modules/bcryptjs/src/bcrypt/prng/accum.js(47,56)
    • /mnt/ts_downloads/bcryptjs/node_modules/bcryptjs/src/bcrypt/prng/accum.js(61,56)

rxjs-src

/mnt/ts_downloads/rxjs-src/build.sh

  • [NEW] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
  • [MISSING] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)

@Andarist
Copy link
Contributor Author

The bcryptjs failure doesn't look related to this PR since it fails on those 2 lines: 1, 2. Those check truthiness of window.addEventListener and window.removeEventListener. The rxjs-src failure is reported for all PRs and it's unrelated as well.

@typescript-bot
Copy link
Collaborator

@sandersn Here are the results of running the top-repos suite comparing main and refs/pull/54753/merge:

Something interesting changed - please have a look.

Details

conwnet/github1s

tests/tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?

tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?

vscode-web/tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?

immutable-js/immutable-js

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

website/tsconfig.json

  • error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead?

microsoft/vscode

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

src/tsconfig.monaco.json

src/tsconfig.tsec.json

vercel/swr

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

_internal/tsconfig.json

core/tsconfig.json

immutable/tsconfig.json

infinite/tsconfig.json

mutation/tsconfig.json

subscription/tsconfig.json

test/type/tsconfig.json

vuejs/vue

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

tsconfig.json

@jakebailey
Copy link
Member

Hm, doesn't feel unrelated when another user test suite reports the same error in a bunch of new repos...

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..54753
Metric main 54753 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 368,782k (± 0.01%) 368,796k (± 0.01%) ~ 368,756k 368,830k p=0.630 n=6
Parse Time 3.40s (± 1.23%) 3.39s (± 0.22%) ~ 3.38s 3.40s p=0.869 n=6
Bind Time 1.12s (± 0.46%) 1.12s (± 0.80%) ~ 1.11s 1.13s p=0.541 n=6
Check Time 8.95s (± 0.39%) 8.97s (± 0.53%) ~ 8.90s 9.02s p=0.686 n=6
Emit Time 7.54s (± 0.54%) 7.59s (± 0.47%) ~ 7.54s 7.63s p=0.127 n=6
Total Time 21.02s (± 0.43%) 21.06s (± 0.33%) ~ 20.96s 21.15s p=0.470 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 192,117k (± 0.02%) 193,507k (± 1.21%) ~ 192,085k 197,867k p=0.298 n=6
Parse Time 1.51s (± 0.84%) 1.51s (± 0.88%) ~ 1.49s 1.52s p=0.866 n=6
Bind Time 0.78s (± 0.66%) 0.78s (± 0.71%) ~ 0.77s 0.78s p=0.640 n=6
Check Time 9.50s (± 0.79%) 9.58s (± 0.30%) ~ 9.54s 9.61s p=0.064 n=6
Emit Time 2.76s (± 0.98%) 2.76s (± 0.91%) ~ 2.73s 2.80s p=0.742 n=6
Total Time 14.54s (± 0.62%) 14.62s (± 0.35%) ~ 14.57s 14.68s p=0.053 n=6
Monaco - node (v18.10.0, x64)
Memory used 347,748k (± 0.01%) 347,783k (± 0.01%) ~ 347,740k 347,828k p=0.054 n=6
Parse Time 2.63s (± 0.87%) 2.63s (± 1.18%) ~ 2.60s 2.68s p=0.871 n=6
Bind Time 1.01s (± 0.51%) 1.01s (± 0.82%) ~ 1.00s 1.02s p=0.533 n=6
Check Time 7.30s (± 0.53%) 7.35s (± 0.36%) ~ 7.30s 7.38s p=0.053 n=6
Emit Time 4.23s (± 0.89%) 4.29s (± 1.30%) ~ 4.25s 4.40s p=0.077 n=6
Total Time 15.17s (± 0.56%) 15.28s (± 0.42%) ~ 15.20s 15.39s p=0.073 n=6
TFS - node (v18.10.0, x64)
Memory used 301,774k (± 0.00%) 301,784k (± 0.01%) ~ 301,767k 301,816k p=0.335 n=6
Parse Time 2.10s (± 0.58%) 2.10s (± 1.04%) ~ 2.06s 2.12s p=0.452 n=6
Bind Time 1.12s (± 1.54%) 1.13s (± 0.49%) ~ 1.12s 1.13s p=0.498 n=6
Check Time 6.65s (± 0.21%) 6.64s (± 0.34%) ~ 6.62s 6.68s p=0.292 n=6
Emit Time 3.87s (± 0.60%) 3.87s (± 1.59%) ~ 3.82s 3.95s p=0.570 n=6
Total Time 13.74s (± 0.33%) 13.74s (± 0.62%) ~ 13.67s 13.85s p=0.809 n=6
material-ui - node (v18.10.0, x64)
Memory used 482,583k (± 0.01%) 482,988k (± 0.01%) +405k (+ 0.08%) 482,931k 483,081k p=0.005 n=6
Parse Time 3.05s (± 2.60%) 3.10s (± 2.31%) ~ 2.96s 3.17s p=0.164 n=6
Bind Time 0.96s (± 6.79%) 0.94s (± 5.22%) ~ 0.91s 1.04s p=0.934 n=6
Check Time 17.42s (± 1.00%) 17.65s (± 0.75%) +0.23s (+ 1.34%) 17.47s 17.84s p=0.031 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.43s (± 0.83%) 21.69s (± 0.54%) +0.26s (+ 1.22%) 21.55s 21.85s p=0.031 n=6
xstate - node (v18.10.0, x64)
Memory used 563,783k (± 0.02%) 563,815k (± 0.02%) ~ 563,719k 563,952k p=0.810 n=6
Parse Time 3.86s (± 0.69%) 3.87s (± 0.86%) ~ 3.80s 3.89s p=0.684 n=6
Bind Time 1.65s (± 1.11%) 1.66s (± 0.97%) ~ 1.64s 1.68s p=0.192 n=6
Check Time 2.81s (± 1.03%) 2.85s (± 0.88%) ~ 2.82s 2.89s p=0.064 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.39s (± 0.49%) 8.44s (± 0.68%) ~ 8.34s 8.49s p=0.107 n=6
Angular - node (v16.17.1, x64)
Memory used 368,212k (± 0.01%) 368,206k (± 0.01%) ~ 368,188k 368,248k p=0.689 n=6
Parse Time 3.55s (± 0.50%) 3.59s (± 0.38%) +0.04s (+ 1.22%) 3.57s 3.61s p=0.006 n=6
Bind Time 1.19s (± 0.43%) 1.19s (± 0.34%) ~ 1.19s 1.20s p=0.114 n=6
Check Time 9.73s (± 0.61%) 9.81s (± 0.15%) ~ 9.79s 9.82s p=0.063 n=6
Emit Time 8.01s (± 0.52%) 8.07s (± 0.97%) ~ 7.96s 8.15s p=0.148 n=6
Total Time 22.48s (± 0.39%) 22.67s (± 0.42%) +0.19s (+ 0.85%) 22.50s 22.75s p=0.020 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,837k (± 0.01%) 193,936k (± 0.01%) +99k (+ 0.05%) 193,891k 193,973k p=0.005 n=6
Parse Time 1.58s (± 0.48%) 1.60s (± 0.47%) +0.02s (+ 1.48%) 1.59s 1.61s p=0.006 n=6
Bind Time 0.83s (± 1.19%) 0.82s (± 0.66%) ~ 0.82s 0.83s p=0.662 n=6
Check Time 10.16s (± 0.37%) 10.24s (± 0.64%) ~ 10.12s 10.29s p=0.077 n=6
Emit Time 3.00s (± 0.71%) 3.04s (± 0.92%) +0.04s (+ 1.33%) 3.01s 3.08s p=0.043 n=6
Total Time 15.57s (± 0.36%) 15.70s (± 0.57%) +0.13s (+ 0.83%) 15.55s 15.80s p=0.030 n=6
Monaco - node (v16.17.1, x64)
Memory used 347,082k (± 0.00%) 347,084k (± 0.00%) ~ 347,071k 347,112k p=0.936 n=6
Parse Time 2.77s (± 0.58%) 2.77s (± 0.48%) ~ 2.76s 2.79s p=1.000 n=6
Bind Time 1.08s (± 0.91%) 1.08s (± 0.70%) ~ 1.07s 1.09s p=1.000 n=6
Check Time 8.01s (± 0.36%) 8.03s (± 0.34%) ~ 7.99s 8.07s p=0.333 n=6
Emit Time 4.44s (± 0.58%) 4.47s (± 0.48%) ~ 4.44s 4.50s p=0.088 n=6
Total Time 16.31s (± 0.24%) 16.36s (± 0.26%) ~ 16.29s 16.42s p=0.090 n=6
TFS - node (v16.17.1, x64)
Memory used 301,107k (± 0.01%) 301,108k (± 0.01%) ~ 301,072k 301,131k p=0.872 n=6
Parse Time 2.19s (± 0.34%) 2.21s (± 0.74%) ~ 2.19s 2.23s p=0.112 n=6
Bind Time 1.22s (± 1.59%) 1.22s (± 1.70%) ~ 1.19s 1.25s p=0.685 n=6
Check Time 7.33s (± 0.41%) 7.35s (± 0.62%) ~ 7.30s 7.41s p=0.687 n=6
Emit Time 4.34s (± 0.97%) 4.36s (± 0.48%) ~ 4.33s 4.38s p=0.418 n=6
Total Time 15.08s (± 0.37%) 15.13s (± 0.39%) ~ 15.03s 15.21s p=0.091 n=6
material-ui - node (v16.17.1, x64)
Memory used 481,885k (± 0.01%) 482,318k (± 0.01%) +433k (+ 0.09%) 482,279k 482,383k p=0.005 n=6
Parse Time 3.26s (± 0.36%) 3.27s (± 0.68%) ~ 3.24s 3.30s p=0.508 n=6
Bind Time 0.96s (± 0.88%) 0.96s (± 0.43%) ~ 0.95s 0.96s p=0.285 n=6
Check Time 18.38s (± 0.62%) 18.81s (± 0.78%) +0.43s (+ 2.35%) 18.63s 19.04s p=0.005 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.60s (± 0.53%) 23.04s (± 0.64%) +0.45s (+ 1.97%) 22.85s 23.24s p=0.005 n=6
xstate - node (v16.17.1, x64)
Memory used 561,343k (± 0.02%) 561,422k (± 0.02%) ~ 561,297k 561,575k p=0.378 n=6
Parse Time 4.03s (± 0.34%) 4.03s (± 0.35%) ~ 4.01s 4.05s p=0.807 n=6
Bind Time 1.66s (± 5.94%) 1.69s (± 6.12%) ~ 1.58s 1.79s p=0.936 n=6
Check Time 3.15s (± 3.15%) 3.18s (± 3.63%) ~ 3.06s 3.33s p=0.468 n=6
Emit Time 0.09s (± 5.53%) 0.09s (± 4.62%) ~ 0.08s 0.09s p=0.070 n=6
Total Time 8.93s (± 0.78%) 8.99s (± 0.65%) ~ 8.89s 9.05s p=0.090 n=6
Angular - node (v14.21.3, x64)
Memory used 362,123k (± 0.01%) 362,127k (± 0.01%) ~ 362,081k 362,180k p=0.872 n=6
Parse Time 3.73s (± 0.28%) 3.73s (± 0.51%) ~ 3.71s 3.75s p=0.744 n=6
Bind Time 1.22s (± 0.62%) 1.22s (± 0.67%) ~ 1.21s 1.23s p=0.306 n=6
Check Time 10.14s (± 0.31%) 10.13s (± 0.61%) ~ 10.04s 10.19s p=1.000 n=6
Emit Time 8.30s (± 0.59%) 8.32s (± 0.64%) ~ 8.27s 8.40s p=0.520 n=6
Total Time 23.38s (± 0.34%) 23.41s (± 0.47%) ~ 23.25s 23.56s p=0.521 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used 189,119k (± 0.02%) 189,182k (± 0.01%) +63k (+ 0.03%) 189,155k 189,205k p=0.016 n=6
Parse Time 1.61s (± 0.39%) 1.61s (± 0.32%) ~ 1.60s 1.61s p=0.386 n=6
Bind Time 0.85s (± 0.65%) 0.84s (± 0.65%) ~ 0.84s 0.85s p=1.000 n=6
Check Time 10.31s (± 0.51%) 10.42s (± 0.87%) +0.11s (+ 1.10%) 10.31s 10.53s p=0.045 n=6
Emit Time 3.11s (± 0.62%) 3.12s (± 1.12%) ~ 3.08s 3.17s p=0.624 n=6
Total Time 15.87s (± 0.37%) 16.00s (± 0.65%) +0.13s (+ 0.80%) 15.86s 16.16s p=0.037 n=6
Monaco - node (v14.21.3, x64)
Memory used 342,086k (± 0.01%) 342,063k (± 0.01%) ~ 342,049k 342,102k p=0.199 n=6
Parse Time 2.80s (± 0.43%) 2.82s (± 0.58%) ~ 2.79s 2.83s p=0.143 n=6
Bind Time 1.10s (± 0.74%) 1.10s (± 0.94%) ~ 1.09s 1.12s p=0.270 n=6
Check Time 8.29s (± 0.32%) 8.31s (± 0.29%) ~ 8.29s 8.35s p=0.096 n=6
Emit Time 4.67s (± 0.79%) 4.68s (± 0.76%) ~ 4.62s 4.71s p=0.744 n=6
Total Time 16.85s (± 0.29%) 16.91s (± 0.29%) ~ 16.84s 16.98s p=0.109 n=6
TFS - node (v14.21.3, x64)
Memory used 296,190k (± 0.00%) 296,190k (± 0.00%) ~ 296,177k 296,210k p=0.873 n=6
Parse Time 2.42s (± 0.97%) 2.43s (± 0.89%) ~ 2.40s 2.46s p=0.211 n=6
Bind Time 1.08s (± 0.76%) 1.08s (± 0.59%) ~ 1.07s 1.09s p=0.432 n=6
Check Time 7.63s (± 0.92%) 7.64s (± 0.67%) ~ 7.59s 7.70s p=0.568 n=6
Emit Time 4.29s (± 0.52%) 4.29s (± 1.04%) ~ 4.25s 4.37s p=1.000 n=6
Total Time 15.40s (± 0.33%) 15.45s (± 0.46%) ~ 15.38s 15.57s p=0.261 n=6
material-ui - node (v14.21.3, x64)
Memory used 477,351k (± 0.00%) 477,787k (± 0.00%) +436k (+ 0.09%) 477,758k 477,820k p=0.005 n=6
Parse Time 3.31s (± 0.43%) 3.31s (± 0.32%) ~ 3.29s 3.32s p=0.564 n=6
Bind Time 0.99s (± 0.52%) 0.99s (± 0.55%) ~ 0.99s 1.00s p=0.640 n=6
Check Time 19.22s (± 0.43%) 19.56s (± 0.53%) +0.33s (+ 1.73%) 19.42s 19.73s p=0.005 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.53s (± 0.36%) 23.86s (± 0.47%) +0.33s (+ 1.41%) 23.72s 24.05s p=0.005 n=6
xstate - node (v14.21.3, x64)
Memory used 550,147k (± 0.00%) 550,341k (± 0.01%) +193k (+ 0.04%) 550,309k 550,416k p=0.005 n=6
Parse Time 4.19s (± 0.39%) 4.22s (± 0.33%) +0.03s (+ 0.64%) 4.20s 4.24s p=0.029 n=6
Bind Time 1.70s (± 0.58%) 1.70s (± 0.48%) ~ 1.69s 1.71s p=0.862 n=6
Check Time 3.14s (± 0.79%) 3.23s (± 0.36%) +0.09s (+ 2.86%) 3.22s 3.25s p=0.005 n=6
Emit Time 0.09s (± 4.45%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=0.405 n=6
Total Time 9.13s (± 0.26%) 9.25s (± 0.25%) +0.12s (+ 1.31%) 9.21s 9.28s p=0.005 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.21.3, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.21.3, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.21.3, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.21.3, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.21.3, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.21.3, x64)
Benchmark Name Iterations
Current 54753 6
Baseline main 6

TSServer

Comparison Report - main..54753
Metric main 54753 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,539ms (± 0.29%) 2,527ms (± 1.24%) ~ 2,478ms 2,574ms p=0.229 n=6
Req 2 - geterr 5,399ms (± 0.46%) 5,424ms (± 0.85%) ~ 5,387ms 5,488ms p=0.336 n=6
Req 3 - references 340ms (± 0.85%) 340ms (± 1.28%) ~ 335ms 347ms p=0.687 n=6
Req 4 - navto 290ms (± 1.18%) 289ms (± 0.81%) ~ 287ms 293ms p=0.325 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 76ms (± 1.11%) 76ms (± 1.08%) ~ 75ms 77ms p=1.000 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,623ms (± 0.47%) 2,626ms (± 0.80%) ~ 2,592ms 2,645ms p=0.810 n=6
Req 2 - geterr 4,145ms (± 0.46%) 4,128ms (± 0.50%) ~ 4,106ms 4,163ms p=0.173 n=6
Req 3 - references 352ms (± 0.95%) 349ms (± 0.50%) ~ 346ms 351ms p=0.195 n=6
Req 4 - navto 290ms (± 0.71%) 288ms (± 0.34%) -3ms (- 0.86%) 287ms 289ms p=0.022 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 82ms (± 5.74%) 77ms (± 3.18%) 🟩-5ms (- 5.52%) 72ms 78ms p=0.025 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,092ms (± 0.63%) 3,080ms (± 0.16%) ~ 3,075ms 3,088ms p=0.471 n=6
Req 2 - geterr 1,601ms (± 0.39%) 1,645ms (± 0.52%) +44ms (+ 2.76%) 1,632ms 1,654ms p=0.005 n=6
Req 3 - references 118ms (± 6.47%) 116ms (± 1.86%) ~ 113ms 119ms p=0.372 n=6
Req 4 - navto 370ms (± 0.56%) 370ms (± 0.63%) ~ 367ms 373ms p=0.622 n=6
Req 5 - completionInfo count 2,872 (± 0.00%) 2,872 (± 0.00%) ~ 2,872 2,872 p=1.000 n=6
Req 5 - completionInfo 387ms (± 2.01%) 391ms (± 2.15%) ~ 383ms 404ms p=0.810 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,624ms (± 0.34%) 2,615ms (± 0.61%) ~ 2,600ms 2,639ms p=0.297 n=6
Req 2 - geterr 6,072ms (± 0.56%) 6,063ms (± 0.33%) ~ 6,033ms 6,096ms p=0.471 n=6
Req 3 - references 356ms (± 0.46%) 356ms (± 1.00%) ~ 352ms 362ms p=0.618 n=6
Req 4 - navto 284ms (± 0.69%) 284ms (± 0.84%) ~ 283ms 289ms p=0.446 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 80ms (± 0.51%) 81ms (± 0.93%) ~ 80ms 82ms p=0.100 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,808ms (± 0.75%) 2,817ms (± 0.41%) ~ 2,798ms 2,831ms p=0.422 n=6
Req 2 - geterr 4,704ms (± 0.39%) 4,688ms (± 0.41%) ~ 4,659ms 4,717ms p=0.173 n=6
Req 3 - references 365ms (± 0.48%) 364ms (± 0.38%) ~ 362ms 366ms p=0.120 n=6
Req 4 - navto 284ms (± 1.60%) 281ms (± 0.45%) ~ 279ms 283ms p=0.285 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 80ms (± 6.18%) 76ms (± 2.04%) ~ 74ms 78ms p=0.102 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,224ms (± 0.41%) 3,229ms (± 0.24%) ~ 3,216ms 3,239ms p=0.689 n=6
Req 2 - geterr 1,756ms (± 0.44%) 1,799ms (± 1.23%) +43ms (+ 2.43%) 1,771ms 1,832ms p=0.005 n=6
Req 3 - references 123ms (± 1.03%) 133ms (± 8.24%) +10ms (+ 8.40%) 125ms 148ms p=0.005 n=6
Req 4 - navto 354ms (± 1.17%) 352ms (± 0.29%) ~ 351ms 353ms p=0.198 n=6
Req 5 - completionInfo count 2,872 (± 0.00%) 2,872 (± 0.00%) ~ 2,872 2,872 p=1.000 n=6
Req 5 - completionInfo 421ms (± 1.23%) 411ms (± 1.07%) -10ms (- 2.42%) 403ms 415ms p=0.008 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,759ms (± 0.60%) 2,766ms (± 0.34%) ~ 2,755ms 2,782ms p=0.520 n=6
Req 2 - geterr 6,204ms (± 0.35%) 6,211ms (± 0.36%) ~ 6,184ms 6,248ms p=1.000 n=6
Req 3 - references 362ms (± 0.48%) 364ms (± 1.24%) ~ 359ms 372ms p=0.462 n=6
Req 4 - navto 293ms (± 1.10%) 291ms (± 0.86%) ~ 288ms 295ms p=0.162 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 100ms (± 6.93%) 103ms (± 8.06%) ~ 91ms 111ms p=0.570 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,934ms (± 0.29%) 2,930ms (± 0.28%) ~ 2,921ms 2,943ms p=0.422 n=6
Req 2 - geterr 4,581ms (± 0.53%) 4,582ms (± 0.48%) ~ 4,552ms 4,613ms p=1.000 n=6
Req 3 - references 370ms (± 0.47%) 369ms (± 0.57%) ~ 367ms 372ms p=0.568 n=6
Req 4 - navto 298ms (± 0.30%) 298ms (± 0.18%) ~ 297ms 298ms p=0.341 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 84ms (± 0.49%) 88ms (± 7.80%) ~ 83ms 101ms p=0.103 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 3,497ms (± 1.38%) 3,494ms (± 1.22%) ~ 3,414ms 3,542ms p=1.000 n=6
Req 2 - geterr 1,871ms (± 0.53%) 1,909ms (± 0.66%) +38ms (+ 2.04%) 1,893ms 1,922ms p=0.005 n=6
Req 3 - references 153ms (± 0.76%) 145ms (± 8.60%) ~ 133ms 160ms p=0.627 n=6
Req 4 - navto 388ms (± 0.82%) 389ms (± 1.32%) ~ 385ms 399ms p=1.000 n=6
Req 5 - completionInfo count 2,872 (± 0.00%) 2,872 (± 0.00%) ~ 2,872 2,872 p=1.000 n=6
Req 5 - completionInfo 423ms (± 1.12%) 422ms (± 1.04%) ~ 415ms 425ms p=0.572 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.21.3, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.21.3, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.21.3, x64)
Benchmark Name Iterations
Current 54753 6
Baseline main 6

Startup

Comparison Report - main..54753
Metric main 54753 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 142.95ms (± 0.21%) 143.28ms (± 0.22%) +0.33ms (+ 0.23%) 142.27ms 146.76ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 222.80ms (± 0.34%) 222.71ms (± 0.19%) -0.09ms (- 0.04%) 221.65ms 228.28ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 223.58ms (± 0.25%) 223.98ms (± 0.16%) +0.40ms (+ 0.18%) 223.06ms 229.56ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 205.83ms (± 0.22%) 205.88ms (± 0.19%) +0.05ms (+ 0.02%) 205.08ms 215.57ms p=0.014 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
Benchmark Name Iterations
Current 54753 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

Hey @sandersn, the results of running the DT tests are ready.
There were interesting changes:

Branch only errors:

Package: ember/v2
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v2/test/array.ts:16:20
ERROR: 16:20   expect  TypeScript@local compile error: 
Argument of type 'Fix<{ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }> | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'Object'.
ERROR: 23:20   expect  TypeScript@local compile error: 
Argument of type 'Fix<{ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }> | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v2/test/ember-tests.ts:129:25
ERROR: 129:25  expect  TypeScript@local compile error: 
Argument of type '"isHappy"' is not assignable to parameter of type '"toString" | "get" | "getProperties" | "set" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | "decrementProperty" | ... 8 more ... | "willDestroy"'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v2/test/extend.ts:16:37
ERROR: 16:37   expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'Object'.
ERROR: 17:43   expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v2/test/reopen.ts:12:20
ERROR: 12:20   expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof Object> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & Object) & (new (...args: any[]) => { name: string; sayHello(): void; } & Object)> & (new (properties?: object | undefined) => { ...; } & Object) & (new (...args: any[]) => { ...; } & Object)' is not assignable to parameter of type 'Object'.
ERROR: 35:8    expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'Object'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember__array
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__array/test/array.ts:15:20
ERROR: 15:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 16:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 33:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember__object
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__object/test/extend.ts:16:37
ERROR: 16:37  expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'EmberObject'.
ERROR: 17:43  expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'EmberObject'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__object/test/reopen.ts:13:20
ERROR: 13:20  expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof EmberObject> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & EmberObject) & (new (...args: any[]) => { ...; } & EmberObject)> & (new (properties?: object | undefined) => { ...; } & EmberObject) & (new (...args: any[]) => { ...; } & EmberObject)' is not assignable to parameter of type 'EmberObject'.
ERROR: 42:8   expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'EmberObject'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember__array/v3
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__array/v3/test/array.ts:15:20
ERROR: 15:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 16:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 28:1   expect  TypeScript@local expected type to be:
  any
got:
  EmberObject
ERROR: 28:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember__object/v3
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__object/v3/test/extend.ts:16:37
ERROR: 16:37  expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'EmberObject'.
ERROR: 17:43  expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'EmberObject'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__object/v3/test/reopen.ts:13:20
ERROR: 13:20  expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof EmberObject> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & EmberObject) & (new (...args: any[]) => { ...; } & EmberObject)> & (new (properties?: object | undefined) => { ...; } & EmberObject) & (new (...args: any[]) => { ...; } & EmberObject)' is not assignable to parameter of type 'EmberObject'.
ERROR: 42:8   expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'EmberObject'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/test/array.ts:16:20
ERROR: 16:20   expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 25:20   expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'EmberObject'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/test/ember-tests.ts:141:25
ERROR: 141:25  expect  TypeScript@local compile error: 
Argument of type '"isHappy"' is not assignable to parameter of type 'keyof Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/test/extend.ts:16:37
ERROR: 16:37   expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'Object'.
ERROR: 17:43   expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/test/reopen.ts:12:20
ERROR: 12:20   expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof Object> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & Object) & (new (...args: any[]) => { name: string; sayHello(): void; } & Object)> & (new (properties?: object | undefined) => { ...; } & Object) & (new (...args: any[]) => { ...; } & Object)' is not assignable to parameter of type 'Object'.
ERROR: 39:8    expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'Object'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember/v3
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v3/test/array.ts:16:20
ERROR: 16:20   expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 23:20   expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'EmberObject'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v3/test/ember-tests.ts:129:25
ERROR: 129:25  expect  TypeScript@local compile error: 
Argument of type '"isHappy"' is not assignable to parameter of type 'keyof Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v3/test/extend.ts:16:37
ERROR: 16:37   expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'Object'.
ERROR: 17:43   expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v3/test/reopen.ts:12:20
ERROR: 12:20   expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof Object> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & Object) & (new (...args: any[]) => { name: string; sayHello(): void; } & Object)> & (new (properties?: object | undefined) => { ...; } & Object) & (new (...args: any[]) => { ...; } & Object)' is not assignable to parameter of type 'Object'.
ERROR: 39:8    expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'Object'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

You can check the log here.

@Andarist
Copy link
Contributor Author

Hm, ye - definitely something is wrong here. Especially the DefinitelyTyped errors are interesting. I'll have to investigate this further later this week.

@sandersn
Copy link
Member

material-ui check time is slower across node versions, by 1-2%. I'm not sure what the cutoff is for slowdowns.

@jakebailey
Copy link
Member

The RWC script failed to post a comment, retrying with an updated token, but it does appear to have caused a break there.

@typescript-bot test this

@jakebailey
Copy link
Member

RWC is still busted but I'll run everything and I can at least see if it failed. Really gotta get that infra replaced.

@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot run dt
@typescript-bot perf test this faster
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 26, 2023

Heya @jakebailey, I've started to run the tarball bundle task on this PR at 184e1c7. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 26, 2023

Heya @jakebailey, I've started to run the extended test suite on this PR at 184e1c7. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 26, 2023

Heya @jakebailey, I've started to run the abridged perf test suite on this PR at 184e1c7. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 26, 2023

Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 184e1c7. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 26, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 184e1c7. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 26, 2023

Heya @jakebailey, I've started to run the parallelized Definitely Typed test suite on this PR at 184e1c7. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/156028/artifacts?artifactName=tgz&fileId=DE40E201CFCF1334EB94B35E1ADA2F74E9632E226FC44E9782000BC069C9828202&fileName=/typescript-5.2.0-insiders.20230726.tgz"
    }
}

and then running npm install.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..54753

Metric main 54753 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 368,198k (± 0.00%) 368,298k (± 0.00%) +100k (+ 0.03%) 368,278k 368,318k p=0.005 n=6
Parse Time 3.55s (± 0.39%) 3.57s (± 0.54%) ~ 3.53s 3.58s p=0.188 n=6
Bind Time 1.19s (± 0.43%) 1.18s (± 1.15%) ~ 1.17s 1.21s p=0.056 n=6
Check Time 9.76s (± 0.45%) 9.72s (± 0.65%) ~ 9.65s 9.83s p=0.089 n=6
Emit Time 8.03s (± 1.17%) 7.97s (± 0.45%) ~ 7.92s 8.03s p=0.253 n=6
Total Time 22.54s (± 0.55%) 22.44s (± 0.27%) ~ 22.36s 22.54s p=0.261 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,869k (± 0.03%) 194,304k (± 0.01%) +436k (+ 0.22%) 194,273k 194,336k p=0.005 n=6
Parse Time 1.58s (± 1.67%) 1.59s (± 0.65%) ~ 1.57s 1.60s p=0.867 n=6
Bind Time 0.83s (± 0.62%) 0.82s (± 1.25%) ~ 0.81s 0.83s p=0.774 n=6
Check Time 10.19s (± 0.69%) 10.18s (± 0.34%) ~ 10.14s 10.22s p=1.000 n=6
Emit Time 3.02s (± 0.85%) 3.01s (± 0.28%) ~ 2.99s 3.01s p=0.170 n=6
Total Time 15.62s (± 0.43%) 15.59s (± 0.12%) ~ 15.57s 15.62s p=0.569 n=6
Monaco - node (v16.17.1, x64)
Memory used 347,078k (± 0.01%) 347,075k (± 0.01%) ~ 347,030k 347,109k p=0.810 n=6
Parse Time 2.76s (± 0.53%) 2.77s (± 0.59%) ~ 2.75s 2.80s p=0.166 n=6
Bind Time 1.08s (± 0.59%) 1.08s (± 0.70%) ~ 1.07s 1.09s p=0.718 n=6
Check Time 8.03s (± 0.62%) 8.04s (± 0.44%) ~ 7.99s 8.07s p=0.870 n=6
Emit Time 4.48s (± 1.04%) 4.48s (± 0.93%) ~ 4.41s 4.51s p=0.624 n=6
Total Time 16.36s (± 0.56%) 16.37s (± 0.31%) ~ 16.31s 16.45s p=0.809 n=6
TFS - node (v16.17.1, x64)
Memory used 301,106k (± 0.00%) 301,113k (± 0.00%) ~ 301,101k 301,137k p=0.228 n=6
Parse Time 2.20s (± 0.78%) 2.21s (± 0.25%) ~ 2.20s 2.21s p=0.154 n=6
Bind Time 1.21s (± 0.86%) 1.22s (± 1.59%) ~ 1.19s 1.24s p=0.256 n=6
Check Time 7.33s (± 0.49%) 7.32s (± 0.22%) ~ 7.30s 7.34s p=0.627 n=6
Emit Time 4.34s (± 0.86%) 4.35s (± 0.66%) ~ 4.32s 4.40s p=0.747 n=6
Total Time 15.08s (± 0.60%) 15.10s (± 0.24%) ~ 15.05s 15.14s p=0.810 n=6
material-ui - node (v16.17.1, x64)
Memory used 481,842k (± 0.01%) 517,885k (± 0.01%) +36,043k (+ 7.48%) 517,847k 517,938k p=0.005 n=6
Parse Time 3.25s (± 0.66%) 3.26s (± 0.57%) ~ 3.24s 3.29s p=0.368 n=6
Bind Time 0.96s (± 1.08%) 0.96s (± 0.78%) ~ 0.95s 0.97s p=0.931 n=6
Check Time 18.31s (± 0.16%) 18.47s (± 0.70%) +0.16s (+ 0.88%) 18.39s 18.71s p=0.005 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.52s (± 0.10%) 22.69s (± 0.63%) +0.17s (+ 0.75%) 22.59s 22.96s p=0.005 n=6
xstate - node (v16.17.1, x64)
Memory used 561,412k (± 0.01%) 562,058k (± 0.02%) +646k (+ 0.12%) 561,960k 562,269k p=0.005 n=6
Parse Time 4.01s (± 0.37%) 4.02s (± 0.21%) ~ 4.02s 4.04s p=0.241 n=6
Bind Time 1.74s (± 4.24%) 1.75s (± 3.86%) ~ 1.62s 1.81s p=0.746 n=6
Check Time 3.07s (± 1.31%) 3.04s (± 1.55%) -0.03s (- 1.03%) 3.00s 3.13s p=0.041 n=6
Emit Time 0.10s (± 5.76%) 0.09s (± 4.45%) ~ 0.09s 0.10s p=0.282 n=6
Total Time 8.92s (± 0.39%) 8.90s (± 0.51%) ~ 8.84s 8.95s p=0.689 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 54753 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user test suite comparing main and refs/pull/54753/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

rxjs-src

/mnt/ts_downloads/rxjs-src/build.sh

  • [NEW] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54753/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
  • [MISSING] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top-repos suite comparing main and refs/pull/54753/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.
There were interesting changes:

Branch only errors:

Package: ember
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/test/array.ts:16:20
ERROR: 16:20   expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 25:20   expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'EmberObject'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/test/ember-tests.ts:141:25
ERROR: 141:25  expect  TypeScript@local compile error: 
Argument of type '"isHappy"' is not assignable to parameter of type 'keyof Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/test/extend.ts:16:37
ERROR: 16:37   expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'Object'.
ERROR: 17:43   expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/test/reopen.ts:12:20
ERROR: 12:20   expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof Object> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & Object) & (new (...args: any[]) => { name: string; sayHello(): void; } & Object)> & (new (properties?: object | undefined) => { ...; } & Object) & (new (...args: any[]) => { ...; } & Object)' is not assignable to parameter of type 'Object'.
ERROR: 39:8    expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'Object'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember/v3
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v3/test/array.ts:16:20
ERROR: 16:20   expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 23:20   expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'EmberObject'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v3/test/ember-tests.ts:129:25
ERROR: 129:25  expect  TypeScript@local compile error: 
Argument of type '"isHappy"' is not assignable to parameter of type 'keyof Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v3/test/extend.ts:16:37
ERROR: 16:37   expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'Object'.
ERROR: 17:43   expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v3/test/reopen.ts:12:20
ERROR: 12:20   expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof Object> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & Object) & (new (...args: any[]) => { name: string; sayHello(): void; } & Object)> & (new (properties?: object | undefined) => { ...; } & Object) & (new (...args: any[]) => { ...; } & Object)' is not assignable to parameter of type 'Object'.
ERROR: 39:8    expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'Object'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember/v2
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v2/test/array.ts:16:20
ERROR: 16:20   expect  TypeScript@local compile error: 
Argument of type 'Fix<{ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }> | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'Object'.
ERROR: 23:20   expect  TypeScript@local compile error: 
Argument of type 'Fix<{ name: string; isHappy: boolean; } & Object & { name: string; isHappy: boolean; }> | undefined' is not assignable to parameter of type 'Object'.
  Type 'undefined' is not assignable to type 'Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v2/test/ember-tests.ts:129:25
ERROR: 129:25  expect  TypeScript@local compile error: 
Argument of type '"isHappy"' is not assignable to parameter of type '"toString" | "get" | "getProperties" | "set" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | "decrementProperty" | ... 8 more ... | "willDestroy"'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v2/test/extend.ts:16:37
ERROR: 16:37   expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'Object'.
ERROR: 17:43   expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'Object'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember/v2/test/reopen.ts:12:20
ERROR: 12:20   expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof Object> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & Object) & (new (...args: any[]) => { name: string; sayHello(): void; } & Object)> & (new (properties?: object | undefined) => { ...; } & Object) & (new (...args: any[]) => { ...; } & Object)' is not assignable to parameter of type 'Object'.
ERROR: 35:8    expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'Object'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember__array
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__array/test/array.ts:15:20
ERROR: 15:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 16:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 33:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember__object
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__object/test/extend.ts:16:37
ERROR: 16:37  expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'EmberObject'.
ERROR: 17:43  expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'EmberObject'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__object/test/reopen.ts:13:20
ERROR: 13:20  expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof EmberObject> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & EmberObject) & (new (...args: any[]) => { ...; } & EmberObject)> & (new (properties?: object | undefined) => { ...; } & EmberObject) & (new (...args: any[]) => { ...; } & EmberObject)' is not assignable to parameter of type 'EmberObject'.
ERROR: 42:8   expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'EmberObject'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember__array/v3
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__array/v3/test/array.ts:15:20
ERROR: 15:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 16:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.
ERROR: 28:1   expect  TypeScript@local expected type to be:
  any
got:
  EmberObject
ERROR: 28:20  expect  TypeScript@local compile error: 
Argument of type '({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined' is not assignable to parameter of type 'EmberObject'.
  Type 'undefined' is not assignable to type 'EmberObject'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: ember__object/v3
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__object/v3/test/extend.ts:16:37
ERROR: 16:37  expect  TypeScript@local compile error: 
Property 'firstName' does not exist on type 'EmberObject'.
ERROR: 17:43  expect  TypeScript@local compile error: 
Property 'getFullName' does not exist on type 'EmberObject'.

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ember__object/v3/test/reopen.ts:13:20
ERROR: 13:20  expect  TypeScript@local compile error: 
Argument of type 'Readonly<Readonly<typeof EmberObject> & (new (properties?: object | undefined) => { name: string; sayHello(): void; } & EmberObject) & (new (...args: any[]) => { ...; } & EmberObject)> & (new (properties?: object | undefined) => { ...; } & EmberObject) & (new (...args: any[]) => { ...; } & EmberObject)' is not assignable to parameter of type 'EmberObject'.
ERROR: 42:8   expect  TypeScript@local compile error: 
Property 'sayHello' does not exist on type 'EmberObject'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

You can check the log here.

@jakebailey
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 26, 2023

Heya @jakebailey, I've started to run the tarball bundle task on this PR at 184e1c7. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 26, 2023

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/156036/artifacts?artifactName=tgz&fileId=DE40E201CFCF1334EB94B35E1ADA2F74E9632E226FC44E9782000BC069C9828202&fileName=/typescript-5.2.0-insiders.20230726.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/[email protected]".;

@Andarist
Copy link
Contributor Author

Andarist commented Jul 27, 2023

There is still perf impact here that I have to investigate (and code cleanup) but it seems that now we are sitting only on the Ember-related breaks.

This break can be narrowed down to this:

declare class EmberObject {}

type PersonType = Readonly<typeof EmberObject> &
  (new (properties?: object) => {
    firstName: string;
    lastName: string;
  } & EmberObject) &
  (new (...args: any[]) => {
    firstName: string;
    lastName: string;
  } & EmberObject);

type PersonPrototype = PersonType["prototype"];
//   ^? 5.1: any; this PR: EmberObject

Since those assertions in Ember-related tests are doing things like:

assertType<string>(Person.prototype.firstName);

I'd call them broken in the first place because they just rely on any.

A mapped type (like Readonly) applied on a class loses its construct signatures but it doesn't lose properties like prototype. Let's make some tests:

type A = "prototype" extends keyof typeof EmberObject ? 1 : 0;
//  ^? type A = 1
type B = "prototype" extends keyof Readonly<typeof EmberObject> ? 1 : 0;
//  ^? type B = 1
type C = (typeof EmberObject)["prototype"];
//  ^? type C = EmberObject
type D = Readonly<typeof EmberObject>["prototype"];
//  ^? type D = EmberObject

type ConstructSignature = new (...args: any[]) => {
  firstName: string;
  lastName: string;
} & EmberObject;

type E = "prototype" extends keyof ConstructSignature ? 1 : 0;
//  ^? type E = 0
type F = ConstructSignature["prototype"];
//  ^? type F = any  

So far we established that "own" properties (not from the object/function augment) should take priority over the augment in intersections. Given this desired semantic, this break looks desired to me. WDYT @sandersn ?

cc @chriskrycho @wagenet @gitKrystan @jamescdavis (Ember's typedef owners)

@wagenet
Copy link

wagenet commented Jul 27, 2023

I can verify that the existing tests are broken. Types for EmberObject are significantly limited and the class will be going away entirely in the future so we were unlikely to actually fix those anyway.

@sandersn
Copy link
Member

To check my understanding:

  1. assertType<string>(Person.prototype.firstName); currently works because Person.prototype.firstName: any, right?
    For the new code, I don't see a simple way to make an intersection propagate through prototype -- you'd have to add special-case code specifically for an object with prototype when intersected with an object with a new signature.

  2. type E = "prototype" extends ConstructSignature ? 1 : 0; should be extends keyof ConstructSignature, right?

If the only breaks are in old versions of Ember, I'd guess that this pattern is not that common and is OK to not support (either correctly, or by inadvertent any like today).

@Andarist
Copy link
Contributor Author

assertType(Person.prototype.firstName); currently works because Person.prototype.firstName: any, right?

Yes.

For the new code, I don't see a simple way to make an intersection propagate through prototype -- you'd have to add special-case code specifically for an object with prototype when intersected with an object with a new signature.

Yes, that's probably what would have to be done. It would probably be good to break this down into some cases that might be desirable/practical. Do you have anything in particular in mind?

type E = "prototype" extends ConstructSignature ? 1 : 0; should be extends keyof ConstructSignature, right?

Yes, my bad - it doesn't change the result though.

If the only breaks are in old versions of Ember, I'd guess that this pattern is not that common and is OK to not support (either correctly, or by inadvertent any like today).

Should I assume then that this PR is something that you want to pull in and that I should investigate how to improve the perf?

@sandersn
Copy link
Member

Should I assume then that this PR is something that you want to pull in and that I should investigate how to improve the perf?

Yes. I don't think it's worth pursuing special case prototype in intersections.

@chriskrycho
Copy link

Just got back from vacation and saw this – yeah, given the existing reliance on any in the old assertType tests, that seems broken. I would want to make sure we do not lose the production of new types via .extend(), which is what I think this was ultimately being used for; but the tests were "doing it wrong" (albeit in ways that made a lot more sense in the TS 2.4–2.6 era when we wrote that!).

The reason I want to avoid breaking that is: a lot of real-world (legacy, but real) code relies on it, including code that makes other major Ember packages work. Ember's just-shipped-last-month official types don't support that at all, and we're using the DT types as the fallback for folks who are working through that transition.

But from what I can tell, this should still be fine? Assuming so, :shipit:

@sandersn sandersn merged commit 0e61018 into microsoft:main Nov 29, 2023
sandersn added a commit to sandersn/DefinitelyTyped that referenced this pull request Nov 30, 2023
Ember is broken by microsoft/TypeScript#54753

The discussion on this PR ending at
microsoft/TypeScript#54753 (comment)
makes me think that these breaks are acceptable where they aren't strict
improvements.
sandersn added a commit to DefinitelyTyped/DefinitelyTyped that referenced this pull request Dec 1, 2023
* Update ember for TS 5.4

Ember is broken by microsoft/TypeScript#54753

The discussion on this PR ending at
microsoft/TypeScript#54753 (comment)
makes me think that these breaks are acceptable where they aren't strict
improvements.

* update ExpectType for ember__array/v3

* dprint fmt
@Andarist Andarist deleted the avoid-global-augmentations-when-relating-props-of-intersections branch February 14, 2024 11:01
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
Archived in project
Development

Successfully merging this pull request may close these issues.

Inference fails for intersection of types with a toString property on a branch
6 participants