@@ -2731,7 +2731,7 @@ namespace ts {
27312731 }
27322732
27332733 function symbolToParameterDeclaration(parameterSymbol: Symbol): ParameterDeclaration {
2734- const parameterDeclaration = <ParameterDeclaration>getDeclarationOfKind (parameterSymbol, SyntaxKind.Parameter);
2734+ const parameterDeclaration = getDeclarationOfKind <ParameterDeclaration>(parameterSymbol, SyntaxKind.Parameter);
27352735 const parameterType = getTypeOfSymbol(parameterSymbol);
27362736 const parameterTypeNode = typeToTypeNodeHelper(parameterType);
27372737 // TODO(aozgaa): In the future, check initializer accessibility.
@@ -4100,7 +4100,7 @@ namespace ts {
41004100 const func = <FunctionLikeDeclaration>declaration.parent;
41014101 // For a parameter of a set accessor, use the type of the get accessor if one is present
41024102 if (func.kind === SyntaxKind.SetAccessor && !hasDynamicName(func)) {
4103- const getter = <AccessorDeclaration>getDeclarationOfKind (declaration.parent.symbol, SyntaxKind.GetAccessor);
4103+ const getter = getDeclarationOfKind <AccessorDeclaration>(declaration.parent.symbol, SyntaxKind.GetAccessor);
41044104 if (getter) {
41054105 const getterSignature = getSignatureFromDeclaration(getter);
41064106 const thisParameter = getAccessorThisParameter(func as AccessorDeclaration);
@@ -4389,8 +4389,8 @@ namespace ts {
43894389 function getTypeOfAccessors(symbol: Symbol): Type {
43904390 const links = getSymbolLinks(symbol);
43914391 if (!links.type) {
4392- const getter = <AccessorDeclaration>getDeclarationOfKind (symbol, SyntaxKind.GetAccessor);
4393- const setter = <AccessorDeclaration>getDeclarationOfKind (symbol, SyntaxKind.SetAccessor);
4392+ const getter = getDeclarationOfKind <AccessorDeclaration>(symbol, SyntaxKind.GetAccessor);
4393+ const setter = getDeclarationOfKind <AccessorDeclaration>(symbol, SyntaxKind.SetAccessor);
43944394
43954395 if (getter && getter.flags & NodeFlags.JavaScriptFile) {
43964396 const jsDocType = getTypeForDeclarationFromJSDocComment(getter);
@@ -4439,7 +4439,7 @@ namespace ts {
44394439 if (!popTypeResolution()) {
44404440 type = anyType;
44414441 if (noImplicitAny) {
4442- const getter = <AccessorDeclaration>getDeclarationOfKind (symbol, SyntaxKind.GetAccessor);
4442+ const getter = getDeclarationOfKind <AccessorDeclaration>(symbol, SyntaxKind.GetAccessor);
44434443 error(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
44444444 }
44454445 }
@@ -4916,7 +4916,7 @@ namespace ts {
49164916 return unknownType;
49174917 }
49184918
4919- let declaration: JSDocTypedefTag | TypeAliasDeclaration = <JSDocTypedefTag>getDeclarationOfKind (symbol, SyntaxKind.JSDocTypedefTag);
4919+ let declaration: JSDocTypedefTag | TypeAliasDeclaration = getDeclarationOfKind <JSDocTypedefTag>(symbol, SyntaxKind.JSDocTypedefTag);
49204920 let type: Type;
49214921 if (declaration) {
49224922 if (declaration.jsDocTypeLiteral) {
@@ -4927,7 +4927,7 @@ namespace ts {
49274927 }
49284928 }
49294929 else {
4930- declaration = <TypeAliasDeclaration>getDeclarationOfKind (symbol, SyntaxKind.TypeAliasDeclaration);
4930+ declaration = getDeclarationOfKind <TypeAliasDeclaration>(symbol, SyntaxKind.TypeAliasDeclaration);
49314931 type = getTypeFromTypeNode(declaration.type);
49324932 }
49334933
@@ -6220,7 +6220,7 @@ namespace ts {
62206220 !hasDynamicName(declaration) &&
62216221 (!hasThisParameter || !thisParameter)) {
62226222 const otherKind = declaration.kind === SyntaxKind.GetAccessor ? SyntaxKind.SetAccessor : SyntaxKind.GetAccessor;
6223- const other = <AccessorDeclaration>getDeclarationOfKind (declaration.symbol, otherKind);
6223+ const other = getDeclarationOfKind <AccessorDeclaration>(declaration.symbol, otherKind);
62246224 if (other) {
62256225 thisParameter = getAnnotatedAccessorThisParameter(other);
62266226 }
@@ -6263,7 +6263,7 @@ namespace ts {
62636263 // TypeScript 1.0 spec (April 2014):
62646264 // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation.
62656265 if (declaration.kind === SyntaxKind.GetAccessor && !hasDynamicName(declaration)) {
6266- const setter = <AccessorDeclaration>getDeclarationOfKind (declaration.symbol, SyntaxKind.SetAccessor);
6266+ const setter = getDeclarationOfKind <AccessorDeclaration>(declaration.symbol, SyntaxKind.SetAccessor);
62676267 return getAnnotatedAccessorType(setter);
62686268 }
62696269
@@ -6476,7 +6476,7 @@ namespace ts {
64766476 }
64776477
64786478 function getConstraintDeclaration(type: TypeParameter) {
6479- return ( <TypeParameterDeclaration>getDeclarationOfKind (type.symbol, SyntaxKind.TypeParameter) ).constraint;
6479+ return getDeclarationOfKind <TypeParameterDeclaration>(type.symbol, SyntaxKind.TypeParameter).constraint;
64806480 }
64816481
64826482 function getConstraintFromTypeParameter(typeParameter: TypeParameter): Type {
@@ -12559,7 +12559,7 @@ namespace ts {
1255912559 // corresponding set accessor has a type annotation, return statements in the function are contextually typed
1256012560 if (functionDecl.type ||
1256112561 functionDecl.kind === SyntaxKind.Constructor ||
12562- functionDecl.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(<SetAccessorDeclaration>getDeclarationOfKind (functionDecl.symbol, SyntaxKind.SetAccessor))) {
12562+ functionDecl.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(getDeclarationOfKind <SetAccessorDeclaration>(functionDecl.symbol, SyntaxKind.SetAccessor))) {
1256312563 return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl));
1256412564 }
1256512565
@@ -18102,7 +18102,7 @@ namespace ts {
1810218102 // TypeScript 1.0 spec (April 2014): 8.4.3
1810318103 // Accessors for the same member name must specify the same accessibility.
1810418104 const otherKind = node.kind === SyntaxKind.GetAccessor ? SyntaxKind.SetAccessor : SyntaxKind.GetAccessor;
18105- const otherAccessor = <AccessorDeclaration>getDeclarationOfKind (node.symbol, otherKind);
18105+ const otherAccessor = getDeclarationOfKind <AccessorDeclaration>(node.symbol, otherKind);
1810618106 if (otherAccessor) {
1810718107 if ((getModifierFlags(node) & ModifierFlags.AccessibilityModifier) !== (getModifierFlags(otherAccessor) & ModifierFlags.AccessibilityModifier)) {
1810818108 error(node.name, Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility);
@@ -20234,7 +20234,7 @@ namespace ts {
2023420234 }
2023520235
2023620236 function isGetAccessorWithAnnotatedSetAccessor(node: FunctionLikeDeclaration) {
20237- return !!(node.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(<SetAccessorDeclaration>getDeclarationOfKind (node.symbol, SyntaxKind.SetAccessor)));
20237+ return !!(node.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(getDeclarationOfKind <SetAccessorDeclaration>(node.symbol, SyntaxKind.SetAccessor)));
2023820238 }
2023920239
2024020240 function isUnwrappedReturnTypeVoidOrAny(func: FunctionLikeDeclaration, returnType: Type): boolean {
@@ -20922,7 +20922,7 @@ namespace ts {
2092220922 checkTypeParameterListsIdentical(symbol);
2092320923
2092420924 // Only check this symbol once
20925- const firstInterfaceDecl = <InterfaceDeclaration>getDeclarationOfKind (symbol, SyntaxKind.InterfaceDeclaration);
20925+ const firstInterfaceDecl = getDeclarationOfKind <InterfaceDeclaration>(symbol, SyntaxKind.InterfaceDeclaration);
2092620926 if (node === firstInterfaceDecl) {
2092720927 const type = <InterfaceType>getDeclaredTypeOfSymbol(symbol);
2092820928 const typeWithThis = getTypeWithThisArgument(type);
0 commit comments