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

Consistently return errorType when detecting circularities #56429

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

a quick experiment based on discussion/observations we had here: https://github.com/microsoft/TypeScript/pull/56258/files#r1393385776

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 16, 2023
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@Andarist Andarist marked this pull request as draft November 16, 2023 08:35
@@ -2,24 +2,17 @@ witness.ts(4,21): error TS2372: Parameter 'pInit' cannot reference itself.
witness.ts(8,14): error TS2729: Property 'x' is used before its initialization.
witness.ts(20,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'never'.
witness.ts(28,12): error TS2695: Left side of comma operator is unused and has no side effects.
witness.ts(29,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'.
Copy link
Contributor Author

@Andarist Andarist Nov 16, 2023

Choose a reason for hiding this comment

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

it seems that this is even a small improvement since the intention of the caller was not to raise those errors when the type is the errorType, see: https://github.dev/microsoft/TypeScript/blob/32b618c2d8f42948e7d6fa2e9b264079e30b5349/src/compiler/checker.ts#L42290-L42296

Copy link
Member

Choose a reason for hiding this comment

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

Swinging back here, it seems sorta odd just from the PoV that a self referencing thing will just not have any errors. It seems like this test is mainly to "witness" the type of these expressions in errors, but maybe it's fine. Odd that the .types file does not show a change?

Copy link
Member

Choose a reason for hiding this comment

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

Will have to do some forensics but I'm not sure why we even want to ignore these anyway...

@Andarist Andarist marked this pull request as ready for review November 16, 2023 08:43
@jakebailey
Copy link
Member

Honestly I like this better

@typescript-bot test top200
@typescript-bot user test this
@typescript-bot run dt

@typescript-bot perf test this
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 16, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 16, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 16, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 16, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 16, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 16, 2023

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/158643/artifacts?artifactName=tgz&fileId=1E5FC2A3954F892F1155CE85799029CEE36C40AFE8FB71B39396BAA5D40F93DE02&fileName=/typescript-5.4.0-insiders.20231116.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]".;

@Andarist
Copy link
Contributor Author

Honestly I like this better

Than the targeted if in #56258 ? Or in general? ;p

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 2 instances 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

@jakebailey
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,199k (± 0.01%) 295,193k (± 0.01%) ~ 295,167k 295,220k p=0.810 n=6
Parse Time 2.64s (± 0.31%) 2.64s (± 0.44%) ~ 2.63s 2.66s p=0.738 n=6
Bind Time 0.83s (± 0.91%) 0.83s (± 0.66%) ~ 0.82s 0.83s p=0.476 n=6
Check Time 8.03s (± 0.15%) 8.04s (± 0.32%) ~ 8.01s 8.07s p=0.935 n=6
Emit Time 7.08s (± 0.39%) 7.07s (± 0.43%) ~ 7.03s 7.11s p=0.629 n=6
Total Time 18.59s (± 0.16%) 18.58s (± 0.21%) ~ 18.52s 18.63s p=0.687 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 191,662k (± 1.24%) 191,669k (± 1.23%) ~ 190,672k 196,474k p=0.575 n=6
Parse Time 1.36s (± 0.89%) 1.36s (± 0.98%) ~ 1.35s 1.38s p=0.865 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.17s (± 0.25%) 9.18s (± 0.24%) ~ 9.15s 9.21s p=0.744 n=6
Emit Time 2.64s (± 0.56%) 2.65s (± 0.73%) ~ 2.62s 2.67s p=0.372 n=6
Total Time 13.89s (± 0.21%) 13.91s (± 0.15%) ~ 13.88s 13.94s p=0.295 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,352k (± 0.00%) 347,335k (± 0.01%) ~ 347,302k 347,381k p=0.128 n=6
Parse Time 2.45s (± 0.31%) 2.45s (± 0.68%) ~ 2.42s 2.47s p=1.000 n=6
Bind Time 0.92s (± 0.56%) 0.92s (± 0.56%) ~ 0.92s 0.93s p=1.000 n=6
Check Time 6.89s (± 0.28%) 6.91s (± 0.50%) ~ 6.87s 6.96s p=0.418 n=6
Emit Time 4.05s (± 0.22%) 4.05s (± 0.20%) ~ 4.04s 4.06s p=0.550 n=6
Total Time 14.32s (± 0.14%) 14.33s (± 0.36%) ~ 14.28s 14.41s p=0.744 n=6
TFS - node (v18.15.0, x64)
Memory used 302,630k (± 0.01%) 302,648k (± 0.01%) ~ 302,610k 302,705k p=0.520 n=6
Parse Time 1.98s (± 1.06%) 2.00s (± 0.86%) ~ 1.98s 2.02s p=0.118 n=6
Bind Time 1.00s (± 1.03%) 1.00s (± 1.36%) ~ 0.99s 1.02s p=0.933 n=6
Check Time 6.28s (± 0.24%) 6.28s (± 0.27%) ~ 6.25s 6.30s p=0.681 n=6
Emit Time 3.58s (± 0.71%) 3.57s (± 0.33%) ~ 3.56s 3.59s p=0.569 n=6
Total Time 12.85s (± 0.22%) 12.85s (± 0.21%) ~ 12.82s 12.89s p=0.936 n=6
material-ui - node (v18.15.0, x64)
Memory used 470,557k (± 0.01%) 470,581k (± 0.01%) ~ 470,543k 470,632k p=0.230 n=6
Parse Time 2.57s (± 0.64%) 2.58s (± 0.29%) ~ 2.57s 2.59s p=0.672 n=6
Bind Time 0.99s (± 1.49%) 1.00s (± 0.82%) ~ 0.99s 1.01s p=0.284 n=6
Check Time 16.61s (± 0.42%) 16.66s (± 0.38%) ~ 16.54s 16.71s p=0.261 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.18s (± 0.38%) 20.24s (± 0.32%) ~ 20.11s 20.29s p=0.199 n=6
xstate - node (v18.15.0, x64)
Memory used 512,818k (± 0.01%) 512,815k (± 0.01%) ~ 512,766k 512,902k p=1.000 n=6
Parse Time 3.27s (± 0.19%) 3.28s (± 0.17%) ~ 3.27s 3.28s p=0.201 n=6
Bind Time 1.54s (± 0.53%) 1.54s (± 0.49%) ~ 1.53s 1.55s p=0.306 n=6
Check Time 2.86s (± 0.65%) 2.87s (± 0.42%) ~ 2.86s 2.89s p=0.416 n=6
Emit Time 0.09s (± 6.44%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=0.071 n=6
Total Time 7.76s (± 0.25%) 7.76s (± 0.16%) ~ 7.75s 7.78s p=0.366 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,360ms (± 0.51%) 2,377ms (± 0.59%) ~ 2,363ms 2,399ms p=0.078 n=6
Req 2 - geterr 5,393ms (± 1.73%) 5,361ms (± 1.72%) ~ 5,307ms 5,547ms p=0.936 n=6
Req 3 - references 325ms (± 0.42%) 327ms (± 0.79%) ~ 323ms 331ms p=0.358 n=6
Req 4 - navto 277ms (± 1.20%) 279ms (± 0.27%) ~ 278ms 280ms p=0.406 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 84ms (± 7.21%) 80ms (± 7.15%) ~ 75ms 91ms p=0.295 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,494ms (± 0.77%) 2,493ms (± 0.62%) ~ 2,475ms 2,517ms p=1.000 n=6
Req 2 - geterr 4,085ms (± 1.86%) 4,080ms (± 1.87%) ~ 4,012ms 4,179ms p=0.748 n=6
Req 3 - references 341ms (± 1.69%) 340ms (± 1.76%) ~ 332ms 345ms p=0.627 n=6
Req 4 - navto 283ms (± 0.43%) 283ms (± 0.69%) ~ 281ms 286ms p=1.000 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 86ms (± 6.98%) 85ms (± 7.21%) ~ 77ms 90ms p=1.000 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,595ms (± 0.68%) 2,604ms (± 0.36%) ~ 2,595ms 2,619ms p=0.419 n=6
Req 2 - geterr 1,729ms (± 1.83%) 1,723ms (± 2.36%) ~ 1,677ms 1,772ms p=0.936 n=6
Req 3 - references 119ms (± 7.10%) 105ms (± 5.81%) 🟩-14ms (-12.04%) 101ms 117ms p=0.029 n=6
Req 4 - navto 367ms (± 0.58%) 367ms (± 0.57%) ~ 364ms 369ms p=0.743 n=6
Req 5 - completionInfo count 2,073 (± 0.00%) 2,073 (± 0.00%) ~ 2,073 2,073 p=1.000 n=6
Req 5 - completionInfo 311ms (± 1.97%) 305ms (± 1.99%) ~ 300ms 316ms p=0.077 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 152.79ms (± 0.18%) 152.75ms (± 0.17%) ~ 151.57ms 156.08ms p=0.364 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 228.18ms (± 0.17%) 227.86ms (± 0.14%) -0.32ms (- 0.14%) 226.69ms 230.44ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 229.06ms (± 0.17%) 228.86ms (± 0.17%) -0.21ms (- 0.09%) 227.21ms 234.76ms p=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 229.44ms (± 0.16%) 229.30ms (± 0.17%) -0.14ms (- 0.06%) 227.41ms 232.45ms p=0.000 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 @jakebailey, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@jakebailey
Copy link
Member

Honestly I like this better

Than the targeted if in #56258 ? Or in general? ;p

Both!

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

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

Successfully merging this pull request may close these issues.

3 participants