File tree Expand file tree Collapse file tree
crates/ty_python_semantic/src/types Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -556,6 +556,7 @@ impl<'db> GenericContext<'db> {
556556 let partial = PartialSpecialization {
557557 generic_context : self ,
558558 types : & types,
559+ skip : Some ( i) ,
559560 } ;
560561 let updated = types[ i] . apply_type_mapping (
561562 db,
@@ -626,6 +627,7 @@ impl<'db> GenericContext<'db> {
626627 let partial = PartialSpecialization {
627628 generic_context : self ,
628629 types : & expanded[ 0 ..idx] ,
630+ skip : None ,
629631 } ;
630632 let default = default. apply_type_mapping (
631633 db,
@@ -1360,6 +1362,7 @@ impl<'db> Specialization<'db> {
13601362pub struct PartialSpecialization < ' a , ' db > {
13611363 generic_context : GenericContext < ' db > ,
13621364 types : & ' a [ Type < ' db > ] ,
1365+ skip : Option < usize > ,
13631366}
13641367
13651368impl < ' db > PartialSpecialization < ' _ , ' db > {
@@ -1374,6 +1377,9 @@ impl<'db> PartialSpecialization<'_, 'db> {
13741377 . generic_context
13751378 . variables_inner ( db)
13761379 . get_index_of ( & bound_typevar. identity ( db) ) ?;
1380+ if self . skip . is_some_and ( |skip| skip == index) {
1381+ return Some ( Type :: unknown ( ) ) ;
1382+ }
13771383 self . types . get ( index) . copied ( )
13781384 }
13791385}
You can’t perform that action at this time.
0 commit comments