Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
3b6bceb
Add a checkOrder test option
jakebailey Oct 22, 2026
ffcea82
Add a check order fuzzer to the test harness
jakebailey Oct 26, 2026
86eb6d9
Check some existing tests in typesfirst order
jakebailey Oct 22, 2026
87dd0bb
Add tests for check order dependence
jakebailey Oct 21, 2026
b0bfcaf
Add test for recursive variance fixed points
jakebailey Oct 21, 2026
48a716e
Report accessor pair errors from each accessor
jakebailey Oct 19, 2026
a8988f6
Read type alias type parameters through their declared type
jakebailey Oct 19, 2026
1267abf
Check assertion operands once, with their normal type
jakebailey Oct 19, 2026
3f0bee3
Remove unused isConstructorDeclaredProperty link
jakebailey Oct 19, 2026
ee7c1ef
Derive binding pattern parent types without peeking at caches
jakebailey Oct 19, 2026
7c881c9
Prefer contextually assigned parameter types on first query
jakebailey Oct 19, 2026
c72b75a
Contextually check function expressions after member cycles
jakebailey Oct 19, 2026
69fe461
Resolve enclosing calls before the calls in their arguments
jakebailey Oct 19, 2026
459f20e
Do not cache index signature symbols looked up by the API
jakebailey Oct 19, 2026
2e29eed
Complete contextual signatures before anyone reads them
jakebailey Oct 19, 2026
2550147
Do not cache instantiations of single signature types
jakebailey Oct 19, 2026
d650020
Report unresolved names after resolution completes
jakebailey Oct 19, 2026
d541247
Apply the flow analysis depth limit per reference
jakebailey Oct 19, 2026
2e6b26a
Track computed property name cycles on the resolution stack
jakebailey Oct 19, 2026
a623842
Don't reuse incomplete shared flow types after their loop exits
jakebailey Oct 19, 2026
bafc127
Locate call resolution at the call
jakebailey Oct 21, 2026
1888ab0
Order deeply nested types by generation instead of type id
jakebailey Oct 20, 2026
4509521
Reuse cached results for the broadest equivalent relation key
jakebailey Oct 20, 2026
d703f0c
Cache relation results only at the head of a recursion cycle
jakebailey Oct 20, 2026
8f23579
Report completed cyclic comparisons as related
jakebailey Oct 20, 2026
df3a51b
Order derived type parameters by their origin
jakebailey Oct 21, 2026
024c8fd
Order object literal types by their members
jakebailey Oct 21, 2026
7f6bc97
Print declared property types only when equivalent
jakebailey Oct 21, 2026
ad9324c
Intern object literal types by content
jakebailey Oct 21, 2026
702aee8
Intern spread types by inputs and content
jakebailey Oct 21, 2026
61898b4
Order array literal types after their source references
jakebailey Oct 21, 2026
7e1f32d
Compare object literal members without symbol IDs
jakebailey Oct 21, 2026
ebb87af
Intern binding pattern types and order them by pattern
jakebailey Oct 21, 2026
64beb78
Order object literal copies by their creation flags
jakebailey Oct 21, 2026
c55be03
Intern widened, regular, and padded object literal types
jakebailey Oct 21, 2026
53f89e9
Intern object rest types and order them by members
jakebailey Oct 21, 2026
bb53af3
Key deferred indexed access types by their persistent flags
jakebailey Oct 21, 2026
0b3aa82
Intern intersection types by content
jakebailey Oct 21, 2026
5a3ef35
Order tuple targets by their label declarations
jakebailey Oct 21, 2026
1b1a430
Add a test for check order with a parameter in a type query
jakebailey Oct 22, 2026
5840917
Look through instantiation when reusing a parameter name
jakebailey Oct 22, 2026
6435b39
Add a test for check order with late-bound members
jakebailey Oct 22, 2026
bc5d753
Do not late-bind members a name lookup cannot match
jakebailey Oct 22, 2026
47449ea
Add a test for check order with computed enum members
jakebailey Oct 22, 2026
71ce155
Check computed enum initializers when checking the member
jakebailey Oct 22, 2026
531d440
Test that variances don't depend on declaration order
jakebailey Oct 23, 2026
c765691
Add circularity tests from PR 64834
jakebailey Oct 22, 2026
893e77e
Add test for a cycle through namespace spreads
jakebailey Oct 22, 2026
39c95ba
Add test for instantiation limit errors depending on check order
jakebailey Oct 22, 2026
ff26fda
Add a test for check order with circular type parameter defaults
jakebailey Oct 22, 2026
2383825
Add a test for check order with a circular constraint
jakebailey Oct 22, 2026
b2a0cf0
Add a test for emitting before checking
jakebailey Oct 22, 2026
665abed
Order symbols derived from the same declaration without ids
jakebailey Oct 30, 2026
2e15f38
Add a test for check order with aliased module.exports members
jakebailey Oct 22, 2026
bd1da67
Add a test for check order with excessively deep instantiations
jakebailey Oct 22, 2026
73591da
Add a test of awaiting a promise type that refers back to itself
jakebailey Oct 23, 2026
f480d71
Test check order for errors reused within the node reporting them
jakebailey Oct 23, 2026
436ea71
Split checker into shared store and per-checker state
jakebailey Oct 18, 2026
a4ee54b
Memoize checker results and replay their side effects
jakebailey Oct 26, 2026
61cc188
Memoize the remaining checker state
jakebailey Oct 26, 2026
91a1880
Discard results derived from computations in progress
jakebailey Oct 26, 2026
6e72ea7
Resolve a destructured initializer before its elements
jakebailey Oct 26, 2026
06e61d1
Measure circular variances as a fixpoint
jakebailey Oct 26, 2026
fa5641f
Make instantiation limits independent of check order
jakebailey Oct 26, 2026
5671fe7
Vary emit order with checkOrder
jakebailey Oct 22, 2026
c99b7cf
Keep property access symbol lookups inside one query
jakebailey Oct 22, 2026
c4b2948
Resolve cycles of type parameter defaults from a canonical member
jakebailey Oct 22, 2026
241c29a
Do not blame a use for the circular constraint of a declaration
jakebailey Oct 22, 2026
d5fba8a
Resolve mapped type constraints whenever the mapped type is requested
jakebailey Oct 22, 2026
3a7b26d
Report relation complexity overflows in every comparison needing them
jakebailey Oct 23, 2026
1026f25
Cache no results of a comparison cut short by an overflow
jakebailey Oct 23, 2026
7eac030
Fail awaited types that refer back to themselves as a cycle
jakebailey Oct 23, 2026
80e94e0
Combine late-bound members without re-entering their resolution
jakebailey Oct 26, 2026
c7966eb
Track explicit type and assertion operand resolution on the stack
jakebailey Oct 23, 2026
83c5772
Find simplifications in progress on the resolution stack
jakebailey Oct 23, 2026
67ecf6e
Track binding element parent resolution on the resolution stack
jakebailey Oct 23, 2026
43782fc
Track call resolution on the resolution stack
jakebailey Oct 23, 2026
91ebc8f
Don't keep reverse mappings cut short by enclosing ones
jakebailey Oct 23, 2026
bac7833
Document how type comparisons relate to cycles
jakebailey Oct 23, 2026
475d8ed
Don't cache errors reported at a caller's node
jakebailey Oct 26, 2026
70f2a46
Report missing helpers at the first location requesting them
jakebailey Oct 26, 2026
f5a182d
Observe a resolution's result only when it hides a cycle
jakebailey Oct 27, 2026
5070f5b
Break type cycles at their first-declared symbol
jakebailey Oct 27, 2026
3a56a54
Yield type cycles through member tables to the table
jakebailey Oct 27, 2026
9a0156f
Record effects in checks as queries do
jakebailey Oct 28, 2026
320ba35
Keep memo state inline in memo cells
jakebailey Oct 28, 2026
b90bca4
Skip the re-entry lookup for computations started by a check
jakebailey Oct 28, 2026
383c9c6
Add test for mutually dependent late-bound member tables
jakebailey Oct 28, 2026
9e2c9a4
Discard results of inner cycles when their head finishes
jakebailey Oct 28, 2026
86f2c70
Resolve mutually dependent member tables as if entered first-declared
jakebailey Oct 28, 2026
48e800c
Resolve module table cycles from a canonical entry
jakebailey Oct 28, 2026
2a75013
Read resolved structured members without a computation
jakebailey Oct 28, 2026
cd2735c
Read resolved base constraints without a computation
jakebailey Oct 28, 2026
66e4c12
Look up memo state once when beginning a memo
jakebailey Oct 28, 2026
eab7501
Remember which resolution records its key in progress
jakebailey Oct 28, 2026
862698c
Track computations in progress in a small open-addressing table
jakebailey Oct 28, 2026
8b64a2b
Observe memo cells through their own state
jakebailey Oct 28, 2026
573dfa3
Apply effects directly in checks outside cycles
jakebailey Oct 30, 2026
27272e7
Look up whether a member can late-merge cheaply
jakebailey Oct 30, 2026
9ea411b
Cache counting hashes in dense stores
jakebailey Oct 30, 2026
7802e1b
Look up a memo map entry's state once on entry
jakebailey Oct 30, 2026
5f53bb8
Compute a comparison's relation key once
jakebailey Oct 30, 2026
a6c20c4
Keep pre-checking merges in a dense symbol store
jakebailey Oct 30, 2026
9679b25
Filter the relation keys that have memo states
jakebailey Oct 30, 2026
ea216b9
Keep the observing test to one comparison
jakebailey Oct 30, 2026
4431cf1
Read a comparison's own cached result once
jakebailey Oct 30, 2026
792765c
Push resolutions in place
jakebailey Oct 30, 2026
9ea071f
Keep a memo map's rarely used parts in a side table
jakebailey Oct 30, 2026
27d9c7e
Keep instantiation counts with few registers as a list
jakebailey Oct 30, 2026
cdcb586
Count instantiations per statement again
jakebailey Oct 30, 2026
67ff383
Check nodes without a resolution of their own
jakebailey Oct 30, 2026
38ee10f
Begin a comparison's computation on its first cached pair
jakebailey Oct 30, 2026
88242ea
Reset a pooled relater field by field
jakebailey Oct 30, 2026
6ae0f53
Look up links without giving out ids
jakebailey Oct 30, 2026
94737df
Read computed object flags without a call
jakebailey Oct 30, 2026
d08bc7c
Skip current nodes when searching type resolutions
jakebailey Oct 30, 2026
08ac437
Inline reading resolved members
jakebailey Oct 30, 2026
c2f55ba
Begin and end a cached computation without calls
jakebailey Oct 30, 2026
0e570a9
Keep the node saved by a query on the checker
jakebailey Oct 30, 2026
fe10b73
Enter and exit a checked node without nested calls
jakebailey Oct 30, 2026
15eb8a0
Find and record a computation in progress in one probe
jakebailey Oct 30, 2026
de46dc9
Begin and end a cached entry of a map without calls
jakebailey Oct 30, 2026
49f6265
Key object literal and binding pattern types in member order
jakebailey Oct 30, 2026
4f04b4d
Key content-interned object types in member order
jakebailey Oct 31, 2026
c3e79c2
Keep the memo state of a cell in the memo state map again
jakebailey Oct 30, 2026
b738ad3
Check regular expression grammar once through a memo set
jakebailey Oct 30, 2026
55a980a
Remove the TypeChecked node flag
jakebailey Oct 30, 2026
df31677
Measure circular variances as TypeScript does, canonically
jakebailey Oct 31, 2026
f31e287
Stop walking the stack once a cycle head is already a dependency
jakebailey Oct 31, 2026
fd2dfaa
Resume checking as soon as nothing in progress can be discarded
jakebailey Oct 31, 2026
074b673
Discard only what reads incomplete variances
jakebailey Oct 31, 2026
b70440e
Stop comparisons of a measurement a restart superseded
jakebailey Oct 31, 2026
d12486e
Find an entry's computation in progress without scanning the stack
jakebailey Oct 31, 2026
3f34cd7
Rule out reports with a filter that stays in cache
jakebailey Oct 31, 2026
a146ff8
Stop runaway instantiations at twice the per-computation depth
jakebailey Oct 31, 2026
d6ae478
Size the memo state filter to the number of states
jakebailey Oct 31, 2026
3dfb95b
Store variances by symbol id
jakebailey Oct 31, 2026
43f3ddd
Read cached results without beginning a memo
jakebailey Oct 31, 2026
25b9b2f
Look for reports only in results that can have them
jakebailey Oct 31, 2026
d2c28a4
Key late-bindable kinds by parent
jakebailey Oct 31, 2026
db0acf1
Look up a computation's memo state only when needed
jakebailey Oct 31, 2026
9ce5a09
Index global resolutions by a small integer
jakebailey Oct 31, 2026
d15fb8c
Share awaited and promised types with callers that report errors
jakebailey Oct 31, 2026
647084e
Skip resolving an enclosing call that is already resolved
jakebailey Oct 31, 2026
891e34f
Compare object literal types by content directly
jakebailey Oct 31, 2026
73a722d
Share the resolution of a node checked directly within another
jakebailey Oct 31, 2026
0d1bc64
Return keyword types without memoizing them
jakebailey Oct 31, 2026
b8a1c1c
Keep interned results in maps without memo state
jakebailey Oct 31, 2026
0007e4b
Use slices.Backward when replaying resumed effects
jakebailey Oct 31, 2026
5b81f22
Observe resolutions when looking up members of a resolving type
jakebailey Nov 2, 2026
63cdff5
Remove ObjectFlagsMembersResolving
jakebailey Oct 31, 2026
32bba67
Add test for variance consistency in recursive generics
jakebailey Nov 1, 2026
fbc6abb
Add test for circular return types through callback arguments
jakebailey Nov 1, 2026
b798d52
Infer contextual return types without marking them in progress
jakebailey Nov 1, 2026
8ac3c5a
Add test for return type cycles through subtype reduction
jakebailey Nov 1, 2026
0986b82
Add test for JSDoc type tags on contextually typed functions
jakebailey Nov 1, 2026
63c32ab
Use JSDoc type tags when assigning contextual parameter types
jakebailey Nov 1, 2026
9233cb1
Add test for inference through iterators regardless of check order
jakebailey Nov 1, 2026
a7320f7
Revert "Skip resolving an enclosing call that is already resolved"
jakebailey Nov 1, 2026
4594e2a
Add test for a scope whose thunks refer to the scope
jakebailey Nov 1, 2026
77daf9a
Add test for a never narrowing after a loop with an && condition
jakebailey Nov 1, 2026
12068c6
Keep the result of a resolution nested in a hidden one of itself
jakebailey Nov 1, 2026
68fa09b
Name an instantiation cycle from its first declared type
jakebailey Nov 1, 2026
58ce69c
Keep rare memo effects fields out of line
jakebailey Nov 1, 2026
a2eb116
Make a result depend on its first computation directly
jakebailey Nov 1, 2026
cd24318
Keep the errors of a memo state out of line
jakebailey Nov 1, 2026
6b0f802
Retain what a forwarding computation observed in its place
jakebailey Nov 1, 2026
092cb75
Index memo maps' resolving counts
jakebailey Nov 1, 2026
acbe052
Measure circular variances once per strongly connected component
jakebailey Nov 1, 2026
2f756dc
fixup! Make a result depend on its first computation directly
jakebailey Nov 1, 2026
cc9b84c
Make computations depend only on the lowest cycle head they observe
jakebailey Nov 1, 2026
b32df3f
Find a variance measurement in progress without scanning the stack
jakebailey Nov 1, 2026
1904840
Reuse the caller's read of the outermost relation result
jakebailey Nov 1, 2026
96ff5e7
Find runs of unreachable statements once per block
jakebailey Nov 2, 2026
d548a83
Discard cached exports and instantiation expressions with cycles
jakebailey Nov 2, 2026
be77f3a
Only reuse the last reachability result when it is final
jakebailey Nov 2, 2026
c047cd5
Attach deferred results unlogged during variance cycles too
jakebailey Nov 2, 2026
ce74b6c
Correct two misleading descriptions of memo state
jakebailey Nov 2, 2026
c114c28
Discard intrinsic JSX flags with their tag symbol
jakebailey Nov 2, 2026
8ce9b68
Ask for contextual types and signatures when querying first
jakebailey Nov 2, 2026
7ffb50f
Add test for a const assertion inferred before its binding pattern
jakebailey Nov 2, 2026
56aeb4e
Keep a contextually inferred return type with its marker
jakebailey Nov 2, 2026
f34e474
Ignore symbol IDs in names when fuzzing check order
jakebailey Nov 2, 2026
9497534
Discard results computed from a binding pattern's own elements
jakebailey Nov 2, 2026
0d1bae0
Keep where unlocated effects of a reused result were observed
jakebailey Nov 2, 2026
c03e01b
Ask for the types of type nodes when querying before checking
jakebailey Nov 2, 2026
f13ebfd
Emit files among queries when fuzzing check order
jakebailey Nov 2, 2026
8b8ee25
Resolve return type cycles from their first declared member
jakebailey Nov 2, 2026
dbe149e
Keep results computed only against the outermost variance measurement
jakebailey Nov 2, 2026
ca14940
Keep results a cycle yield computes from scratch
jakebailey Nov 2, 2026
776fadb
Don't keep the failure of a resolution a yield recomputes
jakebailey Nov 2, 2026
cf4597c
Don't count symbol IDs toward the length of printed types
jakebailey Nov 2, 2026
a43e494
Start counting instantiations again for each outermost computation
jakebailey Nov 2, 2026
b4fe268
Remember where flow walks run out of depth
jakebailey Nov 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion packages/typescript/enums/objectFlags.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export declare enum ObjectFlags {
ContainsSpread = 1 << 22,
ObjectRestType = 1 << 23,
IsClassInstanceClone = 1 << 26,
IdenticalBaseTypeCalculated = 1 << 27,
IdenticalBaseTypeExists = 1 << 28,
FromTypeNode = 1 << 29,
IsGenericTypeComputed = 1 << 22,
Expand Down
1 change: 0 additions & 1 deletion packages/typescript/enums/objectFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export var ObjectFlags;
ObjectFlags[ObjectFlags["ContainsSpread"] = 4194304] = "ContainsSpread";
ObjectFlags[ObjectFlags["ObjectRestType"] = 8388608] = "ObjectRestType";
ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 67108864] = "IsClassInstanceClone";
ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] = 134217728] = "IdenticalBaseTypeCalculated";
ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 268435456] = "IdenticalBaseTypeExists";
ObjectFlags[ObjectFlags["FromTypeNode"] = 536870912] = "FromTypeNode";
ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
Expand Down
1 change: 0 additions & 1 deletion tsc/internal/api/enum_values_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions tsc/internal/ast/symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ func (m *SymbolMap) symbolAt(i int) *Symbol {
return symbol
}

