Skip to content

Allow {} to narrow in same special cases as unknown - #50601

Merged
Andrew Branch (andrewbranch) merged 1 commit into
microsoft:mainfrom
andrewbranch:bug/50567
Sep 2, 2022
Merged

Allow {} to narrow in same special cases as unknown#50601
Andrew Branch (andrewbranch) merged 1 commit into
microsoft:mainfrom
andrewbranch:bug/50567

Conversation

@andrewbranch

Copy link
Copy Markdown
Member

Fixes #50567

@andrewbranch

Copy link
Copy Markdown
Member Author

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

Heya Andrew Branch (@andrewbranch), I've started to run the parallelized Definitely Typed test suite on this PR at 8fa47f1. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

Heya Andrew Branch (@andrewbranch), I'm starting to run the diff-based user code test suite on this PR at 8fa47f1. Hold tight - I'll update this comment with the log link once the build has been queued.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

Heya Andrew Branch (@andrewbranch), I've started to run the abridged perf test suite on this PR at 8fa47f1. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

Heya Andrew Branch (@andrewbranch), I'm starting to run the diff-based user code test suite on this PR at 8fa47f1. Hold tight - I'll update this comment with the log link once the build has been queued.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Andrew Branch (@andrewbranch) Here are the results of running the user test suite comparing main and refs/pull/50601/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Andrew Branch (@andrewbranch)
The results of the perf run you requested are in!

Here they are:

Comparison Report - main..50601

