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

Filter out non-array types when contextually typing array literal elements #52589

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Feb 3, 2023

fixes #52588

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Feb 3, 2023
src/compiler/checker.ts Outdated Show resolved Hide resolved
@RyanCavanaugh
Copy link
Member

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 3, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 3, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 3, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 3, 2023

Heya @RyanCavanaugh, I've started to run the diff-based top-repos suite (tsserver) on this PR at 8ebc95f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 3, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 3, 2023

Heya @RyanCavanaugh, I've started to run the diff-based user code test suite (tsserver) on this PR at 8ebc95f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 3, 2023

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

@Andarist Andarist changed the title Filter out non-array types when contextually typing union members Filter out non-array types when contextually typing array literal elements Feb 3, 2023
@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

webpack

tsconfig.types.json

@typescript-bot
Copy link
Collaborator

Heya @RyanCavanaugh, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@Andarist
Copy link
Contributor Author

Andarist commented Feb 3, 2023

When it comes to the new error reported for webpack here... I see that any is there even today (in the IDE). I'm not sure how to exactly run this particular test case in a way that would ensure that I'm running the same thing that was executed by the bot - is the script that executes this public anywhere?

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..52589
Metric main 52589 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 359,893k (± 0.02%) 360,021k (± 0.02%) ~ 359,930k 360,126k p=0.065 n=6
Parse Time 3.99s (± 0.21%) 3.99s (± 1.07%) ~ 3.95s 4.04s p=1.000 n=6
Bind Time 1.18s (± 0.47%) 1.18s (± 0.88%) ~ 1.16s 1.19s p=0.663 n=6
Check Time 8.67s (± 0.40%) 8.71s (± 0.55%) ~ 8.66s 8.79s p=0.103 n=6
Emit Time 7.61s (± 0.39%) 7.65s (± 0.65%) ~ 7.58s 7.70s p=0.126 n=6
Total Time 21.45s (± 0.30%) 21.53s (± 0.56%) ~ 21.37s 21.73s p=0.228 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 192,181k (± 0.02%) 193,132k (± 1.17%) ~ 192,160k 197,741k p=0.173 n=6
Parse Time 1.63s (± 1.33%) 1.66s (± 0.62%) +0.04s (+ 2.36%) 1.65s 1.68s p=0.014 n=6
Bind Time 0.79s (± 0.69%) 0.80s (± 0.65%) ~ 0.79s 0.80s p=0.640 n=6
Check Time 9.70s (± 0.71%) 9.79s (± 0.76%) ~ 9.72s 9.92s p=0.093 n=6
Emit Time 2.77s (± 1.22%) 2.84s (± 4.48%) ~ 2.76s 3.10s p=0.225 n=6
Total Time 14.90s (± 0.45%) 15.09s (± 1.06%) +0.19s (+ 1.31%) 14.95s 15.36s p=0.037 n=6
Monaco - node (v18.10.0, x64)
Memory used 344,000k (± 0.01%) 344,045k (± 0.01%) ~ 344,019k 344,083k p=0.092 n=6
Parse Time 2.95s (± 0.78%) 2.96s (± 0.46%) ~ 2.94s 2.98s p=0.292 n=6
Bind Time 1.03s (± 1.33%) 1.04s (± 0.79%) ~ 1.03s 1.05s p=0.868 n=6
Check Time 7.06s (± 0.45%) 7.09s (± 0.68%) ~ 7.05s 7.17s p=0.629 n=6
Emit Time 4.31s (± 0.52%) 4.36s (± 0.64%) +0.05s (+ 1.24%) 4.32s 4.39s p=0.015 n=6
Total Time 15.36s (± 0.38%) 15.45s (± 0.49%) ~ 15.37s 15.55s p=0.065 n=6
TFS - node (v18.10.0, x64)
Memory used 300,414k (± 0.01%) 300,419k (± 0.00%) ~ 300,410k 300,444k p=0.572 n=6
Parse Time 2.27s (± 0.86%) 2.27s (± 0.92%) ~ 2.25s 2.30s p=0.683 n=6
Bind Time 1.17s (± 0.54%) 1.17s (± 0.64%) ~ 1.16s 1.18s p=0.718 n=6
Check Time 6.54s (± 0.32%) 6.56s (± 0.36%) ~ 6.53s 6.59s p=0.224 n=6
Emit Time 3.93s (± 0.86%) 3.92s (± 0.94%) ~ 3.87s 3.96s p=0.572 n=6
Total Time 13.91s (± 0.38%) 13.92s (± 0.29%) ~ 13.85s 13.95s p=0.808 n=6
material-ui - node (v18.10.0, x64)
Memory used 476,888k (± 0.00%) 476,858k (± 0.00%) -30k (- 0.01%) 476,843k 476,872k p=0.024 n=6
Parse Time 3.55s (± 0.71%) 3.54s (± 0.74%) ~ 3.51s 3.58s p=0.571 n=6
Bind Time 0.96s (± 0.57%) 0.97s (± 0.56%) +0.01s (+ 1.04%) 0.97s 0.98s p=0.024 n=6
Check Time 17.26s (± 0.80%) 17.23s (± 0.46%) ~ 17.11s 17.33s p=1.000 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.79s (± 0.74%) 21.75s (± 0.45%) ~ 21.60s 21.88s p=0.873 n=6
xstate - node (v18.10.0, x64)
Memory used 549,089k (± 0.02%) 549,064k (± 0.03%) ~ 548,901k 549,291k p=0.810 n=6
Parse Time 4.57s (± 0.20%) 4.58s (± 0.18%) ~ 4.57s 4.59s p=0.270 n=6
Bind Time 1.71s (± 0.30%) 1.71s (± 0.94%) ~ 1.69s 1.73s p=0.797 n=6
Check Time 2.82s (± 0.58%) 2.81s (± 0.29%) ~ 2.80s 2.82s p=0.085 n=6
Emit Time 0.08s (± 4.99%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=0.405 n=6
Total Time 9.20s (± 0.16%) 9.19s (± 0.22%) ~ 9.17s 9.23s p=0.373 n=6
Angular - node (v16.17.1, x64)
Memory used 359,237k (± 0.00%) 359,389k (± 0.00%) +152k (+ 0.04%) 359,373k 359,413k p=0.005 n=6
Parse Time 4.19s (± 0.32%) 4.19s (± 0.39%) ~ 4.16s 4.20s p=0.738 n=6
Bind Time 1.23s (± 1.23%) 1.23s (± 0.61%) ~ 1.22s 1.24s p=0.615 n=6
Check Time 9.45s (± 0.39%) 9.48s (± 0.44%) ~ 9.43s 9.55s p=0.199 n=6
Emit Time 8.08s (± 0.83%) 8.10s (± 0.65%) ~ 8.02s 8.17s p=0.520 n=6
Total Time 22.94s (± 0.35%) 23.00s (± 0.39%) ~ 22.92s 23.15s p=0.261 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 194,487k (± 0.71%) 194,604k (± 0.72%) ~ 194,016k 197,448k p=0.173 n=6
Parse Time 1.81s (± 0.76%) 1.81s (± 0.67%) ~ 1.79s 1.82s p=1.000 n=6
Bind Time 0.85s (± 0.88%) 0.85s (± 0.88%) ~ 0.84s 0.86s p=1.000 n=6
Check Time 10.40s (± 0.36%) 10.44s (± 0.32%) ~ 10.41s 10.50s p=0.061 n=6
Emit Time 3.06s (± 1.11%) 3.04s (± 0.38%) ~ 3.02s 3.05s p=0.223 n=6
Total Time 16.12s (± 0.15%) 16.14s (± 0.25%) ~ 16.09s 16.21s p=0.518 n=6
Monaco - node (v16.17.1, x64)
Memory used 343,288k (± 0.01%) 343,290k (± 0.01%) ~ 343,255k 343,361k p=0.936 n=6
Parse Time 3.15s (± 1.04%) 3.17s (± 1.22%) ~ 3.13s 3.24s p=0.257 n=6
Bind Time 1.11s (± 0.68%) 1.12s (± 0.73%) ~ 1.11s 1.13s p=0.383 n=6
Check Time 7.73s (± 0.30%) 7.75s (± 0.43%) ~ 7.72s 7.81s p=0.568 n=6
Emit Time 4.52s (± 0.46%) 4.54s (± 0.71%) ~ 4.49s 4.58s p=0.329 n=6
Total Time 16.51s (± 0.16%) 16.58s (± 0.33%) +0.07s (+ 0.42%) 16.50s 16.65s p=0.037 n=6
TFS - node (v16.17.1, x64)
Memory used 299,780k (± 0.01%) 299,783k (± 0.01%) ~ 299,746k 299,813k p=0.630 n=6
Parse Time 2.48s (± 1.06%) 2.49s (± 2.08%) ~ 2.43s 2.54s p=0.746 n=6
Bind Time 1.25s (± 0.60%) 1.26s (± 0.78%) ~ 1.25s 1.27s p=0.300 n=6
Check Time 7.20s (± 0.51%) 7.21s (± 0.42%) ~ 7.18s 7.26s p=0.806 n=6
Emit Time 4.23s (± 0.72%) 4.25s (± 0.61%) ~ 4.21s 4.27s p=0.332 n=6
Total Time 15.17s (± 0.58%) 15.21s (± 0.50%) ~ 15.13s 15.31s p=0.572 n=6
material-ui - node (v16.17.1, x64)
Memory used 476,121k (± 0.01%) 476,127k (± 0.01%) ~ 476,089k 476,155k p=0.575 n=6
Parse Time 3.73s (± 0.55%) 3.72s (± 0.24%) ~ 3.71s 3.73s p=0.273 n=6
Bind Time 1.02s (± 0.40%) 1.02s (± 0.00%) ~ 1.02s 1.02s p=0.405 n=6
Check Time 18.20s (± 0.39%) 18.26s (± 0.50%) ~ 18.10s 18.38s p=0.297 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.95s (± 0.37%) 22.99s (± 0.39%) ~ 22.85s 23.12s p=0.335 n=6
xstate - node (v16.17.1, x64)
Memory used 546,670k (± 0.00%) 546,788k (± 0.02%) ~ 546,656k 546,955k p=0.173 n=6
Parse Time 4.76s (± 0.30%) 4.77s (± 0.43%) ~ 4.75s 4.81s p=0.289 n=6
Bind Time 1.83s (± 0.46%) 1.80s (± 3.67%) ~ 1.67s 1.84s p=0.340 n=6
Check Time 3.05s (± 0.58%) 3.10s (± 2.11%) +0.04s (+ 1.42%) 3.05s 3.23s p=0.033 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 9.74s (± 0.25%) 9.77s (± 0.19%) ~ 9.74s 9.79s p=0.072 n=6
Angular - node (v14.15.1, x64)
Memory used 352,850k (± 0.01%) 353,026k (± 0.01%) +176k (+ 0.05%) 353,001k 353,068k p=0.005 n=6
Parse Time 4.24s (± 0.19%) 4.24s (± 0.35%) ~ 4.22s 4.26s p=0.508 n=6
Bind Time 1.29s (± 0.43%) 1.29s (± 0.98%) ~ 1.28s 1.31s p=0.663 n=6
Check Time 9.73s (± 0.67%) 9.78s (± 0.39%) ~ 9.74s 9.83s p=0.121 n=6
Emit Time 8.33s (± 0.36%) 8.38s (± 0.72%) ~ 8.29s 8.47s p=0.107 n=6
Total Time 23.59s (± 0.36%) 23.69s (± 0.33%) ~ 23.58s 23.77s p=0.078 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used 188,852k (± 0.06%) 188,891k (± 0.08%) ~ 188,702k 189,069k p=1.000 n=6
Parse Time 1.84s (± 0.00%) 1.84s (± 0.63%) ~ 1.83s 1.86s p=1.000 n=6
Bind Time 0.86s (± 0.48%) 0.86s (± 0.47%) ~ 0.86s 0.87s p=0.218 n=6
Check Time 10.53s (± 0.43%) 10.56s (± 0.35%) ~ 10.52s 10.62s p=0.170 n=6
Emit Time 3.44s (± 3.69%) 3.29s (± 5.36%) 🟩-0.15s (- 4.26%) 3.11s 3.46s p=0.042 n=6
Total Time 16.67s (± 0.90%) 16.56s (± 1.19%) ~ 16.37s 16.77s p=0.378 n=6
Monaco - node (v14.15.1, x64)
Memory used 338,023k (± 0.00%) 338,021k (± 0.01%) ~ 337,985k 338,043k p=1.000 n=6
Parse Time 3.22s (± 0.60%) 3.25s (± 0.64%) +0.03s (+ 0.98%) 3.23s 3.28s p=0.023 n=6
Bind Time 1.11s (± 0.93%) 1.12s (± 0.73%) ~ 1.11s 1.13s p=0.546 n=6
Check Time 8.06s (± 0.56%) 8.11s (± 0.45%) ~ 8.06s 8.15s p=0.052 n=6
Emit Time 4.77s (± 1.27%) 4.78s (± 0.49%) ~ 4.76s 4.82s p=0.744 n=6
Total Time 17.16s (± 0.41%) 17.26s (± 0.33%) +0.10s (+ 0.56%) 17.17s 17.34s p=0.031 n=6
TFS - node (v14.15.1, x64)
Memory used 294,584k (± 0.01%) 294,580k (± 0.00%) ~ 294,566k 294,604k p=0.810 n=6
Parse Time 2.75s (± 0.50%) 2.75s (± 1.01%) ~ 2.70s 2.78s p=0.932 n=6
Bind Time 1.11s (± 1.36%) 1.10s (± 0.68%) ~ 1.09s 1.11s p=0.555 n=6
Check Time 7.51s (± 0.71%) 7.50s (± 0.33%) ~ 7.46s 7.53s p=0.572 n=6
Emit Time 4.61s (± 0.64%) 4.62s (± 0.84%) ~ 4.56s 4.67s p=0.809 n=6
Total Time 15.98s (± 0.54%) 15.97s (± 0.32%) ~ 15.88s 16.03s p=0.744 n=6
material-ui - node (v14.15.1, x64)
Memory used 471,628k (± 0.01%) 471,614k (± 0.01%) ~ 471,586k 471,656k p=0.423 n=6
Parse Time 3.92s (± 0.26%) 3.93s (± 0.55%) ~ 3.90s 3.96s p=0.326 n=6
Bind Time 1.03s (± 0.50%) 1.04s (± 0.72%) ~ 1.03s 1.05s p=0.247 n=6
Check Time 19.06s (± 0.77%) 19.15s (± 0.37%) ~ 19.07s 19.27s p=0.173 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 24.02s (± 0.63%) 24.12s (± 0.27%) ~ 24.02s 24.21s p=0.147 n=6
xstate - node (v14.15.1, x64)
Memory used 534,822k (± 0.00%) 534,889k (± 0.00%) +67k (+ 0.01%) 534,864k 534,912k p=0.005 n=6
Parse Time 5.15s (± 0.33%) 5.19s (± 1.02%) ~ 5.12s 5.26s p=0.294 n=6
Bind Time 1.71s (± 0.96%) 1.73s (± 1.12%) ~ 1.71s 1.76s p=0.191 n=6
Check Time 3.15s (± 0.58%) 3.15s (± 0.38%) ~ 3.14s 3.17s p=1.000 n=6
Emit Time 0.10s (± 4.01%) 0.10s (± 4.99%) ~ 0.10s 0.11s p=0.595 n=6
Total Time 10.12s (± 0.27%) 10.17s (± 0.64%) ~ 10.09s 10.24s p=0.196 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 52589 6
Baseline main 6

TSServer

Comparison Report - main..52589
Metric main 52589 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,526ms (± 1.51%) 2,509ms (± 1.92%) ~ 2,462ms 2,589ms p=0.575 n=6
Req 2 - geterr 5,573ms (± 0.53%) 5,562ms (± 0.56%) ~ 5,512ms 5,596ms p=0.689 n=6
Req 3 - references 377ms (± 1.20%) 377ms (± 0.37%) ~ 375ms 379ms p=0.936 n=6
Req 4 - navto 283ms (± 0.53%) 282ms (± 0.58%) ~ 280ms 284ms p=0.367 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 68ms (± 9.74%) 68ms (± 6.81%) ~ 64ms 77ms p=0.871 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,722ms (± 1.81%) 2,734ms (± 1.72%) ~ 2,682ms 2,799ms p=0.810 n=6
Req 2 - geterr 4,053ms (± 0.68%) 4,057ms (± 0.31%) ~ 4,038ms 4,071ms p=0.574 n=6
Req 3 - references 367ms (± 0.87%) 369ms (± 0.63%) ~ 365ms 372ms p=0.469 n=6
Req 4 - navto 296ms (± 0.63%) 298ms (± 0.46%) ~ 295ms 299ms p=0.103 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 (± 8.26%) 81ms (± 6.02%) ~ 71ms 84ms p=0.277 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,505ms (± 0.56%) 3,496ms (± 0.49%) ~ 3,478ms 3,523ms p=0.378 n=6
Req 2 - geterr 1,649ms (± 1.00%) 1,652ms (± 1.02%) ~ 1,627ms 1,668ms p=0.810 n=6
Req 3 - references 104ms (± 0.94%) 103ms (± 1.29%) ~ 101ms 105ms p=0.176 n=6
Req 4 - navto 357ms (± 0.52%) 358ms (± 1.17%) ~ 351ms 364ms p=0.329 n=6
Req 5 - completionInfo count 3,175 (± 0.00%) 3,175 (± 0.00%) ~ 3,175 3,175 p=1.000 n=6
Req 5 - completionInfo 473ms (± 0.83%) 470ms (± 1.27%) ~ 461ms 477ms p=0.260 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,787ms (± 0.60%) 2,793ms (± 0.44%) ~ 2,775ms 2,806ms p=0.630 n=6
Req 2 - geterr 5,884ms (± 0.35%) 5,952ms (± 0.74%) +69ms (+ 1.17%) 5,911ms 6,017ms p=0.005 n=6
Req 3 - references 380ms (± 0.87%) 378ms (± 0.27%) ~ 377ms 380ms p=0.622 n=6
Req 4 - navto 281ms (± 2.04%) 279ms (± 1.19%) ~ 276ms 283ms p=0.805 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 71ms (± 1.87%) 70ms (± 0.58%) ~ 70ms 71ms p=0.257 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,929ms (± 0.38%) 2,931ms (± 0.41%) ~ 2,916ms 2,948ms p=0.810 n=6
Req 2 - geterr 4,401ms (± 0.25%) 4,409ms (± 0.44%) ~ 4,370ms 4,423ms p=0.228 n=6
Req 3 - references 378ms (± 0.73%) 380ms (± 0.55%) ~ 377ms 383ms p=0.220 n=6
Req 4 - navto 287ms (± 0.48%) 286ms (± 0.22%) ~ 285ms 287ms p=0.236 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 71ms (± 1.06%) 73ms (± 4.15%) ~ 71ms 79ms p=0.150 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,633ms (± 0.16%) 3,631ms (± 0.31%) ~ 3,614ms 3,641ms p=1.000 n=6
Req 2 - geterr 1,828ms (± 1.28%) 1,818ms (± 1.07%) ~ 1,790ms 1,849ms p=0.230 n=6
Req 3 - references 112ms (± 1.78%) 111ms (± 2.26%) ~ 108ms 114ms p=0.413 n=6
Req 4 - navto 341ms (± 0.90%) 341ms (± 1.44%) ~ 337ms 351ms p=0.933 n=6
Req 5 - completionInfo count 3,175 (± 0.00%) 3,175 (± 0.00%) ~ 3,175 3,175 p=1.000 n=6
Req 5 - completionInfo 480ms (± 1.08%) 479ms (± 0.72%) ~ 475ms 484ms p=0.936 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,908ms (± 0.42%) 2,909ms (± 0.62%) ~ 2,894ms 2,944ms p=0.936 n=6
Req 2 - geterr 6,304ms (± 1.65%) 6,324ms (± 0.98%) ~ 6,251ms 6,430ms p=0.810 n=6
Req 3 - references 390ms (± 0.63%) 392ms (± 1.07%) ~ 387ms 398ms p=0.391 n=6
Req 4 - navto 284ms (± 2.46%) 281ms (± 1.54%) ~ 277ms 287ms p=0.374 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 90ms (± 8.67%) 87ms (±12.96%) ~ 73ms 98ms p=0.809 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,076ms (± 0.82%) 3,081ms (± 0.65%) ~ 3,054ms 3,103ms p=0.810 n=6
Req 2 - geterr 4,710ms (± 0.26%) 4,710ms (± 0.26%) ~ 4,690ms 4,722ms p=1.000 n=6
Req 3 - references 410ms (± 2.26%) 409ms (± 1.10%) ~ 405ms 417ms p=0.627 n=6
Req 4 - navto 296ms (± 0.55%) 296ms (± 0.30%) ~ 295ms 297ms p=0.682 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 85ms (± 4.72%) 83ms (± 5.45%) ~ 80ms 89ms p=0.933 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,983ms (± 0.73%) 3,978ms (± 0.36%) ~ 3,955ms 3,992ms p=0.297 n=6
Req 2 - geterr 1,808ms (± 2.43%) 1,805ms (± 1.66%) ~ 1,775ms 1,862ms p=1.000 n=6
Req 3 - references 129ms (± 1.65%) 131ms (± 2.78%) ~ 127ms 137ms p=0.618 n=6
Req 4 - navto 373ms (± 0.76%) 376ms (± 0.77%) ~ 371ms 379ms p=0.198 n=6
Req 5 - completionInfo count 3,175 (± 0.00%) 3,175 (± 0.00%) ~ 3,175 3,175 p=1.000 n=6
Req 5 - completionInfo 494ms (± 0.99%) 501ms (± 1.95%) ~ 486ms 513ms p=0.199 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 52589 6
Baseline main 6

Startup

Comparison Report - main..52589
Metric main 52589 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 142.54ms (± 0.19%) 142.84ms (± 0.22%) +0.30ms (+ 0.21%) 142.01ms 146.49ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 227.84ms (± 0.20%) 227.74ms (± 0.17%) ~ 226.74ms 232.87ms p=0.141 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 229.20ms (± 0.15%) 229.43ms (± 0.20%) +0.23ms (+ 0.10%) 228.28ms 236.16ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 210.35ms (± 0.20%) 210.16ms (± 0.18%) -0.19ms (- 0.09%) 209.26ms 217.53ms p=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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 52589 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@jakebailey
Copy link
Member

When it comes to the new error reported for webpack here... I see that any is there even today (in the IDE). I'm not sure how to exactly run this particular test case in a way that would ensure that I'm running the same thing that was executed by the bot - is the script that executes this public anywhere?

The code is here: https://github.com/microsoft/typescript-error-deltas

And the test (https://github.com/microsoft/typescript-error-deltas/blob/main/userTests/webpack/test.json) implies that it's just cloning and running tsc.

@Andarist
Copy link
Contributor Author

Andarist commented Feb 3, 2023

Thank you for the pointers! It's a little bit weird that the bot's message mentioned tsconfig.types.json. Why that would be picked by tsc with no args etc? 🤔

@jakebailey
Copy link
Member

jakebailey commented Feb 3, 2023

I glossed over the fact that the error-deltas script has some logic to find tsconfigs and test them; that might be what's happening here.

@RyanCavanaugh
Copy link
Member

@fatcerberus
Copy link

TIL typescript-bot is actually multiple separate bots

@Andarist
Copy link
Contributor Author

Andarist commented Feb 4, 2023

I confirmed that this webpack-related failure is caused by some weird intersection of this PR and this regression that was introduced in #51865 . The PR that is fixing this regression (this one) is fixing the webpack issue (I tested a build with this PR + @ahejlsberg's fix in it).

I'll try to distill a minimal repro from webpack to include it as a test somewhere but I don't think it's going to be that crucial for this PR here. Once @ahejlsberg's PR lands - I will just pull in main here.

@Andarist
Copy link
Contributor Author

@RyanCavanaugh I pulled in the contextual type caching fix here (by merging main into this branch) and now the caught issue shouldn't happen any longer. Could you re-trigger the bot run?

@jakebailey
Copy link
Member

@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this

@@ -23075,6 +23065,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return isArrayLikeType(type) || isTupleLikeType(type);
}

function isAssignableToAvailableAnyIterable(type: Type): boolean {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe I'm brainfarting, but what does "Available" mean in this context?

Copy link
Contributor Author

@Andarist Andarist Mar 8, 2023

Choose a reason for hiding this comment

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

When we are in es5 context the "available any iterable" becomes anyReadonlyArray. I know that the name isn't the best but I wanted to indicate that it might not exactly be testing against anyIterable (cause that might not be available). I'm open to suggestions for a better name here

@jakebailey
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 faster

@typescript-bot
Copy link
Collaborator

Heya @jakebailey, I'm starting to run the diff-based top-repos suite on this PR at 85c03c5. Hold tight - I'll update this comment with the log link once the build has been queued.

@typescript-bot
Copy link
Collaborator

Heya @jakebailey, I'm starting to run the diff-based user code test suite on this PR at 85c03c5. Hold tight - I'll update this comment with the log link once the build has been queued.

@typescript-bot
Copy link
Collaborator

Heya @jakebailey, I'm starting to run the parallelized Definitely Typed test suite on this PR at 85c03c5. Hold tight - I'll update this comment with the log link once the build has been queued.

@typescript-bot
Copy link
Collaborator

Heya @jakebailey, I'm starting to run the abridged perf test suite on this PR at 85c03c5. Hold tight - I'll update this comment with the log link once the build has been queued.

@typescript-bot
Copy link
Collaborator

Heya @jakebailey, I'm starting to run the extended test suite on this PR at 85c03c5. Hold tight - I'll update this comment with the log link once the build has been queued.

@jakebailey
Copy link
Member

Apparently the bot choked and I didn't notice. Let's try again:

@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
Copy link
Collaborator

typescript-bot commented Mar 10, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 10, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 10, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 10, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 10, 2023

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

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..52589

Metric main 52589 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 362,834k (± 0.01%) 362,978k (± 0.00%) +145k (+ 0.04%) 362,952k 362,996k p=0.005 n=6
Parse Time 3.50s (± 0.55%) 3.52s (± 0.55%) ~ 3.50s 3.55s p=0.124 n=6
Bind Time 1.18s (± 0.54%) 1.18s (± 0.46%) ~ 1.18s 1.19s p=0.201 n=6
Check Time 9.41s (± 0.47%) 9.45s (± 0.49%) ~ 9.40s 9.53s p=0.172 n=6
Emit Time 7.86s (± 0.35%) 7.93s (± 0.64%) +0.07s (+ 0.87%) 7.87s 8.02s p=0.024 n=6
Total Time 21.95s (± 0.34%) 22.08s (± 0.33%) +0.13s (+ 0.60%) 22.01s 22.19s p=0.011 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 192,702k (± 0.02%) 192,713k (± 0.02%) ~ 192,671k 192,764k p=0.689 n=6
Parse Time 1.57s (± 1.10%) 1.58s (± 0.84%) ~ 1.56s 1.60s p=0.210 n=6
Bind Time 0.82s (± 0.50%) 0.82s (± 0.77%) ~ 0.81s 0.83s p=0.673 n=6
Check Time 10.09s (± 0.66%) 10.08s (± 0.75%) ~ 10.00s 10.18s p=0.748 n=6
Emit Time 2.98s (± 0.86%) 2.98s (± 0.68%) ~ 2.95s 3.01s p=0.935 n=6
Total Time 15.46s (± 0.54%) 15.47s (± 0.44%) ~ 15.38s 15.54s p=0.810 n=6
Monaco - node (v16.17.1, x64)
Memory used 346,715k (± 0.00%) 346,702k (± 0.00%) ~ 346,677k 346,721k p=0.172 n=6
Parse Time 2.72s (± 0.55%) 2.73s (± 0.38%) ~ 2.71s 2.74s p=0.868 n=6
Bind Time 1.09s (± 0.75%) 1.09s (± 0.69%) ~ 1.08s 1.10s p=1.000 n=6
Check Time 7.71s (± 0.25%) 7.76s (± 0.43%) +0.05s (+ 0.63%) 7.70s 7.80s p=0.024 n=6
Emit Time 4.45s (± 0.68%) 4.45s (± 0.68%) ~ 4.40s 4.49s p=0.627 n=6
Total Time 15.97s (± 0.28%) 16.02s (± 0.29%) ~ 15.95s 16.08s p=0.106 n=6
TFS - node (v16.17.1, x64)
Memory used 300,148k (± 0.01%) 300,134k (± 0.01%) ~ 300,111k 300,179k p=0.873 n=6
Parse Time 2.18s (± 0.54%) 2.16s (± 0.70%) ~ 2.15s 2.19s p=0.071 n=6
Bind Time 1.24s (± 0.41%) 1.24s (± 1.07%) ~ 1.22s 1.26s p=0.928 n=6
Check Time 7.18s (± 0.31%) 7.16s (± 0.30%) ~ 7.14s 7.20s p=0.223 n=6
Emit Time 4.35s (± 0.92%) 4.34s (± 0.56%) ~ 4.31s 4.37s p=1.000 n=6
Total Time 14.95s (± 0.40%) 14.92s (± 0.29%) ~ 14.87s 14.97s p=0.332 n=6
material-ui - node (v16.17.1, x64)
Memory used 477,676k (± 0.02%) 477,723k (± 0.01%) ~ 477,662k 477,763k p=0.378 n=6
Parse Time 3.21s (± 0.23%) 3.20s (± 0.51%) ~ 3.19s 3.23s p=0.276 n=6
Bind Time 0.95s (± 0.00%) 0.96s (± 0.57%) ~ 0.95s 0.96s p=0.071 n=6
Check Time 18.02s (± 0.53%) 18.04s (± 0.32%) ~ 17.96s 18.11s p=0.689 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.18s (± 0.45%) 22.20s (± 0.27%) ~ 22.10s 22.27s p=0.689 n=6
xstate - node (v16.17.1, x64)
Memory used 550,643k (± 0.01%) 550,648k (± 0.02%) ~ 550,588k 550,853k p=0.872 n=6
Parse Time 3.94s (± 0.32%) 3.95s (± 0.26%) ~ 3.94s 3.97s p=0.061 n=6
Bind Time 1.78s (± 1.09%) 1.79s (± 0.65%) ~ 1.78s 1.81s p=0.410 n=6
Check Time 2.99s (± 0.34%) 2.99s (± 0.18%) ~ 2.99s 3.00s p=0.866 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.80s (± 0.25%) 8.83s (± 0.15%) +0.03s (+ 0.32%) 8.81s 8.85s p=0.022 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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 52589 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

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

Branch only errors:

Package: dom-mediacapture-transform
Error:

Error: Errors in typescript@local for external dependencies:
../dom-webcodecs/webcodecs.generated.d.ts(132,5): error TS2687: All declarations of 'config' must have identical modifiers.
../dom-webcodecs/webcodecs.generated.d.ts(132,5): error TS2717: Subsequent property declarations must have the same type.  Property 'config' must be of type 'VideoDecoderConfig | undefined', but here has type 'VideoDecoderConfig'.
../dom-webcodecs/webcodecs.generated.d.ts(133,5): error TS2687: All declarations of 'supported' must have identical modifiers.
../dom-webcodecs/webcodecs.generated.d.ts(133,5): error TS2717: Subsequent property declarations must have the same type.  Property 'supported' must be of type 'boolean | undefined', but here has type 'boolean'.
../dom-webcodecs/webcodecs.generated.d.ts(153,5): error TS2717: Subsequent property declarations must have the same type.  Property 'keyFrame' must be of type 'boolean | undefined', but here has type 'boolean | null | undefined'.
../dom-webcodecs/webcodecs.generated.d.ts(162,5): error TS2687: All declarations of 'config' must have identical modifiers.
../dom-webcodecs/webcodecs.generated.d.ts(162,5): error TS2717: Subsequent property declarations must have the same type.  Property 'config' must be of type 'VideoEncoderConfig | undefined', but here has type 'VideoEncoderConfig'.
../dom-webcodecs/webcodecs.generated.d.ts(163,5): error TS2687: All declarations of 'supported' must have identical modifiers.
../dom-webcodecs/webcodecs.generated.d.ts(163,5): error TS2717: Subsequent property declarations must have the same type.  Property 'supported' must be of type 'boolean | undefined', but here has type 'boolean'.
../dom-webcodecs/webcodecs.generated.d.ts(369,14): error TS2717: Subsequent property declarations must have the same type.  Property 'timestamp' must be of type 'number', but here has type 'number | null'.
../dom-webcodecs/webcodecs.generated.d.ts(404,6): error TS2300: Duplicate identifier 'BitrateMode'.
../dom-webcodecs/webcodecs.generated.d.ts(406,6): error TS2300: Duplicate identifier 'AlphaOption'.
../dom-webcodecs/webcodecs.generated.d.ts(408,6): error TS2300: Duplicate identifier 'AvcBitstreamFormat'.
../dom-webcodecs/webcodecs.generated.d.ts(409,6): error TS2300: Duplicate identifier 'CodecState'.
../dom-webcodecs/webcodecs.generated.d.ts(411,6): error TS2300: Duplicate identifier 'EncodedVideoChunkType'.
../dom-webcodecs/webcodecs.generated.d.ts(413,6): error TS2300: Duplicate identifier 'LatencyMode'.
../dom-webcodecs/webcodecs.generated.d.ts(416,6): error TS2300: Duplicate identifier 'VideoPixelFormat'.
../../../../../../built/local/lib.dom.d.ts(2010,5): error TS2687: All declarations of 'config' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(2011,5): error TS2687: All declarations of 'supported' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(2040,5): error TS2687: All declarations of 'config' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(2041,5): error TS2687: All declarations of 'supported' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(19284,6): error TS2300: Duplicate identifier 'AlphaOption'.
../../../../../../built/local/lib.dom.d.ts(19295,6): error TS2300: Duplicate identifier 'AvcBitstreamFormat'.
../../../../../../built/local/lib.dom.d.ts(19298,6): error TS2300: Duplicate identifier 'BitrateMode'.
../../../../../../built/local/lib.dom.d.ts(19315,6): error TS2300: Duplicate identifier 'CodecState'.
../../../../../../built/local/lib.dom.d.ts(19327,6): error TS2300: Duplicate identifier 'EncodedVideoChunkType'.
../../../../../../built/local/lib.dom.d.ts(19354,6): error TS2300: Duplicate identifier 'LatencyMode'.
../../../../../../built/local/lib.dom.d.ts(19448,6): error TS2300: Duplicate identifier 'VideoPixelFormat'.

    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: dom-screen-wake-lock
Error:

Error: Errors in typescript@local for external dependencies:
../../../../../../built/local/lib.dom.d.ts(19450,6): error TS2300: Duplicate identifier 'WakeLockType'.

    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: web-animations-js
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/web-animations-js/index.d.ts:11:14
ERROR: 11:14  expect  TypeScript@local compile error: 
Subsequent property declarations must have the same type.  Property 'currentTime' must be of type 'CSSNumberish | null', but here has type 'number | null'.
ERROR: 12:14  expect  TypeScript@local compile error: 
Subsequent property declarations must have the same type.  Property 'timelineTime' must be of type 'CSSNumberish | null', but here has type 'number | null'.
ERROR: 23:5   expect  TypeScript@local compile error: 
Subsequent property declarations must have the same type.  Property 'currentTime' must be of type 'CSSNumberish | null | undefined', but here has type 'number | null | undefined'.
ERROR: 24:5   expect  TypeScript@local compile error: 
Subsequent property declarations must have the same type.  Property 'timelineTime' must be of type 'CSSNumberish | null | undefined', but here has type 'number | null | undefined'.
ERROR: 41:14  expect  TypeScript@local compile error: 
Subsequent property declarations must have the same type.  Property 'currentTime' must be of type 'CSSNumberish | null', but here has type 'number | null'.
ERROR: 73:5   expect  TypeScript@local compile error: 
Subsequent property declarations must have the same type.  Property 'currentTime' must be of type 'CSSNumberish | null', but here has type 'number | null'.
ERROR: 79:5   expect  TypeScript@local compile error: 
Subsequent property declarations must have the same type.  Property 'startTime' must be of type 'CSSNumberish | null', but here has type 'number | null'.

    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: webappsec-credential-management
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/webappsec-credential-management/index.d.ts:309:5
ERROR: 309:5  expect  TypeScript@local compile error: 
Subsequent property declarations must have the same type.  Property 'mediation' must be of type 'CredentialMediationRequirement | undefined', but here has type '"required" | "optional" | "silent" | undefined'.

    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: dom-webcodecs
Error:

Error: Errors in typescript@local for external dependencies:
../../../../../../built/local/lib.dom.d.ts(2010,5): error TS2687: All declarations of 'config' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(2011,5): error TS2687: All declarations of 'supported' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(2040,5): error TS2687: All declarations of 'config' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(2041,5): error TS2687: All declarations of 'supported' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(19284,6): error TS2300: Duplicate identifier 'AlphaOption'.
../../../../../../built/local/lib.dom.d.ts(19295,6): error TS2300: Duplicate identifier 'AvcBitstreamFormat'.
../../../../../../built/local/lib.dom.d.ts(19298,6): error TS2300: Duplicate identifier 'BitrateMode'.
../../../../../../built/local/lib.dom.d.ts(19315,6): error TS2300: Duplicate identifier 'CodecState'.
../../../../../../built/local/lib.dom.d.ts(19327,6): error TS2300: Duplicate identifier 'EncodedVideoChunkType'.
../../../../../../built/local/lib.dom.d.ts(19354,6): error TS2300: Duplicate identifier 'LatencyMode'.
../../../../../../built/local/lib.dom.d.ts(19448,6): error TS2300: Duplicate identifier 'VideoPixelFormat'.

    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: w3c-css-typed-object-model-level-1
Error:

Error: Errors in typescript@local for external dependencies:
../../../../../../built/local/lib.dom.d.ts(23,1): error TS6200: Definitions of the following identifiers conflict with those in another file: CSSStyleValue, CSSVariableReferenceValue, CSSUnparsedSegment, CSSUnparsedValue, CSSKeywordValue, CSSNumericValue, CSSUnitValue, CSSMathValue, CSSMathSum, CSSMathProduct, CSSMathNegate, CSSMathInvert, CSSMathMin, CSSMathMax, CSSNumericArray, CSSTransformValue, CSSTransformComponent, CSSTranslate, CSSRotate, CSSScale, CSSSkew, CSSSkewX, CSSSkewY, CSSPerspective, CSSMatrixComponent, CSSImageValue, StylePropertyMapReadOnly, StylePropertyMap
../../../../../../built/local/lib.dom.d.ts(177,5): error TS2687: All declarations of 'is2D' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(181,5): error TS2687: All declarations of 'angle' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(182,5): error TS2687: All declarations of 'flex' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(183,5): error TS2687: All declarations of 'frequency' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(184,5): error TS2687: All declarations of 'length' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(185,5): error TS2687: All declarations of 'percent' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(186,5): error TS2687: All declarations of 'percentHint' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(187,5): error TS2687: All declarations of 'resolution' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(188,5): error TS2687: All declarations of 'time' must have identical modifiers.
../../../../../../built/local/lib.dom.d.ts(19299,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
../../../../../../built/local/lib.dom.d.ts(19300,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations.

    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: use-color-scheme
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/use-color-scheme/use-color-scheme-tests.ts:8:1
ERROR: 8:1  expect  TypeScript@local expected type to be:
  "dark" | "light" | "no-preference"
got:
  "no-preference" | "dark" | "light"

    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: dom-mediacapture-record
Error:

Error: Errors in typescript@local for external dependencies:
../../../../../../built/local/lib.dom.d.ts(19298,6): error TS2300: Duplicate identifier 'BitrateMode'.

    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: ramda
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ramda/test/binary-tests.ts:29:5
ERROR: 29:5  expect  TypeScript@local expected type to be:
  (head: number, head: undefined) => number[]
got:
  (head: number, head_1: undefined) => number[]
ERROR: 30:5  expect  TypeScript@local expected type to be:
  (head: number, head: number) => number[]
got:
  (head: number, head_1: number) => number[]
ERROR: 31:5  expect  TypeScript@local expected type to be:
  (head: number, head: number) => number[]
got:
  (head: number, head_1: number) => number[]

/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/ramda/test/nAry-tests.ts:22:5
ERROR: 22:5  expect  TypeScript@local expected type to be:
  (head: number, head: undefined) => number[]
got:
  (head: number, head_1: undefined) => number[]

    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.

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@jakebailey jakebailey merged commit e775383 into microsoft:main Mar 10, 2023
@Andarist Andarist deleted the fix/prefer-array-members-for-contextual-type-of-arr-el branch March 10, 2023 17:57
@ahejlsberg
Copy link
Member

This PR breaks the following code:

function f<T extends { "0": (p1: number) => number }>(p: T): T {
    return p;
}

var v = f([x => x]);  // Implicit any error that wasn't there before

I'm surprised this wasn't caught by our CI tests since it is an existing test in tests/cases/compiler/inferringAnyFunctionType1.ts.

Also, I'm not sure I agree with the issue (#52588) that this PR fixes. Seems to me entirely reasonable that the string index signature contributes to the contextual type for the array literal element.

@ahejlsberg
Copy link
Member

I think I understand why we didn't see a test failure. It's because we run our tests with a lib.d.ts file that doesn't include an Iterable type (which seems wrong, BTW). The break shows up once an Iterable type is present.

@jakebailey
Copy link
Member

I'll send a revert.

jakebailey added a commit to jakebailey/TypeScript that referenced this pull request Mar 16, 2023
@jakebailey jakebailey mentioned this pull request Mar 16, 2023
@jakebailey
Copy link
Member

It's because we run our tests with a lib.d.ts file that doesn't include an Iterable type (which seems wrong, BTW). The break shows up once an Iterable type is present.

Yeah, the default lib is es5, which doesn't have Iterable.

jakebailey added a commit to jakebailey/TypeScript that referenced this pull request Mar 16, 2023
jakebailey added a commit that referenced this pull request Mar 16, 2023
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.

Contextual type for an array element doesn't filter out non-array union members
6 participants