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

Isolated declarations fix signature serialization scoping #58409

Merged

Conversation

dragomirtitian
Copy link
Contributor

@dragomirtitian dragomirtitian commented May 2, 2024

Fixes #58408
Fixes #58407

@dragomirtitian dragomirtitian changed the title Isolated declarations fix sig scoping Isolated declarations fix signature serialization scoping May 2, 2024
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 2, 2024
Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

I stopped reviewing at the letter C (there's a lot changing, of course)

@jakebailey
Copy link
Member

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 3, 2024

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

Command Status Results
perf test this ✅ Started 👀 Results

@@ -18,16 +18,16 @@ function run(configuration: commands.IConfiguration) {
> : ^^^^^^
>configuration.workspace.toAbsolutePath(configuration.server) : string
> : ^^^^^^
>configuration.workspace.toAbsolutePath : (server: IServer, workspaceRelativePath?: string) => string
> : ^ ^^ ^^ ^^^ ^^^^^^^^^^^
>configuration.workspace.toAbsolutePath : (server: import("visibilityOfCrossModuleTypeUsage_server").IServer, workspaceRelativePath?: string) => string
Copy link
Member

Choose a reason for hiding this comment

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

Huh, interesting; I guess this was a bug before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

trackExistingEntityName would previously check if the symbol could be resolved in the original context and if the symbol is accessible from the enclosing declaration. The answer to both of those is yes. The issue is that the symbol is not accessible in the same way. This can lead to the scope confusion I showed in one of the bugs.

What I do now is I test if the symbol is also resolvable in the context it is being used in. And in this case IServer is not directly accessible so it falls back on typeToTypeNodeHelper which will print the import.

I have a follow on PR that will try to find a more appropriate name in the enclosing declaration where this is printed (such as commands.IServer in this case) and will also try to use more of the original node even if sometimes this means replacing parts of the node with nodes printed from types.

@typescript-bot
Copy link
Collaborator

@jakebailey
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,834k (± 0.80%) 193,427k (± 0.94%) ~ 192,230k 195,805k p=0.173 n=6
Parse Time 1.56s (± 1.24%) 1.54s (± 1.21%) ~ 1.51s 1.56s p=0.220 n=6
Bind Time 0.87s (± 0.94%) 0.87s (± 1.13%) ~ 0.86s 0.88s p=0.862 n=6
Check Time 11.30s (± 0.19%) 11.29s (± 0.37%) ~ 11.24s 11.36s p=0.169 n=6
Emit Time 3.14s (± 0.48%) 3.14s (± 0.98%) ~ 3.09s 3.18s p=0.560 n=6
Total Time 16.87s (± 0.25%) 16.84s (± 0.45%) ~ 16.75s 16.95s p=0.422 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 945,322 945,322 ~ ~ ~ p=1.000 n=6
Types 408,110 408,110 ~ ~ ~ p=1.000 n=6
Memory used 1,222,790k (± 0.00%) 1,222,662k (± 0.01%) -129k (- 0.01%) 1,222,591k 1,222,736k p=0.008 n=6
Parse Time 6.75s (± 0.33%) 6.80s (± 0.58%) ~ 6.74s 6.85s p=0.063 n=6
Bind Time 1.87s (± 0.40%) 1.88s (± 0.52%) ~ 1.86s 1.89s p=0.077 n=6
Check Time 31.33s (± 0.41%) 31.48s (± 0.30%) ~ 31.38s 31.62s p=0.109 n=6
Emit Time 14.63s (± 0.92%) 14.63s (± 1.07%) ~ 14.33s 14.76s p=1.000 n=6
Total Time 54.58s (± 0.30%) 54.78s (± 0.33%) ~ 54.54s 55.07s p=0.092 n=6
mui-docs - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 1,956,892 1,956,892 ~ ~ ~ p=1.000 n=6
Types 676,640 676,640 ~ ~ ~ p=1.000 n=6
Memory used 1,765,652k (± 0.00%) 1,765,678k (± 0.00%) ~ 1,765,615k 1,765,719k p=0.230 n=6
Parse Time 7.93s (± 0.38%) 7.93s (± 0.29%) ~ 7.90s 7.97s p=0.870 n=6
Bind Time 2.73s (± 0.55%) 2.74s (± 0.72%) ~ 2.71s 2.76s p=0.370 n=6
Check Time 66.48s (± 0.45%) 66.96s (± 0.32%) +0.48s (+ 0.72%) 66.72s 67.19s p=0.013 n=6
Emit Time 0.18s (± 4.62%) 0.17s (± 6.19%) ~ 0.16s 0.18s p=0.112 n=6
Total Time 77.32s (± 0.40%) 77.80s (± 0.28%) +0.48s (+ 0.63%) 77.57s 78.08s p=0.013 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,217,388 1,217,541 +153 (+ 0.01%) ~ ~ p=0.001 n=6
Types 259,008 259,048 +40 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 2,328,259k (± 0.04%) 2,445,846k (±11.72%) ~ 2,327,915k 3,031,667k p=0.128 n=6
Parse Time 7.41s (± 1.05%) 7.40s (± 1.00%) ~ 7.31s 7.51s p=0.873 n=6
Bind Time 2.74s (± 0.64%) 2.72s (± 0.98%) ~ 2.68s 2.76s p=0.090 n=6
Check Time 48.72s (± 0.47%) 48.83s (± 0.62%) ~ 48.58s 49.39s p=0.748 n=6
Emit Time 3.87s (± 1.03%) 3.83s (± 1.85%) ~ 3.70s 3.89s p=0.297 n=6
Total Time 62.76s (± 0.46%) 62.81s (± 0.56%) ~ 62.50s 63.44s p=1.000 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,217,388 1,217,541 +153 (+ 0.01%) ~ ~ p=0.001 n=6
Types 259,008 259,048 +40 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 2,403,180k (± 0.01%) 2,403,637k (± 0.02%) ~ 2,403,088k 2,404,338k p=0.093 n=6
Parse Time 7.69s (± 0.85%) 7.74s (± 0.90%) ~ 7.65s 7.83s p=0.297 n=6
Bind Time 2.47s (± 1.29%) 2.47s (± 0.54%) ~ 2.46s 2.49s p=1.000 n=6
Check Time 49.50s (± 0.32%) 49.60s (± 0.33%) ~ 49.39s 49.82s p=0.422 n=6
Emit Time 3.87s (± 0.77%) 3.85s (± 0.63%) ~ 3.81s 3.87s p=0.108 n=6
Total Time 63.55s (± 0.33%) 63.68s (± 0.23%) ~ 63.48s 63.88s p=0.298 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,310 256,463 +153 (+ 0.06%) ~ ~ p=0.001 n=6
Types 104,458 104,498 +40 (+ 0.04%) ~ ~ p=0.001 n=6
Memory used 424,910k (± 0.01%) 425,072k (± 0.03%) +162k (+ 0.04%) 424,972k 425,285k p=0.005 n=6
Parse Time 4.15s (± 0.85%) 4.15s (± 0.76%) ~ 4.09s 4.18s p=0.935 n=6
Bind Time 1.59s (± 1.30%) 1.57s (± 0.80%) -0.02s (- 1.57%) 1.55s 1.58s p=0.041 n=6
Check Time 21.94s (± 0.48%) 21.95s (± 0.29%) ~ 21.89s 22.06s p=1.000 n=6
Emit Time 1.70s (± 0.80%) 1.72s (± 0.79%) +0.02s (+ 1.17%) 1.70s 1.74s p=0.042 n=6
Total Time 29.39s (± 0.41%) 29.39s (± 0.34%) ~ 29.26s 29.55s p=0.873 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,826 224,826 ~ ~ ~ p=1.000 n=6
Types 94,115 94,115 ~ ~ ~ p=1.000 n=6
Memory used 369,964k (± 0.03%) 370,017k (± 0.01%) ~ 369,945k 370,065k p=0.230 n=6
Parse Time 3.51s (± 0.81%) 3.51s (± 1.42%) ~ 3.46s 3.58s p=1.000 n=6
Bind Time 1.95s (± 0.72%) 1.95s (± 0.60%) ~ 1.94s 1.97s p=0.803 n=6
Check Time 19.34s (± 0.31%) 19.34s (± 0.16%) ~ 19.30s 19.39s p=1.000 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.80s (± 0.24%) 24.80s (± 0.22%) ~ 24.71s 24.85s p=1.000 n=6
vscode - node (v18.15.0, x64)
Errors 4 4 ~ ~ ~ p=1.000 n=6
Symbols 2,802,322 2,802,322 ~ ~ ~ p=1.000 n=6
Types 951,823 951,823 ~ ~ ~ p=1.000 n=6
Memory used 2,956,359k (± 0.00%) 2,956,332k (± 0.00%) ~ 2,956,177k 2,956,449k p=0.936 n=6
Parse Time 16.66s (± 0.18%) 16.74s (± 0.10%) +0.08s (+ 0.50%) 16.72s 16.76s p=0.005 n=6
Bind Time 5.00s (± 0.56%) 4.99s (± 0.37%) ~ 4.96s 5.01s p=0.375 n=6
Check Time 88.46s (± 0.22%) 88.28s (± 0.42%) ~ 87.82s 88.84s p=0.298 n=6
Emit Time 28.70s (± 0.89%) 28.78s (± 0.68%) ~ 28.54s 29.00s p=0.575 n=6
Total Time 138.82s (± 0.32%) 138.79s (± 0.39%) ~ 138.09s 139.57s p=0.936 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 265,864 265,864 ~ ~ ~ p=1.000 n=6
Types 108,449 108,449 ~ ~ ~ p=1.000 n=6
Memory used 410,433k (± 0.01%) 410,488k (± 0.03%) ~ 410,375k 410,710k p=0.810 n=6
Parse Time 3.18s (± 0.81%) 3.20s (± 0.61%) ~ 3.18s 3.23s p=0.059 n=6
Bind Time 1.40s (± 0.95%) 1.40s (± 0.70%) ~ 1.39s 1.41s p=1.000 n=6
Check Time 14.40s (± 0.25%) 14.40s (± 0.32%) ~ 14.35s 14.46s p=0.687 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 18.98s (± 0.15%) 19.00s (± 0.21%) ~ 18.93s 19.04s p=0.334 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 524,146 524,146 ~ ~ ~ p=1.000 n=6
Types 178,737 178,737 ~ ~ ~ p=1.000 n=6
Memory used 462,157k (± 0.01%) 462,292k (± 0.02%) +135k (+ 0.03%) 462,154k 462,401k p=0.045 n=6
Parse Time 2.63s (± 0.52%) 2.60s (± 0.45%) -0.03s (- 1.02%) 2.58s 2.61s p=0.007 n=6
Bind Time 0.99s (± 0.82%) 0.99s (± 0.52%) ~ 0.99s 1.00s p=0.929 n=6
Check Time 15.29s (± 0.66%) 15.33s (± 0.41%) ~ 15.27s 15.41s p=0.575 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 18.91s (± 0.57%) 18.92s (± 0.30%) ~ 18.86s 19.00s p=0.575 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

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,756ms (± 0.70%) 2,775ms (± 0.31%) ~ 2,767ms 2,789ms p=0.128 n=6
Req 2 - geterr 6,135ms (± 0.65%) 6,136ms (± 0.95%) ~ 6,048ms 6,216ms p=0.936 n=6
Req 3 - references 346ms (± 0.92%) 348ms (± 1.74%) ~ 341ms 356ms p=0.747 n=6
Req 4 - navto 278ms (± 0.49%) 284ms (± 6.15%) ~ 275ms 320ms p=0.802 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 94ms (± 3.03%) 94ms (± 2.91%) ~ 91ms 99ms p=0.599 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,445ms (± 0.70%) 2,433ms (± 0.60%) ~ 2,418ms 2,457ms p=0.336 n=6
Req 2 - geterr 3,837ms (± 0.17%) 3,852ms (± 0.27%) +15ms (+ 0.39%) 3,838ms 3,870ms p=0.019 n=6
Req 3 - references 295ms (± 0.33%) 296ms (± 0.28%) ~ 295ms 297ms p=0.498 n=6
Req 4 - navto 228ms (± 0.24%) 229ms (± 2.71%) ~ 226ms 242ms p=0.322 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 78ms (± 9.60%) 76ms (± 6.76%) ~ 73ms 83ms p=0.546 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen 6,113ms (± 0.26%) 6,101ms (± 0.49%) ~ 6,045ms 6,125ms p=0.470 n=6
Req 2 - geterr 1,364ms (± 0.92%) 1,344ms (± 0.80%) -20ms (- 1.45%) 1,326ms 1,357ms p=0.024 n=6
Req 3 - references 101ms (± 0.54%) 100ms (± 0.89%) ~ 99ms 101ms p=0.341 n=6
Req 4 - navto 509ms (± 3.62%) 514ms (± 3.44%) ~ 489ms 531ms p=0.575 n=6
Req 5 - completionInfo count 3,413 3,413 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 1,035ms (± 2.07%) 1,071ms (±10.46%) ~ 1,009ms 1,298ms p=0.936 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)
  • xstate-main-1-tsserver - 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 156.74ms (± 0.17%) 156.89ms (± 0.24%) +0.16ms (+ 0.10%) 155.68ms 170.22ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 239.68ms (± 0.14%) 239.86ms (± 0.12%) +0.18ms (+ 0.07%) 238.46ms 242.46ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 236.18ms (± 0.15%) 236.27ms (± 0.13%) +0.09ms (+ 0.04%) 234.80ms 238.59ms p=0.004 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 287.33ms (± 0.29%) 287.26ms (± 0.28%) ~ 279.92ms 295.24ms p=0.212 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 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 May 3, 2024
@jakebailey
Copy link
Member

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 3, 2024

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

Command Status Results
perf test this ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

@jakebailey
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,799k (± 0.76%) 194,057k (± 1.04%) ~ 192,204k 195,959k p=0.173 n=6
Parse Time 1.95s (± 1.39%) 1.95s (± 1.15%) ~ 1.93s 1.99s p=1.000 n=6
Bind Time 1.07s (± 1.18%) 1.08s (± 0.59%) ~ 1.07s 1.09s p=0.152 n=6
Check Time 14.02s (± 0.48%) 14.02s (± 0.46%) ~ 13.95s 14.13s p=1.000 n=6
Emit Time 3.90s (± 0.59%) 3.90s (± 0.80%) ~ 3.87s 3.96s p=1.000 n=6
Total Time 20.94s (± 0.29%) 20.96s (± 0.20%) ~ 20.92s 21.01s p=0.465 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 945,322 945,322 ~ ~ ~ p=1.000 n=6
Types 408,110 408,110 ~ ~ ~ p=1.000 n=6
Memory used 1,222,797k (± 0.00%) 1,222,704k (± 0.00%) -93k (- 0.01%) 1,222,631k 1,222,757k p=0.025 n=6
Parse Time 8.08s (± 0.53%) 8.10s (± 0.50%) ~ 8.04s 8.16s p=0.295 n=6
Bind Time 2.23s (± 0.63%) 2.23s (± 0.72%) ~ 2.20s 2.24s p=0.676 n=6
Check Time 36.40s (± 0.62%) 36.48s (± 0.26%) ~ 36.33s 36.55s p=0.229 n=6
Emit Time 17.43s (± 0.33%) 17.34s (± 0.49%) -0.09s (- 0.50%) 17.26s 17.50s p=0.044 n=6
Total Time 64.14s (± 0.31%) 64.15s (± 0.29%) ~ 63.89s 64.39s p=0.873 n=6
mui-docs - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 1,956,892 1,956,892 ~ ~ ~ p=1.000 n=6
Types 676,640 676,640 ~ ~ ~ p=1.000 n=6
Memory used 1,765,621k (± 0.00%) 1,765,625k (± 0.00%) ~ 1,765,563k 1,765,761k p=0.936 n=6
Parse Time 7.92s (± 0.64%) 7.92s (± 0.33%) ~ 7.89s 7.96s p=0.871 n=6
Bind Time 2.73s (± 0.52%) 2.74s (± 0.64%) ~ 2.72s 2.76s p=0.743 n=6
Check Time 66.55s (± 0.34%) 66.74s (± 0.38%) ~ 66.43s 67.15s p=0.128 n=6
Emit Time 0.17s (± 6.44%) 0.16s (± 4.99%) ~ 0.16s 0.18s p=0.282 n=6
Total Time 77.37s (± 0.32%) 77.57s (± 0.37%) ~ 77.20s 78.00s p=0.230 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,217,388 1,217,564 +176 (+ 0.01%) ~ ~ p=0.001 n=6
Types 259,008 259,034 +26 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,327,761k (± 0.03%) 2,328,269k (± 0.03%) ~ 2,327,550k 2,329,584k p=0.230 n=6
Parse Time 5.94s (± 0.68%) 5.92s (± 0.69%) ~ 5.84s 5.96s p=0.465 n=6
Bind Time 2.22s (± 0.99%) 2.22s (± 0.60%) ~ 2.20s 2.24s p=0.739 n=6
Check Time 39.44s (± 0.23%) 39.54s (± 0.26%) ~ 39.43s 39.69s p=0.128 n=6
Emit Time 3.10s (± 1.75%) 3.03s (± 3.04%) ~ 2.88s 3.13s p=0.298 n=6
Total Time 50.72s (± 0.26%) 50.74s (± 0.38%) ~ 50.43s 50.97s p=0.689 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,217,388 1,217,564 +176 (+ 0.01%) ~ ~ p=0.001 n=6
Types 259,008 259,034 +26 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,403,238k (± 0.03%) 2,403,699k (± 0.02%) ~ 2,403,337k 2,404,305k p=0.173 n=6
Parse Time 7.67s (± 0.40%) 7.71s (± 0.62%) ~ 7.63s 7.77s p=0.148 n=6
Bind Time 2.46s (± 1.49%) 2.46s (± 0.95%) ~ 2.44s 2.50s p=0.746 n=6
Check Time 49.41s (± 0.55%) 49.59s (± 0.35%) ~ 49.41s 49.87s p=0.298 n=6
Emit Time 3.89s (± 1.70%) 3.96s (± 2.97%) ~ 3.88s 4.19s p=0.378 n=6
Total Time 63.46s (± 0.47%) 63.75s (± 0.25%) ~ 63.58s 64.03s p=0.078 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,310 256,486 +176 (+ 0.07%) ~ ~ p=0.001 n=6
Types 104,458 104,484 +26 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 424,918k (± 0.01%) 425,075k (± 0.01%) +158k (+ 0.04%) 425,024k 425,093k p=0.005 n=6
Parse Time 4.15s (± 0.58%) 4.17s (± 0.49%) ~ 4.14s 4.19s p=0.086 n=6
Bind Time 1.58s (± 1.26%) 1.60s (± 0.65%) ~ 1.58s 1.61s p=0.142 n=6
Check Time 21.90s (± 0.32%) 22.03s (± 0.45%) ~ 21.93s 22.19s p=0.065 n=6
Emit Time 1.72s (± 0.24%) 1.73s (± 0.79%) ~ 1.71s 1.74s p=0.275 n=6
Total Time 29.35s (± 0.17%) 29.52s (± 0.35%) +0.17s (+ 0.59%) 29.42s 29.68s p=0.005 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,826 224,826 ~ ~ ~ p=1.000 n=6
Types 94,115 94,115 ~ ~ ~ p=1.000 n=6
Memory used 370,038k (± 0.04%) 369,961k (± 0.04%) ~ 369,813k 370,156k p=0.378 n=6
Parse Time 3.51s (± 1.01%) 3.50s (± 0.64%) ~ 3.46s 3.52s p=0.677 n=6
Bind Time 1.93s (± 0.78%) 1.93s (± 0.93%) ~ 1.90s 1.95s p=0.869 n=6
Check Time 19.30s (± 0.29%) 19.27s (± 0.39%) ~ 19.18s 19.38s p=0.521 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.73s (± 0.26%) 24.70s (± 0.27%) ~ 24.63s 24.78s p=0.575 n=6
vscode - node (v18.15.0, x64)
Errors 4 4 ~ ~ ~ p=1.000 n=6
Symbols 2,799,032 2,799,032 ~ ~ ~ p=1.000 n=6
Types 950,581 950,581 ~ ~ ~ p=1.000 n=6
Memory used 2,953,883k (± 0.00%) 2,953,856k (± 0.00%) ~ 2,953,822k 2,953,926k p=0.261 n=6
Parse Time 16.74s (± 0.63%) 16.69s (± 0.14%) ~ 16.66s 16.72s p=0.421 n=6
Bind Time 4.97s (± 0.30%) 5.02s (± 1.81%) ~ 4.96s 5.20s p=0.325 n=6
Check Time 88.30s (± 0.27%) 88.41s (± 0.29%) ~ 87.96s 88.75s p=0.575 n=6
Emit Time 28.80s (± 0.57%) 28.98s (± 1.04%) ~ 28.61s 29.43s p=0.378 n=6
Total Time 138.82s (± 0.18%) 139.11s (± 0.27%) ~ 138.64s 139.59s p=0.173 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 265,864 265,864 ~ ~ ~ p=1.000 n=6
Types 108,449 108,449 ~ ~ ~ p=1.000 n=6
Memory used 410,456k (± 0.02%) 410,554k (± 0.01%) ~ 410,481k 410,636k p=0.066 n=6
Parse Time 4.78s (± 0.54%) 4.78s (± 1.24%) ~ 4.68s 4.83s p=0.686 n=6
Bind Time 2.08s (± 1.04%) 2.06s (± 0.57%) ~ 2.04s 2.07s p=0.052 n=6
Check Time 20.99s (± 0.53%) 21.03s (± 0.41%) ~ 20.92s 21.18s p=0.334 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 27.85s (± 0.44%) 27.87s (± 0.41%) ~ 27.73s 28.06s p=0.936 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 524,146 524,146 ~ ~ ~ p=1.000 n=6
Types 178,737 178,737 ~ ~ ~ p=1.000 n=6
Memory used 462,165k (± 0.02%) 462,221k (± 0.01%) ~ 462,166k 462,316k p=0.335 n=6
Parse Time 2.61s (± 0.63%) 2.60s (± 0.16%) ~ 2.60s 2.61s p=0.087 n=6
Bind Time 0.99s (± 0.52%) 1.00s (± 0.41%) ~ 0.99s 1.00s p=0.112 n=6
Check Time 15.26s (± 0.25%) 15.26s (± 0.30%) ~ 15.19s 15.31s p=0.871 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 18.87s (± 0.25%) 18.86s (± 0.24%) ~ 18.79s 18.91s p=0.871 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

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,296ms (± 0.47%) 2,296ms (± 0.16%) ~ 2,291ms 2,301ms p=0.376 n=6
Req 2 - geterr 5,134ms (± 0.48%) 5,112ms (± 0.28%) ~ 5,092ms 5,135ms p=0.093 n=6
Req 3 - references 284ms (± 1.01%) 289ms (± 1.25%) +4ms (+ 1.47%) 285ms 293ms p=0.029 n=6
Req 4 - navto 227ms (± 0.61%) 227ms (± 0.54%) ~ 224ms 227ms p=1.000 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 80ms (± 8.19%) 80ms (± 8.33%) ~ 76ms 93ms p=0.673 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,442ms (± 0.66%) 2,441ms (± 0.93%) ~ 2,415ms 2,470ms p=0.873 n=6
Req 2 - geterr 3,832ms (± 0.22%) 3,850ms (± 0.31%) +17ms (+ 0.45%) 3,836ms 3,871ms p=0.020 n=6
Req 3 - references 295ms (± 0.97%) 297ms (± 0.35%) ~ 295ms 298ms p=0.106 n=6
Req 4 - navto 230ms (± 2.88%) 227ms (± 0.37%) ~ 225ms 227ms p=0.170 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 76ms (± 8.86%) 73ms (± 0.56%) ~ 72ms 73ms p=0.858 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen 5,101ms (± 0.27%) 5,101ms (± 0.22%) ~ 5,082ms 5,114ms p=0.936 n=6
Req 2 - geterr 1,141ms (± 0.95%) 1,122ms (± 0.55%) -18ms (- 1.61%) 1,115ms 1,130ms p=0.020 n=6
Req 3 - references 86ms (± 0.73%) 85ms (± 0.89%) -1ms (- 1.36%) 84ms 86ms p=0.027 n=6
Req 4 - navto 449ms (± 0.65%) 449ms (± 0.54%) ~ 446ms 451ms p=0.934 n=6
Req 5 - completionInfo count 3,413 3,413 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 844ms (± 0.70%) 836ms (± 0.68%) ~ 831ms 845ms p=0.053 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)
  • xstate-main-1-tsserver - 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 157.53ms (± 0.21%) 157.54ms (± 0.16%) ~ 156.28ms 160.91ms p=0.089 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 239.69ms (± 0.15%) 239.77ms (± 0.13%) +0.07ms (+ 0.03%) 238.09ms 242.18ms p=0.003 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 235.55ms (± 0.15%) 235.70ms (± 0.14%) +0.16ms (+ 0.07%) 234.36ms 240.65ms p=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 234.99ms (± 0.15%) 234.98ms (± 0.17%) ~ 233.39ms 244.79ms p=0.488 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

src/compiler/checker.ts Outdated Show resolved Hide resolved
Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

I like it - injecting new unknownSymbol refs into the synthetic scope to block lookups we know won't work due to the transform we've done to the parameters is good.

src/compiler/checker.ts Show resolved Hide resolved
src/compiler/utilities.ts Outdated Show resolved Hide resolved
src/compiler/checker.ts Show resolved Hide resolved
@@ -2320,7 +2320,8 @@ function isDeclarationKind(kind: SyntaxKind) {
|| kind === SyntaxKind.VariableDeclaration
|| kind === SyntaxKind.JSDocTypedefTag
|| kind === SyntaxKind.JSDocCallbackTag
|| kind === SyntaxKind.JSDocPropertyTag;
|| kind === SyntaxKind.JSDocPropertyTag
|| kind === SyntaxKind.NamedTupleMember;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NamedTupleMember seemed to be missing here. This meant that tuple member names were being funneled through trackExistingEntityName even when other declaration names were not.

                if (isEntityName(node) || isEntityNameExpression(node)) {
                    if (isDeclarationName(node)) {
                        return node;
                    }
                    const { introducesError, node: result } = trackExistingEntityName(node, context);
                    hadError = hadError || introducesError;
                    // We should not go to child nodes of the entity name, they will not be accessible
                    return result;
                }

@jakebailey jakebailey merged commit 72c12c9 into microsoft:main May 10, 2024
28 checks passed
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
None yet
Development

Successfully merging this pull request may close these issues.

Declaration references expanded type paramater Scope confusion with reused signatures
4 participants