mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Remove default constructor from IndexBase (#2598)
There were some notes about default constructors being required in parse_tree.h, but they don't seem to be. Removing the default constructor forces the explicit `::Invalid` where there's no value immediately being assigned, which works fine for existing code. I think this actually reduces the chance of accidents more than the prior default-construct-as-invalid approach.
This commit is contained in:
@@ -324,10 +324,8 @@ auto SemanticsParseTreeHandler::HandleFunctionDefinitionStart(
|
||||
auto fn_node =
|
||||
node_stack_.PopForSoloParseNode(ParseNodeKind::FunctionIntroducer);
|
||||
|
||||
SemanticsCallable callable;
|
||||
callable.param_ir_id = param_ir_id;
|
||||
callable.param_refs_id = param_refs_id;
|
||||
auto callable_id = semantics_->AddCallable(callable);
|
||||
auto callable_id = semantics_->AddCallable(
|
||||
{.param_ir_id = param_ir_id, .param_refs_id = param_refs_id});
|
||||
auto decl_id =
|
||||
AddNode(SemanticsNode::MakeFunctionDeclaration(fn_node, callable_id));
|
||||
// TODO: Propagate the type of the function.
|
||||
|
||||
Reference in New Issue
Block a user