mirror of
https://github.com/microsoft/pyright.git
synced 2024-11-13 09:34:44 +03:00
Fixed recent regression with isinstance narrowing.
This commit is contained in:
parent
b44975440e
commit
61f483fcb5
@ -12384,13 +12384,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
|
||||
): Type {
|
||||
let effectiveType = doForSubtypes(type, (subtype) => {
|
||||
subtype = transformPossibleRecursiveTypeAlias(subtype);
|
||||
|
||||
if (isTypeVar(subtype)) {
|
||||
// If it's a constrained TypeVar, treat it as a union for the
|
||||
// purposes of narrowing.
|
||||
subtype = getConcreteTypeFromTypeVar(subtype, /* convertConstraintsToUnion */ true);
|
||||
}
|
||||
|
||||
return transformTypeObjectToClass(subtype);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user