@@ -3617,7 +3617,7 @@ namespace ts {
3617
3617
});
3618
3618
}
3619
3619
3620
- function isDeclarationVisible(node: Declaration ): boolean {
3620
+ function isDeclarationVisible(node: Node ): boolean {
3621
3621
if (node) {
3622
3622
const links = getNodeLinks(node);
3623
3623
if (links.isVisible === undefined) {
@@ -3631,10 +3631,10 @@ namespace ts {
3631
3631
function determineIfDeclarationIsVisible() {
3632
3632
switch (node.kind) {
3633
3633
case SyntaxKind.BindingElement:
3634
- return isDeclarationVisible(<Declaration> node.parent.parent);
3634
+ return isDeclarationVisible(node.parent.parent);
3635
3635
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) {
3638
3638
// If the binding pattern is empty, this variable declaration is not visible
3639
3639
return false;
3640
3640
}
@@ -3657,7 +3657,7 @@ namespace ts {
3657
3657
return isGlobalSourceFile(parent);
3658
3658
}
3659
3659
// Exported members/ambient module elements (exception import declaration) are visible if parent is visible
3660
- return isDeclarationVisible(<Declaration> parent);
3660
+ return isDeclarationVisible(parent);
3661
3661
3662
3662
case SyntaxKind.PropertyDeclaration:
3663
3663
case SyntaxKind.PropertySignature:
@@ -3687,7 +3687,7 @@ namespace ts {
3687
3687
case SyntaxKind.UnionType:
3688
3688
case SyntaxKind.IntersectionType:
3689
3689
case SyntaxKind.ParenthesizedType:
3690
- return isDeclarationVisible(<Declaration> node.parent);
3690
+ return isDeclarationVisible(node.parent);
3691
3691
3692
3692
// Default binding, import specifier and namespace import is visible
3693
3693
// only on demand so by default it is not visible
@@ -6235,8 +6235,8 @@ namespace ts {
6235
6235
case SyntaxKind.MethodDeclaration:
6236
6236
case SyntaxKind.GetAccessor:
6237
6237
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);
6240
6240
6241
6241
default:
6242
6242
return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && forEachChild(node, traverse);
@@ -21841,7 +21841,7 @@ namespace ts {
21841
21841
function isTypeDeclarationName(name: Node): boolean {
21842
21842
return name.kind === SyntaxKind.Identifier &&
21843
21843
isTypeDeclaration(name.parent) &&
21844
- (<RealDeclaration >name.parent).name === name;
21844
+ (<TypeElement >name.parent).name === name;
21845
21845
}
21846
21846
21847
21847
function isTypeDeclaration(node: Node): boolean {
@@ -22469,7 +22469,7 @@ namespace ts {
22469
22469
22470
22470
// Return true if the given node is a declaration of a nested block scoped entity with a name that either hides an
22471
22471
// existing name or might hide a name when compiled downlevel
22472
- function isDeclarationWithCollidingName(node: Declaration ): boolean {
22472
+ function isDeclarationWithCollidingName(node: Node ): boolean {
22473
22473
node = getParseTreeNode(node, isDeclaration);
22474
22474
if (node) {
22475
22475
const symbol = getSymbolOfNode(node);
0 commit comments