Skip to content
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

fix(55841) - Indexing with never should produce never #55842

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

jfet97
Copy link
Contributor

@jfet97 jfet97 commented Sep 23, 2023

Fixes #55841 by doing the check before the one about index signatures.

Closed because: even if { a: 42 }[never] is already computed as never, something like Record<string, boolean>[never] is boolean, not never. So the current behaviour of arrays/tuples is not consistent with the one of object literals, but is consistent with other cases.

Re-opened because the correspondent issue has been accepted as a bug.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 23, 2023
@jfet97 jfet97 changed the title fix(55841) - Array/Tuple indexed by never behaving like indexed with number fix(55841) - Array/Tuple indexed by never behaving like indexed by number Sep 23, 2023
@jfet97 jfet97 closed this Sep 23, 2023
@jfet97 jfet97 reopened this Sep 27, 2023
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 27, 2023
@DanielRosenwasser
Copy link
Member

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 1, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 1, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 1, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 1, 2023

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

Update: The results are in!

@microsoft microsoft deleted a comment from typescript-bot Oct 1, 2023
@microsoft microsoft deleted a comment from typescript-bot Oct 1, 2023
@DanielRosenwasser
Copy link
Member

@typescript-bot test top300

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 1, 2023

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

Update: The results are in!

@microsoft microsoft deleted a comment from typescript-bot Oct 1, 2023
@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 1, 2023

