mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 21:21:04 +01:00
Switch FunctionDefinition to a class (#852)
Splitting out the task from #849
This commit is contained in:
@@ -113,14 +113,14 @@ void Interpreter::InitEnv(const Declaration& d, Env* env) {
|
||||
cast<FunctionDeclaration>(d).Definition();
|
||||
Env new_env = *env;
|
||||
// Bring the deduced parameters into scope.
|
||||
for (const auto& deduced : func_def.deduced_parameters) {
|
||||
for (const auto& deduced : func_def.deduced_parameters()) {
|
||||
Address a = heap.AllocateValue(arena->New<VariableType>(deduced.name));
|
||||
new_env.Set(deduced.name, a);
|
||||
}
|
||||
auto pt = InterpPattern(new_env, func_def.param_pattern);
|
||||
auto f = arena->New<FunctionValue>(func_def.name, pt, func_def.body);
|
||||
auto pt = InterpPattern(new_env, &func_def.param_pattern());
|
||||
auto f = arena->New<FunctionValue>(func_def.name(), pt, func_def.body());
|
||||
Address a = heap.AllocateValue(f);
|
||||
env->Set(func_def.name, a);
|
||||
env->Set(func_def.name(), a);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user