@@ -674,10 +674,10 @@ import {
674
674
isOptionalTypeNode,
675
675
isOutermostOptionalChain,
676
676
isParameter,
677
- isParameterDeclaration,
678
677
isParameterPropertyDeclaration,
679
678
isParenthesizedExpression,
680
679
isParenthesizedTypeNode,
680
+ isPartOfParameterDeclaration,
681
681
isPartOfTypeNode,
682
682
isPartOfTypeQuery,
683
683
isPlainJsFile,
@@ -8233,7 +8233,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
8233
8233
sym.flags & SymbolFlags.FunctionScopedVariable
8234
8234
&& sym.valueDeclaration
8235
8235
) {
8236
- if (isParameterDeclaration (sym.valueDeclaration)) {
8236
+ if (isPartOfParameterDeclaration (sym.valueDeclaration)) {
8237
8237
return { introducesError, node: attachSymbolToLeftmostIdentifier(node) as T };
8238
8238
}
8239
8239
}
@@ -8994,7 +8994,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
8994
8994
}
8995
8995
8996
8996
function includePrivateSymbol(symbol: Symbol) {
8997
- if (some(symbol.declarations, isParameterDeclaration )) return;
8997
+ if (some(symbol.declarations, isPartOfParameterDeclaration )) return;
8998
8998
Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]);
8999
8999
getUnusedName(unescapeLeadingUnderscores(symbol.escapedName), symbol); // Call to cache unique name for symbol
9000
9000
// 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 {
10686
10686
}
10687
10687
const pattern = declaration.parent;
10688
10688
// 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)) {
10690
10690
parentType = getNonNullableType(parentType);
10691
10691
}
10692
10692
// 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 {
42464
42464
for (const node of potentialUnusedRenamedBindingElementsInTypes) {
42465
42465
if (!getSymbolOfDeclaration(node)?.isReferenced) {
42466
42466
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");
42468
42468
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));
42469
42469
if (!wrappingDeclaration.type) {
42470
42470
// entire parameter does not have type annotation, suggest adding an annotation
@@ -42746,7 +42746,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
42746
42746
// }
42747
42747
42748
42748
// skip block-scoped variables and parameters
42749
- if ((getCombinedNodeFlagsCached(node) & NodeFlags.BlockScoped) !== 0 || isParameterDeclaration (node)) {
42749
+ if ((getCombinedNodeFlagsCached(node) & NodeFlags.BlockScoped) !== 0 || isPartOfParameterDeclaration (node)) {
42750
42750
return;
42751
42751
}
42752
42752
@@ -42818,7 +42818,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
42818
42818
if (
42819
42819
node.propertyName &&
42820
42820
isIdentifier(node.name) &&
42821
- isParameterDeclaration (node) &&
42821
+ isPartOfParameterDeclaration (node) &&
42822
42822
nodeIsMissing((getContainingFunction(node) as FunctionLikeDeclaration).body)
42823
42823
) {
42824
42824
// type F = ({a: string}) => void;
@@ -42864,7 +42864,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
42864
42864
forEach(node.name.elements, checkSourceElement);
42865
42865
}
42866
42866
// 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)) {
42868
42868
error(node, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);
42869
42869
return;
42870
42870
}
0 commit comments