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:
Richard Smith
2024-12-10 03:00:28 +00:00
committed by GitHub
parent e75ef34591
commit eabe9f117a
107 changed files with 1357 additions and 291 deletions
@@ -42,7 +42,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); }
// CHECK:STDOUT: %G.type: type = fn_type @G, @Inner(%F.1) [symbolic]
// CHECK:STDOUT: %G: %G.type = struct_value () [symbolic]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
// CHECK:STDOUT: %complete_type.1: <witness> = complete_type_witness %empty_struct_type [template]
// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
@@ -99,7 +99,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); }
// CHECK:STDOUT:
// CHECK:STDOUT: class {
// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner.1] {} {}
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%Class
@@ -139,7 +139,7 @@ fn Class(F:! type).Inner.G() -> i32 { return F(); }
// CHECK:STDOUT: %return.param.loc9: ref %i32 = out_param runtime_param0
// CHECK:STDOUT: %return.loc9: ref %i32 = return_slot %return.param.loc9
// CHECK:STDOUT: }
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%Inner.2