microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
98.27k stars 12.2k forks source link

Fix ghost errors resulting from out-of-order type checking #58337

Closed ahejlsberg closed 2 weeks ago

ahejlsberg commented 2 weeks ago

This PR introduces logic that suppresses ghost errors resulting from "inverted" type checking situations where, for example, an API client asks for the type of a symbol in the middle of a section of code, causing type resolution to occur in a different order than when the code is checked from top to bottom in a regular compilation.

Some context on the fix in this PR. In this example

function builder(def: IThing) {
  return def;
}

interface IThing {
  doThing: (args: { value: object }) => string
  args: { value: number }
}

builder({
  doThing(args: { value: object }) {
    const { value } = this.args;  // Ghost circularity error on "value"
    return `${value}`
  },
  args: { value: 42 }
});

a circularity error is reported in the VS Code IDE, but no error is reported with the command-line compiler. The issue is that the IDE language service requests type information on identifiers in the code (likely for semantic classification, but doesn't really matter) before it requests the full list of diagnostics for the code. Specifically, a request is initially made for getTypeOfSymbol for the symbol of the value identifier. This causes resolution of this.args, and to resolve the type of this, a request is made for the contextual type of the object literal passed as an argument in the builder({...}) call. That in turn means we need to resolve the signature for the call, which in turn means resolving the type of the arguments, which in turn means obtaining the type of the {...} object literal argument, which further requires resolving the return type of doThing, which gets us back to a second getTypeOfSymbol call for value. And we have a circularity.

However, in the regular top-to-bottom sweep to produce diagnostics, we request resolving the signature of the builder({...}) call first, which eventually gets us to a getTypeOfSymbol for value, which in turn requests the contextual type for the object literal. We then see that we're in the process of resolving the signature of the containing builder({...}) call, and therefore we simply report that there is no contextual type. And thus no circularity.

With the fix in this PR, we temporarily reset the resolution stack during getResolvedSignature calls. In the IDE scenario this means that the first call to getTypeOfSymbol is no longer reflected on the resolution stack, so resolution can proceed in the same manner as the regular case. Following that, the outer getTypeOfSymbol call notices that a resolved type has already been recorded, so it simply proceeds with that. No circularity, and all is well.

Fixes #57429. Fixes #57585.

ahejlsberg commented 2 weeks ago

@typescript-bot test it

typescript-bot commented 2 weeks ago

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
ahejlsberg commented 2 weeks ago

@typescript-bot pack this

typescript-bot commented 2 weeks ago

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

Command Status Results
pack this ✅ Started ✅ Results
typescript-bot commented 2 weeks ago

Hey @ahejlsberg, 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/161498/artifacts?artifactName=tgz&fileId=FC3BCEFCEC65EC0872BF4A014DB519141AE7906101F9BC5D7289BBA167D4517302&fileName=/typescript-5.5.0-insiders.20240426.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/pr-build@5.5.0-pr-58337-4".;

jakebailey commented 2 weeks ago

You should be able to pull the tests from Andarist's comments, i.e. copy these ones: https://github.com/microsoft/TypeScript/pull/58323/files#diff-8814cff6472937bf39f151270b038e16552d0896cc67cb5c5382aa432c909acf (though with better filenames than mine)

I tested locally by pulling this code into my branch and it seemed to work!

typescript-bot commented 2 weeks ago

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

Everything looks the same!

You can check the log here.

typescript-bot commented 2 weeks ago

@ahejlsberg Here are the results of running the user tests comparing main and refs/pull/58337/merge:

Something interesting changed - please have a look.

Details

webpack

### [tsconfig.types.json](https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/tsconfig.types.json) - [NEW] `error TS2322: Type '{ name: string; canMangle: boolean; exports: any; }[] | undefined' is not assignable to type 'true | (string | ExportSpec)[] | null'.` - [lib\/dependencies\/JsonExportsDependency.js\#L68](https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/lib/dependencies/JsonExportsDependency.js#L68) - [NEW] `error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.` - [lib\/hmr\/HotModuleReplacement.runtime.js\#L369](https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/lib/hmr/HotModuleReplacement.runtime.js#L369)
typescript-bot commented 2 weeks ago

@ahejlsberg 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,154 62,154 ~ ~ ~ p=1.000 n=6
Types 50,273 50,273 ~ ~ ~ p=1.000 n=6
Memory used 193,300k (± 0.94%) 192,767k (± 0.76%) ~ 192,082k 195,748k p=0.230 n=6
Parse Time 1.63s (± 1.39%) 1.64s (± 1.93%) ~ 1.60s 1.67s p=0.224 n=6
Bind Time 0.87s (± 0.97%) 0.87s (± 1.03%) ~ 0.86s 0.88s p=0.339 n=6
Check Time 11.35s (± 0.46%) 11.29s (± 0.44%) ~ 11.22s 11.36s p=0.065 n=6
Emit Time 3.12s (± 1.08%) 3.15s (± 0.63%) ~ 3.13s 3.18s p=0.103 n=6
Total Time 16.97s (± 0.48%) 16.95s (± 0.45%) ~ 16.88s 17.05s p=0.745 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 945,172 945,322 +150 (+ 0.02%) ~ ~ p=0.001 n=6
Types 408,068 408,088 +20 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 1,221,995k (± 0.00%) 1,222,028k (± 0.01%) ~ 1,221,932k 1,222,107k p=0.297 n=6
Parse Time 8.21s (± 0.34%) 8.22s (± 0.46%) ~ 8.17s 8.28s p=0.573 n=6
Bind Time 2.23s (± 0.69%) 2.24s (± 0.59%) ~ 2.22s 2.25s p=0.242 n=6
Check Time 36.61s (± 0.32%) 36.70s (± 0.34%) ~ 36.59s 36.92s p=0.173 n=6
Emit Time 17.47s (± 0.33%) 17.49s (± 0.95%) ~ 17.27s 17.73s p=1.000 n=6
Total Time 64.52s (± 0.30%) 64.65s (± 0.36%) ~ 64.32s 64.99s p=0.298 n=6
mui-docs - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 1,954,635 1,954,717 +82 (+ 0.00%) ~ ~ p=0.001 n=6
Types 676,418 676,452 +34 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 1,753,418k (± 0.00%) 1,753,447k (± 0.00%) ~ 1,753,425k 1,753,475k p=0.065 n=6
Parse Time 6.90s (± 0.45%) 6.90s (± 0.35%) ~ 6.87s 6.94s p=0.558 n=6
Bind Time 2.31s (± 0.58%) 2.31s (± 0.24%) ~ 2.30s 2.31s p=0.663 n=6
Check Time 56.82s (± 0.23%) 56.88s (± 0.43%) ~ 56.58s 57.17s p=0.810 n=6
Emit Time 0.14s (± 5.31%) 0.14s (± 7.20%) ~ 0.13s 0.16s p=0.931 n=6
Total Time 66.16s (± 0.19%) 66.22s (± 0.37%) ~ 65.95s 66.51s p=0.936 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,215,326 1,215,327 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 257,546 257,546 ~ ~ ~ p=1.000 n=6
Memory used 2,322,567k (± 0.03%) 2,556,537k (±14.16%) ~ 2,322,454k 3,024,744k p=0.298 n=6
Parse Time 7.55s (± 0.34%) 7.64s (± 1.55%) ~ 7.53s 7.85s p=0.066 n=6
Bind Time 2.73s (± 0.54%) 2.73s (± 1.24%) ~ 2.69s 2.77s p=0.806 n=6
Check Time 49.54s (± 0.61%) 49.80s (± 0.78%) ~ 49.29s 50.27s p=0.298 n=6
Emit Time 4.01s (± 3.25%) 3.97s (± 0.85%) ~ 3.91s 4.00s p=0.520 n=6
Total Time 63.84s (± 0.51%) 64.14s (± 0.66%) ~ 63.60s 64.69s p=0.230 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,215,326 1,215,327 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 257,546 257,546 ~ ~ ~ p=1.000 n=6
Memory used 2,397,547k (± 0.03%) 2,397,197k (± 0.03%) ~ 2,396,608k 2,398,552k p=0.230 n=6
Parse Time 6.25s (± 0.53%) 6.30s (± 0.61%) +0.05s (+ 0.72%) 6.22s 6.32s p=0.044 n=6
Bind Time 1.98s (± 1.15%) 2.00s (± 1.24%) ~ 1.97s 2.03s p=0.318 n=6
Check Time 40.49s (± 0.47%) 40.55s (± 0.25%) ~ 40.42s 40.67s p=0.810 n=6
Emit Time 3.11s (± 1.98%) 3.14s (± 1.90%) ~ 3.06s 3.22s p=0.520 n=6
Total Time 51.86s (± 0.43%) 52.01s (± 0.26%) ~ 51.80s 52.20s p=0.173 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,101 256,102 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 103,616 103,616 ~ ~ ~ p=1.000 n=6
Memory used 424,123k (± 0.02%) 424,064k (± 0.01%) ~ 424,033k 424,085k p=0.109 n=6
Parse Time 4.30s (± 0.68%) 4.34s (± 0.61%) ~ 4.30s 4.36s p=0.053 n=6
Bind Time 1.61s (± 1.33%) 1.61s (± 1.28%) ~ 1.57s 1.63s p=0.871 n=6
Check Time 22.47s (± 0.45%) 22.50s (± 0.45%) ~ 22.38s 22.67s p=0.574 n=6
Emit Time 1.75s (± 1.12%) 1.76s (± 0.84%) ~ 1.74s 1.78s p=0.869 n=6
Total Time 30.14s (± 0.38%) 30.21s (± 0.33%) ~ 30.10s 30.36s p=0.199 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,824 224,824 ~ ~ ~ p=1.000 n=6
Types 93,390 93,390 ~ ~ ~ p=1.000 n=6
Memory used 369,286k (± 0.01%) 369,388k (± 0.05%) ~ 369,276k 369,742k p=0.173 n=6
Parse Time 3.68s (± 0.62%) 3.68s (± 0.59%) ~ 3.65s 3.71s p=1.000 n=6
Bind Time 1.94s (± 1.28%) 1.91s (± 1.22%) ~ 1.88s 1.95s p=0.105 n=6
Check Time 19.46s (± 0.41%) 19.44s (± 0.34%) ~ 19.32s 19.50s p=0.568 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.09s (± 0.30%) 25.03s (± 0.29%) ~ 24.90s 25.12s p=0.171 n=6
vscode - node (v18.15.0, x64)
Errors 4 4 ~ ~ ~ p=1.000 n=6
Symbols 2,797,174 2,797,178 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Types 950,074 950,076 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,925,297k (± 0.00%) 2,925,315k (± 0.00%) ~ 2,925,280k 2,925,373k p=0.199 n=6
Parse Time 16.56s (± 0.26%) 16.58s (± 0.36%) ~ 16.51s 16.68s p=0.748 n=6
Bind Time 4.93s (± 0.42%) 4.92s (± 0.51%) ~ 4.88s 4.95s p=0.739 n=6
Check Time 88.23s (± 0.41%) 88.12s (± 0.27%) ~ 87.78s 88.41s p=0.575 n=6
Emit Time 24.47s (± 7.77%) 24.58s (± 7.44%) ~ 23.62s 28.30s p=0.521 n=6
Total Time 134.19s (± 1.63%) 134.19s (± 1.40%) ~ 133.14s 138.00s p=0.689 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 265,853 265,858 +5 (+ 0.00%) ~ ~ p=0.001 n=6
Types 108,438 108,445 +7 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 410,403k (± 0.02%) 410,430k (± 0.02%) ~ 410,347k 410,509k p=0.521 n=6
Parse Time 4.89s (± 0.46%) 4.90s (± 0.72%) ~ 4.85s 4.94s p=0.685 n=6
Bind Time 2.08s (± 0.77%) 2.07s (± 0.83%) ~ 2.05s 2.09s p=0.321 n=6
Check Time 21.15s (± 0.32%) 21.14s (± 0.31%) ~ 21.09s 21.26s p=0.629 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.12s (± 0.20%) 28.11s (± 0.13%) ~ 28.07s 28.16s p=0.936 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 523,981 524,146 +165 (+ 0.03%) ~ ~ p=0.001 n=6
Types 178,708 178,732 +24 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 461,162k (± 0.01%) 461,212k (± 0.01%) ~ 461,124k 461,286k p=0.378 n=6
Parse Time 2.69s (± 0.87%) 2.68s (± 0.51%) ~ 2.66s 2.70s p=0.503 n=6
Bind Time 0.98s (± 0.42%) 0.98s (± 0.42%) ~ 0.97s 0.98s p=0.218 n=6
Check Time 15.45s (± 0.23%) 15.46s (± 0.22%) ~ 15.41s 15.50s p=0.520 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 19.11s (± 0.22%) 19.11s (± 0.19%) ~ 19.05s 19.15s p=0.687 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

DanielRosenwasser commented 2 weeks ago

Those webpack breaks are kind of weird.

@typescript-bot test top800

typescript-bot commented 2 weeks ago

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

Command Status Results
test top800 ✅ Started 👀 Results
ahejlsberg commented 2 weeks ago

@typescript-bot test it

typescript-bot commented 2 weeks ago

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
ahejlsberg commented 2 weeks ago

Those webpack breaks are kind of weird

With the temporary resetting of the resolution stack, it is now possible for getReturnTypeOfSignature to resolve the same signature twice in a nested manner. When that happens we should always keep the result of the first resolution to complete, and that's now happening with the latest commit.

typescript-bot commented 2 weeks ago

@ahejlsberg Here are the results of running the top 400 repos comparing main and refs/pull/58337/merge:

Something interesting changed - please have a look.

Details

compiler-explorer/compiler-explorer

**2 of 6 projects failed to build with the old tsc and were ignored** ### [tsconfig.tests.json](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/tsconfig.tests.json) - `error TS2339: Property 'name' does not exist on type 'String'.` - [lib\/cache\/on-disk.ts\#L66](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L66) - `error TS2339: Property 'fullPath' does not exist on type 'String'.` - [lib\/cache\/on-disk.ts\#L66](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L66) - `error TS18048: 'x' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L84](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L84) - `error TS18048: 'y' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L84](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L84) - `error TS18048: 'i' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L86](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L86) - [lib\/cache\/on-disk.ts\#L86](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L86) ### [tsconfig.json](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/tsconfig.json) - `error TS2339: Property 'name' does not exist on type 'String'.` - [lib\/cache\/on-disk.ts\#L66](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L66) - `error TS2339: Property 'fullPath' does not exist on type 'String'.` - [lib\/cache\/on-disk.ts\#L66](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L66) - `error TS18048: 'x' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L84](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L84) - `error TS18048: 'y' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L84](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L84) - `error TS18048: 'i' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L86](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L86) - [lib\/cache\/on-disk.ts\#L86](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L86)

reduxjs/redux

**2 of 5 projects failed to build with the old tsc and were ignored** ### [test\/tsconfig.json](https://github.com/reduxjs/redux/blob/c58086ed33b6abe0411edfd6e8ba372cfd6f66a2/test/tsconfig.json) - `error TS2345: Argument of type '(x: StoreEnhancerStoreCreator) => StoreEnhancerStoreCreator' is not assignable to parameter of type 'StoreEnhancer, {}>'.` - [test\/createStore.spec.ts\#L684](https://github.com/reduxjs/redux/blob/c58086ed33b6abe0411edfd6e8ba372cfd6f66a2/test/createStore.spec.ts#L684)

tinacms/tinacms

**11 of 24 projects failed to build with the old tsc and were ignored** ### [packages\/@tinacms\/cli\/tsconfig.json](https://github.com/tinacms/tinacms/blob/f921e327e8eccf888dab9004e42a6751aa518e9c/packages/@tinacms/cli/tsconfig.json) - `error TS2322: Type '(ctx: ts.TransformationContext) => (node: ts.Node) => ts.Node' is not assignable to type 'TransformerFactory'.` - [packages\/@tinacms\/cli\/src\/cmds\/init\/codegen\/index.ts\#L200](https://github.com/tinacms/tinacms/blob/f921e327e8eccf888dab9004e42a6751aa518e9c/packages/@tinacms/cli/src/cmds/init/codegen/index.ts#L200) - [packages\/@tinacms\/cli\/src\/cmds\/init\/codegen\/index.ts\#L304](https://github.com/tinacms/tinacms/blob/f921e327e8eccf888dab9004e42a6751aa518e9c/packages/@tinacms/cli/src/cmds/init/codegen/index.ts#L304)
typescript-bot commented 2 weeks ago

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

Everything looks the same!

You can check the log here.

typescript-bot commented 2 weeks ago

@ahejlsberg Here are the results of running the user tests comparing main and refs/pull/58337/merge:

Something interesting changed - please have a look.

Details

webpack

### [tsconfig.types.json](https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/tsconfig.types.json) - [NEW] `error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.` - [lib\/hmr\/HotModuleReplacement.runtime.js\#L369](https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/lib/hmr/HotModuleReplacement.runtime.js#L369)
typescript-bot commented 2 weeks ago

@ahejlsberg 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,154 62,154 ~ ~ ~ p=1.000 n=6
Types 50,273 50,273 ~ ~ ~ p=1.000 n=6
Memory used 192,746k (± 0.77%) 192,727k (± 0.76%) ~ 192,038k 195,707k p=0.810 n=6
Parse Time 1.63s (± 1.59%) 1.63s (± 2.16%) ~ 1.60s 1.67s p=0.871 n=6
Bind Time 0.86s (± 0.73%) 0.87s (± 1.19%) ~ 0.86s 0.88s p=0.293 n=6
Check Time 11.37s (± 0.57%) 11.34s (± 0.23%) ~ 11.30s 11.37s p=0.572 n=6
Emit Time 3.14s (± 0.62%) 3.15s (± 0.62%) ~ 3.12s 3.17s p=0.289 n=6
Total Time 16.99s (± 0.55%) 16.98s (± 0.27%) ~ 16.94s 17.07s p=1.000 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 945,172 945,322 +150 (+ 0.02%) ~ ~ p=0.001 n=6
Types 408,068 408,088 +20 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 1,222,010k (± 0.00%) 1,222,091k (± 0.00%) +81k (+ 0.01%) 1,222,014k 1,222,164k p=0.045 n=6
Parse Time 6.92s (± 0.51%) 6.91s (± 0.27%) ~ 6.89s 6.93s p=0.677 n=6
Bind Time 1.87s (± 0.65%) 1.87s (± 0.63%) ~ 1.85s 1.88s p=0.563 n=6
Check Time 31.40s (± 0.34%) 31.41s (± 0.14%) ~ 31.37s 31.49s p=0.936 n=6
Emit Time 14.73s (± 0.29%) 14.63s (± 0.50%) -0.10s (- 0.67%) 14.56s 14.74s p=0.029 n=6
Total Time 54.93s (± 0.20%) 54.83s (± 0.13%) ~ 54.73s 54.91s p=0.173 n=6
mui-docs - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 1,954,635 1,954,717 +82 (+ 0.00%) ~ ~ p=0.001 n=6
Types 676,418 676,452 +34 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 1,753,435k (± 0.00%) 1,753,469k (± 0.00%) +34k (+ 0.00%) 1,753,446k 1,753,488k p=0.013 n=6
Parse Time 6.89s (± 0.46%) 6.86s (± 0.36%) ~ 6.83s 6.90s p=0.257 n=6
Bind Time 2.31s (± 1.07%) 2.30s (± 0.35%) ~ 2.30s 2.32s p=0.932 n=6
Check Time 56.75s (± 0.70%) 56.78s (± 0.49%) ~ 56.44s 57.29s p=0.810 n=6
Emit Time 0.14s (± 2.88%) 0.14s ~ ~ ~ p=0.405 n=6
Total Time 66.09s (± 0.57%) 66.09s (± 0.45%) ~ 65.72s 66.63s p=0.873 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,215,567 1,215,568 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 257,612 257,612 ~ ~ ~ p=1.000 n=6
Memory used 2,323,057k (± 0.01%) 2,323,337k (± 0.01%) ~ 2,322,857k 2,323,713k p=0.093 n=6
Parse Time 6.11s (± 0.81%) 6.07s (± 1.21%) ~ 6.00s 6.19s p=0.298 n=6
Bind Time 2.22s (± 0.94%) 2.22s (± 0.53%) ~ 2.21s 2.24s p=0.808 n=6
Check Time 39.92s (± 0.10%) 39.91s (± 0.40%) ~ 39.74s 40.19s p=0.810 n=6
Emit Time 3.10s (± 1.30%) 3.09s (± 1.32%) ~ 3.04s 3.16s p=0.630 n=6
Total Time 51.37s (± 0.19%) 51.29s (± 0.22%) ~ 51.16s 51.50s p=0.149 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,215,567 1,215,568 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 257,612 257,612 ~ ~ ~ p=1.000 n=6
Memory used 2,514,299k (±11.35%) 2,397,814k (± 0.02%) ~ 2,396,993k 2,398,524k p=0.810 n=6
Parse Time 7.81s (± 1.11%) 7.83s (± 0.93%) ~ 7.74s 7.91s p=0.575 n=6
Bind Time 2.46s (± 1.90%) 2.47s (± 1.10%) ~ 2.44s 2.50s p=0.807 n=6
Check Time 50.40s (± 0.73%) 50.38s (± 0.14%) ~ 50.30s 50.49s p=0.810 n=6
Emit Time 3.92s (± 1.73%) 3.92s (± 1.75%) ~ 3.81s 4.00s p=1.000 n=6
Total Time 64.59s (± 0.51%) 64.60s (± 0.20%) ~ 64.49s 64.81s p=0.423 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,196 256,197 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 103,640 103,640 ~ ~ ~ p=1.000 n=6
Memory used 424,214k (± 0.01%) 424,242k (± 0.01%) ~ 424,193k 424,289k p=0.128 n=6
Parse Time 4.29s (± 0.61%) 4.31s (± 0.53%) ~ 4.29s 4.35s p=0.225 n=6
Bind Time 1.59s (± 1.85%) 1.62s (± 1.01%) ~ 1.60s 1.64s p=0.063 n=6
Check Time 22.52s (± 0.37%) 22.55s (± 0.37%) ~ 22.41s 22.65s p=0.748 n=6
Emit Time 1.71s (± 1.41%) 1.72s (± 1.63%) ~ 1.67s 1.75s p=0.808 n=6
Total Time 30.12s (± 0.43%) 30.19s (± 0.31%) ~ 30.09s 30.35s p=0.377 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,824 224,824 ~ ~ ~ p=1.000 n=6
Types 93,390 93,390 ~ ~ ~ p=1.000 n=6
Memory used 369,306k (± 0.02%) 369,322k (± 0.02%) ~ 369,216k 369,439k p=1.000 n=6
Parse Time 2.96s (± 0.73%) 2.97s (± 0.90%) ~ 2.93s 2.99s p=0.466 n=6
Bind Time 1.59s (± 0.84%) 1.58s (± 0.65%) ~ 1.57s 1.59s p=0.111 n=6
Check Time 15.73s (± 0.47%) 15.69s (± 0.31%) ~ 15.62s 15.75s p=0.198 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.27s (± 0.42%) 20.22s (± 0.27%) ~ 20.13s 20.29s p=0.261 n=6
vscode - node (v18.15.0, x64)
Errors 4 4 ~ ~ ~ p=1.000 n=6
Symbols 2,797,149 2,797,153 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Types 950,053 950,055 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,925,288k (± 0.00%) 2,925,275k (± 0.00%) ~ 2,925,072k 2,925,396k p=1.000 n=6
Parse Time 16.69s (± 0.60%) 16.62s (± 0.31%) ~ 16.55s 16.69s p=0.258 n=6
Bind Time 4.98s (± 0.46%) 4.99s (± 0.20%) ~ 4.98s 5.00s p=0.677 n=6
Check Time 88.77s (± 0.38%) 88.60s (± 0.25%) ~ 88.42s 88.99s p=0.173 n=6
Emit Time 24.60s (± 7.48%) 24.68s (± 7.62%) ~ 23.84s 28.52s p=0.378 n=6
Total Time 135.04s (± 1.53%) 134.89s (± 1.35%) ~ 133.90s 138.58s p=0.521 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 265,853 265,858 +5 (+ 0.00%) ~ ~ p=0.001 n=6
Types 108,438 108,442 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 410,429k (± 0.03%) 410,408k (± 0.02%) ~ 410,300k 410,540k p=0.689 n=6
Parse Time 4.86s (± 0.64%) 4.89s (± 0.73%) ~ 4.84s 4.94s p=0.169 n=6
Bind Time 2.07s (± 0.79%) 2.07s (± 0.99%) ~ 2.04s 2.09s p=0.742 n=6
Check Time 21.15s (± 0.48%) 21.12s (± 0.52%) ~ 21.02s 21.32s p=0.417 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.09s (± 0.41%) 28.08s (± 0.44%) ~ 27.91s 28.27s p=1.000 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 523,981 524,146 +165 (+ 0.03%) ~ ~ p=0.001 n=6
Types 178,708 178,732 +24 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 461,219k (± 0.02%) 461,374k (± 0.03%) ~ 461,232k 461,499k p=0.066 n=6
Parse Time 4.01s (± 0.54%) 4.00s (± 0.52%) ~ 3.97s 4.03s p=0.462 n=6
Bind Time 1.46s (± 0.75%) 1.46s (± 1.01%) ~ 1.44s 1.48s p=0.805 n=6
Check Time 22.57s (± 0.40%) 22.63s (± 0.27%) ~ 22.54s 22.71s p=0.296 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.05s (± 0.32%) 28.08s (± 0.16%) ~ 28.03s 28.14s p=0.336 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 commented 2 weeks ago

@ahejlsberg Here are the results of running the top 400 repos comparing main and refs/pull/58337/merge:

Something interesting changed - please have a look.

Details

reduxjs/redux

**2 of 5 projects failed to build with the old tsc and were ignored** ### [test\/tsconfig.json](https://github.com/reduxjs/redux/blob/c58086ed33b6abe0411edfd6e8ba372cfd6f66a2/test/tsconfig.json) - `error TS2345: Argument of type '(x: StoreEnhancerStoreCreator) => StoreEnhancerStoreCreator' is not assignable to parameter of type 'StoreEnhancer, {}>'.` - [test\/createStore.spec.ts\#L684](https://github.com/reduxjs/redux/blob/c58086ed33b6abe0411edfd6e8ba372cfd6f66a2/test/createStore.spec.ts#L684)
typescript-bot commented 2 weeks ago

@DanielRosenwasser Here are the results of running the top 800 repos comparing main and refs/pull/58337/merge:

Something interesting changed - please have a look.

Details

compiler-explorer/compiler-explorer

**2 of 6 projects failed to build with the old tsc and were ignored** ### [tsconfig.tests.json](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/tsconfig.tests.json) - `error TS2339: Property 'name' does not exist on type 'String'.` - [lib\/cache\/on-disk.ts\#L66](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L66) - `error TS2339: Property 'fullPath' does not exist on type 'String'.` - [lib\/cache\/on-disk.ts\#L66](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L66) - `error TS18048: 'x' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L84](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L84) - `error TS18048: 'y' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L84](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L84) - `error TS18048: 'i' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L86](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L86) - [lib\/cache\/on-disk.ts\#L86](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L86) ### [tsconfig.json](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/tsconfig.json) - `error TS2339: Property 'name' does not exist on type 'String'.` - [lib\/cache\/on-disk.ts\#L66](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L66) - `error TS2339: Property 'fullPath' does not exist on type 'String'.` - [lib\/cache\/on-disk.ts\#L66](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L66) - `error TS18048: 'x' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L84](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L84) - `error TS18048: 'y' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L84](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L84) - `error TS18048: 'i' is possibly 'undefined'.` - [lib\/cache\/on-disk.ts\#L86](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L86) - [lib\/cache\/on-disk.ts\#L86](https://github.com/compiler-explorer/compiler-explorer/blob/9d7ad0452b6ba7981d8d3605fe699fca972b9252/lib/cache/on-disk.ts#L86)

reduxjs/redux

**2 of 5 projects failed to build with the old tsc and were ignored** ### [test\/tsconfig.json](https://github.com/reduxjs/redux/blob/c58086ed33b6abe0411edfd6e8ba372cfd6f66a2/test/tsconfig.json) - `error TS2345: Argument of type '(x: StoreEnhancerStoreCreator) => StoreEnhancerStoreCreator' is not assignable to parameter of type 'StoreEnhancer, {}>'.` - [test\/createStore.spec.ts\#L684](https://github.com/reduxjs/redux/blob/c58086ed33b6abe0411edfd6e8ba372cfd6f66a2/test/createStore.spec.ts#L684)

tinacms/tinacms

**11 of 24 projects failed to build with the old tsc and were ignored** ### [packages\/@tinacms\/cli\/tsconfig.json](https://github.com/tinacms/tinacms/blob/f921e327e8eccf888dab9004e42a6751aa518e9c/packages/@tinacms/cli/tsconfig.json) - `error TS2322: Type '(ctx: ts.TransformationContext) => (node: ts.Node) => ts.Node' is not assignable to type 'TransformerFactory'.` - [packages\/@tinacms\/cli\/src\/cmds\/init\/codegen\/index.ts\#L200](https://github.com/tinacms/tinacms/blob/f921e327e8eccf888dab9004e42a6751aa518e9c/packages/@tinacms/cli/src/cmds/init/codegen/index.ts#L200) - [packages\/@tinacms\/cli\/src\/cmds\/init\/codegen\/index.ts\#L304](https://github.com/tinacms/tinacms/blob/f921e327e8eccf888dab9004e42a6751aa518e9c/packages/@tinacms/cli/src/cmds/init/codegen/index.ts#L304)
ahejlsberg commented 2 weeks ago

@typescript-bot test it

typescript-bot commented 2 weeks ago

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
Andarist commented 2 weeks ago

Could you also create a playground for this new build?

typescript-bot commented 2 weeks ago

Hey @ahejlsberg, it looks like the DT test run failed. Please check the log for more details.

You can check the log here.

typescript-bot commented 2 weeks ago

@ahejlsberg Here are the results of running the user tests comparing main and refs/pull/58337/merge:

Something interesting changed - please have a look.

Details

webpack

### [tsconfig.types.json](https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/tsconfig.types.json) - [NEW] `error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.` - [lib\/hmr\/HotModuleReplacement.runtime.js\#L369](https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/lib/hmr/HotModuleReplacement.runtime.js#L369)
jakebailey commented 2 weeks ago

@typescript-bot pack this

typescript-bot commented 2 weeks ago

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

Command Status Results
pack this ✅ Started ✅ Results
typescript-bot commented 2 weeks ago

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/161517/artifacts?artifactName=tgz&fileId=0FFD034C5FCA1BCAA99BB23D78C0AD5F936A7B8B93DE85116CBEA76F7984380102&fileName=/typescript-5.5.0-insiders.20240427.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/pr-build@5.5.0-pr-58337-27".;

typescript-bot commented 2 weeks ago

@ahejlsberg 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,154 62,154 ~ ~ ~ p=1.000 n=6
Types 50,273 50,273 ~ ~ ~ p=1.000 n=6
Memory used 193,361k (± 0.95%) 193,427k (± 0.93%) ~ 192,190k 195,863k p=0.378 n=6
Parse Time 1.35s (± 1.48%) 1.36s (± 1.70%) ~ 1.32s 1.39s p=0.677 n=6
Bind Time 0.72s 0.72s ~ ~ ~ p=1.000 n=6
Check Time 9.59s (± 0.20%) 9.57s (± 0.49%) ~ 9.51s 9.64s p=0.346 n=6
Emit Time 2.63s (± 0.70%) 2.63s (± 0.71%) ~ 2.61s 2.66s p=0.625 n=6
Total Time 14.29s (± 0.10%) 14.28s (± 0.30%) ~ 14.24s 14.35s p=0.746 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 945,172 945,322 +150 (+ 0.02%) ~ ~ p=0.001 n=6
Types 408,068 408,088 +20 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 1,222,012k (± 0.01%) 1,222,098k (± 0.00%) +86k (+ 0.01%) 1,222,040k 1,222,151k p=0.031 n=6
Parse Time 6.90s (± 0.40%) 6.93s (± 0.38%) ~ 6.89s 6.96s p=0.050 n=6
Bind Time 1.87s (± 0.53%) 1.87s (± 0.40%) ~ 1.86s 1.88s p=1.000 n=6
Check Time 31.31s (± 0.70%) 31.30s (± 0.49%) ~ 31.14s 31.54s p=0.873 n=6
Emit Time 14.59s (± 0.28%) 14.62s (± 0.36%) ~ 14.57s 14.71s p=0.197 n=6
Total Time 54.66s (± 0.34%) 54.72s (± 0.32%) ~ 54.56s 54.99s p=0.226 n=6
mui-docs - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 1,954,673 1,954,755 +82 (+ 0.00%) ~ ~ p=0.001 n=6
Types 676,418 676,452 +34 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 1,753,543k (± 0.00%) 1,753,591k (± 0.00%) ~ 1,753,559k 1,753,640k p=0.054 n=6
Parse Time 6.86s (± 0.43%) 6.88s (± 0.46%) ~ 6.82s 6.91s p=0.376 n=6
Bind Time 2.31s (± 0.35%) 2.31s (± 0.47%) ~ 2.30s 2.33s p=0.448 n=6
Check Time 56.80s (± 0.56%) 56.75s (± 0.40%) ~ 56.31s 56.95s p=0.810 n=6
Emit Time 0.14s (± 5.31%) 0.14s (± 5.44%) ~ 0.13s 0.15s p=0.487 n=6
Total Time 66.11s (± 0.51%) 66.08s (± 0.33%) ~ 65.66s 66.29s p=0.872 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,215,567 1,215,568 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 257,612 257,612 ~ ~ ~ p=1.000 n=6
Memory used 2,323,284k (± 0.01%) 2,323,265k (± 0.02%) ~ 2,322,474k 2,323,702k p=0.471 n=6
Parse Time 5.04s (± 0.92%) 5.07s (± 1.01%) ~ 5.00s 5.13s p=0.335 n=6
Bind Time 1.89s (± 1.21%) 1.88s (± 0.73%) ~ 1.86s 1.90s p=0.288 n=6
Check Time 34.04s (± 0.38%) 33.96s (± 0.28%) ~ 33.84s 34.09s p=0.230 n=6
Emit Time 2.60s (± 0.89%) 2.61s (± 1.34%) ~ 2.57s 2.67s p=0.809 n=6
Total Time 43.58s (± 0.33%) 43.54s (± 0.31%) ~ 43.34s 43.72s p=0.575 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,215,567 1,215,568 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 257,612 257,612 ~ ~ ~ p=1.000 n=6
Memory used 2,397,325k (± 0.01%) 2,397,823k (± 0.02%) ~ 2,397,330k 2,398,325k p=0.093 n=6
Parse Time 6.30s (± 0.51%) 6.30s (± 0.61%) ~ 6.24s 6.33s p=0.572 n=6
Bind Time 2.01s (± 1.02%) 2.01s (± 1.87%) ~ 1.96s 2.06s p=1.000 n=6
Check Time 40.62s (± 0.41%) 40.78s (± 0.26%) ~ 40.62s 40.88s p=0.093 n=6
Emit Time 3.14s (± 2.22%) 3.07s (± 2.29%) -0.07s (- 2.18%) 2.93s 3.11s p=0.045 n=6
Total Time 52.08s (± 0.29%) 52.19s (± 0.37%) ~ 51.93s 52.40s p=0.298 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,196 256,197 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 103,640 103,640 ~ ~ ~ p=1.000 n=6
Memory used 424,185k (± 0.01%) 424,188k (± 0.01%) ~ 424,159k 424,216k p=0.810 n=6
Parse Time 3.47s (± 1.19%) 3.48s (± 0.57%) ~ 3.45s 3.50s p=0.685 n=6
Bind Time 1.30s (± 1.06%) 1.30s (± 1.02%) ~ 1.28s 1.32s p=0.441 n=6
Check Time 18.19s (± 0.43%) 18.22s (± 0.41%) ~ 18.13s 18.33s p=0.748 n=6
Emit Time 1.37s (± 1.22%) 1.37s (± 1.93%) ~ 1.32s 1.40s p=1.000 n=6
Total Time 24.33s (± 0.44%) 24.37s (± 0.33%) ~ 24.24s 24.45s p=0.335 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,824 224,824 ~ ~ ~ p=1.000 n=6
Types 93,390 93,390 ~ ~ ~ p=1.000 n=6
Memory used 369,308k (± 0.01%) 369,338k (± 0.01%) ~ 369,294k 369,395k p=0.128 n=6
Parse Time 3.69s (± 0.61%) 3.68s (± 0.66%) ~ 3.66s 3.72s p=0.410 n=6
Bind Time 1.92s (± 0.90%) 1.93s (± 1.11%) ~ 1.90s 1.95s p=0.684 n=6
Check Time 19.46s (± 0.51%) 19.41s (± 0.52%) ~ 19.28s 19.56s p=0.521 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.06s (± 0.39%) 25.02s (± 0.47%) ~ 24.92s 25.22s p=0.378 n=6
vscode - node (v18.15.0, x64)
Errors 4 4 ~ ~ ~ p=1.000 n=6
Symbols 2,797,149 2,797,153 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Types 950,053 950,055 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,925,274k (± 0.00%) 2,925,264k (± 0.00%) ~ 2,925,082k 2,925,397k p=0.936 n=6
Parse Time 16.63s (± 0.49%) 16.58s (± 0.48%) ~ 16.53s 16.74s p=0.334 n=6
Bind Time 4.99s (± 0.49%) 4.99s (± 0.41%) ~ 4.95s 5.01s p=1.000 n=6
Check Time 88.50s (± 0.24%) 88.46s (± 0.43%) ~ 88.01s 89.08s p=0.748 n=6
Emit Time 24.74s (± 7.21%) 25.39s (± 9.01%) ~ 23.84s 28.38s p=0.873 n=6
Total Time 134.86s (± 1.34%) 135.42s (± 1.52%) ~ 133.79s 138.11s p=0.936 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 265,853 265,858 +5 (+ 0.00%) ~ ~ p=0.001 n=6
Types 108,438 108,442 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 410,479k (± 0.02%) 410,358k (± 0.02%) -120k (- 0.03%) 410,261k 410,443k p=0.031 n=6
Parse Time 4.90s (± 0.63%) 4.89s (± 0.91%) ~ 4.82s 4.95s p=1.000 n=6
Bind Time 2.07s (± 1.21%) 2.07s (± 0.83%) ~ 2.05s 2.09s p=0.869 n=6
Check Time 21.19s (± 0.58%) 21.09s (± 0.20%) ~ 21.02s 21.13s p=0.228 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.15s (± 0.37%) 28.06s (± 0.30%) ~ 27.90s 28.13s p=0.199 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 523,981 524,146 +165 (+ 0.03%) ~ ~ p=0.001 n=6
Types 178,708 178,732 +24 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 461,158k (± 0.01%) 461,255k (± 0.03%) ~ 461,096k 461,530k p=0.298 n=6
Parse Time 3.25s (± 0.61%) 3.25s (± 0.63%) ~ 3.22s 3.28s p=0.625 n=6
Bind Time 1.18s (± 0.69%) 1.18s (± 0.76%) ~ 1.17s 1.19s p=0.550 n=6
Check Time 18.18s (± 0.39%) 18.18s (± 0.33%) ~ 18.10s 18.25s p=0.573 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.60s (± 0.35%) 22.61s (± 0.27%) ~ 22.55s 22.70s p=0.935 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 commented 2 weeks ago

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

Everything looks the same!

You can check the log here.

typescript-bot commented 2 weeks ago

@ahejlsberg Here are the results of running the top 400 repos comparing main and refs/pull/58337/merge:

Something interesting changed - please have a look.

Details

reduxjs/redux

**2 of 5 projects failed to build with the old tsc and were ignored** ### [test\/tsconfig.json](https://github.com/reduxjs/redux/blob/c58086ed33b6abe0411edfd6e8ba372cfd6f66a2/test/tsconfig.json) - `error TS2345: Argument of type '(x: StoreEnhancerStoreCreator) => StoreEnhancerStoreCreator' is not assignable to parameter of type 'StoreEnhancer, {}>'.` - [test\/createStore.spec.ts\#L684](https://github.com/reduxjs/redux/blob/c58086ed33b6abe0411edfd6e8ba372cfd6f66a2/test/createStore.spec.ts#L684)
ahejlsberg commented 2 weeks ago

The new redux error is another example of a ghost error. Without this PR, the error doesn't show in command line builds, but comes and goes when viewing/editing the file in the IDE. With this PR, the error is consistently reported in command line builds and the IDE.

ahejlsberg commented 2 weeks ago

The new webpack error looks legit, the internalApply function has no type annotation and is indirectly recursively called in a return statement.

Andarist commented 2 weeks ago

I verified that this fixes the other repro that I posted in #57585 (see here). To be honest, it's kinda the same repro as the one that you already have here as tests/cases/fourslash/issue57585.ts - it just excercices a different path leading to a problem.

I also checked effect's case reported in #57585 and this doesn't fix that problem as far as I was able to verify it manually (cc @mikearnaldi ). So after all... it was worth digging into it :D (cc @jakebailey ). I'll reduce this to a minimal repro case over the weekend and post here.

mikearnaldi commented 2 weeks ago

I verified that this fixes the other repro that I posted in #57585 (see here). To be honest, it's kinda the same repro as the one that you already have here as tests/cases/fourslash/issue57585.ts - it just excercices a different path leading to a problem.

I also checked effect's case reported in #57585 and this doesn't fix that problem as far as I was able to verify it manually (cc @mikearnaldi ). So after all... it was worth digging into it :D (cc @jakebailey ). I'll reduce this to a minimal repro case over the weekend and post here.

I don't seem to be able to reproduce the same issue anymore, but given it was sporadic I believe you :) hope you'll manage to get a repro which is minimal enough

ahejlsberg commented 2 weeks ago

I don't seem to be able to reproduce the same issue anymore

FWIW, I haven't been able to reproduce it either. With or without this PR.

Andarist commented 2 weeks ago

I could try to minimize this further if requested - I think it's pretty minimal already though (given the complexity of the original: Effect's codebase 😉 ):

