Skip to content

Properly handle non-generic string mapping types in unions and intersections - #57197

Merged
Daniel Rosenwasser (DanielRosenwasser) merged 3 commits into
mainfrom
fix57192
Jan 28, 2024
Merged

Properly handle non-generic string mapping types in unions and intersections#57197
Daniel Rosenwasser (DanielRosenwasser) merged 3 commits into
mainfrom
fix57192

Conversation

@ahejlsberg

Copy link
Copy Markdown
Member

Fixes#57192.

@ahejlsberg

Copy link
Copy Markdown
MemberAuthor

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 27, 2024

Copy link
Copy Markdown
Contributor

Heya Anders Hejlsberg (@ahejlsberg), I've started to run the diff-based top-repos suite on this PR at f445b4f. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 27, 2024

Copy link
Copy Markdown
Contributor

Heya Anders Hejlsberg (@ahejlsberg), I've started to run the diff-based user code test suite on this PR at f445b4f. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 27, 2024

Copy link
Copy Markdown
Contributor

Heya Anders Hejlsberg (@ahejlsberg), I've started to run the parallelized Definitely Typed test suite on this PR at f445b4f. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 27, 2024

Copy link
Copy Markdown
Contributor

Heya Anders Hejlsberg (@ahejlsberg), I've started to run the faster perf test suite on this PR at f445b4f. You can monitor the build here.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg) Here are the results of running the user test suite comparing main and refs/pull/57197/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

puppeteer

packages/browsers/test/src/tsconfig.json

