You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (parameterTypeOfTypeTag) return parameterTypeOfTypeTag;
9072
9070
// Use contextual parameter type if one is available
9073
9071
const type = declaration.symbol.escapedName === InternalSymbolName.This ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
9074
9072
if (type) {
@@ -13117,7 +13115,14 @@ namespace ts {
13117
13115
continue;
13118
13116
}
13119
13117
}
13120
-
result.push(getSignatureFromDeclaration(decl));
13118
+
// If this is a function or method declaration, get the signature from the @type tag for the sake of optional parameters.
13119
+
// Exclude contextually-typed kinds because we already apply the @type tag to the context, plus applying it here to the initializer would supress checks that the two are compatible.
13120
+
result.push(
13121
+
(!isFunctionExpressionOrArrowFunction(decl) &&
13122
+
!isObjectLiteralMethod(decl) &&
13123
+
getSignatureOfTypeTag(decl)) ||
13124
+
getSignatureFromDeclaration(decl)
13125
+
);
13121
13126
}
13122
13127
return result;
13123
13128
}
@@ -13152,7 +13157,7 @@ namespace ts {
13152
13157
else {
13153
13158
const type = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
0 commit comments