Switch EvalLookupSingleImplWitness from "concrete" to "final" terminology (#6246)

A `final impl` can have a symbolic witness, but that witness is still
final. Using "final" here per discussion on
[#generics-and-templates](https://discord.com/channels/655572317891461132/941071822756143115/1428851511672312120).

I'm also changing the variant a little because `concrete_witness` was
only called when `has_concrete_value` was true, so it can be more
careful about its contract. Having a more explicit `None` also
simplifies `has_value`. I think it doesn't change the overall cost much
past that.
This commit is contained in:
Jon Ross-Perkins
2025-10-20 17:25:26 +00:00
committed by GitHub
parent 1df0d4566e
commit b1f734e1cd
4 changed files with 38 additions and 36 deletions
+3 -3
View File
@@ -526,9 +526,9 @@ auto CheckUnit::CheckPoisonedConcreteImplLookupQueries() -> void {
for (const auto& poison : poisoned_queries) {
auto witness_result = EvalLookupSingleImplWitness(
context_, poison.loc_id, poison.query, poison.query.query_self_inst_id,
/*poison_concrete_results=*/false);
CARBON_CHECK(witness_result.has_concrete_value());
auto found_witness_id = witness_result.concrete_witness();
/*poison_final_results=*/false);
CARBON_CHECK(witness_result.has_final_value());
auto found_witness_id = witness_result.final_witness();
if (found_witness_id != poison.impl_witness) {
auto witness_to_impl_id = [&](SemIR::InstId witness_id) {
auto table_id = context_.insts()