Distinguish between name IDs and string IDs in the type system. (#3341)

Add a `NameId` that is effectively just a wrapper around a `StringId`,
with
some additional predefined values for names that don't correspond to
strings, such as the name of `self` or the function's return slot.
This commit is contained in:
Richard Smith
2023-11-09 16:51:36 +00:00
committed by GitHub
parent 84bc8cc4bf
commit 71aa4a45be
206 changed files with 1050 additions and 921 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ auto HandleStructFieldUnknown(Context& context, Parse::Node parse_node)
auto HandleStructFieldValue(Context& context, Parse::Node parse_node) -> bool {
auto [value_parse_node, value_inst_id] =
context.node_stack().PopExpressionWithParseNode();
IdentifierId name_id = context.node_stack().Pop<Parse::NodeKind::Name>();
SemIR::NameId name_id = context.node_stack().Pop<Parse::NodeKind::Name>();
// Store the name for the type.
context.args_type_info_stack().AddInst(SemIR::StructTypeField{