mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-19 04:07:36 +03:00
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:
parent
341af785aa
commit
346999a2e6
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user