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

Method getTypeFromTypeQueryNode

internal/checker/checker.go:24010–24021  ·  view source on GitHub ↗
(node *ast.Node)

Source from the content-addressed store, hash-verified

24008}
24009
24010func (c *Checker) getTypeFromTypeQueryNode(node *ast.Node) *Type {
24011 links := c.typeNodeLinks.Get(node)
24012 if links.resolvedType == nil {
24013 // TypeScript 1.0 spec (April 2014): 3.6.3
24014 // The expression is processed as an identifier expression (section 4.3)
24015 // or property access expression(section 4.10),
24016 // the widened type(section 3.9) of which becomes the result.
24017 t := c.checkExpressionWithTypeArguments(node)
24018 links.resolvedType = c.getRegularTypeOfLiteralType(c.getWidenedType(t))
24019 }
24020 return links.resolvedType
24021}
24022
24023func (c *Checker) getTypeFromArrayOrTupleTypeNode(node *ast.Node) *Type {
24024 links := c.typeNodeLinks.Get(node)

Callers 2

checkTypeQueryMethod · 0.95

Calls 4

getWidenedTypeMethod · 0.95
GetMethod · 0.65

Tested by

no test coverage detected