@typescript-bot

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Angular - node (v18.15.0, x64)
Memory used295,659k (± 0.01%)295,646k (± 0.01%)~295,631k295,674kp=0.468 n=6
Parse Time2.66s (± 0.34%)2.66s (± 0.55%)~2.64s2.68sp=0.804 n=6
Bind Time0.83s (± 1.18%)0.83s (± 1.52%)~0.82s0.85sp=0.799 n=6
Check Time8.19s (± 0.24%)8.20s (± 0.19%)~8.17s8.21sp=0.566 n=6
Emit Time7.10s (± 0.35%)7.09s (± 0.47%)~7.06s7.14sp=0.518 n=6
Total Time18.79s (± 0.09%)18.78s (± 0.26%)~18.74s18.85sp=0.572 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used192,935k (± 1.25%)191,536k (± 0.02%)~191,490k191,576kp=0.689 n=6
Parse Time1.36s (± 1.21%)1.35s (± 1.36%)~1.33s1.37sp=0.935 n=6
Bind Time0.72s (± 0.00%)0.72s (± 0.00%)~0.72s0.72sp=1.000 n=6
Check Time9.34s (± 0.38%)9.35s (± 0.43%)~9.29s9.40sp=0.809 n=6
Emit Time2.63s (± 0.63%)2.61s (± 0.82%)~2.58s2.64sp=0.169 n=6
Total Time14.04s (± 0.16%)14.03s (± 0.22%)~13.99s14.07sp=0.871 n=6
Monaco - node (v18.15.0, x64)
Memory used347,460k (± 0.01%)347,458k (± 0.00%)~347,443k347,477kp=0.936 n=6
Parse Time2.48s (± 0.54%)2.47s (± 0.21%)~2.46s2.47sp=0.140 n=6
Bind Time0.92s (± 0.56%)0.92s (± 0.59%)~0.92s0.93sp=0.640 n=6
Check Time6.93s (± 0.43%)6.94s (± 0.40%)~6.91s6.97sp=0.672 n=6
Emit Time4.05s (± 0.33%)4.06s (± 0.52%)~4.04s4.10sp=0.676 n=6
Total Time14.38s (± 0.24%)14.40s (± 0.21%)~14.35s14.43sp=0.745 n=6
TFS - node (v18.15.0, x64)
Memory used302,839k (± 0.00%)302,840k (± 0.01%)~302,803k302,881kp=0.936 n=6
Parse Time2.01s (± 1.04%)2.01s (± 0.68%)~1.99s2.02sp=0.934 n=6
Bind Time1.01s (± 1.02%)1.00s (± 1.09%)~0.99s1.02sp=0.241 n=6
Check Time6.32s (± 0.31%)6.33s (± 0.37%)~6.30s6.36sp=0.464 n=6
Emit Time3.59s (± 0.25%)3.60s (± 0.57%)~3.57s3.62sp=0.682 n=6
Total Time12.93s (± 0.36%)12.94s (± 0.17%)~12.90s12.96sp=0.570 n=6
material-ui - node (v18.15.0, x64)
Memory used511,320k (± 0.00%)511,321k (± 0.01%)~511,286k511,380kp=0.748 n=6
Parse Time2.65s (± 0.69%)2.66s (± 0.24%)~2.65s2.67sp=0.295 n=6
Bind Time0.99s (± 0.41%)1.00s (± 1.26%)~0.98s1.02sp=0.101 n=6
Check Time17.23s (± 0.31%)17.24s (± 0.22%)~17.20s17.30sp=0.630 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time20.87s (± 0.33%)20.90s (± 0.19%)~20.86s20.96sp=0.469 n=6
mui-docs - node (v18.15.0, x64)
Memory used1,694,776k (± 0.00%)1,694,756k (± 0.00%)~1,694,725k1,694,811kp=0.173 n=6
Parse Time6.53s (± 0.23%)6.53s (± 0.38%)~6.49s6.56sp=0.935 n=6
Bind Time2.36s (± 0.56%)2.30s (± 6.60%)~1.99s2.37sp=0.804 n=6
Check Time55.27s (± 0.60%)55.06s (± 0.34%)~54.75s55.33sp=0.297 n=6
Emit Time0.16s (± 3.16%)0.16s (± 0.00%)~0.16s0.16sp=0.174 n=6
Total Time64.32s (± 0.54%)64.05s (± 0.37%)~63.75s64.40sp=0.173 n=6
self-build-src - node (v18.15.0, x64)
Memory used2,413,033k (± 0.03%)2,412,993k (± 0.02%)~2,412,432k2,413,796kp=1.000 n=6
Parse Time4.94s (± 1.32%)4.91s (± 0.66%)~4.87s4.95sp=0.378 n=6
Bind Time1.89s (± 0.93%)1.87s (± 0.87%)~1.85s1.89sp=0.279 n=6
Check Time33.41s (± 0.22%)33.42s (± 0.23%)~33.35s33.55sp=0.747 n=6
Emit Time2.67s (± 1.02%)2.68s (± 1.26%)~2.65s2.74sp=0.748 n=6
Total Time42.93s (± 0.14%)42.92s (± 0.20%)~42.84s43.04sp=0.471 n=6
self-compiler - node (v18.15.0, x64)
Memory used419,755k (± 0.01%)419,753k (± 0.01%)~419,716k419,789kp=1.000 n=6
Parse Time2.71s (± 2.87%)2.73s (± 2.96%)~2.66s2.84sp=0.406 n=6
Bind Time1.17s (± 6.11%)1.17s (± 6.41%)~1.07s1.23sp=1.000 n=6
Check Time15.12s (± 0.32%)15.13s (± 0.28%)~15.09s15.19sp=0.629 n=6
Emit Time1.14s (± 1.29%)1.15s (± 0.65%)~1.14s1.16sp=0.300 n=6
Total Time20.14s (± 0.25%)20.18s (± 0.23%)~20.13s20.25sp=0.199 n=6
vscode - node (v18.15.0, x64)
Memory used2,808,667k (± 0.00%)2,808,716k (± 0.00%)+49k (+ 0.00%)2,808,663k2,808,762kp=0.013 n=6
Parse Time10.63s (± 0.41%)10.64s (± 0.38%)~10.60s10.71sp=1.000 n=6
Bind Time3.39s (± 0.15%)3.42s (± 0.75%)+0.03s (+ 0.89%)3.39s3.46sp=0.020 n=6
Check Time59.55s (± 0.45%)59.87s (± 0.58%)~59.60s60.41sp=0.230 n=6
Emit Time16.17s (± 0.55%)16.16s (± 0.35%)~16.06s16.23sp=0.422 n=6
Total Time89.75s (± 0.34%)90.08s (± 0.43%)~89.71s90.71sp=0.065 n=6
webpack - node (v18.15.0, x64)
Memory used392,583k (± 0.02%)392,614k (± 0.02%)~392,526k392,684kp=0.471 n=6
Parse Time3.06s (± 0.89%)3.05s (± 0.34%)~3.03s3.06sp=0.164 n=6
Bind Time1.39s (± 0.71%)1.41s (± 0.75%)~1.39s1.42sp=0.066 n=6
Check Time13.93s (± 0.19%)13.97s (± 0.47%)~13.91s14.07sp=0.374 n=6
Emit Time0.00s (± 0.00%)0.00s (±244.70%)~0.00s0.01sp=0.405 n=6
Total Time18.38s (± 0.15%)18.43s (± 0.36%)~18.37s18.52sp=0.294 n=6
xstate - node (v18.15.0, x64)
Memory used513,403k (± 0.01%)513,414k (± 0.01%)~513,359k513,535kp=1.000 n=6
Parse Time3.28s (± 0.42%)3.29s (± 0.25%)~3.28s3.30sp=0.121 n=6
Bind Time1.54s (± 0.26%)1.54s (± 0.49%)~1.53s1.55sp=1.000 n=6
Check Time2.85s (± 0.44%)2.87s (± 0.65%)~2.84s2.89sp=0.141 n=6
Emit Time0.08s (± 0.00%)0.08s (± 4.99%)~0.08s0.09sp=0.405 n=6
Total Time7.75s (± 0.24%)7.77s (± 0.30%)~7.74s7.80sp=0.168 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)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Anders Hejlsberg (@ahejlsberg), the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg) Here are the results of running the top-repos suite comparing main and refs/pull/57197/merge:

Everything looks good!

@ahejlsberg

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) test top200

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 27, 2024

Copy link
Copy Markdown
Contributor

Heya Anders Hejlsberg (@ahejlsberg), I've started to run the diff-based top-repos suite on this PR at f445b4f. You can monitor the build here.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg) Here are the results of running the top-repos suite comparing main and refs/pull/57197/merge:

Everything looks good!

Comment threadsrc/compiler/types.ts
TemplateLiteral = 1 << 27, // Template literal type
StringMapping = 1 << 28, // Uppercase/Lowercase type
/** @internal */
Reserved1 = 1 << 29, // Used by union/intersection type construction

Choose a reason for hiding this comment

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

This is kind of funky - I'd just directly make this IncludesConstrainedTypeVariable.

@DanielRosenwasser

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) test this

@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Milestone BugPRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent intersections of string literal types and pattern string mapping types

3 participants

@ahejlsberg@typescript-bot@DanielRosenwasser