Skip to content

Commit bf72c43

Browse files
authored
Set the completed flag in NamedConstraint after the defn is complete (#6304)
A named constraint can not be [identified](https://github.com/carbon-language/carbon-lang/blob/656150593c1e3fc2b6ccd83c7256a61e4bd04030/proposals/p5168.md#proposed-rules) until its definition is complete, so this flag will be used to determine if the named constraint is ready to be identified.
1 parent 43e09e8 commit bf72c43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

toolchain/check/handle_named_constraint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ auto HandleParseNode(Context& context,
156156
.Pop<Parse::NodeKind::NamedConstraintDefinitionStart>();
157157
context.inst_block_stack().Pop();
158158

159-
const auto& constraint_info =
160-
context.named_constraints().Get(named_constraint_id);
159+
auto& constraint_info = context.named_constraints().Get(named_constraint_id);
160+
constraint_info.complete = true;
161161

162162
// TODO: Do something with `require` and `alias` statements in the body of the
163163
// constraint.

0 commit comments

Comments
 (0)