Associated constants can be used in member function signatures (#5089)

This required allowing incomplete facet types where previously
completeness was required. Once we support named constraints, we will
need a way to consistently go from an interface to a facet type witness
index without requiring the interface to be complete in these cases.

---------

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
This commit is contained in:
josh11b
2025-03-12 00:33:46 +00:00
committed by GitHub
co-authored by Josh L
parent 68f6906c9f
commit ebaf62efb9
37 changed files with 4530 additions and 1285 deletions
+4 -1
View File
@@ -1148,7 +1148,10 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id,
return SemIR::ErrorInst::SingletonInstId;
}
// We can only perform initialization for complete, non-abstract types.
// We can only perform initialization for complete, non-abstract types. Note
// that `RequireConcreteType` returns true for facet types, since their
// representation is fixed. This allows us to support using the `Self` of an
// interface inside its definition.
if (!RequireConcreteType(
context, target.type_id, loc_id,
[&] {