Repository navigation
Commit a970563
committed
Intern deferred conditional types by their content
A conditional type instantiation is also reached through distributive
and tail-recursive instantiation, so the same deferred conditional
type, with the same root, mappings, and alias, could be created more
than once. Such copies can be told apart only by type id, which follows
the order in which code was checked. Deferred conditional types are now
interned by their root, the content of their mapper, and their alias.
Those made for a constraint stay apart from the others, as the
instantiation caches of a conditional type already keep them:
evaluating a conditional type for a constraint can include its true
branch where evaluating it otherwise would not. Sharing the deferred
types made for one with the other reused the comparisons reached from
them, and checking calls with SetOptional of generic keys then exceeded
the instantiation depth limit (seen in type-fest).
Instantiations of InferData and UnpackKeyValue, whose recursion is
bounded, are no longer reported as infinitely circular when inferred
through a closure.1 parent d638605 commit a970563
10 files changed
Lines changed: 328 additions & 91 deletions
File tree
- packages/typescript/enums
- tsc
- internal
- api
- checker
- testdata
- baselines/reference/compiler
- tests/cases/compiler
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| 681 | + | |
681 | 682 | | |
682 | 683 | | |
683 | 684 | | |
| |||
1025 | 1026 | | |
1026 | 1027 | | |
1027 | 1028 | | |
| 1029 | + | |
1028 | 1030 | | |
1029 | 1031 | | |
1030 | 1032 | | |
| |||
18083 | 18085 | | |
18084 | 18086 | | |
18085 | 18087 | | |
| 18088 | + | |
| 18089 | + | |
| 18090 | + | |
| 18091 | + | |
| 18092 | + | |
| 18093 | + | |
| 18094 | + | |
| 18095 | + | |
| 18096 | + | |
| 18097 | + | |
| 18098 | + | |
| 18099 | + | |
| 18100 | + | |
| 18101 | + | |
| 18102 | + | |
| 18103 | + | |
| 18104 | + | |
| 18105 | + | |
| 18106 | + | |
| 18107 | + | |
| 18108 | + | |
| 18109 | + | |
| 18110 | + | |
| 18111 | + | |
| 18112 | + | |
| 18113 | + | |
| 18114 | + | |
| 18115 | + | |
18086 | 18116 | | |
18087 | 18117 | | |
18088 | 18118 | | |
| |||
25600 | 25630 | | |
25601 | 25631 | | |
25602 | 25632 | | |
25603 | | - | |
25604 | | - | |
25605 | | - | |
25606 | | - | |
25607 | | - | |
| 25633 | + | |
| 25634 | + | |
25608 | 25635 | | |
| 25636 | + | |
25609 | 25637 | | |
25610 | 25638 | | |
25611 | 25639 | | |
| |||
25614 | 25642 | | |
25615 | 25643 | | |
25616 | 25644 | | |
| 25645 | + | |
| 25646 | + | |
| 25647 | + | |
| 25648 | + | |
| 25649 | + | |
| 25650 | + | |
| 25651 | + | |
| 25652 | + | |
| 25653 | + | |
| 25654 | + | |
| 25655 | + | |
| 25656 | + | |
| 25657 | + | |
| 25658 | + | |
| 25659 | + | |
| 25660 | + | |
| 25661 | + | |
| 25662 | + | |
| 25663 | + | |
| 25664 | + | |
| 25665 | + | |
| 25666 | + | |
| 25667 | + | |
| 25668 | + | |
| 25669 | + | |
| 25670 | + | |
| 25671 | + | |
| 25672 | + | |
| 25673 | + | |
| 25674 | + | |
| 25675 | + | |
| 25676 | + | |
| 25677 | + | |
| 25678 | + | |
| 25679 | + | |
| 25680 | + | |
| 25681 | + | |
| 25682 | + | |
| 25683 | + | |
| 25684 | + | |
25617 | 25685 | | |
25618 | 25686 | | |
25619 | 25687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| 740 | + | |
| 741 | + | |
740 | 742 | | |
741 | 743 | | |
742 | 744 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
729 | 732 | | |
730 | 733 | | |
731 | 734 | | |
| |||
0 commit comments