Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug that led to incorrect generation of Unknown type evaluati… #5983

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/pyright-internal/src/analyzer/typeEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8746,6 +8746,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
): CallResult {
let filteredMatchResults: MatchArgsToParamsResult[] = [];
let contextFreeArgTypes: Type[] | undefined;
let isTypeIncomplete = !!typeResult.isIncomplete;

// Start by evaluating the types of the arguments without any expected
// type. Also, filter the list of overloads based on the number of
Expand Down Expand Up @@ -8807,7 +8808,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
);
}

return { argumentErrors: true, isTypeIncomplete: false, overloadsUsedForCall: [] };
return { argumentErrors: true, isTypeIncomplete, overloadsUsedForCall: [] };
}

// Create a helper function that evaluates the overload that best
Expand Down Expand Up @@ -8844,7 +8845,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
}

let expandedArgTypes: (Type | undefined)[][] | undefined = [argList.map((arg) => undefined)];
let isTypeIncomplete = !!typeResult.isIncomplete;

while (true) {
const callResult = validateOverloadsWithExpandedTypes(
Expand Down Expand Up @@ -8908,7 +8908,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
return { ...result, argumentErrors: true };
}

return { argumentErrors: true, isTypeIncomplete: false, overloadsUsedForCall: [] };
return { argumentErrors: true, isTypeIncomplete, overloadsUsedForCall: [] };
}

// Replaces each item in the expandedArgTypes with n items where n is
Expand Down
Loading