Add an identifier to the set of visited names in `self` and emit a [`SemanticSyntaxError`] if `ident` has already been seen.
(&mut self, ident: &'a ast::Identifier)
| 2489 | /// Add an identifier to the set of visited names in `self` and emit a [`SemanticSyntaxError`] |
| 2490 | /// if `ident` has already been seen. |
| 2491 | fn insert(&mut self, ident: &'a ast::Identifier) { |
| 2492 | if !self.names.insert(&ident.id) { |
| 2493 | SemanticSyntaxChecker::add_error( |
| 2494 | self.ctx, |
| 2495 | SemanticSyntaxErrorKind::MultipleCaseAssignment(ident.id.clone()), |
| 2496 | ident.range(), |
| 2497 | ); |
| 2498 | } |
| 2499 | // test_err debug_shadow_match |
| 2500 | // match x: |
| 2501 | // case __debug__: ... |
| 2502 | SemanticSyntaxChecker::check_identifier(ident, self.ctx); |
| 2503 | } |
| 2504 | } |
| 2505 | |
| 2506 | struct InvalidExpressionVisitor<'a, Ctx> { |