Add Abstract enumerator to InitRepr::Kind (#6513)

This fixes a bug where `CheckFunctionReturnType` could sometimes fail to
diagnose an abstract return type.
This commit is contained in:
Geoff Romer authored and GitHub committed 2025-12-17 00:00:14 +00:00
1 parent 2e65d28a16
commit ad7ea755b0
9 files changed
+47 -23

No files matched your search

+3
View File
@@ -282,6 +282,9 @@ auto FunctionContext::FinishInit(TypeInFile type, SemIR::InstId dest_id,
case SemIR::InitRepr::ByCopy:
CopyValue(type, source_id, dest_id);
break;
case SemIR::InitRepr::Abstract:
CARBON_FATAL("Lowering aggregate initialization of abstract type {0}",
type.file->types().GetAsInst(type.type_id));
case SemIR::InitRepr::Incomplete:
CARBON_FATAL("Lowering aggregate initialization of incomplete type {0}",
type.file->types().GetAsInst(type.type_id));