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
2025-12-17 00:00:14 +00:00
committed by GitHub
parent 2e65d28a16
commit ad7ea755b0
9 changed files with 47 additions and 23 deletions
+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));