mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 07:31:04 +01:00
Always create a StructType node for every syntactic struct type. (#3084)
Don't elide the StructType node if we've already created an equivalent type. Its spelling and location may be interesting to diagnostics, tooling, debug information, etc.
This commit is contained in:
@@ -108,9 +108,9 @@ auto SemanticsHandleStructTypeLiteral(SemanticsContext& context,
|
||||
CARBON_CHECK(refs_id != SemanticsNodeBlockId::Empty)
|
||||
<< "{} is handled by StructLiteral.";
|
||||
|
||||
auto type_id = context.CanonicalizeStructType(parse_node, refs_id);
|
||||
context.node_stack().Push(parse_node,
|
||||
context.semantics_ir().GetType(type_id));
|
||||
context.AddNodeAndPush(parse_node,
|
||||
SemanticsNode::StructType::Make(
|
||||
parse_node, SemanticsTypeId::TypeType, refs_id));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user