Rename MemberIndex -> ElementIndex, ClassFieldAccess -> ClassElementAccess, UnboundFieldType -> UnboundElementType. (#3446)

In preparation for base class support, where these types will be used
for bases as well as fields.

As discussed [on
discord](https://discord.com/channels/655572317891461132/963846118964350976/1180267686316478575).
This commit is contained in:
Richard Smith
2023-12-02 00:29:48 +00:00
committed by GitHub
parent 9c46d15f78
commit ca53c18ddc
64 changed files with 280 additions and 280 deletions
+4 -4
View File
@@ -88,15 +88,15 @@ auto HandleBindingPattern(Context& context, Parse::NodeId parse_node) -> bool {
} else if (enclosing_class_decl) {
auto& class_info =
context.classes().Get(enclosing_class_decl->class_id);
auto field_type_inst_id = context.AddInst(SemIR::UnboundFieldType{
auto field_type_inst_id = context.AddInst(SemIR::UnboundElementType{
parse_node, context.GetBuiltinType(SemIR::BuiltinKind::TypeType),
class_info.self_type_id, cast_type_id});
value_type_id = context.CanonicalizeType(field_type_inst_id);
value_id = context.AddInst(
SemIR::Field{parse_node, value_type_id, name_id,
SemIR::MemberIndex(context.args_type_info_stack()
.PeekCurrentBlockContents()
.size())});
SemIR::ElementIndex(context.args_type_info_stack()
.PeekCurrentBlockContents()
.size())});
// Add a corresponding field to the object representation of the class.
context.args_type_info_stack().AddInst(