mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-26 19:01:08 +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 {
|
): Type {
|
||||||
let effectiveType = doForSubtypes(type, (subtype) => {
|
let effectiveType = doForSubtypes(type, (subtype) => {
|
||||||
subtype = transformPossibleRecursiveTypeAlias(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);
|
return transformTypeObjectToClass(subtype);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user