Skip to content

Commit

Permalink
Fixed a bug that led to a false positive error when calling the same …
Browse files Browse the repository at this point in the history
…generic function multiple times in a call expression. This bug specifically affected the case where the generic function used PEP 695 syntax. This addresses #6386.
  • Loading branch information
erictraut committed Nov 9, 2023
1 parent 33700bc commit dbd9976
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/pyright-internal/src/analyzer/typeEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17032,7 +17032,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
// accumulate the list of type parameters upfront.
const typeParametersSeen: TypeVarType[] = [];
if (node.typeParameters) {
functionType.details.typeParameters = evaluateTypeParameterList(node.typeParameters);
functionType.details.typeParameters = evaluateTypeParameterList(node.typeParameters).map((typeParam) =>
convertToInstance(typeParam)
);
} else {
functionType.details.typeParameters = typeParametersSeen;
}
Expand Down

0 comments on commit dbd9976

Please sign in to comment.