mirror of https://github.com/astral-sh/ruff
add the first wrapper method to ClassSingletonType
This commit is contained in:
parent
6b81418bdb
commit
fd181bf986
|
|
@ -1194,6 +1194,15 @@ enum ClassSingletonType<'db> {
|
||||||
NewType(NewTypeClass<'db>),
|
NewType(NewTypeClass<'db>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'db> ClassSingletonType<'db> {
|
||||||
|
pub(crate) fn has_pep_695_type_params(self, db: &'db dyn Db) -> bool {
|
||||||
|
match self {
|
||||||
|
Self::ClassLiteral(literal) => literal.has_pep_695_type_params(db),
|
||||||
|
Self::NewType(new_type) => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Representation of a class definition statement in the AST: either a non-generic class, or a
|
/// Representation of a class definition statement in the AST: either a non-generic class, or a
|
||||||
/// generic class that has not been specialized.
|
/// generic class that has not been specialized.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue