mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 17:06:09 +01:00
Make NamedEntityInterface non-movable (#946)
This commit is contained in:
@@ -133,8 +133,8 @@ void PopulateNamesInDeclaration(Arena* arena, Declaration& declaration,
|
||||
case Declaration::Kind::FunctionDeclaration: {
|
||||
auto& func = cast<FunctionDeclaration>(declaration);
|
||||
static_scope.Add(func.name(), &declaration);
|
||||
for (const auto& param : func.deduced_parameters()) {
|
||||
func.static_scope().Add(param.name(), ¶m);
|
||||
for (Nonnull<const GenericBinding*> param : func.deduced_parameters()) {
|
||||
func.static_scope().Add(param->name(), param);
|
||||
}
|
||||
PopulateNamesInPattern(func.param_pattern(), func.static_scope());
|
||||
PopulateNamesInStatement(arena, func.body(), static_scope);
|
||||
@@ -151,8 +151,9 @@ void PopulateNamesInDeclaration(Arena* arena, Declaration& declaration,
|
||||
case Declaration::Kind::ChoiceDeclaration: {
|
||||
auto& choice = cast<ChoiceDeclaration>(declaration);
|
||||
static_scope.Add(choice.name(), &declaration);
|
||||
for (auto& alt : choice.alternatives()) {
|
||||
choice.static_scope().Add(alt.name(), &alt);
|
||||
for (Nonnull<const ChoiceDeclaration::Alternative*> alt :
|
||||
choice.alternatives()) {
|
||||
choice.static_scope().Add(alt->name(), alt);
|
||||
}
|
||||
// Populate name into declared_names.
|
||||
// Init the choice's declared_names, and populate it with the
|
||||
|
||||
Reference in New Issue
Block a user