mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Unify initialization and conversion logic (#3255)
Combine the initialization, implicit conversion, and value category conversion functions into a single function. This substantially reduces the duplication between these steps, and ensures that we support the same set of conversions in all these contexts. This also fixes some issues where we would not use the proper value representation for tuples and structs after performing implicit conversions.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#include "toolchain/check/context.h"
|
||||
#include "toolchain/check/convert.h"
|
||||
#include "toolchain/parse/node_kind.h"
|
||||
#include "toolchain/sem_ir/node.h"
|
||||
#include "toolchain/sem_ir/node_kind.h"
|
||||
@@ -43,7 +44,7 @@ auto HandleArrayExpression(Context& context, Parse::Node parse_node) -> bool {
|
||||
parse_node,
|
||||
SemIR::Node::ArrayType::Make(
|
||||
parse_node, SemIR::TypeId::TypeType, bound_node_id,
|
||||
context.ExpressionAsType(parse_node, element_type_node_id)));
|
||||
ExpressionAsType(context, parse_node, element_type_node_id)));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user