Add template action for compound member access. (#7657)

This allows various templated constructs to get further through
checking, but typically we hit another unsupported action such as a
conversion or call, so it's not enough to make much work.
This commit is contained in:
Richard Smith
2026-08-20 15:45:02 +00:00
committed by GitHub
parent 631f8fb6d2
commit 6eb900dff5
11 changed files with 920 additions and 1009 deletions
+8 -7
View File
@@ -2063,15 +2063,16 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id,
if (sem_ir.insts().Get(expr_id).type_id() != target.type_id &&
target.kind == ConversionTarget::Value) {
auto target_type_inst_id = context.types().GetTypeInstId(target.type_id);
SemIR::ConvertToValueAction convert_action = {
.type_id = SemIR::InstType::TypeId,
.inst_id = expr_id,
.target_type_inst_id = target_type_inst_id};
// We don't use `HandleAction` here because it would call `PerformAction`
// inline if it's performable, which would lead to infinite recursion.
if (!ActionIsPerformable(context, convert_action)) {
return AddDependentActionSplice(context, loc_id, convert_action,
target_type_inst_id);
if (auto splice_inst_id = AddActionSpliceIfDependent(
context, loc_id, target_type_inst_id,
SemIR::ConvertToValueAction{
.type_id = SemIR::InstType::TypeId,
.inst_id = expr_id,
.target_type_inst_id = target_type_inst_id});
splice_inst_id.has_value()) {
return splice_inst_id;
}
}