Skip to content

Allow intersections (and substitutions) to be checked against discriminable unions - #36663

Merged
Wesley Wigham (weswigham) merged 1 commit into
microsoft:masterfrom
weswigham:allow-nonobject-type-distributive-checks
Feb 10, 2020
Merged

Allow intersections (and substitutions) to be checked against discriminable unions#36663
Wesley Wigham (weswigham) merged 1 commit into
microsoft:masterfrom
weswigham:allow-nonobject-type-distributive-checks

Conversation

@weswigham

Copy link
Copy Markdown
Member

Intersections for the reasons reported, substitutions because they're just opaque intersections and should generally work the same way in relationships.

Fixes#33243

@weswigham

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this I don't even know why, it's not like there are unions in the perf suite
TypeScript Bot (@typescript-bot) test this
TypeScript Bot (@typescript-bot) user test this
TypeScript Bot (@typescript-bot) run dt

@typescript-bot

TypeScript Bot (typescript-bot) commented Feb 6, 2020

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the parallelized Definitely Typed test suite on this PR at 6aaf984. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot

TypeScript Bot (typescript-bot) commented Feb 6, 2020

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the perf test suite on this PR at 6aaf984. You can monitor the build here. It should now contribute to this PR's status checks.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Feb 6, 2020

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the parallelized community code test suite on this PR at 6aaf984. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot

TypeScript Bot (typescript-bot) commented Feb 6, 2020

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 6aaf984. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..36663

