mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-05 20:38:25 +03:00
Fixed bug that results in false negative when a list
or set
expression includes more than 64 elements and is being evaluated with a bidirectional inference context. This addresses #8314.
This commit is contained in:
parent
1c85d650ae
commit
228bd84c54
@ -13303,7 +13303,7 @@ export function createTypeEvaluator(
|
||||
}
|
||||
}
|
||||
|
||||
const result = getTypeOfDictionaryInferred(node, flags, /* hasExpectedType */ !!inferenceContext);
|
||||
const result = getTypeOfDictionaryInferred(node, flags, /* hasExpectedType */ !!inferenceContext?.expectedType);
|
||||
return { ...result, expectedTypeDiagAddendum };
|
||||
}
|
||||
|
||||
@ -13877,7 +13877,7 @@ export function createTypeEvaluator(
|
||||
const typeResult = getTypeOfListOrSetInferred(
|
||||
node,
|
||||
flags,
|
||||
/* hasExpectedType */ inferenceContext !== undefined
|
||||
/* hasExpectedType */ !!inferenceContext?.expectedType
|
||||
);
|
||||
return { ...typeResult, expectedTypeDiagAddendum };
|
||||
}
|
||||
@ -14043,7 +14043,7 @@ export function createTypeEvaluator(
|
||||
typeErrors = true;
|
||||
}
|
||||
|
||||
if (index < maxEntriesToUseForInference) {
|
||||
if (hasExpectedType || index < maxEntriesToUseForInference) {
|
||||
entryTypes.push(entryTypeResult.type);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user