From 7b36de761d1bd6488c575a033d679a4e85380ba2 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 22 Jan 2026 13:32:50 -0800 Subject: [PATCH] Shift a TODO to a CHECK (#6645) --- toolchain/check/custom_witness.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/toolchain/check/custom_witness.cpp b/toolchain/check/custom_witness.cpp index 1ea791a98a2e..4504cc89ca29 100644 --- a/toolchain/check/custom_witness.cpp +++ b/toolchain/check/custom_witness.cpp @@ -136,11 +136,6 @@ auto BuildCustomWitness(Context& context, SemIR::LocId loc_id, // This is necessary because later associated entities may refer to earlier // associated entities in their signatures. In particular, an associated // result type may be used as the return type of an associated function. - // - // TODO: Consider building one witness after all associated constants, and - // then a second after all associated functions, rather than building one at - // each step. For now this doesn't really matter since we don't have more than - // one of each anyway. auto make_witness = [&] { return context.constant_values().GetInstId( EvalOrAddInst( @@ -193,6 +188,13 @@ auto BuildCustomWitness(Context& context, SemIR::LocId loc_id, } } + // TODO: Consider building one witness after all associated constants, and + // then a second after all associated functions, rather than building one in + // each `StructValue`. Right now the code is written assuming at most one + // function, though this CHECK can be removed as a temporary workaround. + CARBON_CHECK(entries.size() <= 1, + "TODO: Support multiple associated functions"); + return make_witness(); }