Start populating named entities in relevant locations. (#919)

This starts detecting naming collisions as a consequence of being able to determine when the name is declared twice in a given scope.



Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
Jon MeowandGeoff Romer authored and GitHub committed 2021-11-03 08:04:13 -07:00
1 parent 82a870cfcd
commit 27e084d37a
25 files changed
+586 -30

No files matched your search

@@ -117,8 +117,8 @@ void Interpreter::InitEnv(const Declaration& d, Env* env) {
// Bring the deduced parameters into scope.
for (const auto& deduced : func_def.deduced_parameters()) {
AllocationId a =
heap_.AllocateValue(arena_->New<VariableType>(deduced.name));
new_env.Set(deduced.name, a);
heap_.AllocateValue(arena_->New<VariableType>(deduced.name()));
new_env.Set(deduced.name(), a);
}
Nonnull<const FunctionValue*> f = arena_->New<FunctionValue>(&func_def);
AllocationId a = heap_.AllocateValue(f);