Track the instruction used to name the type and constraint in an impl. (#4368)

This is necessary in order to have access to the specific versions of
their constant values in a generic impl.

Stub out impl deduction.
This commit is contained in:
Richard Smith
2024-10-04 00:06:55 +00:00
committed by GitHub
parent eab5dd6112
commit 568ad197d1
79 changed files with 591 additions and 342 deletions
+15
View File
@@ -10,6 +10,7 @@
#include "toolchain/check/generic.h"
#include "toolchain/check/subst.h"
#include "toolchain/sem_ir/ids.h"
#include "toolchain/sem_ir/impl.h"
#include "toolchain/sem_ir/typed_insts.h"
namespace Carbon::Check {
@@ -238,4 +239,18 @@ auto DeduceGenericCallArguments(
context.inst_blocks().AddCanonical(result_arg_ids));
}
// Deduces the impl arguments to use in a use of a parameterized impl. Returns
// `Invalid` if deduction fails.
auto DeduceImplArguments(Context& context, const SemIR::Impl& impl,
SemIR::ConstantId self_id,
SemIR::ConstantId constraint_id) -> SemIR::SpecificId {
CARBON_CHECK(impl.generic_id.is_valid(),
"Performing deduction for non-generic impl");
// TODO: This is a placeholder. Implement deduction.
static_cast<void>(context);
static_cast<void>(self_id);
static_cast<void>(constraint_id);
return SemIR::SpecificId::Invalid;
}
} // namespace Carbon::Check