Fixed a bug that resulted in a false positive when analyzing a call to an instance method that omits a self parameter and instead uses *args.

This commit is contained in:
Eric Traut 2022-08-19 16:29:59 -07:00
parent 341af785aa
commit 346999a2e6

View File

@ -1329,16 +1329,15 @@ export namespace FunctionType {
newFunction.preBoundFlags = newFunction.details.flags;
if (stripFirstParam) {
if (
type.details.parameters.length > 0 &&
type.details.parameters[0].category === ParameterCategory.Simple
) {
if (type.details.parameters.length > 0 && !type.details.parameters[0].isTypeInferred) {
// Stash away the effective type of the first parameter if it
// wasn't synthesized.
newFunction.strippedFirstParamType = getEffectiveParameterType(type, 0);
if (type.details.parameters.length > 0) {
if (type.details.parameters[0].category === ParameterCategory.Simple) {
if (type.details.parameters.length > 0 && !type.details.parameters[0].isTypeInferred) {
// Stash away the effective type of the first parameter if it
// wasn't synthesized.
newFunction.strippedFirstParamType = getEffectiveParameterType(type, 0);
}
newFunction.details.parameters = type.details.parameters.slice(1);
}
newFunction.details.parameters = type.details.parameters.slice(1);
} else {
stripFirstParam = false;
}