MCPcopy
hub / github.com/microsoft/typescript-go / getFlowReferenceKey

Method getFlowReferenceKey

internal/checker/flow.go:1636–1642  ·  view source on GitHub ↗

Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers separated by dots). The key consists of the id of the symbol referenced by the leftmost identifier followed by zero or more property names separated by dots. The result is nonDottedNameCacheKey if the reference isn't a dot

(f *FlowState)

Source from the content-addressed store, hash-verified

1634// leftmost identifier followed by zero or more property names separated by dots.
1635// The result is nonDottedNameCacheKey if the reference isn't a dotted name.
1636func (c *Checker) getFlowReferenceKey(f *FlowState) CacheHashKey {
1637 var b keyBuilder
1638 if c.writeFlowCacheKey(&b, f.reference, f.declaredType, f.initialType, f.flowContainer) {
1639 return b.hash()
1640 }
1641 return nonDottedNameCacheKey // Reference isn't a dotted name
1642}
1643
1644func (c *Checker) writeFlowCacheKey(b *keyBuilder, node *ast.Node, declaredType *Type, initialType *Type, flowContainer *ast.Node) bool {
1645 switch node.Kind {

Callers 1

Calls 2

writeFlowCacheKeyMethod · 0.95
hashMethod · 0.95

Tested by

no test coverage detected