mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Unqualified names don't handle scopes the way that typical names do, so a name conflict with a namespace needs to be handled specially. I'm still favoring keeping code close as much as possible, particularly since long-term this syntax will probably shift to be more consistent. For now I'm just flagging when we shouldn't push scopes, so that MakeUnqualifiedName doesn't need to clean up. Note, a different approach would basically be: ``` PushScopeAndStartName ApplyNameQualifierTo result = decl_name_stack_.back(); decl_name_stack_.back().state = NameContext::State::Finished; PopScope return result; ``` But that approach feels worse to me, due to the additional stack manipulations and the need to duplicate some of the FinishName logic just to be able to pop the scope that didn't really need to be added.