@@ -3621,7 +3621,7 @@ namespace ts {
36213621 });
36223622 }
36233623
3624- function isDeclarationVisible(node: Declaration ): boolean {
3624+ function isDeclarationVisible(node: Node ): boolean {
36253625 if (node) {
36263626 const links = getNodeLinks(node);
36273627 if (links.isVisible === undefined) {
@@ -3635,10 +3635,10 @@ namespace ts {
36353635 function determineIfDeclarationIsVisible() {
36363636 switch (node.kind) {
36373637 case SyntaxKind.BindingElement:
3638- return isDeclarationVisible(<Declaration> node.parent.parent);
3638+ return isDeclarationVisible(node.parent.parent);
36393639 case SyntaxKind.VariableDeclaration:
3640- if (isBindingPattern( node.name) &&
3641- !(<BindingPattern>node .name) .elements.length) {
3640+ const declaration = node as VariableDeclaration;
3641+ if (isBindingPattern(declaration.name) && !declaration .name.elements.length) {
36423642 // If the binding pattern is empty, this variable declaration is not visible
36433643 return false;
36443644 }
@@ -3661,7 +3661,7 @@ namespace ts {
36613661 return isGlobalSourceFile(parent);
36623662 }
36633663 // Exported members/ambient module elements (exception import declaration) are visible if parent is visible
3664- return isDeclarationVisible(<Declaration> parent);
3664+ return isDeclarationVisible(parent);
36653665
36663666 case SyntaxKind.PropertyDeclaration:
36673667 case SyntaxKind.PropertySignature:
@@ -3691,7 +3691,7 @@ namespace ts {
36913691 case SyntaxKind.UnionType:
36923692 case SyntaxKind.IntersectionType:
36933693 case SyntaxKind.ParenthesizedType:
3694- return isDeclarationVisible(<Declaration> node.parent);
3694+ return isDeclarationVisible(node.parent);
36953695
36963696 // Default binding, import specifier and namespace import is visible
36973697 // only on demand so by default it is not visible
@@ -6236,8 +6236,8 @@ namespace ts {
62366236 case SyntaxKind.MethodDeclaration:
62376237 case SyntaxKind.GetAccessor:
62386238 case SyntaxKind.SetAccessor:
6239- return (<RealDeclaration >node).name.kind === SyntaxKind.ComputedPropertyName
6240- && traverse((<RealDeclaration >node).name);
6239+ return (<DeclarationBase >node).name.kind === SyntaxKind.ComputedPropertyName
6240+ && traverse((<DeclarationBase >node).name);
62416241
62426242 default:
62436243 return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && forEachChild(node, traverse);
@@ -21917,7 +21917,7 @@ namespace ts {
2191721917 function isTypeDeclarationName(name: Node): boolean {
2191821918 return name.kind === SyntaxKind.Identifier &&
2191921919 isTypeDeclaration(name.parent) &&
21920- (<RealDeclaration >name.parent).name === name;
21920+ (<TypeElement >name.parent).name === name;
2192121921 }
2192221922
2192321923 function isTypeDeclaration(node: Node): boolean {
@@ -22545,7 +22545,7 @@ namespace ts {
2254522545
2254622546 // Return true if the given node is a declaration of a nested block scoped entity with a name that either hides an
2254722547 // existing name or might hide a name when compiled downlevel
22548- function isDeclarationWithCollidingName(node: Declaration ): boolean {
22548+ function isDeclarationWithCollidingName(node: Node ): boolean {
2254922549 node = getParseTreeNode(node, isDeclaration);
2255022550 if (node) {
2255122551 const symbol = getSymbolOfNode(node);
0 commit comments