// At returns the name and symbol of the i-th entry, in insertion order.
func (m *SymbolMap) At(i int) (string, *Symbol) {
return m.keyAt(i), m.symbolAt(i)
}

func (m *SymbolMap) find(key string) int {
if m == nil {
return -1
Expand Down
10 changes: 10 additions & 0 deletions tsc/internal/ast/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ func GetNodeId(node *Node) NodeId {
return NodeId(id)
}

// PeekNodeId returns the id of node, or 0 if it has none yet.
func PeekNodeId(node *Node) NodeId {
return NodeId(node.id.Load())
}

// PeekSymbolId returns the id of symbol, or 0 if it has none yet.
func PeekSymbolId(symbol *Symbol) SymbolId {
return SymbolId(symbol.id.Load())
}

func GetSymbolId(symbol *Symbol) SymbolId {
id := symbol.id.Load()
if id == 0 {
Expand Down
5,468 changes: 4,018 additions & 1,450 deletions tsc/internal/checker/checker.go

Large diffs are not rendered by default.

508 changes: 508 additions & 0 deletions tsc/internal/checker/checker_test.go

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion tsc/internal/checker/emitresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (r *EmitResolver) IsReferencedAliasDeclaration(node *ast.Node) bool {
if aliasLinks.referenced {
return true
}
target := aliasLinks.aliasTarget
target := aliasLinks.aliasTarget.get(c)
if target != nil && node.ModifierFlags()&ast.ModifierFlagsExport != 0 &&
c.getSymbolFlags(target)&ast.SymbolFlagsValue != 0 &&
(c.compilerOptions.ShouldPreserveConstEnums() || !isConstEnumOrConstEnumOnlyModule(target)) {
Expand Down Expand Up @@ -502,6 +502,12 @@ func (r *EmitResolver) MarkLinkedReferencesRecursively(file *ast.SourceFile) {
defer r.checkerMu.Unlock()

if file != nil {
r.checker.withReferenceMarks(func() { r.markLinkedReferencesRecursively(file) })
}
}

func (r *EmitResolver) markLinkedReferencesRecursively(file *ast.SourceFile) {
{
var visit ast.Visitor
visit = func(n *ast.Node) bool {
if ast.IsImportEqualsDeclaration(n) && n.ModifierFlags()&ast.ModifierFlagsExport == 0 {
Expand Down
Loading
Loading