@@ -126,19 +126,21 @@ use crate::types::typed_dict::{
126126 TypedDictAssignmentKind, TypedDictKeyAssignment, validate_typed_dict_constructor,
127127 validate_typed_dict_dict_literal,
128128};
129+ use crate::types::typevar::{
130+ BoundTypeVarIdentity, TypeVarBoundOrConstraintsEvaluation, TypeVarConstraints,
131+ TypeVarDefaultEvaluation, TypeVarIdentity, TypeVarInstance,
132+ };
129133use crate::types::visitor::find_over_type;
130134use crate::types::{
131- BoundTypeVarIdentity, CallDunderError, CallableBinding, CallableType, CallableTypeKind,
132- ClassType, DataclassParams, DynamicType, EvaluationMode, GenericAlias, InternedConstraintSet,
133- InternedType, IntersectionBuilder, IntersectionType, KnownClass, KnownInstanceType, KnownUnion,
135+ CallDunderError, CallableBinding, CallableType, CallableTypeKind, ClassType, DataclassParams ,
136+ DynamicType, EvaluationMode, GenericAlias, InternedConstraintSet, InternedType ,
137+ IntersectionBuilder, IntersectionType, KnownClass, KnownInstanceType, KnownUnion,
134138 LintDiagnosticGuard, LiteralValueTypeKind, ManualPEP695TypeAliasType, MemberLookupPolicy,
135139 MetaclassCandidate, PEP695TypeAliasType, ParamSpecAttrKind, Parameter, ParameterForm,
136140 Parameters, Signature, SpecialFormType, StaticClassLiteral, SubclassOfType, Truthiness, Type,
137141 TypeAliasType, TypeAndQualifiers, TypeContext, TypeQualifiers, TypeVarBoundOrConstraints,
138- TypeVarBoundOrConstraintsEvaluation, TypeVarConstraints, TypeVarDefaultEvaluation,
139- TypeVarIdentity, TypeVarInstance, TypeVarKind, TypeVarVariance, TypedDictType, UnionBuilder,
140- UnionType, binding_type, definition_expression_type, infer_complete_scope_types,
141- infer_scope_types, todo_type,
142+ TypeVarKind, TypeVarVariance, TypedDictType, UnionBuilder, UnionType, binding_type,
143+ definition_expression_type, infer_complete_scope_types, infer_scope_types, todo_type,
142144};
143145use crate::types::{CallableTypes, overrides};
144146use crate::types::{ClassBase, add_inferred_python_version_hint_to_diagnostic};
@@ -9645,13 +9647,9 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
96459647 typevar.identity(self.db()).definition(self.db()),
96469648 TypeVarKind::Pep613Alias,
96479649 );
9648- Type::KnownInstance(KnownInstanceType::TypeVar(TypeVarInstance::new(
9649- self.db(),
9650- identity,
9651- typevar._bound_or_constraints(self.db()),
9652- typevar.explicit_variance(self.db()),
9653- typevar._default(self.db()),
9654- )))
9650+ Type::KnownInstance(KnownInstanceType::TypeVar(
9651+ typevar.with_identity(self.db(), identity),
9652+ ))
96559653 } else {
96569654 inferred_ty
96579655 };
0 commit comments