naming tweak

This commit is contained in:
Carl Meyer 2025-12-12 15:28:12 -08:00
parent 7806a459ed
commit 7c45d95d4a
No known key found for this signature in database
GPG Key ID: 2D1FB7916A52E121
3 changed files with 5 additions and 5 deletions

View File

@ -8011,7 +8011,7 @@ impl<'db> Type<'db> {
) {
let matching_typevar = |bound_typevar: &BoundTypeVarInstance<'db>| {
match bound_typevar.typevar(db).kind(db) {
TypeVarKind::Legacy | TypeVarKind::Pep613 | TypeVarKind::TypingSelf
TypeVarKind::Legacy | TypeVarKind::Pep613Alias | TypeVarKind::TypingSelf
if binding_context.is_none_or(|binding_context| {
bound_typevar.binding_context(db)
== BindingContext::Definition(binding_context)
@ -9480,8 +9480,6 @@ impl<'db> FieldInstance<'db> {
pub enum TypeVarKind {
/// `T = TypeVar("T")`
Legacy,
/// `Alias: typing.TypeAlias = T`
Pep613,
/// `def foo[T](x: T) -> T: ...`
Pep695,
/// `typing.Self`
@ -9490,6 +9488,8 @@ pub enum TypeVarKind {
ParamSpec,
/// `def foo[**P]() -> None: ...`
Pep695ParamSpec,
/// `Alias: typing.TypeAlias = T`
Pep613Alias,
}
impl TypeVarKind {

View File

@ -5871,7 +5871,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
self.db(),
typevar.identity(self.db()).name(self.db()),
typevar.identity(self.db()).definition(self.db()),
TypeVarKind::Pep613,
TypeVarKind::Pep613Alias,
);
Type::KnownInstance(KnownInstanceType::TypeVar(TypeVarInstance::new(
self.db(),

View File

@ -1003,7 +1003,7 @@ impl<'db> TypeInferenceBuilder<'db, '_> {
// Annotated: TypeAlias = T
// _: Annotated[int] = 1 # valid
// ```
if typevar.identity(self.db()).kind(self.db()) == TypeVarKind::Pep613 {
if typevar.identity(self.db()).kind(self.db()) == TypeVarKind::Pep613Alias {
self.infer_explicit_type_alias_specialization(subscript, value_ty, false)
} else {
if let Some(builder) =