/// <reference path="fourslash.ts" />

// @strict: true
// @target: esnext
// @lib: esnext

//// declare const EffectTypeId: unique symbol;
////
//// type Covariant<A> = (_: never) => A;
////
//// interface VarianceStruct<out A, out E, out R> {
////   readonly _V: string;
////   readonly _A: Covariant<A>;
////   readonly _E: Covariant<E>;
////   readonly _R: Covariant<R>;
//// }
////
//// interface Variance<out A, out E, out R> {
////   readonly [EffectTypeId]: VarianceStruct<A, E, R>;
//// }
////
//// type Success<T extends Effect<any, any, any>> = [T] extends [
////   Effect<infer _A, infer _E, infer _R>,
//// ]
////   ? _A
////   : never;
////
//// declare const YieldWrapTypeId: unique symbol;
////
//// class YieldWrap<T> {
////   readonly #value: T;
////   constructor(value: T) {
////     this.#value = value;
////   }
////   [YieldWrapTypeId](): T {
////     return this.#value;
////   }
//// }
////
//// interface EffectGenerator<T extends Effect<any, any, any>> {
////   next(...args: ReadonlyArray<any>): IteratorResult<YieldWrap<T>, Success<T>>;
//// }
////
//// interface Effect<out A, out E = never, out R = never>
////   extends Variance<A, E, R> {
////   [Symbol.iterator](): EffectGenerator<Effect<A, E, R>>;
//// }
////
//// declare const gen: {
////   <Eff extends YieldWrap<Effect<any, any, any>>, AEff>(
////     f: () => Generator<Eff, AEff, never>,
////   ): Effect<
////     AEff,
////     [Eff] extends [never]
////       ? never
////       : [Eff] extends [YieldWrap<Effect<infer _A, infer E, infer _R>>]
////       ? E
////       : never,
////     [Eff] extends [never]
////       ? never
////       : [Eff] extends [YieldWrap<Effect<infer _A, infer _E, infer R>>]
////       ? R
////       : never
////   >;
//// };
////
//// declare const succeed: <A>(value: A) => Effect<A>;
////
//// gen(function* () {
////   const a = yield* succeed(1);
////   const b/*1*/ = yield* succeed(2);
////   return a + b;
//// });

