carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
https://github.com/carbon-language/carbon-lang/blob/trunk/README.md
Other
32.31k stars 1.48k forks source link

Factor out pushing / popping of names plus parameters. #4005

Closed zygoloid closed 1 month ago

zygoloid commented 1 month ago

Previously we did some of this in decl_name_stack and some of it in the callers of decl_name_stack. Factor out a single place to pop a name and its optional following parameters.

Part of making this behavior consistent is that we now track whether an implicit parameter list was present or absent rather than mapping an absent list to InstBlockId::Empty. This improves our redeclaration checking and the precision of some diagnostics.