mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01: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:
@@ -23,6 +23,7 @@ fn G(T:! type) {
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_0, %T [symbolic]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type [symbolic]
|
||||
// CHECK:STDOUT: %array: %array_type = tuple_value () [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -54,6 +55,7 @@ fn G(T:! type) {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %array_type.loc13_17.2: type = array_type constants.%int_0, @G.%T.loc11_6.2 (%T) [symbolic = %array_type.loc13_17.2 (constants.%array_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @G.%array_type.loc13_17.2 (%array_type) [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %array: @G.%array_type.loc13_17.2 (%array_type) = tuple_value () [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%T.param_patt: type) {
|
||||
|
||||
Reference in New Issue
Block a user