verify.quickInfoAt("1", "const b: number");
verify.getSemanticDiagnostics([]);
ahejlsberg commented 2 weeks ago

I can confirm that @Andarist's Effect repro here reproduces for me and is fixed by this PR.

Andarist commented 2 weeks ago

I'm confused. I posted this repro after testing it on this very branch - it doesn't pass:

  1) fourslash tests
       tests/cases/fourslash/issue57585-2.ts
         fourslash test issue57585-2.ts runs correctly:

      AssertionError: At marker '1': quick info text: expected 'const b: any' to equal 'const b: number'
      + expected - actual

      -const b: any
      +const b: number

      at _TestState.verifyQuickInfoString (src/harness/fourslashImpl.ts:1863:16)
      at _TestState.verifyQuickInfoAt (src/harness/fourslashImpl.ts:1835:14)
      at Verify.quickInfoAt (src/harness/fourslashInterfaceImpl.ts:272:20)
      at eval (issue57585-2.js:72:8)
      at runCode (src/harness/fourslashImpl.ts:4613:9)
      at runFourSlashTestContent (src/harness/fourslashImpl.ts:4571:5)
      at runFourSlashTest (src/harness/fourslashImpl.ts:4554:5)
      at Context.<anonymous> (src/testRunner/fourslashRunner.ts:59:39)
      at processImmediate (node:internal/timers:478:21)

