Fixed a bug that results in an unsolved TypeVar when calling list(tuple()). This addresses #7998. (#7999)

This commit is contained in:
Eric Traut 2024-05-25 00:25:05 -07:00 committed by GitHub
parent 1466ccb653
commit 1bba737d93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4184,7 +4184,9 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer {
return TypeVarType.cloneForUnpacked(replacement, typeVar.isVariadicInUnion);
}
return replacement;
if (!isTypeVar(replacement) || !replacement.isInScopePlaceholder || !this._options.unknownIfNotFound) {
return replacement;
}
}
// If this typeVar is in scope for what we're solving but the type