Hey @DanielRosenwasser, 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/158043/artifacts?artifactName=tgz&fileId=EF8DA85BB05A314D744FBA6A9C0CA8EFE0E466D64CA9870BDBF221304845FE6F02&fileName=/typescript-5.3.0-insiders.20231001.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]".;

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,067k (± 0.01%) 295,066k (± 0.01%) ~ 294,998k 295,112k p=0.873 n=6
Parse Time 2.63s (± 0.57%) 2.63s (± 0.79%) ~ 2.59s 2.65s p=0.868 n=6
Bind Time 0.83s (± 1.00%) 0.84s (± 0.90%) ~ 0.83s 0.85s p=0.432 n=6
Check Time 8.07s (± 0.36%) 8.09s (± 0.39%) ~ 8.04s 8.14s p=0.441 n=6
Emit Time 7.05s (± 0.49%) 7.04s (± 0.25%) ~ 7.01s 7.06s p=0.683 n=6
Total Time 18.59s (± 0.21%) 18.60s (± 0.19%) ~ 18.56s 18.65s p=0.687 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 192,610k (± 1.55%) 192,639k (± 1.57%) ~ 190,659k 196,590k p=0.689 n=6
Parse Time 1.33s (± 1.55%) 1.35s (± 0.61%) ~ 1.34s 1.36s p=0.401 n=6
Bind Time 0.73s (± 0.00%) 0.73s (± 0.00%) ~ 0.73s 0.73s p=1.000 n=6
Check Time 9.18s (± 0.83%) 9.19s (± 0.30%) ~ 9.16s 9.23s p=0.686 n=6
Emit Time 2.63s (± 0.70%) 2.62s (± 0.46%) ~ 2.61s 2.64s p=0.461 n=6
Total Time 13.88s (± 0.56%) 13.89s (± 0.20%) ~ 13.84s 13.92s p=0.872 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,300k (± 0.00%) 347,299k (± 0.00%) ~ 347,287k 347,312k p=1.000 n=6
Parse Time 2.46s (± 1.22%) 2.47s (± 0.44%) ~ 2.46s 2.49s p=0.250 n=6
Bind Time 0.94s (± 0.43%) 0.93s (± 0.89%) ~ 0.92s 0.94s p=0.527 n=6
Check Time 6.90s (± 0.25%) 6.90s (± 0.41%) ~ 6.87s 6.94s p=0.934 n=6
Emit Time 4.02s (± 0.19%) 4.01s (± 0.29%) ~ 4.00s 4.03s p=0.136 n=6
Total Time 14.32s (± 0.27%) 14.31s (± 0.25%) ~ 14.27s 14.35s p=0.935 n=6
TFS - node (v18.15.0, x64)
Memory used 302,549k (± 0.01%) 302,538k (± 0.00%) ~ 302,524k 302,556k p=0.423 n=6
Parse Time 2.00s (± 0.97%) 1.99s (± 0.68%) ~ 1.97s 2.01s p=0.463 n=6
Bind Time 1.00s (± 0.83%) 1.00s (± 0.63%) ~ 0.99s 1.01s p=0.340 n=6
Check Time 6.26s (± 0.58%) 6.27s (± 0.46%) ~ 6.23s 6.31s p=0.629 n=6
Emit Time 3.56s (± 0.33%) 3.56s (± 0.42%) ~ 3.55s 3.59s p=0.563 n=6
Total Time 12.83s (± 0.39%) 12.83s (± 0.20%) ~ 12.79s 12.86s p=0.520 n=6
material-ui - node (v18.15.0, x64)
Memory used 470,492k (± 0.00%) 470,483k (± 0.00%) ~ 470,458k 470,493k p=0.470 n=6
Parse Time 2.57s (± 0.20%) 2.58s (± 0.85%) ~ 2.55s 2.61s p=0.667 n=6
Bind Time 1.00s (± 0.52%) 0.99s (± 0.76%) ~ 0.98s 1.00s p=0.069 n=6
Check Time 16.64s (± 0.46%) 16.58s (± 0.24%) ~ 16.54s 16.65s p=0.199 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.21s (± 0.39%) 20.16s (± 0.28%) ~ 20.09s 20.25s p=0.199 n=6
xstate - node (v18.15.0, x64)
Memory used 512,634k (± 0.01%) 512,573k (± 0.01%) ~ 512,532k 512,612k p=0.066 n=6
Parse Time 3.27s (± 0.16%) 3.27s (± 0.30%) ~ 3.25s 3.28s p=0.386 n=6
Bind Time 1.55s (± 0.41%) 1.55s (± 0.33%) ~ 1.55s 1.56s p=0.386 n=6
Check Time 2.88s (± 0.92%) 2.88s (± 0.79%) ~ 2.86s 2.91s p=1.000 n=6
Emit Time 0.08s (± 4.99%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=0.405 n=6
Total Time 7.78s (± 0.36%) 7.77s (± 0.38%) ~ 7.73s 7.80s p=0.936 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,388ms (± 1.12%) 2,374ms (± 1.62%) ~ 2,331ms 2,421ms p=0.575 n=6
Req 2 - geterr 5,322ms (± 1.33%) 5,338ms (± 1.77%) ~ 5,262ms 5,463ms p=0.574 n=6
Req 3 - references 328ms (± 0.92%) 330ms (± 1.19%) ~ 326ms 334ms p=0.622 n=6
Req 4 - navto 277ms (± 0.91%) 277ms (± 1.13%) ~ 274ms 283ms p=0.932 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 78ms (± 7.72%) 80ms (± 9.74%) ~ 74ms 90ms p=0.933 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,465ms (± 0.90%) 2,456ms (± 1.58%) ~ 2,398ms 2,501ms p=0.575 n=6
Req 2 - geterr 4,111ms (± 1.74%) 4,155ms (± 1.73%) ~ 4,060ms 4,212ms p=0.378 n=6
Req 3 - references 338ms (± 1.47%) 335ms (± 0.75%) ~ 333ms 340ms p=0.304 n=6
Req 4 - navto 284ms (± 0.29%) 283ms (± 0.18%) ~ 283ms 284ms p=0.523 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 79ms (± 9.12%) 78ms (± 5.90%) ~ 75ms 87ms p=1.000 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,592ms (± 0.41%) 2,595ms (± 0.69%) ~ 2,572ms 2,615ms p=0.689 n=6
Req 2 - geterr 1,682ms (± 1.43%) 1,694ms (± 1.70%) ~ 1,663ms 1,743ms p=0.471 n=6
Req 3 - references 112ms (± 8.86%) 111ms (± 8.30%) ~ 105ms 127ms p=0.801 n=6
Req 4 - navto 358ms (± 0.14%) 359ms (± 0.41%) ~ 358ms 361ms p=0.417 n=6
Req 5 - completionInfo count 2,071 (± 0.00%) 2,071 (± 0.00%) ~ 2,071 2,071 p=1.000 n=6
Req 5 - completionInfo 305ms (± 1.60%) 304ms (± 1.24%) ~ 299ms 309ms p=0.573 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 151.96ms (± 0.19%) 151.91ms (± 0.19%) -0.05ms (- 0.03%) 150.47ms 154.77ms p=0.031 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 227.58ms (± 0.16%) 227.49ms (± 0.16%) -0.09ms (- 0.04%) 226.09ms 233.68ms p=0.003 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 228.65ms (± 0.16%) 228.71ms (± 0.16%) ~ 227.03ms 234.91ms p=0.132 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 228.52ms (± 0.17%) 228.57ms (± 0.15%) ~ 226.97ms 231.87ms p=0.086 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

react-hook-form/react-hook-form

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

tsconfig.json

vuejs/core

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

tsconfig.build.json

tsconfig.json

@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

react-hook-form/react-hook-form

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

tsconfig.json

vuejs/core

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

tsconfig.build.json

tsconfig.json

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 14, 2024

Hey @gabritto, 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/159874/artifacts?artifactName=tgz&fileId=6F4A6B190C6B6CD1121C6CB6CAD470E185F84EAB6EA08E3C5CA82583202C055E02&fileName=/typescript-5.4.0-insiders.20240214.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]".;

