mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Create a BindName for function parameters. (#3535)
The goal here is to make the representation more uniform so that we can start adding different kinds of binding -- checked generic bindings and template bindings -- across both function parameters and local `let` declarations. With this change, the entry in the parameter list for the function is the name binding, not the Param itself, which has some ripple effects on consumers of that list that want to access the parameter rather than the binding. This is expected to change again when we start adding more of the pattern matching SemIR, but this seems good enough for now.
This commit is contained in:
@@ -258,7 +258,7 @@ auto HandleFunctionDefinitionStart(Context& context, Parse::NodeId parse_node)
|
||||
context.sem_ir().StringifyType(param.type_id()));
|
||||
});
|
||||
|
||||
if (auto fn_param = param.TryAs<SemIR::Param>()) {
|
||||
if (auto fn_param = param.TryAs<SemIR::BindName>()) {
|
||||
context.AddNameToLookup(fn_param->parse_node, fn_param->name_id,
|
||||
param_id);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user