mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Completing a type no longer ignores facet types (#5004)
Make facet types complete like other types. This means that in the body of an interface, the type of `Self` is incomplete. This involved fixing an issue where eval of a specific_id that was already canonical was not resolving the specific declaration, which could occur as part of substituting into a facet type. --------- Co-authored-by: Josh L <josh11b@users.noreply.github.com> Co-authored-by: Richard Smith <richard@metafoo.co.uk> Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
co-authored by
Josh L
Richard Smith
Dana Jansens
parent
1d48270dc4
commit
3ebd098597
@@ -322,7 +322,13 @@ static auto CheckConstraintIsInterface(Context& context,
|
||||
|
||||
auto complete_id = RequireCompleteFacetType(
|
||||
context, facet_type_id, context.insts().GetLocId(impl.constraint_id),
|
||||
*facet_type, FacetTypeImpl);
|
||||
*facet_type, [&] {
|
||||
CARBON_DIAGNOSTIC(ImplAsIncompleteFacetType, Error,
|
||||
"impl as incomplete facet type {0}", InstIdAsType);
|
||||
return context.emitter().Build(impl.latest_decl_id(),
|
||||
ImplAsIncompleteFacetType,
|
||||
impl.constraint_id);
|
||||
});
|
||||
if (!complete_id.has_value()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user