Rename "generic instance" to "specific" throughout the toolchain. (#4165)

As discussed in toolchain meeting, we want to avoid overloading the
meaning of "instance", and "specific" was the best name we found. It's a
little unorthodox and inventive, but hopefully over time will become as
unsurprising as the term "generic" is.
This commit is contained in:
Richard Smith
2024-07-25 16:42:01 +00:00
committed by GitHub
parent 70c20be91b
commit 3cb769a053
41 changed files with 370 additions and 396 deletions
+4 -4
View File
@@ -252,13 +252,13 @@ static auto BuildClassDecl(Context& context, Parse::AnyClassDeclId node_id,
// declaration.
auto& class_info = context.classes().Get(class_decl.class_id);
if (class_info.is_generic()) {
auto instance_id =
context.generics().GetSelfInstance(class_info.generic_id);
auto specific_id =
context.generics().GetSelfSpecific(class_info.generic_id);
class_info.self_type_id = context.GetTypeIdForTypeConstant(
TryEvalInst(context, SemIR::InstId::Invalid,
SemIR::ClassType{.type_id = SemIR::TypeId::TypeType,
.class_id = class_decl.class_id,
.instance_id = instance_id}));
.specific_id = specific_id}));
} else {
class_info.self_type_id = context.GetTypeIdForTypeInst(class_decl_id);
}
@@ -293,7 +293,7 @@ auto HandleParseNode(Context& context, Parse::ClassDefinitionStartId node_id)
// Enter the class scope.
context.scope_stack().Push(
class_decl_id, class_info.scope_id,
context.generics().GetSelfInstance(class_info.generic_id));
context.generics().GetSelfSpecific(class_info.generic_id));
StartGenericDefinition(context);
// Introduce `Self`.