File tree Expand file tree Collapse file tree 2 files changed +202
-205
lines changed
crates/ty_python_semantic/src/types Expand file tree Collapse file tree 2 files changed +202
-205
lines changed Original file line number Diff line number Diff line change @@ -4213,14 +4213,14 @@ pub(crate) struct SliceLiteral {
42134213 pub ( crate ) step : Option < i32 > ,
42144214}
42154215
4216- impl < ' db > Type < ' db > {
4217- /// If this type represents a valid slice literal , returns a [`SliceLiteral`] describing it.
4216+ impl < ' db > ClassType < ' db > {
4217+ /// If this class is a specialization of `slice` , returns a [`SliceLiteral`] describing it.
42184218 /// Otherwise returns `None`.
42194219 ///
4220- /// The type must be a specialization of the `slice` builtin type, where the specialized
4221- /// typevars are statically known integers or `None`.
4220+ /// The specialization must be one in which the typevars are solved as being statically known
4221+ /// integers or `None`.
42224222 pub ( crate ) fn slice_literal ( self , db : & ' db dyn Db ) -> Option < SliceLiteral > {
4223- let ClassType :: Generic ( alias) = self . into_nominal_instance ( ) ? . class else {
4223+ let ClassType :: Generic ( alias) = self else {
42244224 return None ;
42254225 } ;
42264226 if !alias. origin ( db) . is_known ( db, KnownClass :: Slice ) {
You can’t perform that action at this time.
0 commit comments