@jfet97
Copy link
Contributor Author

jfet97 commented Feb 15, 2024

@Andarist We are of the same mind on this, I feel TS is quite inconsistent in these circumstances and I'm not sure this is the right change too. I re-opened this PR just because the correspondent issue has been accepted as a bug. You are right on the fact that this PR is not exactly about arrays and tuples and it is related with index signatures.

OTOH I suspect that making { a: 42 }[never] valid wouldn't be the right thing to do either. Some folks actively exploit the current behaviour, like @danvk does here with the LooseKey type.

What does indexing a type mean?

42, of course 😆.

@gabritto
Copy link
Member

@typescript-bot test top300

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 15, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@gabritto
Copy link
Member

Top tests all pass, but I do find this example kinda bad and it probably should be never instead of boolean?

@jfet97 jfet97 changed the title fix(55841) - Array/Tuple indexed by never behaving like indexed by number fix(55841) - Indexing with never should produce never Feb 16, 2024
@@ -18196,6 +18196,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (objectType.flags & (TypeFlags.Any | TypeFlags.Never)) {
return objectType;
}
if (indexType === neverType || indexType === implicitNeverType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably go with this:

Suggested change
if (indexType === neverType || indexType === implicitNeverType) {
if (indexType.flags & TypeFlags.Never && indexType !== silentNeverType) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that way we would change the indexing behaviour of unreachableNeverType too. Are you sure? XD

Copy link
Contributor

Choose a reason for hiding this comment

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

Am I sure? Not at all. It seems reasonable to treat that the same way as the regular never here but who knows?

@jfet97
Copy link
Contributor Author

jfet97 commented Feb 16, 2024

@gabritto I think now it's fixed and I added the bad cases as tests. What's your take?

@gabritto
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 16, 2024

Heya @gabritto, I've started to run the tarball bundle task on this PR at 740a74f. You can monitor the build here.

@gabritto
Copy link
Member

@typescript-bot run DT
@typescript-bot user test this
@typescript-bot test top300
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 16, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 16, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 16, 2024

Heya @gabritto, I've started to run the regular perf test suite on this PR at 740a74f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 16, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 16, 2024

Hey @gabritto, 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/159911/artifacts?artifactName=tgz&fileId=741D66A21D6ADE33B2FADFBEF2B0BBD50467FB9BDD13FD34BAACC90743633EC802&fileName=/typescript-5.4.0-insiders.20240216.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]".;

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

puppeteer

packages/browsers/test/src/tsconfig.json

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,666k (± 0.01%) 295,664k (± 0.01%) ~ 295,626k 295,687k p=0.689 n=6
Parse Time 2.66s (± 0.15%) 2.66s (± 0.28%) ~ 2.65s 2.67s p=1.000 n=6
Bind Time 0.83s (± 1.24%) 0.83s (± 1.32%) ~ 0.82s 0.84s p=0.676 n=6
Check Time 8.23s (± 0.33%) 8.22s (± 0.31%) ~ 8.19s 8.26s p=0.573 n=6
Emit Time 7.10s (± 0.23%) 7.09s (± 0.19%) ~ 7.08s 7.12s p=0.867 n=6
Total Time 18.83s (± 0.19%) 18.82s (± 0.14%) ~ 18.78s 18.85s p=0.629 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 193,539k (± 1.55%) 192,558k (± 1.24%) ~ 191,554k 197,428k p=0.423 n=6
Parse Time 1.36s (± 0.80%) 1.35s (± 0.76%) ~ 1.34s 1.37s p=0.310 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.38s (± 0.24%) 9.36s (± 0.54%) ~ 9.27s 9.40s p=0.466 n=6
Emit Time 2.62s (± 0.71%) 2.61s (± 0.74%) ~ 2.59s 2.64s p=0.808 n=6
Total Time 14.08s (± 0.26%) 14.04s (± 0.30%) ~ 13.99s 14.10s p=0.196 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,456k (± 0.01%) 347,465k (± 0.01%) ~ 347,433k 347,480k p=0.471 n=6
Parse Time 2.47s (± 0.33%) 2.48s (± 0.84%) ~ 2.44s 2.50s p=0.157 n=6
Bind Time 0.92s (± 0.56%) 0.93s (± 0.00%) +0.01s (+ 0.72%) 0.93s 0.93s p=0.025 n=6
Check Time 6.95s (± 0.44%) 6.95s (± 0.46%) ~ 6.91s 6.99s p=1.000 n=6
Emit Time 4.04s (± 0.31%) 4.05s (± 0.37%) ~ 4.03s 4.07s p=0.134 n=6
Total Time 14.39s (± 0.31%) 14.41s (± 0.33%) ~ 14.35s 14.47s p=0.517 n=6
TFS - node (v18.15.0, x64)
Memory used 302,858k (± 0.01%) 302,869k (± 0.01%) ~ 302,850k 302,894k p=0.423 n=6
Parse Time 2.01s (± 0.60%) 2.01s (± 0.92%) ~ 1.99s 2.03s p=1.000 n=6
Bind Time 1.01s (± 1.25%) 1.00s (± 0.81%) ~ 1.00s 1.02s p=0.293 n=6
Check Time 6.35s (± 0.32%) 6.37s (± 0.34%) ~ 6.35s 6.40s p=0.286 n=6
Emit Time 3.60s (± 0.41%) 3.59s (± 0.41%) ~ 3.57s 3.61s p=0.289 n=6
Total Time 12.98s (± 0.18%) 12.97s (± 0.24%) ~ 12.92s 13.01s p=1.000 n=6
material-ui - node (v18.15.0, x64)
Memory used 511,378k (± 0.01%) 511,413k (± 0.01%) ~ 511,369k 511,482k p=0.378 n=6
Parse Time 2.64s (± 0.44%) 2.64s (± 0.62%) ~ 2.62s 2.66s p=0.870 n=6
Bind Time 0.98s (± 1.29%) 1.00s (± 0.89%) +0.02s (+ 2.04%) 0.99s 1.01s p=0.016 n=6
Check Time 17.32s (± 0.19%) 17.30s (± 0.38%) ~ 17.23s 17.42s p=0.227 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.95s (± 0.24%) 20.95s (± 0.33%) ~ 20.89s 21.07s p=0.625 n=6
mui-docs - node (v18.15.0, x64)
Memory used 2,272,170k (± 0.00%) 2,272,181k (± 0.00%) ~ 2,272,142k 2,272,218k p=0.630 n=6
Parse Time 12.03s (± 0.88%) 12.03s (± 0.77%) ~ 11.92s 12.16s p=1.000 n=6
Bind Time 2.63s (± 0.40%) 2.62s (± 0.39%) ~ 2.61s 2.64s p=0.801 n=6
Check Time 101.76s (± 1.46%) 101.80s (± 0.50%) ~ 101.11s 102.45s p=0.936 n=6
Emit Time 0.32s (± 1.28%) 0.32s (± 0.00%) ~ 0.32s 0.32s p=0.405 n=6
Total Time 116.74s (± 1.29%) 116.77s (± 0.45%) ~ 115.98s 117.45s p=0.873 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,413,414k (± 0.03%) 2,413,143k (± 0.04%) ~ 2,411,955k 2,414,183k p=0.810 n=6
Parse Time 4.96s (± 0.53%) 4.98s (± 0.94%) ~ 4.89s 5.03s p=0.295 n=6
Bind Time 1.86s (± 0.40%) 1.89s (± 1.59%) ~ 1.86s 1.94s p=0.080 n=6
Check Time 33.62s (± 0.47%) 33.55s (± 0.43%) ~ 33.37s 33.74s p=0.810 n=6
Emit Time 2.68s (± 1.12%) 2.70s (± 1.34%) ~ 2.64s 2.74s p=0.466 n=6
Total Time 43.14s (± 0.40%) 43.13s (± 0.30%) ~ 42.94s 43.33s p=0.689 n=6
self-compiler - node (v18.15.0, x64)
Memory used 418,856k (± 0.01%) 418,929k (± 0.01%) +73k (+ 0.02%) 418,884k 418,986k p=0.030 n=6
Parse Time 2.81s (± 2.11%) 2.84s (± 0.54%) ~ 2.82s 2.85s p=0.220 n=6
Bind Time 1.10s (± 5.91%) 1.07s (± 0.76%) ~ 1.06s 1.08s p=0.865 n=6
Check Time 15.14s (± 0.32%) 15.22s (± 0.26%) +0.08s (+ 0.54%) 15.16s 15.26s p=0.024 n=6
Emit Time 1.14s (± 1.17%) 1.14s (± 1.20%) ~ 1.12s 1.15s p=1.000 n=6
Total Time 20.18s (± 0.24%) 20.27s (± 0.16%) +0.08s (+ 0.41%) 20.21s 20.30s p=0.020 n=6
vscode - node (v18.15.0, x64)
Memory used 2,844,807k (± 0.00%) 2,844,845k (± 0.00%) ~ 2,844,767k 2,844,986k p=0.298 n=6
Parse Time 10.80s (± 0.71%) 10.75s (± 0.14%) ~ 10.73s 10.77s p=0.332 n=6
Bind Time 3.42s (± 0.24%) 3.43s (± 0.43%) ~ 3.41s 3.45s p=0.677 n=6
Check Time 60.62s (± 0.32%) 60.70s (± 0.37%) ~ 60.52s 61.07s p=0.378 n=6
Emit Time 16.25s (± 0.67%) 16.34s (± 1.04%) ~ 16.10s 16.56s p=0.521 n=6
Total Time 91.09s (± 0.34%) 91.22s (± 0.41%) ~ 90.77s 91.84s p=0.748 n=6
webpack - node (v18.15.0, x64)
Memory used 394,103k (± 0.01%) 394,156k (± 0.02%) ~ 394,082k 394,230k p=0.128 n=6
Parse Time 3.10s (± 0.63%) 3.12s (± 0.55%) ~ 3.10s 3.14s p=0.076 n=6
Bind Time 1.39s (± 1.24%) 1.39s (± 1.11%) ~ 1.37s 1.40s p=0.675 n=6
Check Time 14.12s (± 0.46%) 14.12s (± 0.51%) ~ 14.00s 14.17s p=0.936 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 18.61s (± 0.46%) 18.63s (± 0.44%) ~ 18.52s 18.71s p=0.872 n=6
xstate - node (v18.15.0, x64)
Memory used 513,366k (± 0.00%) 513,361k (± 0.01%) ~ 513,256k 513,454k p=0.575 n=6
Parse Time 3.27s (± 0.23%) 3.27s (± 0.30%) ~ 3.26s 3.29s p=0.652 n=6
Bind Time 1.54s (± 0.26%) 1.54s (± 0.33%) ~ 1.54s 1.55s p=0.595 n=6
Check Time 2.86s (± 0.72%) 2.86s (± 0.75%) ~ 2.83s 2.89s p=0.936 n=6
Emit Time 0.08s (± 4.99%) 0.08s (± 4.99%) ~ 0.08s 0.09s p=1.000 n=6
Total Time 7.75s (± 0.19%) 7.76s (± 0.30%) ~ 7.73s 7.80s p=0.515 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,359ms (± 0.65%) 2,349ms (± 0.47%) ~ 2,338ms 2,363ms p=0.377 n=6
Req 2 - geterr 5,534ms (± 1.34%) 5,499ms (± 0.90%) ~ 5,449ms 5,583ms p=0.471 n=6
Req 3 - references 324ms (± 1.24%) 325ms (± 1.40%) ~ 321ms 333ms p=0.936 n=6
Req 4 - navto 276ms (± 0.99%) 277ms (± 0.96%) ~ 272ms 279ms p=0.564 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 85ms (± 8.21%) 83ms (± 7.22%) ~ 78ms 94ms p=0.622 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,481ms (± 1.32%) 2,486ms (± 0.73%) ~ 2,463ms 2,505ms p=0.810 n=6
Req 2 - geterr 4,196ms (± 1.83%) 4,166ms (± 1.80%) ~ 4,103ms 4,280ms p=0.423 n=6
Req 3 - references 338ms (± 1.79%) 335ms (± 0.98%) ~ 332ms 341ms p=0.370 n=6
Req 4 - navto 285ms (± 1.15%) 286ms (± 0.82%) ~ 284ms 290ms p=0.252 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 (± 7.60%) 85ms (± 6.26%) ~ 78ms 90ms p=0.934 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,615ms (± 0.32%) 2,608ms (± 0.29%) ~ 2,599ms 2,618ms p=0.172 n=6
Req 2 - geterr 1,722ms (± 2.60%) 1,720ms (± 2.16%) ~ 1,686ms 1,778ms p=0.936 n=6
Req 3 - references 122ms (± 8.94%) 121ms (± 8.55%) ~ 107ms 128ms p=0.452 n=6
Req 4 - navto 369ms (± 0.97%) 370ms (± 0.33%) ~ 369ms 372ms p=0.934 n=6
Req 5 - completionInfo count 2,078 (± 0.00%) 2,078 (± 0.00%) ~ 2,078 2,078 p=1.000 n=6
Req 5 - completionInfo 309ms (± 1.76%) 310ms (± 1.75%) ~ 306ms 317ms p=0.624 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 153.89ms (± 0.22%) 153.72ms (± 0.18%) -0.17ms (- 0.11%) 152.68ms 157.47ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 230.32ms (± 0.15%) 230.17ms (± 0.18%) -0.15ms (- 0.07%) 228.81ms 238.72ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 231.25ms (± 0.18%) 231.37ms (± 0.18%) +0.12ms (+ 0.05%) 229.84ms 236.41ms p=0.004 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 231.01ms (± 0.18%) 231.00ms (± 0.17%) ~ 229.67ms 235.53ms p=0.766 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

Hey @gabritto, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

graphile/crystal

6 of 10 projects failed to build with the old tsc and were ignored

tsconfig.json

@jfet97
Copy link
Contributor Author

jfet97 commented Feb 16, 2024

@gabritto I think this error is right: pgSubscriberKey has type undefined, therefore inside if (pgSubscriberKey != null) { it has type never and indexing with never now produces never. You cannot assign GrafastSubscriber<Record<string, string>> | null | undefined> to it anymore.

However, I would say that this PR introduces a sort of breaking change.

@jfet97
Copy link
Contributor Author

jfet97 commented Feb 16, 2024

About the meaning of indexing with never: if we have a record/object/tuple/array/whatever indexed by something that has type never we already are in an absurd situation, like the default case of an exhaustive switch. I think we could apply the ex falso quodlibet principle, therefore any resulting type would be correct. Propagating the never itself it's just an option, that probably makes some sense.

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

Successfully merging this pull request may close these issues.

never as keyof tuples/arrays behaves the same as number
6 participants