mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-17 11:17:17 +03:00
Fixed regression that affected type narrowing of subscript expressions for TypedDict objects.
This commit is contained in:
parent
ae2cb23bbc
commit
fbb0d521ee
@ -5401,7 +5401,10 @@ export function createTypeEvaluator(
|
||||
// passed to __setitem__ is the same type as the value returned by __getitem__).
|
||||
let baseTypeSupportsIndexNarrowing = true;
|
||||
mapSubtypesExpandTypeVars(baseTypeResult.type, /* conditionFilter */ undefined, (subtype) => {
|
||||
if (!isClassInstance(subtype) || !ClassType.isBuiltIn(subtype)) {
|
||||
if (
|
||||
!isClassInstance(subtype) ||
|
||||
!(ClassType.isBuiltIn(subtype) || ClassType.isTypedDictClass(subtype))
|
||||
) {
|
||||
baseTypeSupportsIndexNarrowing = false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user