mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 18:21:16 +01:00
Always form a ConstType instruction for const. (#6341)
Do this even if the operand is a `ConstType` instruction. This better
preserves the source form of the type, and avoids a special case.
Repeated `const`s are already flattened in constant evaluation, and this
special case also didn't prevent forming a `ConstType` whose operand is
`const` in general, only cases where the operand happens to literally be
a `ConstType` instruction.
This reverts commit eed21f6439.
This commit is contained in:
@@ -286,8 +286,6 @@ auto HandleParseNode(Context& context, Parse::PrefixOperatorConstId node_id)
|
||||
"`const` applied repeatedly to the same type has no "
|
||||
"additional effect");
|
||||
context.emitter().Emit(node_id, RepeatedConst);
|
||||
context.node_stack().Push(node_id, value_id);
|
||||
return true;
|
||||
}
|
||||
auto inner_type = ExprAsType(context, node_id, value_id);
|
||||
AddInstAndPush<SemIR::ConstType>(
|
||||
|
||||
Reference in New Issue
Block a user