@@ -674,10 +674,10 @@ import {
674674 isOptionalTypeNode,
675675 isOutermostOptionalChain,
676676 isParameter,
677- isParameterDeclaration,
678677 isParameterPropertyDeclaration,
679678 isParenthesizedExpression,
680679 isParenthesizedTypeNode,
680+ isPartOfParameterDeclaration,
681681 isPartOfTypeNode,
682682 isPartOfTypeQuery,
683683 isPlainJsFile,
@@ -8233,7 +8233,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
82338233 sym.flags & SymbolFlags.FunctionScopedVariable
82348234 && sym.valueDeclaration
82358235 ) {
8236- if (isParameterDeclaration (sym.valueDeclaration)) {
8236+ if (isPartOfParameterDeclaration (sym.valueDeclaration)) {
82378237 return { introducesError, node: attachSymbolToLeftmostIdentifier(node) as T };
82388238 }
82398239 }
@@ -8994,7 +8994,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
89948994 }
89958995
89968996 function includePrivateSymbol(symbol: Symbol) {
8997- if (some(symbol.declarations, isParameterDeclaration )) return;
8997+ if (some(symbol.declarations, isPartOfParameterDeclaration )) return;
89988998 Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]);
89998999 getUnusedName(unescapeLeadingUnderscores(symbol.escapedName), symbol); // Call to cache unique name for symbol
90009000 // Blanket moving (import) aliases into the root private context should work, since imports are not valid within namespaces
@@ -10686,7 +10686,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1068610686 }
1068710687 const pattern = declaration.parent;
1068810688 // Relax null check on ambient destructuring parameters, since the parameters have no implementation and are just documentation
10689- if (strictNullChecks && declaration.flags & NodeFlags.Ambient && isParameterDeclaration (declaration)) {
10689+ if (strictNullChecks && declaration.flags & NodeFlags.Ambient && isPartOfParameterDeclaration (declaration)) {
1069010690 parentType = getNonNullableType(parentType);
1069110691 }
1069210692 // Filter `undefined` from the type we check against if the parent has an initializer and that initializer is not possibly `undefined`
@@ -42464,7 +42464,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4246442464 for (const node of potentialUnusedRenamedBindingElementsInTypes) {
4246542465 if (!getSymbolOfDeclaration(node)?.isReferenced) {
4246642466 const wrappingDeclaration = walkUpBindingElementsAndPatterns(node);
42467- Debug.assert(isParameterDeclaration (wrappingDeclaration), "Only parameter declaration should be checked here");
42467+ Debug.assert(isPartOfParameterDeclaration (wrappingDeclaration), "Only parameter declaration should be checked here");
4246842468 const diagnostic = createDiagnosticForNode(node.name, Diagnostics._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation, declarationNameToString(node.name), declarationNameToString(node.propertyName));
4246942469 if (!wrappingDeclaration.type) {
4247042470 // entire parameter does not have type annotation, suggest adding an annotation
@@ -42746,7 +42746,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4274642746 // }
4274742747
4274842748 // skip block-scoped variables and parameters
42749- if ((getCombinedNodeFlagsCached(node) & NodeFlags.BlockScoped) !== 0 || isParameterDeclaration (node)) {
42749+ if ((getCombinedNodeFlagsCached(node) & NodeFlags.BlockScoped) !== 0 || isPartOfParameterDeclaration (node)) {
4275042750 return;
4275142751 }
4275242752
@@ -42818,7 +42818,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4281842818 if (
4281942819 node.propertyName &&
4282042820 isIdentifier(node.name) &&
42821- isParameterDeclaration (node) &&
42821+ isPartOfParameterDeclaration (node) &&
4282242822 nodeIsMissing((getContainingFunction(node) as FunctionLikeDeclaration).body)
4282342823 ) {
4282442824 // type F = ({a: string}) => void;
@@ -42864,7 +42864,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4286442864 forEach(node.name.elements, checkSourceElement);
4286542865 }
4286642866 // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body
42867- if (node.initializer && isParameterDeclaration (node) && nodeIsMissing((getContainingFunction(node) as FunctionLikeDeclaration).body)) {
42867+ if (node.initializer && isPartOfParameterDeclaration (node) && nodeIsMissing((getContainingFunction(node) as FunctionLikeDeclaration).body)) {
4286842868 error(node, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);
4286942869 return;
4287042870 }
0 commit comments