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

Method checkExpressionEx

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

Source from the content-addressed store, hash-verified

7532}
7533
7534func (c *Checker) checkExpressionEx(node *ast.Node, checkMode CheckMode) *Type {
7535 if tr := c.tracer; tr != nil {
7536 defer tr.Push(tracing.PhaseCheck, "checkExpression", map[string]any{"kind": node.Kind, "pos": node.Pos(), "end": node.End(), "path": ast.GetSourceFileOfNode(node).FileName()}, false)()
7537 }
7538 saveCurrentNode := c.currentNode
7539 c.currentNode = node
7540 c.instantiationCount = 0
7541 uninstantiatedType := c.checkExpressionWorker(node, checkMode)
7542 t := c.instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode)
7543 if isConstEnumObjectType(t) {
7544 c.checkConstEnumAccess(node, t)
7545 }
7546 c.currentNode = saveCurrentNode
7547 return t
7548}
7549
7550func (c *Checker) checkConstEnumAccess(node *ast.Node, t *Type) {
7551 // enum object type for const enums are only permitted in:

Calls 9

checkExpressionWorkerMethod · 0.95
checkConstEnumAccessMethod · 0.95
GetSourceFileOfNodeFunction · 0.92
isConstEnumObjectTypeFunction · 0.85
PosMethod · 0.65
EndMethod · 0.65
FileNameMethod · 0.65
PushMethod · 0.45

Tested by

no test coverage detected