Add diagnostic support so that we can just pass in TypeId. (#3695)

Note we may also want to do this with NameId, maybe some other things,
but the TypeId use is pretty broad and repetitive -- I thought I'd start
with it first.
This commit is contained in:
Jon Ross-Perkins
2024-02-09 16:25:23 +00:00
committed by GitHub
parent bdff7ccf28
commit 1bf4dc53d9
16 changed files with 168 additions and 104 deletions
+2 -3
View File
@@ -231,11 +231,10 @@ auto DeclNameStack::TryResolveQualifier(NameContext& name_context,
.TryAs<SemIR::ClassDecl>()) {
CARBON_DIAGNOSTIC(QualifiedDeclInIncompleteClassScope, Error,
"Cannot declare a member of incomplete class `{0}`.",
std::string);
SemIR::TypeId);
auto builder = context_->emitter().Build(
name_context.parse_node, QualifiedDeclInIncompleteClassScope,
context_->sem_ir().StringifyType(
context_->classes().Get(class_decl->class_id).self_type_id));
context_->classes().Get(class_decl->class_id).self_type_id);
context_->NoteIncompleteClass(class_decl->class_id, builder);
builder.Emit();
} else {