Skip to content

Fixed a redundant used before defined error #55283

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

Merged

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Aug 6, 2023

fixes #8775

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 6, 2023
Comment on lines +17 to +19
let bar = {
three: {} as IThing<typeof bar>,
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this isn't actually super useful as the result of this is an implicit any but that's a separate error category and the reported "no used before defined" was still redundant

Copy link
Member

Choose a reason for hiding this comment

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

can you set @strict: true to show that the no implicit any errors are there?

@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

typescript-bot commented Aug 7, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 7, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 7, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 7, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 7, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

rxjs-src

/mnt/ts_downloads/rxjs-src/build.sh

  • [NEW] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55283/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
  • [MISSING] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..55283

Metric main 55283 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 368,247k (± 0.00%) 368,270k (± 0.01%) ~ 368,247k 368,294k p=0.128 n=6
Parse Time 3.58s (± 0.42%) 3.58s (± 0.33%) ~ 3.56s 3.59s p=0.621 n=6
Bind Time 1.19s (± 0.63%) 1.19s (± 0.53%) ~ 1.18s 1.20s p=0.718 n=6
Check Time 9.85s (± 0.75%) 9.85s (± 0.54%) ~ 9.76s 9.91s p=0.808 n=6
Emit Time 8.05s (± 1.10%) 7.99s (± 0.56%) ~ 7.92s 8.04s p=0.199 n=6
Total Time 22.67s (± 0.59%) 22.61s (± 0.40%) ~ 22.47s 22.75s p=0.336 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,839k (± 0.02%) 193,807k (± 0.02%) ~ 193,769k 193,860k p=0.128 n=6
Parse Time 1.60s (± 1.02%) 1.59s (± 0.47%) ~ 1.58s 1.60s p=0.454 n=6
Bind Time 0.82s (± 0.63%) 0.82s (± 0.92%) ~ 0.81s 0.83s p=0.784 n=6
Check Time 10.25s (± 0.25%) 10.20s (± 0.53%) ~ 10.14s 10.28s p=0.121 n=6
Emit Time 3.02s (± 0.91%) 3.00s (± 0.83%) ~ 2.96s 3.03s p=0.413 n=6
Total Time 15.69s (± 0.37%) 15.61s (± 0.35%) -0.08s (- 0.52%) 15.54s 15.67s p=0.035 n=6
Monaco - node (v16.17.1, x64)
Memory used 347,099k (± 0.00%) 347,096k (± 0.01%) ~ 347,066k 347,131k p=0.810 n=6
Parse Time 2.78s (± 0.72%) 2.77s (± 0.63%) ~ 2.75s 2.80s p=0.627 n=6
Bind Time 1.08s (± 0.76%) 1.08s (± 0.59%) ~ 1.07s 1.09s p=0.432 n=6
Check Time 8.10s (± 0.45%) 8.07s (± 0.64%) ~ 8.00s 8.13s p=0.261 n=6
Emit Time 4.46s (± 0.12%) 4.46s (± 0.76%) ~ 4.40s 4.49s p=0.933 n=6
Total Time 16.42s (± 0.35%) 16.38s (± 0.49%) ~ 16.26s 16.47s p=0.378 n=6
TFS - node (v16.17.1, x64)
Memory used 301,122k (± 0.01%) 301,143k (± 0.00%) ~ 301,128k 301,167k p=0.128 n=6
Parse Time 2.21s (± 1.17%) 2.20s (± 0.47%) ~ 2.18s 2.21s p=0.220 n=6
Bind Time 1.22s (± 2.04%) 1.20s (± 1.22%) ~ 1.19s 1.23s p=0.169 n=6
Check Time 7.36s (± 0.48%) 7.35s (± 0.36%) ~ 7.32s 7.39s p=0.519 n=6
Emit Time 4.33s (± 1.05%) 4.31s (± 0.68%) ~ 4.27s 4.35s p=0.335 n=6
Total Time 15.13s (± 0.62%) 15.06s (± 0.36%) ~ 15.01s 15.16s p=0.173 n=6
material-ui - node (v16.17.1, x64)
Memory used 481,893k (± 0.02%) 481,904k (± 0.02%) ~ 481,843k 482,050k p=0.521 n=6
Parse Time 3.25s (± 0.49%) 3.26s (± 0.53%) ~ 3.24s 3.29s p=0.623 n=6
Bind Time 0.96s (± 0.85%) 0.96s (± 0.54%) ~ 0.95s 0.96s p=0.929 n=6
Check Time 18.49s (± 0.58%) 18.46s (± 0.37%) ~ 18.36s 18.52s p=0.809 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.70s (± 0.50%) 22.68s (± 0.27%) ~ 22.57s 22.73s p=0.520 n=6
xstate - node (v16.17.1, x64)
Memory used 561,396k (± 0.01%) 561,432k (± 0.03%) ~ 561,311k 561,675k p=0.810 n=6
Parse Time 4.02s (± 0.26%) 4.03s (± 0.33%) ~ 4.01s 4.05s p=0.506 n=6
Bind Time 1.79s (± 1.19%) 1.77s (± 2.14%) ~ 1.73s 1.81s p=0.462 n=6
Check Time 3.06s (± 0.54%) 3.06s (± 0.52%) ~ 3.04s 3.08s p=0.568 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.96s (± 0.34%) 8.95s (± 0.51%) ~ 8.90s 9.01s p=0.748 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-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 55283 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@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.

@sandersn sandersn merged commit f07077c into microsoft:main Aug 24, 2023
@Andarist Andarist deleted the fix/redundant-used-before-define-error branch August 24, 2023 15:36
snovader pushed a commit to EG-A-S/TypeScript that referenced this pull request Sep 23, 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.

typeof operator fails on use-before-defined block scoped variable.
5 participants