mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 16:00:30 +00:00
Track complete types required by a generic. (#4652)
When a generic requires a symbolic type to be complete, add a new `require_complete_type` instruction to the generic eval block. During monomorphization of such an instruction, require that type to be complete.
This commit is contained in:
1 parent
e75ef34591
commit
eabe9f117a
107 files changed
+1357
-291
No files matched your search
@@ -104,7 +104,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
// A `var` declaration at class scope introduces a field.
|
||||
auto parent_class_decl = context.GetCurrentScopeAs<SemIR::ClassDecl>();
|
||||
cast_type_id = context.AsCompleteType(
|
||||
cast_type_id,
|
||||
cast_type_id, type_node,
|
||||
[&] {
|
||||
CARBON_DIAGNOSTIC(IncompleteTypeInVarDecl, Error,
|
||||
"{0:field|variable} has incomplete type {1}",
|
||||
@@ -245,7 +245,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
}
|
||||
|
||||
case Parse::NodeKind::LetIntroducer: {
|
||||
cast_type_id = context.AsCompleteType(cast_type_id, [&] {
|
||||
cast_type_id = context.AsCompleteType(cast_type_id, type_node, [&] {
|
||||
CARBON_DIAGNOSTIC(IncompleteTypeInLetDecl, Error,
|
||||
"`let` binding has incomplete type {0}",
|
||||
InstIdAsType);
|
||||
|
||||
Reference in new issue
Block a user