Skip to content

Constraints for mapped types with filtering 'as' clauses #48699

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
merged 4 commits into from
Apr 18, 2022
Merged

Conversation

ahejlsberg
Copy link
Member

Fixes #48626.

@ahejlsberg
Copy link
Member Author

@typescript-bot test this
@typescript-bot user test this inline
@typescript-bot run dt
@typescript-bot perf test faster

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 14, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 14, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 14, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 14, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..48699

Metric main 48699 Delta Best Worst
Angular - node (v14.15.1, x64)
Memory used 333,312k (± 0.01%) 333,313k (± 0.01%) +2k (+ 0.00%) 333,252k 333,350k
Parse Time 2.04s (± 0.65%) 2.04s (± 0.77%) +0.00s (+ 0.10%) 2.01s 2.08s
Bind Time 0.88s (± 0.57%) 0.87s (± 0.74%) -0.00s (- 0.34%) 0.86s 0.89s
Check Time 5.63s (± 0.51%) 5.63s (± 0.39%) +0.00s (+ 0.07%) 5.60s 5.70s
Emit Time 6.30s (± 0.63%) 6.30s (± 0.47%) -0.00s (- 0.08%) 6.21s 6.38s
Total Time 14.84s (± 0.38%) 14.84s (± 0.21%) +0.00s (+ 0.02%) 14.76s 14.90s
Compiler-Unions - node (v14.15.1, x64)
Memory used 194,019k (± 0.59%) 194,695k (± 0.55%) +676k (+ 0.35%) 191,413k 195,475k
Parse Time 0.85s (± 0.43%) 0.86s (± 0.80%) +0.00s (+ 0.23%) 0.84s 0.87s
Bind Time 0.57s (± 0.66%) 0.56s (± 1.10%) -0.00s (- 0.71%) 0.55s 0.58s
Check Time 7.51s (± 0.53%) 7.48s (± 0.56%) -0.03s (- 0.36%) 7.41s 7.59s
Emit Time 2.51s (± 0.81%) 2.51s (± 0.70%) -0.00s (- 0.08%) 2.48s 2.54s
Total Time 11.44s (± 0.45%) 11.40s (± 0.46%) -0.03s (- 0.29%) 11.29s 11.51s
Monaco - node (v14.15.1, x64)
Memory used 325,459k (± 0.01%) 325,438k (± 0.01%) -21k (- 0.01%) 325,377k 325,501k
Parse Time 1.57s (± 0.67%) 1.57s (± 0.71%) +0.00s (+ 0.06%) 1.55s 1.59s
Bind Time 0.77s (± 0.52%) 0.77s (± 0.38%) +0.00s (+ 0.13%) 0.77s 0.78s
Check Time 5.54s (± 0.39%) 5.53s (± 0.66%) -0.01s (- 0.13%) 5.45s 5.63s
Emit Time 3.35s (± 0.71%) 3.31s (± 0.65%) -0.04s (- 1.11%) 3.26s 3.36s
Total Time 11.23s (± 0.37%) 11.19s (± 0.47%) -0.04s (- 0.39%) 11.07s 11.33s
TFS - node (v14.15.1, x64)
Memory used 289,022k (± 0.01%) 289,014k (± 0.01%) -8k (- 0.00%) 288,944k 289,065k
Parse Time 1.36s (± 1.17%) 1.35s (± 0.57%) -0.01s (- 0.88%) 1.34s 1.37s
Bind Time 0.72s (± 0.51%) 0.72s (± 0.41%) -0.00s (- 0.41%) 0.72s 0.73s
Check Time 5.19s (± 0.44%) 5.17s (± 0.52%) -0.02s (- 0.31%) 5.13s 5.24s
Emit Time 3.56s (± 2.39%) 3.55s (± 1.72%) -0.00s (- 0.14%) 3.40s 3.64s
Total Time 10.83s (± 0.79%) 10.79s (± 0.60%) -0.04s (- 0.34%) 10.63s 10.93s
material-ui - node (v14.15.1, x64)
Memory used 447,557k (± 0.08%) 447,804k (± 0.01%) +247k (+ 0.06%) 447,763k 447,864k
Parse Time 1.88s (± 0.67%) 1.87s (± 0.37%) -0.01s (- 0.37%) 1.85s 1.88s
Bind Time 0.70s (± 0.64%) 0.70s (± 1.37%) -0.00s (- 0.29%) 0.68s 0.73s
Check Time 13.05s (± 0.60%) 13.03s (± 0.73%) -0.02s (- 0.18%) 12.89s 13.27s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.63s (± 0.54%) 15.59s (± 0.61%) -0.04s (- 0.22%) 15.44s 15.83s
xstate - node (v14.15.1, x64)
Memory used 535,839k (± 0.00%) 535,861k (± 0.00%) +22k (+ 0.00%) 535,829k 535,896k
Parse Time 2.60s (± 0.30%) 2.58s (± 0.33%) -0.02s (- 0.77%) 2.56s 2.60s
Bind Time 1.16s (± 0.77%) 1.14s (± 0.77%) -0.01s (- 1.30%) 1.13s 1.17s
Check Time 1.51s (± 0.48%) 1.50s (± 0.33%) -0.01s (- 0.46%) 1.50s 1.52s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.34s (± 0.25%) 5.30s (± 0.19%) -0.04s (- 0.77%) 5.28s 5.33s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory3 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 48699 10
Baseline main 10

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

@ahejlsberg
Great news! no new errors were found between main..refs/pull/48699/merge

@ahejlsberg ahejlsberg merged commit 65f6cb2 into main Apr 18, 2022
@ahejlsberg ahejlsberg deleted the fix48626 branch April 18, 2022 21:24
Jack-Works pushed a commit to Jack-Works/TypeScript that referenced this pull request Apr 22, 2022
…8699)

* Constraints for mapped types with filtering 'as' clauses

* Add regression test
@Igorbek
Copy link
Contributor

Igorbek commented May 27, 2022

@ahejlsberg the fix also seems related to #47447 and I thought it would be fixed by this, but it's not. Do you think this is a similar case, producing a super type by filtering properties out with as clause?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

Type of F<T>[keyof F<T>] becomes unknown in TS 4.7.0-beta
4 participants