diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index 9fa6a8eee061..6d092a23518d 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -348,6 +348,12 @@ static auto MakeFacetTypeResult(Context& context, // with constant phase, and if so, returns the corresponding constant value. // Overloads are provided for different kinds of ID. +// AbsoluteInstId can not have its values substituted, so this overload is +// deleted. This prevents conversion to InstId. +static auto GetConstantValue(EvalContext& eval_context, + SemIR::AbsoluteInstId inst_id, Phase* phase) + -> SemIR::InstId = delete; + // If the given instruction is constant, returns its constant value. static auto GetConstantValue(EvalContext& eval_context, SemIR::InstId inst_id, Phase* phase) -> SemIR::InstId { @@ -375,7 +381,8 @@ static auto GetConstantValue(EvalContext& eval_context, SemIR::TypeId type_id, return eval_context.context().types().GetTypeIdForTypeConstantId(const_id); } -// AbsoluteInstBlockId can not have its values substituted. +// AbsoluteInstBlockId can not have its values substituted, so this overload is +// deleted. This prevents conversion to InstBlockId. static auto GetConstantValue(EvalContext& eval_context, SemIR::AbsoluteInstBlockId inst_block_id, Phase* phase) -> SemIR::InstBlockId = delete;