Fixed recent regression with isinstance narrowing.

This commit is contained in:
Eric Traut 2020-09-26 17:01:40 -07:00
parent b44975440e
commit 61f483fcb5

View File

@ -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);
});