From fd181bf986dfacc37162cfa69e0525085604ebf5 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Mon, 18 Aug 2025 12:30:35 -0700 Subject: [PATCH] add the first wrapper method to ClassSingletonType --- crates/ty_python_semantic/src/types/class.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/ty_python_semantic/src/types/class.rs b/crates/ty_python_semantic/src/types/class.rs index 02b3383f95..e1b1c8038a 100644 --- a/crates/ty_python_semantic/src/types/class.rs +++ b/crates/ty_python_semantic/src/types/class.rs @@ -1194,6 +1194,15 @@ enum ClassSingletonType<'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 /// generic class that has not been specialized. ///