mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-07 05:17:10 +03:00
Fixed regression relating to type inference for non-generic classes that have unannotated constructors (so-called "pseudo-generic classes").
This commit is contained in:
parent
15d6cb74ce
commit
bda1e0b822
@ -11333,7 +11333,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
|
||||
|
||||
// A ClassVar should not allow TypeVars or generic types parameterized
|
||||
// by TypeVars.
|
||||
if (requiresSpecialization(type)) {
|
||||
if (requiresSpecialization(type, /* ignorePseudoGeneric */ true)) {
|
||||
const fileInfo = AnalyzerNodeInfo.getFileInfo(errorNode);
|
||||
|
||||
addDiagnostic(
|
||||
|
@ -2468,9 +2468,7 @@ export function requiresSpecialization(type: Type, ignorePseudoGeneric = false,
|
||||
);
|
||||
}
|
||||
|
||||
// If there are any type parameters, we need to specialize
|
||||
// since there are no corresponding type arguments.
|
||||
return !ClassType.isPseudoGenericClass(type) && ClassType.getTypeParameters(type).length > 0;
|
||||
return ClassType.getTypeParameters(type).length > 0;
|
||||
}
|
||||
|
||||
case TypeCategory.Function: {
|
||||
|
Loading…
Reference in New Issue
Block a user