Repository navigation
Commit 94add3a
committed
Keep the result of a resolution nested in a hidden one of itself
A call resolution hides the resolutions below it, so a symbol whose
initializer reaches itself through a call argument is computed again,
nested in itself, as in main. The nested computation observes things
in progress that the outer one entered: here, a mapped property whose
contextual type is skipped, and the reverse mapping whose depth cutoff
it reaches. Those mark everything since as circular, so the nested
result was discarded, and the outer computation, reaching the same
types again outside that context, then failed with a circularity.
When everything the nested computation observed in progress was
entered by the outermost hidden resolution of the same target, the
nested computation is what that one always computes first from
scratch, whichever entry led to it, so its result is kept as a cycle
participant, as main keeps the first result set.
Main also keeps the reverse-mapped property type computed under the
depth cutoff, so it types the property as unknown. That result still
depends on the cutoff and is discarded, so the property is computed
again from scratch afterwards, giving its full type: an improvement
over main rather than a match (seen in arktype).1 parent 2facf71 commit 94add3a
4 files changed
Lines changed: 68 additions & 68 deletions
File tree
- tsc
- internal/checker
- testdata/baselines/reference/compiler
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| |||
20292 | 20296 | | |
20293 | 20297 | | |
20294 | 20298 | | |
| 20299 | + | |
| 20300 | + | |
| 20301 | + | |
| 20302 | + | |
| 20303 | + | |
20295 | 20304 | | |
20296 | 20305 | | |
20297 | 20306 | | |
| 20307 | + | |
| 20308 | + | |
| 20309 | + | |
| 20310 | + | |
| 20311 | + | |
| 20312 | + | |
| 20313 | + | |
| 20314 | + | |
| 20315 | + | |
| 20316 | + | |
| 20317 | + | |
| 20318 | + | |
| 20319 | + | |
| 20320 | + | |
| 20321 | + | |
20298 | 20322 | | |
20299 | 20323 | | |
20300 | 20324 | | |
| |||
20823 | 20847 | | |
20824 | 20848 | | |
20825 | 20849 | | |
20826 | | - | |
| 20850 | + | |
| 20851 | + | |
| 20852 | + | |
| 20853 | + | |
| 20854 | + | |
| 20855 | + | |
| 20856 | + | |
| 20857 | + | |
| 20858 | + | |
20827 | 20859 | | |
20828 | 20860 | | |
20829 | 20861 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
| 88 | + | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
| |||
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| 112 | + | |
| 113 | + | |
108 | 114 | | |
| 115 | + | |
| 116 | + | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
0 commit comments