@@ -3617,7 +3617,7 @@ namespace ts {
36173617 });
36183618 }
36193619
3620- function isDeclarationVisible(node: Declaration ): boolean {
3620+ function isDeclarationVisible(node: Node ): boolean {
36213621 if (node) {
36223622 const links = getNodeLinks(node);
36233623 if (links.isVisible === undefined) {
@@ -3631,10 +3631,10 @@ namespace ts {
36313631 function determineIfDeclarationIsVisible() {
36323632 switch (node.kind) {
36333633 case SyntaxKind.BindingElement:
3634- return isDeclarationVisible(<Declaration> node.parent.parent);
3634+ return isDeclarationVisible(node.parent.parent);
36353635 case SyntaxKind.VariableDeclaration:
3636- if (isBindingPattern( node.name) &&
3637- !(<BindingPattern>node .name) .elements.length) {
3636+ const declaration = node as VariableDeclaration;
3637+ if (isBindingPattern(declaration.name) && !declaration .name.elements.length) {
36383638 // If the binding pattern is empty, this variable declaration is not visible
36393639 return false;
36403640 }
@@ -3657,7 +3657,7 @@ namespace ts {
36573657 return isGlobalSourceFile(parent);
36583658 }
36593659 // Exported members/ambient module elements (exception import declaration) are visible if parent is visible
3660- return isDeclarationVisible(<Declaration> parent);
3660+ return isDeclarationVisible(parent);
36613661
36623662 case SyntaxKind.PropertyDeclaration:
36633663 case SyntaxKind.PropertySignature:
@@ -3687,7 +3687,7 @@ namespace ts {
36873687 case SyntaxKind.UnionType:
36883688 case SyntaxKind.IntersectionType:
36893689 case SyntaxKind.ParenthesizedType:
3690- return isDeclarationVisible(<Declaration> node.parent);
3690+ return isDeclarationVisible(node.parent);
36913691
36923692 // Default binding, import specifier and namespace import is visible
36933693 // only on demand so by default it is not visible
@@ -6235,8 +6235,8 @@ namespace ts {
62356235 case SyntaxKind.MethodDeclaration:
62366236 case SyntaxKind.GetAccessor:
62376237 case SyntaxKind.SetAccessor:
6238- return (<RealDeclaration >node).name.kind === SyntaxKind.ComputedPropertyName
6239- && traverse((<RealDeclaration >node).name);
6238+ return (<DeclarationBase >node).name.kind === SyntaxKind.ComputedPropertyName
6239+ && traverse((<DeclarationBase >node).name);
62406240
62416241 default:
62426242 return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && forEachChild(node, traverse);
@@ -21841,7 +21841,7 @@ namespace ts {
2184121841 function isTypeDeclarationName(name: Node): boolean {
2184221842 return name.kind === SyntaxKind.Identifier &&
2184321843 isTypeDeclaration(name.parent) &&
21844- (<RealDeclaration >name.parent).name === name;
21844+ (<TypeElement >name.parent).name === name;
2184521845 }
2184621846
2184721847 function isTypeDeclaration(node: Node): boolean {
@@ -22469,7 +22469,7 @@ namespace ts {
2246922469
2247022470 // Return true if the given node is a declaration of a nested block scoped entity with a name that either hides an
2247122471 // existing name or might hide a name when compiled downlevel
22472- function isDeclarationWithCollidingName(node: Declaration ): boolean {
22472+ function isDeclarationWithCollidingName(node: Node ): boolean {
2247322473 node = getParseTreeNode(node, isDeclaration);
2247422474 if (node) {
2247522475 const symbol = getSymbolOfNode(node);
0 commit comments