Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions tsc/internal/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ type Checker struct {
structuredTypeExtraArena core.Arena[structuredTypeExtra]
freeTypeSets *temporaryTypeSet
freePropertyCounts *temporaryPropertyCounts
mergedSymbols map[*ast.Symbol]*ast.Symbol
mergedSymbols symbolLinkStore[*ast.Symbol]
mergedExportsChecked collections.Set[*ast.Symbol]
factory ast.NodeFactory
nodeLinks core.LinkStore[*ast.Node, NodeLinks]
Expand Down Expand Up @@ -1003,7 +1003,6 @@ func NewChecker(program Program, tracer *Tracer) (*Checker, *sync.Mutex) {
c.unionOfUnionTypes = make(map[UnionOfUnionKey]*Type)
c.intersectionTypes = make(map[CacheHashKey]*Type)
c.propertiesTypes = make(map[PropertiesTypesKey]*Type)
c.mergedSymbols = make(map[*ast.Symbol]*ast.Symbol)
c.patternForType = make(map[*Type]*ast.Node)
c.contextFreeTypes = make(map[*ast.Node]*Type)
c.anyType = c.newIntrinsicType(TypeFlagsAny, "any")
Expand Down Expand Up @@ -14624,9 +14623,8 @@ func (c *Checker) cloneSymbol(symbol *ast.Symbol) *ast.Symbol {

func (c *Checker) getMergedSymbol(symbol *ast.Symbol) *ast.Symbol {
if symbol != nil {
merged := c.mergedSymbols[symbol]
if merged != nil {
return merged
if merged := c.mergedSymbols.TryGet(symbol); merged != nil && *merged != nil {
return *merged
}
}
return symbol
Expand All @@ -14640,7 +14638,7 @@ func (c *Checker) getParentOfSymbol(symbol *ast.Symbol) *ast.Symbol {
}

func (c *Checker) recordMergedSymbol(target *ast.Symbol, source *ast.Symbol) {
c.mergedSymbols[source] = target
*c.mergedSymbols.Get(source) = target
}

func (c *Checker) getResolvedTarget(symbol *ast.Symbol) *ast.Symbol {
Expand Down
Loading