Metricmaster36663DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used356,858k (± 0.01%)358,586k (± 0.02%)+1,728k (+ 0.48%)358,417k358,788k
Parse Time1.61s (± 0.50%)1.62s (± 0.29%)+0.01s (+ 0.50%)1.61s1.63s
Bind Time0.89s (± 0.95%)0.88s (± 0.65%)-0.01s (- 1.01%)0.87s0.89s
Check Time4.67s (± 0.44%)4.67s (± 0.39%)+0.00s (+ 0.02%)4.63s4.70s
Emit Time5.22s (± 0.25%)5.23s (± 0.78%)+0.00s (+ 0.06%)5.16s5.33s
Total Time12.40s (± 0.23%)12.40s (± 0.43%)+0.00s (+ 0.01%)12.27s12.51s
Monaco - node (v10.16.3, x64)
Memory used364,682k (± 0.02%)364,656k (± 0.02%)-26k (- 0.01%)364,556k364,785k
Parse Time1.25s (± 0.66%)1.25s (± 0.42%)-0.00s (- 0.40%)1.24s1.26s
Bind Time0.78s (± 0.48%)0.77s (± 0.75%)-0.00s (- 0.26%)0.76s0.79s
Check Time4.68s (± 0.70%)4.65s (± 0.38%)-0.03s (- 0.64%)4.60s4.69s
Emit Time2.90s (± 0.77%)2.89s (± 0.46%)-0.02s (- 0.55%)2.85s2.91s
Total Time9.61s (± 0.45%)9.56s (± 0.20%)-0.05s (- 0.55%)9.50s9.60s
TFS - node (v10.16.3, x64)
Memory used324,299k (± 0.07%)324,149k (± 0.02%)-149k (- 0.05%)323,947k324,287k
Parse Time0.94s (± 0.52%)0.95s (± 0.68%)+0.00s (+ 0.42%)0.93s0.96s
Bind Time0.75s (± 1.54%)0.74s (± 1.45%)-0.01s (- 1.07%)0.72s0.76s
Check Time4.23s (± 0.38%)4.23s (± 0.53%)-0.00s (- 0.09%)4.18s4.27s
Emit Time3.01s (± 0.76%)3.01s (± 0.63%)-0.01s (- 0.20%)2.95s3.05s
Total Time8.93s (± 0.43%)8.92s (± 0.37%)-0.02s (- 0.18%)8.85s9.00s
Angular - node (v12.1.0, x64)
Memory used332,632k (± 0.07%)334,306k (± 0.01%)+1,674k (+ 0.50%)334,178k334,399k
Parse Time1.57s (± 0.54%)1.57s (± 0.25%)+0.00s (+ 0.13%)1.56s1.58s
Bind Time0.86s (± 1.10%)0.88s (± 0.68%)+0.01s (+ 1.16%)0.86s0.89s
Check Time4.62s (± 0.80%)4.57s (± 0.63%)-0.04s (- 0.89%)4.52s4.64s
Emit Time5.41s (± 0.57%)5.38s (± 0.72%)-0.03s (- 0.55%)5.29s5.45s
Total Time12.46s (± 0.47%)12.39s (± 0.40%)-0.06s (- 0.51%)12.31s12.50s
Monaco - node (v12.1.0, x64)
Memory used344,551k (± 0.02%)344,567k (± 0.02%)+16k (+ 0.00%)344,435k344,769k
Parse Time1.22s (± 0.67%)1.21s (± 0.67%)-0.01s (- 0.82%)1.20s1.23s
Bind Time0.75s (± 0.80%)0.75s (± 0.53%)+0.00s (+ 0.54%)0.74s0.76s
Check Time4.54s (± 0.35%)4.54s (± 0.47%)+0.01s (+ 0.18%)4.51s4.60s
Emit Time2.94s (± 0.61%)2.95s (± 0.61%)+0.01s (+ 0.48%)2.91s2.99s
Total Time9.44s (± 0.31%)9.46s (± 0.40%)+0.02s (+ 0.18%)9.38s9.53s
TFS - node (v12.1.0, x64)
Memory used306,384k (± 0.02%)306,440k (± 0.02%)+57k (+ 0.02%)306,328k306,576k
Parse Time0.94s (± 0.66%)0.94s (± 0.48%)-0.00s (- 0.11%)0.93s0.95s
Bind Time0.70s (± 0.53%)0.70s (± 0.57%)-0.00s (- 0.57%)0.69s0.71s
Check Time4.17s (± 0.44%)4.18s (± 0.74%)+0.01s (+ 0.34%)4.14s4.24s
Emit Time3.07s (± 0.63%)3.07s (± 0.58%)-0.00s (- 0.03%)3.02s3.12s
Total Time8.88s (± 0.38%)8.89s (± 0.42%)+0.01s (+ 0.12%)8.81s8.96s
Angular - node (v8.9.0, x64)
Memory used351,823k (± 0.01%)353,504k (± 0.01%)+1,680k (+ 0.48%)353,427k353,643k
Parse Time2.10s (± 0.54%)2.11s (± 0.39%)+0.01s (+ 0.43%)2.09s2.12s
Bind Time0.92s (± 0.64%)0.93s (± 0.56%)+0.00s (+ 0.54%)0.92s0.94s
Check Time5.46s (± 0.66%)5.42s (± 0.51%)-0.04s (- 0.66%)5.37s5.48s
Emit Time6.24s (± 0.36%)6.19s (± 0.73%)-0.04s (- 0.71%)6.12s6.29s
Total Time14.71s (± 0.25%)14.65s (± 0.47%)-0.06s (- 0.44%)14.53s14.80s
Monaco - node (v8.9.0, x64)
Memory used362,939k (± 0.01%)362,924k (± 0.01%)-16k (- 0.00%)362,880k363,008k
Parse Time1.56s (± 0.43%)1.56s (± 0.33%)+0.00s (+ 0.06%)1.55s1.57s
Bind Time0.95s (± 0.49%)0.95s (± 0.80%)-0.00s (- 0.42%)0.93s0.97s
Check Time5.39s (± 1.25%)5.38s (± 1.45%)-0.02s (- 0.28%)5.24s5.56s
Emit Time3.30s (± 3.17%)3.32s (± 3.40%)+0.02s (+ 0.48%)3.01s3.47s
Total Time11.21s (± 0.55%)11.20s (± 0.43%)-0.00s (- 0.04%)11.09s11.30s
TFS - node (v8.9.0, x64)
Memory used323,541k (± 0.02%)323,488k (± 0.02%)-53k (- 0.02%)323,301k323,564k
Parse Time1.26s (± 0.44%)1.26s (± 0.51%)0.00s ( 0.00%)1.25s1.28s
Bind Time0.75s (± 0.65%)0.75s (± 0.30%)-0.00s (- 0.40%)0.75s0.76s
Check Time4.82s (± 0.56%)4.80s (± 0.75%)-0.02s (- 0.37%)4.73s4.89s
Emit Time3.20s (± 0.73%)3.19s (± 0.64%)-0.01s (- 0.19%)3.14s3.25s
Total Time10.04s (± 0.41%)10.01s (± 0.57%)-0.03s (- 0.31%)9.88s10.15s
Angular - node (v8.9.0, x86)
Memory used200,058k (± 0.02%)200,929k (± 0.02%)+871k (+ 0.44%)200,829k201,043k
Parse Time2.04s (± 1.23%)2.04s (± 0.46%)+0.00s (+ 0.05%)2.02s2.06s
Bind Time1.05s (± 0.85%)1.05s (± 0.59%)+0.00s (+ 0.48%)1.04s1.06s
Check Time4.97s (± 0.70%)4.95s (± 0.75%)-0.02s (- 0.30%)4.86s5.05s
Emit Time6.06s (± 1.14%)6.06s (± 1.51%)-0.00s (- 0.07%)5.93s6.30s
Total Time14.11s (± 0.61%)14.10s (± 0.68%)-0.01s (- 0.09%)13.94s14.33s
Monaco - node (v8.9.0, x86)
Memory used203,746k (± 0.02%)203,766k (± 0.02%)+21k (+ 0.01%)203,687k203,864k
Parse Time1.60s (± 0.55%)1.59s (± 0.76%)-0.01s (- 0.56%)1.58s1.63s
Bind Time0.77s (± 1.35%)0.77s (± 0.47%)-0.01s (- 0.78%)0.76s0.77s
Check Time5.19s (± 1.98%)5.16s (± 1.42%)-0.02s (- 0.42%)5.07s5.43s
Emit Time3.13s (± 2.72%)3.15s (± 2.78%)+0.02s (+ 0.64%)2.84s3.27s
Total Time10.69s (± 0.42%)10.67s (± 0.39%)-0.02s (- 0.16%)10.60s10.80s
TFS - node (v8.9.0, x86)
Memory used182,635k (± 0.03%)182,630k (± 0.02%)-5k (- 0.00%)182,525k182,674k
Parse Time1.30s (± 0.77%)1.31s (± 0.72%)+0.00s (+ 0.23%)1.29s1.33s
Bind Time0.71s (± 0.87%)0.71s (± 0.31%)-0.00s (- 0.00%)0.71s0.72s
Check Time4.58s (± 0.77%)4.57s (± 0.62%)-0.02s (- 0.35%)4.51s4.64s
Emit Time2.96s (± 1.44%)2.94s (± 0.71%)-0.02s (- 0.81%)2.88s2.98s
Total Time9.57s (± 0.68%)9.53s (± 0.32%)-0.04s (- 0.40%)9.43s9.57s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory4 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
BenchmarkNameIterations
Current3666310
Baselinemaster10