Metric main 50601 Delta Best Worst
Angular - node (v14.15.1, x64)
Memory used 338,735k (± 0.00%) 338,725k (± 0.01%) -10k (- 0.00%) 338,697k 338,791k
Parse Time 2.06s (± 0.74%) 2.08s (± 1.01%) +0.02s (+ 0.92%) 2.03s 2.12s
Bind Time 0.80s (± 0.46%) 0.80s (± 0.62%) 0.00s ( 0.00%) 0.79s 0.81s
Check Time 5.83s (± 0.63%) 5.84s (± 0.58%) +0.02s (+ 0.31%) 5.77s 5.90s
Emit Time 6.23s (± 0.78%) 6.16s (± 0.59%) -0.07s (- 1.19%) 6.09s 6.25s
Total Time 14.90s (± 0.48%) 14.87s (± 0.36%) -0.03s (- 0.22%) 14.75s 14.99s
Compiler-Unions - node (v14.15.1, x64)
Memory used 192,628k (± 0.01%) 192,533k (± 0.12%) -95k (- 0.05%) 191,595k 192,720k
Parse Time 0.85s (± 0.58%) 0.85s (± 0.56%) -0.00s (- 0.23%) 0.85s 0.87s
Bind Time 0.49s (± 1.06%) 0.49s (± 1.33%) -0.00s (- 0.20%) 0.48s 0.51s
Check Time 6.72s (± 0.43%) 6.72s (± 0.60%) +0.00s (+ 0.06%) 6.65s 6.81s
Emit Time 2.42s (± 1.40%) 2.42s (± 1.14%) -0.01s (- 0.37%) 2.37s 2.47s
Total Time 10.48s (± 0.40%) 10.48s (± 0.60%) -0.01s (- 0.07%) 10.36s 10.62s
Monaco - node (v14.15.1, x64)
Memory used 326,525k (± 0.00%) 326,518k (± 0.01%) -7k (- 0.00%) 326,482k 326,558k
Parse Time 1.58s (± 0.63%) 1.57s (± 0.82%) -0.01s (- 0.44%) 1.55s 1.61s
Bind Time 0.73s (± 0.50%) 0.72s (± 0.62%) -0.00s (- 0.55%) 0.71s 0.73s
Check Time 5.73s (± 0.26%) 5.69s (± 0.56%) -0.04s (- 0.73%) 5.63s 5.75s
Emit Time 3.32s (± 0.43%) 3.33s (± 0.73%) +0.01s (+ 0.18%) 3.27s 3.39s
Total Time 11.36s (± 0.22%) 11.31s (± 0.45%) -0.05s (- 0.41%) 11.21s 11.44s
TFS - node (v14.15.1, x64)
Memory used 289,655k (± 0.01%) 289,657k (± 0.01%) +2k (+ 0.00%) 289,599k 289,687k
Parse Time 1.30s (± 0.77%) 1.30s (± 0.51%) +0.00s (+ 0.23%) 1.29s 1.32s
Bind Time 0.79s (± 1.27%) 0.79s (± 0.66%) +0.00s (+ 0.51%) 0.78s 0.81s
Check Time 5.35s (± 0.43%) 5.36s (± 0.39%) +0.01s (+ 0.15%) 5.33s 5.42s
Emit Time 3.56s (± 0.49%) 3.58s (± 0.91%) +0.03s (+ 0.73%) 3.53s 3.67s
Total Time 11.00s (± 0.36%) 11.04s (± 0.41%) +0.04s (+ 0.41%) 10.95s 11.14s
material-ui - node (v14.15.1, x64)
Memory used 436,470k (± 0.00%) 436,476k (± 0.00%) +5k (+ 0.00%) 436,434k 436,527k
Parse Time 1.87s (± 0.54%) 1.86s (± 0.48%) -0.00s (- 0.05%) 1.85s 1.89s
Bind Time 0.58s (± 0.58%) 0.58s (± 0.69%) -0.00s (- 0.34%) 0.57s 0.59s
Check Time 12.85s (± 0.61%) 12.89s (± 0.70%) +0.04s (+ 0.30%) 12.72s 13.17s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.30s (± 0.51%) 15.33s (± 0.61%) +0.03s (+ 0.20%) 15.16s 15.62s
xstate - node (v14.15.1, x64)
Memory used 546,740k (± 0.00%) 546,735k (± 0.00%) -5k (- 0.00%) 546,711k 546,761k
Parse Time 2.61s (± 0.56%) 2.60s (± 0.40%) -0.01s (- 0.23%) 2.58s 2.63s
Bind Time 0.97s (± 0.70%) 0.97s (± 0.78%) +0.00s (+ 0.10%) 0.96s 0.99s
Check Time 1.52s (± 0.76%) 1.52s (± 0.37%) -0.00s (- 0.20%) 1.51s 1.53s
Emit Time 0.07s (± 0.00%) 0.07s (± 4.13%) +0.00s (+ 2.86%) 0.07s 0.08s
Total Time 5.18s (± 0.49%) 5.17s (± 0.36%) -0.01s (- 0.17%) 5.12s 5.21s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 50601 10
Baseline main 10

Developer Information:

Download Benchmark

@typescript-bot

Copy link
Copy Markdown
Contributor

Andrew Branch (@andrewbranch) Here are the results of running the top-repos suite comparing main and refs/pull/50601/merge:

Everything looks good!

@andrewbranch

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) cherry-pick to release-4.8

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

Heya Andrew Branch (@andrewbranch), I've started to run the task to cherry-pick this into release-4.8 on this PR at 8fa47f1. You can monitor the build here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Andrew Branch (@andrewbranch), I've opened #50613 for you.

TypeScript Bot (typescript-bot) pushed a commit to typescript-bot/TypeScript that referenced this pull request Sep 2, 2022
Component commits:
8fa47f1 Allow `{}` to narrow in same special cases as `unknown`
@andrewbranch
Andrew Branch (andrewbranch) merged commit 856c7c5 into microsoft:main Sep 2, 2022
Andrew Branch (andrewbranch) added a commit that referenced this pull request Sep 2, 2022
Component commits:
8fa47f1 Allow `{}` to narrow in same special cases as `unknown`

Co-authored-by: Andrew Branch <andrew@wheream.io>
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unknown type is narrowed to {} in strict equality condition since 4.8

3 participants