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

Function SetValueDeclaration

internal/binder/binder.go:2538–2547  ·  view source on GitHub ↗
(symbol *ast.Symbol, node *ast.Node)

Source from the content-addressed store, hash-verified

2536}
2537
2538func SetValueDeclaration(symbol *ast.Symbol, node *ast.Node) {
2539 valueDeclaration := symbol.ValueDeclaration
2540 if valueDeclaration == nil ||
2541 isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node) ||
2542 valueDeclaration.Kind != node.Kind && isEffectiveModuleDeclaration(valueDeclaration) {
2543 // Non-assignment declarations take precedence over assignment declarations and
2544 // non-namespace declarations take precedence over namespace declarations.
2545 symbol.ValueDeclaration = node
2546 }
2547}
2548
2549/**
2550 * Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names.

Callers 5

mergeSymbolMethod · 0.92
bindExportAssignmentMethod · 0.85

Calls 2

isAssignmentDeclarationFunction · 0.85

Tested by

no test coverage detected