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

Function containsNarrowableReference

internal/binder/binder.go:2620–2631  ·  view source on GitHub ↗
(expr *ast.Node)

Source from the content-addressed store, hash-verified

2618}
2619
2620func containsNarrowableReference(expr *ast.Node) bool {
2621 if isNarrowableReference(expr) {
2622 return true
2623 }
2624 if expr.Flags&ast.NodeFlagsOptionalChain != 0 {
2625 switch expr.Kind {
2626 case ast.KindPropertyAccessExpression, ast.KindElementAccessExpression, ast.KindCallExpression, ast.KindNonNullExpression:
2627 return containsNarrowableReference(expr.Expression())
2628 }
2629 }
2630 return false
2631}
2632
2633func isNarrowableReference(node *ast.Node) bool {
2634 switch node.Kind {

Callers 4

isNarrowingExpressionFunction · 0.85
hasNarrowableArgumentFunction · 0.85
isNarrowableOperandFunction · 0.85

Calls 2

isNarrowableReferenceFunction · 0.85
ExpressionMethod · 0.80

Tested by

no test coverage detected