mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 22:02:51 +01:00
Avoid crashing on the fact that block scopes have no related InstId. So we can't push the InstId of the current scope in the ImplIntroducer node, as it can be None. Instead we have to find the parent InstId when we're building the ImplDecl, because the ImplDecl has a node at the top of the scope stack for the DeclNameStack. Impls are allowed in sequential (non-declarative) scopes (functions, blocks), but [redeclarations are not allowed](https://github.com/carbon-language/carbon-lang/blob/db24042fe56d22275aa801696e2f8f5c4171e35b/proposals/p3763.md?plain=1#L279). We now diagnose these redecls as invalid.