add the first wrapper method to ClassSingletonType

This commit is contained in:
Jack O'Connor 2025-08-18 12:30:35 -07:00
parent 6b81418bdb
commit fd181bf986
1 changed files with 9 additions and 0 deletions

View File

@ -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.
/// ///