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

Don"t treat an instantiation expression as an assertion in skipOuterExpressions #59538

Merged
merged 5 commits into from
Aug 6, 2024

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Aug 5, 2024

#50820 added ExpressionWithTypeArguments to isOuterExpression but treated it as an assertion, which then caused the checker to skip past it in reference checking. Split that out so we can skip past it in transforms like we did previously, which feels better because an instantiation is not really an assertion.

Also, while here, fix the fact that other OuterExpression related code was not ExpressionWithTypeArguments either.

Fixes #59535

@jakebailey
Copy link
Member Author

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 5, 2024

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

Command Status Results
test top400 ✅ Started ✅ Results
user test this ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

Looks like you"re introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki"s API Breaking Changes page.

Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up.

@typescript-bot typescript-bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug and removed For Milestone Bug PRs that fix a bug with a specific milestone labels Aug 5, 2024
@typescript-bot
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/59538/merge:

Everything looks good!

@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,153 62,153 ~ ~ ~ p=1.000 n=6
Types 50,242 50,242 ~ ~ ~ p=1.000 n=6
Memory used 192,921k (± 0.75%) 194,723k (± 0.95%) +1,803k (+ 0.93%) 192,332k 195,939k p=0.030 n=6
Parse Time 1.31s (± 0.39%) 1.30s (± 0.90%) ~ 1.28s 1.31s p=0.523 n=6
Bind Time 0.71s 0.71s ~ ~ ~ p=1.000 n=6
Check Time 9.55s (± 0.27%) 9.56s (± 0.45%) ~ 9.50s 9.61s p=0.629 n=6
Emit Time 2.74s (± 0.79%) 2.74s (± 0.71%) ~ 2.71s 2.76s p=0.746 n=6
Total Time 14.31s (± 0.19%) 14.31s (± 0.44%) ~ 14.23s 14.38s p=0.688 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 7 ~ ~ ~ p=1.000 n=6
Symbols 945,537 945,537 ~ ~ ~ p=1.000 n=6
Types 409,512 409,512 ~ ~ ~ p=1.000 n=6
Memory used 1,222,254k (± 0.00%) 1,222,290k (± 0.00%) ~ 1,222,213k 1,222,350k p=0.173 n=6
Parse Time 6.61s (± 0.53%) 6.61s (± 0.56%) ~ 6.57s 6.66s p=0.808 n=6
Bind Time 1.86s (± 0.28%) 1.86s (± 0.53%) ~ 1.84s 1.87s p=0.386 n=6
Check Time 31.19s (± 0.23%) 31.14s (± 0.38%) ~ 30.94s 31.26s p=0.521 n=6
Emit Time 15.01s (± 0.50%) 14.97s (± 0.41%) ~ 14.90s 15.06s p=0.470 n=6
Total Time 54.67s (± 0.30%) 54.58s (± 0.29%) ~ 54.33s 54.77s p=0.521 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,486,257 2,486,257 ~ ~ ~ p=1.000 n=6
Types 1,013,836 1,013,836 ~ ~ ~ p=1.000 n=6
Memory used 2,492,109k (± 0.00%) 2,492,136k (± 0.01%) ~ 2,492,022k 2,492,492k p=0.575 n=6
Parse Time 9.20s (± 0.42%) 9.18s (± 0.21%) ~ 9.16s 9.21s p=0.870 n=6
Bind Time 2.19s (± 0.56%) 2.20s (± 0.23%) ~ 2.20s 2.21s p=0.051 n=6
Check Time 75.56s (± 0.48%) 75.23s (± 0.39%) ~ 74.86s 75.67s p=0.092 n=6
Emit Time 0.28s (± 3.19%) 0.29s (± 1.80%) ~ 0.28s 0.29s p=0.190 n=6
Total Time 87.23s (± 0.39%) 86.90s (± 0.36%) ~ 86.51s 87.37s p=0.173 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,229,171 1,229,232 +61 (+ 0.00%) ~ ~ p=0.001 n=6
Types 264,285 264,398 +113 (+ 0.04%) ~ ~ p=0.001 n=6
Memory used 2,349,341k (± 0.03%) 2,349,956k (± 0.02%) ~ 2,348,985k 2,350,498k p=0.093 n=6
Parse Time 4.99s (± 1.48%) 4.98s (± 0.55%) ~ 4.94s 5.01s p=0.630 n=6
Bind Time 1.88s (± 0.34%) 1.89s (± 0.97%) ~ 1.86s 1.91s p=0.346 n=6
Check Time 34.45s (± 0.39%) 34.42s (± 0.41%) ~ 34.19s 34.56s p=0.810 n=6
Emit Time 3.31s (± 0.55%) 3.30s (± 0.92%) ~ 3.26s 3.35s p=0.419 n=6
Total Time 44.65s (± 0.48%) 44.59s (± 0.29%) ~ 44.40s 44.76s 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,229,171 1,229,232 +61 (+ 0.00%) ~ ~ p=0.001 n=6
Types 264,285 264,398 +113 (+ 0.04%) ~ ~ p=0.001 n=6
Memory used 2,422,597k (± 0.02%) 2,422,937k (± 0.02%) ~ 2,422,359k 2,423,491k p=0.378 n=6
Parse Time 6.21s (± 1.26%) 6.24s (± 0.71%) ~ 6.19s 6.31s p=0.521 n=6
Bind Time 2.02s (± 0.31%) 2.02s (± 0.66%) ~ 2.01s 2.04s p=0.366 n=6
Check Time 41.12s (± 0.46%) 40.98s (± 0.27%) ~ 40.86s 41.15s p=0.126 n=6
Emit Time 4.08s (± 3.85%) 4.05s (± 2.53%) ~ 3.98s 4.25s p=0.810 n=6
Total Time 53.46s (± 0.53%) 53.30s (± 0.35%) ~ 53.14s 53.67s p=0.378 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,238 256,285 +47 (+ 0.02%) ~ ~ p=0.001 n=6
Types 104,976 105,053 +77 (+ 0.07%) ~ ~ p=0.001 n=6
Memory used 428,308k (± 0.04%) 428,352k (± 0.02%) ~ 428,287k 428,550k p=0.173 n=6
Parse Time 4.14s (± 0.33%) 4.13s (± 0.29%) ~ 4.12s 4.15s p=0.137 n=6
Bind Time 1.60s (± 0.97%) 1.62s (± 1.35%) ~ 1.58s 1.64s p=0.103 n=6
Check Time 22.20s (± 0.30%) 22.25s (± 0.36%) ~ 22.12s 22.34s p=0.173 n=6
Emit Time 2.02s (± 1.41%) 2.02s (± 0.94%) ~ 1.99s 2.05s p=0.624 n=6
Total Time 29.96s (± 0.21%) 30.02s (± 0.28%) ~ 29.86s 30.10s p=0.173 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,931 224,931 ~ ~ ~ p=1.000 n=6
Types 94,146 94,146 ~ ~ ~ p=1.000 n=6
Memory used 370,105k (± 0.04%) 370,140k (± 0.02%) ~ 369,962k 370,190k p=0.689 n=6
Parse Time 3.46s (± 0.72%) 3.43s (± 0.81%) ~ 3.39s 3.46s p=0.226 n=6
Bind Time 1.92s (± 1.18%) 1.91s (± 0.21%) ~ 1.90s 1.91s p=1.000 n=6
Check Time 19.36s (± 0.32%) 19.33s (± 0.38%) ~ 19.26s 19.47s p=0.375 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.73s (± 0.22%) 24.68s (± 0.36%) ~ 24.59s 24.84s p=0.172 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,992,449 2,992,449 ~ ~ ~ p=1.000 n=6
Types 1,029,577 1,029,577 ~ ~ ~ p=1.000 n=6
Memory used 3,117,177k (± 0.00%) 3,117,150k (± 0.00%) ~ 3,117,034k 3,117,274k p=0.810 n=6
Parse Time 13.82s (± 0.53%) 13.87s (± 0.58%) ~ 13.79s 14.02s p=0.297 n=6
Bind Time 4.34s (± 2.21%) 4.34s (± 1.95%) ~ 4.29s 4.51s p=0.806 n=6
Check Time 79.48s (± 0.56%) 79.55s (± 0.36%) ~ 79.20s 79.92s p=0.688 n=6
Emit Time 20.54s (± 0.68%) 20.53s (± 0.62%) ~ 20.35s 20.73s p=0.873 n=6
Total Time 118.17s (± 0.57%) 118.29s (± 0.17%) ~ 118.03s 118.56s p=0.471 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 268,291 268,291 ~ ~ ~ p=1.000 n=6
Types 109,194 109,194 ~ ~ ~ p=1.000 n=6
Memory used 413,130k (± 0.01%) 413,119k (± 0.02%) ~ 413,072k 413,248k p=0.471 n=6
Parse Time 3.83s (± 0.51%) 3.81s (± 0.52%) ~ 3.80s 3.85s p=0.143 n=6
Bind Time 1.72s (± 0.60%) 1.72s (± 0.44%) ~ 1.71s 1.73s p=0.931 n=6
Check Time 16.80s (± 0.35%) 16.78s (± 0.21%) ~ 16.74s 16.83s p=0.628 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.34s (± 0.23%) 22.31s (± 0.16%) ~ 22.25s 22.36s p=0.332 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 538,548 538,548 ~ ~ ~ p=1.000 n=6
Types 176,473 176,473 ~ ~ ~ p=1.000 n=6
Memory used 481,356k (± 0.01%) 481,338k (± 0.02%) ~ 481,272k 481,479k p=0.261 n=6
Parse Time 3.39s (± 0.73%) 3.40s (± 0.47%) ~ 3.37s 3.41s p=0.331 n=6
Bind Time 1.25s (± 0.44%) 1.25s (± 1.01%) ~ 1.23s 1.26s p=0.663 n=6
Check Time 17.99s (± 0.36%) 17.96s (± 0.42%) ~ 17.82s 18.03s p=0.574 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.63s (± 0.24%) 22.61s (± 0.29%) ~ 22.49s 22.68s p=0.470 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/59538/merge:

Everything looks good!

Comment on lines +6556 to +6557
case SyntaxKind.ExpressionWithTypeArguments:
return updateExpressionWithTypeArguments(outerExpression, expression, outerExpression.typeArguments);
Copy link
Member Author

Choose a reason for hiding this comment

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

I will note that most of the cases here are uncovered by tests:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Instantiation expressions shouldn"t be allowed in write positions
5 participants