File tree 1 file changed +6
-2
lines changed
crates/red_knot_python_semantic/src/semantic_index
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> {
193
193
countme:: Count :: default ( ) ,
194
194
) ;
195
195
196
- self . definitions_by_node
196
+ let existing_definition = self
197
+ . definitions_by_node
197
198
. insert ( definition_node. key ( ) , definition) ;
199
+ debug_assert_eq ! ( existing_definition, None ) ;
200
+
198
201
self . current_use_def_map_mut ( )
199
202
. record_definition ( symbol, definition) ;
200
203
@@ -327,10 +330,11 @@ impl<'db> SemanticIndexBuilder<'db> {
327
330
// Insert a mapping from the parameter to the same definition.
328
331
// This ensures that calling `HasTy::ty` on the inner parameter returns
329
332
// a valid type (and doesn't panic)
330
- self . definitions_by_node . insert (
333
+ let existing_definition = self . definitions_by_node . insert (
331
334
DefinitionNodeRef :: from ( AnyParameterRef :: Variadic ( & with_default. parameter ) ) . key ( ) ,
332
335
definition,
333
336
) ;
337
+ debug_assert_eq ! ( existing_definition, None ) ;
334
338
}
335
339
}
336
340
You can’t perform that action at this time.
0 commit comments