Allow incomplete types in associated constants (#6657)

Reference: #1084, [Example of declaring interfaces with cyclic
references](https://github.com/carbon-language/carbon-lang/blob/trunk/docs/design/generics/details.md#example-of-declaring-interfaces-with-cyclic-references).
Part of #6411: "Associated constants shouldn't have to be complete".
This commit is contained in:
Özgür
2026-01-28 15:27:14 +00:00
committed by GitHub
parent b0ffed7c3e
commit bdcac5087d
8 changed files with 225 additions and 117 deletions
@@ -366,13 +366,6 @@ auto HandleParseNode(Context& context,
// add a proper diagnostic.
context.TODO(node_id, "_ used as associated constant name");
}
cast_type_id = AsCompleteType(context, cast_type_id, type_node, [&] {
CARBON_DIAGNOSTIC(IncompleteTypeInAssociatedConstantDecl, Error,
"associated constant has incomplete type {0}",
SemIR::TypeId);
return context.emitter().Build(
type_node, IncompleteTypeInAssociatedConstantDecl, cast_type_id);
});
SemIR::AssociatedConstantDecl assoc_const_decl = {
.type_id = cast_type_id,