mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 06:34:41 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user