Give the facet type as a TypeId to IdentifyFacetType functions (#7926)

This statically ensures that identify always works with a constant
value, in the most restrictive way possible (ensuring it's a type not
just a constant).
This commit is contained in:
Dana Jansens authored and GitHub committed 2026-10-13 15:02:58 +00:00
1 parent f396762e22
commit b1de0e037d
7 files changed
+40 -35

No files matched your search

+8 -3
View File
@@ -204,13 +204,18 @@ static auto PopImplIntroducerAndParamsAsNameComponent(
.pattern_block_id = pattern_block_id};
}
struct BuildImplDeclResult {
SemIR::ImplId impl_id;
SemIR::InstId impl_decl_id;
SemIR::TypeInstId full_constraint_type_inst_id;
SemIR::IdentifiedFacetTypeId identified_id;
};
// Build an ImplDecl describing the signature of an impl. This handles the
// common logic shared by impl forward declarations and impl definitions. It
// also sets the `definition_id` on the Impl structure.
static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id,
bool has_definition)
-> std::tuple<SemIR::ImplId, SemIR::InstId, SemIR::TypeInstId,
SemIR::IdentifiedFacetTypeId> {
bool has_definition) -> BuildImplDeclResult {
auto [constraint_node, constraint_id] =
context.node_stack().PopExprWithNodeId();
auto [self_type_node, self_type_inst_id] =