I confirmed now that I am at the correct commit and all, rerun it and it still doesn't pass 😅

> git rev-parse HEAD
abf40126d08dd8cdd1821273fdf0a258a2ec4cfe
mikearnaldi commented 2 weeks ago

After fiddling for a while I can confirm this still occurs, more reliably when you specify a return type

Screenshot 2024-04-28 at 10 39 38
Andarist commented 2 weeks ago

@ahejlsberg thank you ❤️

ahejlsberg commented 2 weeks ago

Ok, now it fixes the Effect repro. Sorry for the confusion.

ahejlsberg commented 2 weeks ago

@typescript-bot pack this

typescript-bot commented 2 weeks ago

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

Command Status Results
pack this ✅ Started ✅ Results
ahejlsberg commented 2 weeks ago

@typescript-bot test it

typescript-bot commented 2 weeks ago

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 commented 2 weeks ago

Hey @ahejlsberg, 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/161518/artifacts?artifactName=tgz&fileId=CB5DA3E812F57E3C4C788ACABF1555D2EEA4DEB5F82EA948870C429E1CCF051102&fileName=/typescript-5.5.0-insiders.20240428.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/pr-build@5.5.0-pr-58337-46".;

typescript-bot commented 2 weeks ago

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

Everything looks the same!

You can check the log here.

typescript-bot commented 2 weeks ago

@ahejlsberg Here are the results of running the user tests comparing main and refs/pull/58337/merge:

Something interesting changed - please have a look.

Details

webpack

### [tsconfig.types.json](https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/tsconfig.types.json) - [NEW] `error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.` - [lib\/hmr\/HotModuleReplacement.runtime.js\#L369](https://github.com/webpack/webpack/blob/c586c7b1e027e1d252d68b4372f08a9bce40d96c/lib/hmr/HotModuleReplacement.runtime.js#L369)
mikearnaldi commented 2 weeks ago

Ok, now it fixes the Effect repro. Sorry for the confusion.

Thank you immensely!! This makes a lot of difference for Effect, I will test this tomorrow just to double check that in the large codebase nothing wierd happens.