@typescript-bot

Copy link
Copy Markdown
Contributor

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@weswigham

Wesley Wigham (weswigham) commented Feb 7, 2020

Copy link
Copy Markdown
MemberAuthor

Perf impact is zero, user baselines look fine, dt error looks identical to master, rwc baselines are identical to master's currently outstanding diff (which I also just accepted). actions-based PR checks seems to have failed because of a networking issue; I'm rerunning them just in case, but everything looks good here~

Ron Buckton (@rbuckton) you wanna give a quick look over this change?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems good! I wonder how there were ZERO changes in any test suite, though.

@weswigham
Wesley Wigham (weswigham) merged commit aece8c0 into microsoft:masterFeb 10, 2020
@weswigham

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) cherrypick this into release-3.8

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Wesley Wigham (@weswigham), I've opened #36726 for you.

TypeScript Bot (typescript-bot) pushed a commit to typescript-bot/TypeScript that referenced this pull request Feb 10, 2020
Component commits:
6aaf984 Allow intersections (and substitutions) to be checks against discriminable unions
Wesley Wigham (weswigham) added a commit that referenced this pull request Feb 11, 2020
Component commits:
6aaf984 Allow intersections (and substitutions) to be checks against discriminable unions
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Union of partial types: common super type of all union members is not assignable to union type

3 participants

@weswigham@typescript-bot@sandersn