Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
53e7be6
Add a checkOrder test option
jakebailey Oct 22, 2026
59a3279
Add a check order fuzzer to the test harness
jakebailey Oct 26, 2026
ec139b6
Check some existing tests in typesfirst order
jakebailey Oct 22, 2026
9d06640
Add tests for check order dependence
jakebailey Oct 21, 2026
7cac3e4
Add test for recursive variance fixed points
jakebailey Oct 21, 2026
4467eab
Report accessor pair errors from each accessor
jakebailey Oct 19, 2026
17fccfe
Read type alias type parameters through their declared type
jakebailey Oct 19, 2026
bb0217d
Check assertion operands once, with their normal type
jakebailey Oct 19, 2026
4e6d6f0
Remove unused isConstructorDeclaredProperty link
jakebailey Oct 19, 2026
0d55017
Derive binding pattern parent types without peeking at caches
jakebailey Oct 19, 2026
d39c2b9
Prefer contextually assigned parameter types on first query
jakebailey Oct 19, 2026
f964545
Contextually check function expressions after member cycles
jakebailey Oct 19, 2026
047d783
Resolve enclosing calls before the calls in their arguments
jakebailey Oct 19, 2026
1ba7aa9
Do not cache index signature symbols looked up by the API
jakebailey Oct 19, 2026
40afad4
Complete contextual signatures before anyone reads them
jakebailey Oct 19, 2026
23d8f9a
Do not cache instantiations of single signature types
jakebailey Oct 19, 2026
3ef4282
Report unresolved names after resolution completes
jakebailey Oct 19, 2026
935a77d
Apply the flow analysis depth limit per reference
jakebailey Oct 19, 2026
990fa47
Track computed property name cycles on the resolution stack
jakebailey Oct 19, 2026
bc5b3b3
Don't reuse incomplete shared flow types after their loop exits
jakebailey Oct 19, 2026
f874c0c
Locate call resolution at the call
jakebailey Oct 21, 2026
c0b23af
Order deeply nested types by generation instead of type id
jakebailey Oct 20, 2026
57d2294
Reuse cached results for the broadest equivalent relation key
jakebailey Oct 20, 2026
a6cfee8
Cache relation results only at the head of a recursion cycle
jakebailey Oct 20, 2026
6f60aaf
Report completed cyclic comparisons as related
jakebailey Oct 20, 2026
dda2818
Order derived type parameters by their origin
jakebailey Oct 21, 2026
d626a31
Order object literal types by their members
jakebailey Oct 21, 2026
8816810
Print declared property types only when equivalent
jakebailey Oct 21, 2026
1e923a7
Intern object literal types by content
jakebailey Oct 21, 2026
24b86d0
Intern spread types by inputs and content
jakebailey Oct 21, 2026
6282037
Order array literal types after their source references
jakebailey Oct 21, 2026
c7a254f
Compare object literal members without symbol IDs
jakebailey Oct 21, 2026
150c985
Intern binding pattern types and order them by pattern
jakebailey Oct 21, 2026
634cd04
Order object literal copies by their creation flags
jakebailey Oct 21, 2026
5c28df1
Intern widened, regular, and padded object literal types
jakebailey Oct 21, 2026
ae452b2
Intern object rest types and order them by members
jakebailey Oct 21, 2026
21aa9b9
Key deferred indexed access types by their persistent flags
jakebailey Oct 21, 2026
16e4548
Intern intersection types by content
jakebailey Oct 21, 2026
79e2904
Order tuple targets by their label declarations
jakebailey Oct 21, 2026
e3dfd2c
Add a test for check order with a parameter in a type query
jakebailey Oct 22, 2026
895dc32
Look through instantiation when reusing a parameter name
jakebailey Oct 22, 2026
5e341f0
Add a test for check order with late-bound members
jakebailey Oct 22, 2026
251de55
Do not late-bind members a name lookup cannot match
jakebailey Oct 22, 2026
78d0ac2
Add a test for check order with computed enum members
jakebailey Oct 22, 2026
caa373d
Check computed enum initializers when checking the member
jakebailey Oct 22, 2026
d6b1115
Test that variances don't depend on declaration order
jakebailey Oct 23, 2026
4f66a65
Add circularity tests from PR 64834
jakebailey Oct 22, 2026
9f4514e
Add test for a cycle through namespace spreads
jakebailey Oct 22, 2026
12d0fa3
Add test for instantiation limit errors depending on check order
jakebailey Oct 22, 2026
90ffb1c
Add a test for check order with circular type parameter defaults
jakebailey Oct 22, 2026
244b0ce
Add a test for check order with a circular constraint
jakebailey Oct 22, 2026
b78ffdf
Add a test for emitting before checking
jakebailey Oct 22, 2026
d77c030
Order symbols derived from the same declaration without ids
jakebailey Oct 30, 2026
388e414
Add a test for check order with aliased module.exports members
jakebailey Oct 22, 2026
4a55d73
Add a test for check order with excessively deep instantiations
jakebailey Oct 22, 2026
32ff72d
Add a test of awaiting a promise type that refers back to itself
jakebailey Oct 23, 2026
ea03773
Test check order for errors reused within the node reporting them
jakebailey Oct 23, 2026
e6bc269
Split checker into shared store and per-checker state
jakebailey Oct 18, 2026
5a63e0c
Memoize checker results and replay their side effects
jakebailey Oct 26, 2026
6a576ae
Memoize the remaining checker state
jakebailey Oct 26, 2026
e9a106e
Discard results derived from computations in progress
jakebailey Oct 26, 2026
0afcb38
Show declared members while resolving inherited ones
jakebailey Oct 26, 2026
c5f0090
Compute the layout of declared members only when used
jakebailey Oct 31, 2026
093047d
Resolve a destructured initializer before its elements
jakebailey Oct 26, 2026
d7aef5d
Measure circular variances as a fixpoint
jakebailey Oct 26, 2026
217f3b2
Make instantiation limits independent of check order
jakebailey Oct 26, 2026
6bc34b7
Vary emit order with checkOrder
jakebailey Oct 22, 2026
062f5a4
Keep property access symbol lookups inside one query
jakebailey Oct 22, 2026
9a43f2f
Resolve cycles of type parameter defaults from a canonical member
jakebailey Oct 22, 2026
71ebdb8
Do not blame a use for the circular constraint of a declaration
jakebailey Oct 22, 2026
87881cd
Resolve mapped type constraints whenever the mapped type is requested
jakebailey Oct 22, 2026
fc9017f
Report relation complexity overflows in every comparison needing them
jakebailey Oct 23, 2026
e238143
Cache no results of a comparison cut short by an overflow
jakebailey Oct 23, 2026
d05e98e
Fail awaited types that refer back to themselves as a cycle
jakebailey Oct 23, 2026
9483a50
Combine late-bound members without re-entering their resolution
jakebailey Oct 26, 2026
53b05f1
Track explicit type and assertion operand resolution on the stack
jakebailey Oct 23, 2026
be60abf
Find simplifications in progress on the resolution stack
jakebailey Oct 23, 2026
630ea9a
Track binding element parent resolution on the resolution stack
jakebailey Oct 23, 2026
bb43f3d
Track call resolution on the resolution stack
jakebailey Oct 23, 2026
72e346e
Don't keep reverse mappings cut short by enclosing ones
jakebailey Oct 23, 2026
dd47fd3
Document how type comparisons relate to cycles
jakebailey Oct 23, 2026
7ae7293
Don't cache errors reported at a caller's node
jakebailey Oct 26, 2026
41cdea8
Report missing helpers at the first location requesting them
jakebailey Oct 26, 2026
a2af362
Observe a resolution's result only when it hides a cycle
jakebailey Oct 27, 2026
dabc63f
Break type cycles at their first-declared symbol
jakebailey Oct 27, 2026
eaa2936
Yield type cycles through member tables to the table
jakebailey Oct 27, 2026
2a9fdd5
Record effects in checks as queries do
jakebailey Oct 28, 2026
80d9f46
Keep memo state inline in memo cells
jakebailey Oct 28, 2026
7021cdc
Skip the re-entry lookup for computations started by a check
jakebailey Oct 28, 2026
8597e0f
Add test for mutually dependent late-bound member tables
jakebailey Oct 28, 2026
057b5f1
Discard results of inner cycles when their head finishes
jakebailey Oct 28, 2026
2a35c4a
Resolve mutually dependent member tables as if entered first-declared
jakebailey Oct 28, 2026
7e0024f
Resolve module table cycles from a canonical entry
jakebailey Oct 28, 2026
d008cf8
Read resolved structured members without a computation
jakebailey Oct 28, 2026
a0f7f21
Read resolved base constraints without a computation
jakebailey Oct 28, 2026
7c292bf
Look up memo state once when beginning a memo
jakebailey Oct 28, 2026
422609c
Remember which resolution records its key in progress
jakebailey Oct 28, 2026
302ab7f
Track computations in progress in a small open-addressing table
jakebailey Oct 28, 2026
99ae03f
Observe memo cells through their own state
jakebailey Oct 28, 2026
c7bafe2
Apply effects directly in checks outside cycles
jakebailey Oct 30, 2026
514bdfe
Look up whether a member can late-merge cheaply
jakebailey Oct 30, 2026
9189a74
Cache counting hashes in dense stores
jakebailey Oct 30, 2026
fcfc28e
Look up a memo map entry's state once on entry
jakebailey Oct 30, 2026
8fd48d8
Compute a comparison's relation key once
jakebailey Oct 30, 2026
e071012
Keep pre-checking merges in a dense symbol store
jakebailey Oct 30, 2026
6f799d0
Filter the relation keys that have memo states
jakebailey Oct 30, 2026
d138425
Keep the observing test to one comparison
jakebailey Oct 30, 2026
337f52f
Read a comparison's own cached result once
jakebailey Oct 30, 2026
cd0b063
Push resolutions in place
jakebailey Oct 30, 2026
b5eb331
Keep a memo map's rarely used parts in a side table
jakebailey Oct 30, 2026
4418f19
Keep instantiation counts with few registers as a list
jakebailey Oct 30, 2026
787e827
Count instantiations per statement again
jakebailey Oct 30, 2026
f001264
Check nodes without a resolution of their own
jakebailey Oct 30, 2026
2c8281e
Begin a comparison's computation on its first cached pair
jakebailey Oct 30, 2026
2c40597
Reset a pooled relater field by field
jakebailey Oct 30, 2026
f301d9b
Look up links without giving out ids
jakebailey Oct 30, 2026
eb6aee0
Read computed object flags without a call
jakebailey Oct 30, 2026
1c9c3e9
Skip current nodes when searching type resolutions
jakebailey Oct 30, 2026
12f535d
Inline reading resolved members
jakebailey Oct 30, 2026
65453e4
Begin and end a cached computation without calls
jakebailey Oct 30, 2026
79b7814
Keep the node saved by a query on the checker
jakebailey Oct 30, 2026
fe397db
Enter and exit a checked node without nested calls
jakebailey Oct 30, 2026
d2c18b8
Find and record a computation in progress in one probe
jakebailey Oct 30, 2026
b4893ec
Begin and end a cached entry of a map without calls
jakebailey Oct 30, 2026
a9c82a3
Key object literal and binding pattern types in member order
jakebailey Oct 30, 2026
d57b421
Key content-interned object types in member order
jakebailey Oct 31, 2026
b842128
Keep the memo state of a cell in the memo state map again
jakebailey Oct 30, 2026
bc578c4
Check regular expression grammar once through a memo set
jakebailey Oct 30, 2026
191b7d8
Remove the TypeChecked node flag
jakebailey Oct 30, 2026
3102c76
Measure circular variances as TypeScript does, canonically
jakebailey Oct 31, 2026
444f1cb
Stop walking the stack once a cycle head is already a dependency
jakebailey Oct 31, 2026
36cdc56
Resume checking as soon as nothing in progress can be discarded
jakebailey Oct 31, 2026
e647c38
Discard only what reads incomplete variances
jakebailey Oct 31, 2026
3c2ddb8
Stop comparisons of a measurement a restart superseded
jakebailey Oct 31, 2026
e4a8983
Find an entry's computation in progress without scanning the stack
jakebailey Oct 31, 2026
598a735
Rule out reports with a filter that stays in cache
jakebailey Oct 31, 2026
eee0524
Stop runaway instantiations at twice the per-computation depth
jakebailey Oct 31, 2026
e250ee1
Size the memo state filter to the number of states
jakebailey Oct 31, 2026
9b6b533
Store variances by symbol id
jakebailey Oct 31, 2026
121634e
Read cached results without beginning a memo
jakebailey Oct 31, 2026
90f0991
Look for reports only in results that can have them
jakebailey Oct 31, 2026
750ad02
Key late-bindable kinds by parent
jakebailey Oct 31, 2026
e78c9c4
Look up a computation's memo state only when needed
jakebailey Oct 31, 2026
bd108f5
Index global resolutions by a small integer
jakebailey Oct 31, 2026
a354916
Share awaited and promised types with callers that report errors
jakebailey Oct 31, 2026
f871455
Skip resolving an enclosing call that is already resolved
jakebailey Oct 31, 2026
b0e9073
Compare object literal types by content directly
jakebailey Oct 31, 2026
0153aef
Share the resolution of a node checked directly within another
jakebailey Oct 31, 2026
15b6b8e
Return keyword types without memoizing them
jakebailey Oct 31, 2026
1b407a5
Keep interned results in maps without memo state
jakebailey Oct 31, 2026
d594f3b
Use slices.Backward when replaying resumed effects
jakebailey Oct 31, 2026
46cb662
Look up declared members of types whose layout is being built
jakebailey Oct 31, 2026
c501b1f
Remove ObjectFlagsMembersResolving
jakebailey Oct 31, 2026
f5d26a8
Add test for variance consistency in recursive generics
jakebailey Nov 1, 2026
efcb516
Add test for circular return types through callback arguments
jakebailey Nov 1, 2026
5b1017c
Infer contextual return types without marking them in progress
jakebailey Nov 1, 2026
7ee6642
Add test for return type cycles through subtype reduction
jakebailey Nov 1, 2026
bfb872d
Add test for JSDoc type tags on contextually typed functions
jakebailey Nov 1, 2026
e1f58fe
Use JSDoc type tags when assigning contextual parameter types
jakebailey Nov 1, 2026
d61a91c
Add test for inference through iterators regardless of check order
jakebailey Nov 1, 2026
8fd656e
Revert "Skip resolving an enclosing call that is already resolved"
jakebailey Nov 1, 2026
e2d2c40
Add test for a scope whose thunks refer to the scope
jakebailey Nov 1, 2026
4c4eb97
Add test for a never narrowing after a loop with an && condition
jakebailey Nov 1, 2026
ae1abce
Keep the result of a resolution nested in a hidden one of itself
jakebailey Nov 1, 2026
f5fe0a0
Name an instantiation cycle from its first declared type
jakebailey Nov 1, 2026
d0c3d56
Keep rare memo effects fields out of line
jakebailey Nov 1, 2026
efc61b9
Make a result depend on its first computation directly
jakebailey Nov 1, 2026
c1b80e6
Keep the errors of a memo state out of line
jakebailey Nov 1, 2026
2519511
Retain what a forwarding computation observed in its place
jakebailey Nov 1, 2026
5514ad0
Index memo maps' resolving counts
jakebailey Nov 1, 2026
2ed17fe
Measure circular variances once per strongly connected component
jakebailey Nov 1, 2026
55c6d8e
fixup! Make a result depend on its first computation directly
jakebailey Nov 1, 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,338 changes: 3,883 additions & 1,455 deletions tsc/internal/checker/checker.go

Large diffs are not rendered by default.

446 changes: 446 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