mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 19:55:11 +00:00
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:
1 parent
f396762e22
commit
b1de0e037d
7 files changed
+40
-35
No files matched your search
@@ -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] =
|
||||
|
||||
Reference in new issue
Block a user