MCPcopy Create free account
hub / github.com/microsoft/typescript-go / checkExpressionCachedEx

Method checkExpressionCachedEx

internal/checker/checker.go:7494–7512  ·  view source on GitHub ↗
(node *ast.Node, checkMode CheckMode)

Source from the content-addressed store, hash-verified

7492}
7493
7494func (c *Checker) checkExpressionCachedEx(node *ast.Node, checkMode CheckMode) *Type {
7495 if checkMode != CheckModeNormal {
7496 return c.checkExpressionEx(node, checkMode)
7497 }
7498 links := c.typeNodeLinks.Get(node)
7499 if links.resolvedType == nil {
7500 // When computing a type that we're going to cache, we need to ignore any ongoing control flow
7501 // analysis because variables may have transient types in indeterminable states. Moving flowLoopStart
7502 // to the top of the stack ensures all transient types are computed from a known point.
7503 saveFlowLoopStack := c.flowLoopStack
7504 saveFlowTypeCache := c.flowTypeCache
7505 c.flowLoopStack = nil
7506 c.flowTypeCache = nil
7507 links.resolvedType = c.checkExpressionEx(node, checkMode)
7508 c.flowTypeCache = saveFlowTypeCache
7509 c.flowLoopStack = saveFlowLoopStack
7510 }
7511 return links.resolvedType
7512}
7513
7514// Returns the type of an expression. Unlike checkExpression, this function is simply concerned
7515// with computing the type and may not fully check all contained sub-expressions for errors.

Calls 2

checkExpressionExMethod · 0.95
GetMethod · 0.65

Tested by

no test coverage detected