File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed 
crates/red_knot_python_semantic/src/semantic_index Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,11 @@ impl<'db> SemanticIndexBuilder<'db> {
193193            countme:: Count :: default ( ) , 
194194        ) ; 
195195
196-         self . definitions_by_node 
196+         let  existing_definition = self 
197+             . definitions_by_node 
197198            . insert ( definition_node. key ( ) ,  definition) ; 
199+         debug_assert_eq ! ( existing_definition,  None ) ; 
200+ 
198201        self . current_use_def_map_mut ( ) 
199202            . record_definition ( symbol,  definition) ; 
200203
@@ -327,10 +330,11 @@ impl<'db> SemanticIndexBuilder<'db> {
327330            // Insert a mapping from the parameter to the same definition. 
328331            // This ensures that calling `HasTy::ty` on the inner parameter returns 
329332            // a valid type (and doesn't panic) 
330-             self . definitions_by_node . insert ( 
333+             let  existing_definition =  self . definitions_by_node . insert ( 
331334                DefinitionNodeRef :: from ( AnyParameterRef :: Variadic ( & with_default. parameter ) ) . key ( ) , 
332335                definition, 
333336            ) ; 
337+             debug_assert_eq ! ( existing_definition,  None ) ; 
334338        } 
335339    } 
336340
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments