Add the form ID to FormParamPattern (#6928)

This enables some nice simplifications, and it's also a step toward a
broader restructuring of binding and parameter patterns.

Assisted-by: Gemini 3.1 Pro via Antigravity
This commit is contained in:
Geoff Romer
2026-03-20 01:08:38 +00:00
committed by GitHub
parent ce50f181f1
commit 8e5b358ec2
11 changed files with 65 additions and 88 deletions
+3 -2
View File
@@ -127,12 +127,13 @@ static auto ClonePattern(Context& context, SemIR::SpecificId specific_id,
}
// Rebuild parameter.
if (param) {
if (param && new_pattern_id != SemIR::ErrorInst::InstId) {
new_pattern_id = RebuildPatternInst<SemIR::AnyParamPattern>(
context, param_id,
{.kind = param->kind,
.type_id = get_type(param_id),
.subpattern_id = new_pattern_id});
.subpattern_id = new_pattern_id,
.form_id = SemIR::ConstantId::None});
}
return new_pattern_id;