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

Method isMatchingConstructorReference

internal/checker/flow.go:738–745  ·  view source on GitHub ↗
(f *FlowState, expr *ast.Node)

Source from the content-addressed store, hash-verified

736}
737
738func (c *Checker) isMatchingConstructorReference(f *FlowState, expr *ast.Node) bool {
739 if ast.IsAccessExpression(expr) {
740 if accessedName, ok := c.getAccessedPropertyName(expr); ok && accessedName == "constructor" && c.isMatchingReference(f.reference, expr.Expression()) {
741 return true
742 }
743 }
744 return false
745}
746
747func (c *Checker) narrowTypeByConstructor(t *Type, operator ast.Kind, identifier *ast.Node, assumeTrue bool) *Type {
748 // Do not narrow when checking inequality.

Callers 1

Calls 4

isMatchingReferenceMethod · 0.95
IsAccessExpressionFunction · 0.92
ExpressionMethod · 0.80

Tested by

no test coverage detected