@@ -3621,7 +3621,7 @@ namespace ts {
3621
3621
});
3622
3622
}
3623
3623
3624
- function isDeclarationVisible(node: Declaration ): boolean {
3624
+ function isDeclarationVisible(node: Node ): boolean {
3625
3625
if (node) {
3626
3626
const links = getNodeLinks(node);
3627
3627
if (links.isVisible === undefined) {
@@ -3635,10 +3635,10 @@ namespace ts {
3635
3635
function determineIfDeclarationIsVisible() {
3636
3636
switch (node.kind) {
3637
3637
case SyntaxKind.BindingElement:
3638
- return isDeclarationVisible(<Declaration> node.parent.parent);
3638
+ return isDeclarationVisible(node.parent.parent);
3639
3639
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) {
3642
3642
// If the binding pattern is empty, this variable declaration is not visible
3643
3643
return false;
3644
3644
}
@@ -3661,7 +3661,7 @@ namespace ts {
3661
3661
return isGlobalSourceFile(parent);
3662
3662
}
3663
3663
// Exported members/ambient module elements (exception import declaration) are visible if parent is visible
3664
- return isDeclarationVisible(<Declaration> parent);
3664
+ return isDeclarationVisible(parent);
3665
3665
3666
3666
case SyntaxKind.PropertyDeclaration:
3667
3667
case SyntaxKind.PropertySignature:
@@ -3691,7 +3691,7 @@ namespace ts {
3691
3691
case SyntaxKind.UnionType:
3692
3692
case SyntaxKind.IntersectionType:
3693
3693
case SyntaxKind.ParenthesizedType:
3694
- return isDeclarationVisible(<Declaration> node.parent);
3694
+ return isDeclarationVisible(node.parent);
3695
3695
3696
3696
// Default binding, import specifier and namespace import is visible
3697
3697
// only on demand so by default it is not visible
@@ -6236,8 +6236,8 @@ namespace ts {
6236
6236
case SyntaxKind.MethodDeclaration:
6237
6237
case SyntaxKind.GetAccessor:
6238
6238
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);
6241
6241
6242
6242
default:
6243
6243
return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && forEachChild(node, traverse);
@@ -21917,7 +21917,7 @@ namespace ts {
21917
21917
function isTypeDeclarationName(name: Node): boolean {
21918
21918
return name.kind === SyntaxKind.Identifier &&
21919
21919
isTypeDeclaration(name.parent) &&
21920
- (<RealDeclaration >name.parent).name === name;
21920
+ (<TypeElement >name.parent).name === name;
21921
21921
}
21922
21922
21923
21923
function isTypeDeclaration(node: Node): boolean {
@@ -22545,7 +22545,7 @@ namespace ts {
22545
22545
22546
22546
// Return true if the given node is a declaration of a nested block scoped entity with a name that either hides an
22547
22547
// existing name or might hide a name when compiled downlevel
22548
- function isDeclarationWithCollidingName(node: Declaration ): boolean {
22548
+ function isDeclarationWithCollidingName(node: Node ): boolean {
22549
22549
node = getParseTreeNode(node, isDeclaration);
22550
22550
if (node) {
22551
22551
const symbol = getSymbolOfNode(node);
0 commit comments