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
@@ -23,7 +23,7 @@ fn ReturnDUsed() -> D;
fn Call() {
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
// CHECK:STDERR: ReturnCUsed();
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: ^~~~~~~~~~~~~
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: class C;
// CHECK:STDERR: ^~~~~~~~
@@ -34,7 +34,7 @@ fn Call() {
ReturnCUsed();
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `D` [IncompleteTypeInFunctionReturnType]
// CHECK:STDERR: ReturnDUsed();
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: ^~~~~~~~~~~~~
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: class D;
// CHECK:STDERR: ^~~~~~~~
@@ -56,7 +56,7 @@ import library "incomplete_return";
fn CallFAndGIncomplete() {
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE+12]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
// CHECK:STDERR: ReturnCUnused();
// CHECK:STDERR: ^~~~~~~~~~~~~
// CHECK:STDERR: ^~~~~~~~~~~~~~~
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-6]]:1: in import [InImport]
// CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: class C;
@@ -69,7 +69,7 @@ fn CallFAndGIncomplete() {
ReturnCUnused();
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE+11]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
// CHECK:STDERR: ReturnCUsed();
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: ^~~~~~~~~~~~~
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-19]]:1: in import [InImport]
// CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: class C;
+49 -2
View File
@@ -198,6 +198,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic]
// CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [template]
// CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %ptr.1 [symbolic]
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.1: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
@@ -211,7 +212,9 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.3: type = ptr_type %struct_type.a [symbolic]
// CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.type: type = fn_type @CallExplicitGenericParamWithGenericArg [template]
// CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg: %CallExplicitGenericParamWithGenericArg.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.2: <witness> = require_complete_type %ptr.3 [symbolic]
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.3: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a) [symbolic]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %ptr.2 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -277,6 +280,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type @ExplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %ptr.loc4_39.2 (constants.%ptr.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.1) [symbolic = %require_complete (constants.%require_complete.1)]
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_25.2) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type) -> @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.1) {
@@ -312,6 +316,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc10_63.2: type = ptr_type @CallExplicitGenericParamWithGenericArg.%struct_type.a.loc10_62.2 (%struct_type.a) [symbolic = %ptr.loc10_63.2 (constants.%ptr.3)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.3) [symbolic = %require_complete (constants.%require_complete.2)]
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc11_10.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a.loc10_62.2) [symbolic = %ExplicitGenericParam.specific_fn.loc11_10.2 (constants.%ExplicitGenericParam.specific_fn.3)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type) -> @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.3) {
@@ -333,6 +338,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.1
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete.1
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -348,6 +354,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.2
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -364,6 +371,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.3
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete.2
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.3
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -381,6 +389,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
// CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [template]
// CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr [symbolic]
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic]
// CHECK:STDOUT: %CallExplicitGenericParamConst.type: type = fn_type @CallExplicitGenericParamConst [template]
// CHECK:STDOUT: %CallExplicitGenericParamConst: %CallExplicitGenericParamConst.type = struct_value () [template]
@@ -438,6 +447,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type @ExplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %ptr.loc4_39.2 (constants.%ptr)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_25.2) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type) -> @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) {
@@ -459,6 +469,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc7_3.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc6_34.2) [symbolic = %ExplicitGenericParam.specific_fn.loc7_3.2 (constants.%ExplicitGenericParam.specific_fn)]
// CHECK:STDOUT: %ptr: type = ptr_type @CallExplicitGenericParamConst.%T.loc6_34.2 (%T) [symbolic = %ptr (constants.%ptr)]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallExplicitGenericParamConst.%ptr (%ptr) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type) {
// CHECK:STDOUT: !entry:
@@ -483,6 +494,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete
// CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -508,18 +520,21 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = class_type @A [template]
// 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: %T: type = bind_symbolic_name T, 0 [symbolic]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic]
// CHECK:STDOUT: %ExplicitAndAlsoDeduced.type: type = fn_type @ExplicitAndAlsoDeduced [template]
// CHECK:STDOUT: %ExplicitAndAlsoDeduced: %ExplicitAndAlsoDeduced.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %ptr.1 [symbolic]
// CHECK:STDOUT: %require_complete.2: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.1: <specific function> = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T) [symbolic]
// CHECK:STDOUT: %ptr.2: type = ptr_type %A [template]
// CHECK:STDOUT: %CallExplicitAndAlsoDeduced.type: type = fn_type @CallExplicitAndAlsoDeduced [template]
// CHECK:STDOUT: %CallExplicitAndAlsoDeduced: %CallExplicitAndAlsoDeduced.type = struct_value () [template]
// CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.2: <specific function> = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%A) [template]
// CHECK:STDOUT: %A.val: %A = struct_value () [template]
// CHECK:STDOUT: %complete_type.2: <witness> = complete_type_witness %ptr.2 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -568,7 +583,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @A {
// 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.%A
@@ -581,6 +596,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc6_47.2: type = ptr_type @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) [symbolic = %ptr.loc6_47.2 (constants.%ptr.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc6_43: <witness> = require_complete_type @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.1) [symbolic = %require_complete.loc6_43 (constants.%require_complete.1)]
// CHECK:STDOUT: %require_complete.loc6_38: <witness> = require_complete_type @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) [symbolic = %require_complete.loc6_38 (constants.%require_complete.2)]
// CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2: <specific function> = specific_function constants.%ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T.loc6_27.2) [symbolic = %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 (constants.%ExplicitAndAlsoDeduced.specific_fn.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T)) -> @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.1) {
@@ -619,6 +636,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc6_47.2 => constants.%ptr.1
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc6_43 => constants.%require_complete.1
// CHECK:STDOUT: %require_complete.loc6_38 => constants.%require_complete.2
// CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -634,6 +653,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc6_47.2 => constants.%ptr.2
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc6_43 => constants.%complete_type.2
// CHECK:STDOUT: %require_complete.loc6_38 => constants.%complete_type.1
// CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -645,6 +666,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic]
// CHECK:STDOUT: %ImplicitGenericParam.type: type = fn_type @ImplicitGenericParam [template]
// CHECK:STDOUT: %ImplicitGenericParam: %ImplicitGenericParam.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %ptr.1 [symbolic]
// CHECK:STDOUT: %require_complete.2: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: %ImplicitGenericParam.specific_fn.1: <specific function> = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%T) [symbolic]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
@@ -654,6 +677,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %CallImplicitGenericParam.type: type = fn_type @CallImplicitGenericParam [template]
// CHECK:STDOUT: %CallImplicitGenericParam: %CallImplicitGenericParam.type = struct_value () [template]
// CHECK:STDOUT: %ImplicitGenericParam.specific_fn.2: <specific function> = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%i32) [template]
// CHECK:STDOUT: %complete_type.1: <witness> = complete_type_witness %ptr.2 [template]
// CHECK:STDOUT: %complete_type.2: <witness> = complete_type_witness %i32 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -717,6 +742,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc4_45.2: type = ptr_type @ImplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %ptr.loc4_45.2 (constants.%ptr.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc4_41: <witness> = require_complete_type @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.1) [symbolic = %require_complete.loc4_41 (constants.%require_complete.1)]
// CHECK:STDOUT: %require_complete.loc4_36: <witness> = require_complete_type @ImplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %require_complete.loc4_36 (constants.%require_complete.2)]
// CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2: <specific function> = specific_function constants.%ImplicitGenericParam, @ImplicitGenericParam(%T.loc4_25.2) [symbolic = %ImplicitGenericParam.specific_fn.loc4_56.2 (constants.%ImplicitGenericParam.specific_fn.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @ImplicitGenericParam.%T.loc4_25.2 (%T)) -> @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.1) {
@@ -748,6 +775,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.1
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc4_41 => constants.%require_complete.1
// CHECK:STDOUT: %require_complete.loc4_36 => constants.%require_complete.2
// CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -763,6 +792,8 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.2
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc4_41 => constants.%complete_type.1
// CHECK:STDOUT: %require_complete.loc4_36 => constants.%complete_type.2
// CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -780,6 +811,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%T, %i32) [symbolic]
// CHECK:STDOUT: %TupleParam.type: type = fn_type @TupleParam [template]
// CHECK:STDOUT: %TupleParam: %TupleParam.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %tuple.type.2 [symbolic]
// CHECK:STDOUT: %CallTupleParam.type: type = fn_type @CallTupleParam [template]
// CHECK:STDOUT: %CallTupleParam: %CallTupleParam.type = struct_value () [template]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
@@ -795,6 +827,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template]
// CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%int_1, %int_2.2) [template]
// CHECK:STDOUT: %complete_type.3: <witness> = complete_type_witness %tuple.type.4 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -840,6 +873,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %tuple.type: type = tuple_type (@TupleParam.%T.loc4_15.2 (%T), %i32) [symbolic = %tuple.type (constants.%tuple.type.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @TupleParam.%tuple.type (%tuple.type.2) [symbolic = %require_complete (constants.%require_complete.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @TupleParam.%tuple.type (%tuple.type.2)) {
// CHECK:STDOUT: !entry:
@@ -878,6 +912,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %tuple.type => constants.%tuple.type.4
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.3
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- deduce_nested_struct.carbon
@@ -893,6 +928,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.a.b.1: type = struct_type {.a: %T, .b: %i32} [symbolic]
// CHECK:STDOUT: %StructParam.type: type = fn_type @StructParam [template]
// CHECK:STDOUT: %StructParam: %StructParam.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %struct_type.a.b.1 [symbolic]
// CHECK:STDOUT: %CallStructParam.type: type = fn_type @CallStructParam [template]
// CHECK:STDOUT: %CallStructParam: %CallStructParam.type = struct_value () [template]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
@@ -908,6 +944,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template]
// CHECK:STDOUT: %struct: %struct_type.a.b.3 = struct_value (%int_1, %int_2.2) [template]
// CHECK:STDOUT: %complete_type.3: <witness> = complete_type_witness %struct_type.a.b.3 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -952,6 +989,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.a.b.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.2 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1) [symbolic = %require_complete (constants.%require_complete.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.1)) {
// CHECK:STDOUT: !entry:
@@ -990,6 +1028,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.a.b.loc4_44.2 => constants.%struct_type.a.b.3
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.3
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_deduce_bigger_struct.carbon
@@ -1004,6 +1043,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.c.d.e: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic]
// CHECK:STDOUT: %BigStructParam.type: type = fn_type @BigStructParam [template]
// CHECK:STDOUT: %BigStructParam: %BigStructParam.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.c.d.e [symbolic]
// CHECK:STDOUT: %CallBigStructParam.type: type = fn_type @CallBigStructParam [template]
// CHECK:STDOUT: %CallBigStructParam: %CallBigStructParam.type = struct_value () [template]
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template]
@@ -1056,6 +1096,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.c.d.e.loc4_56.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.2 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e)) {
// CHECK:STDOUT: !entry:
@@ -1090,6 +1131,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.f.g: type = struct_type {.f: %T, .g: %i32} [symbolic]
// CHECK:STDOUT: %SmallStructParam.type: type = fn_type @SmallStructParam [template]
// CHECK:STDOUT: %SmallStructParam: %SmallStructParam.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.f.g [symbolic]
// CHECK:STDOUT: %CallSmallStructParam.type: type = fn_type @CallSmallStructParam [template]
// CHECK:STDOUT: %CallSmallStructParam: %CallSmallStructParam.type = struct_value () [template]
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template]
@@ -1139,6 +1181,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.f.g.loc4_49.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.2 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g)) {
// CHECK:STDOUT: !entry:
@@ -1174,6 +1217,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.i.different: type = struct_type {.i: %T, .different: %i32} [symbolic]
// CHECK:STDOUT: %WrongNameStructParam.type: type = fn_type @WrongNameStructParam [template]
// CHECK:STDOUT: %WrongNameStructParam: %WrongNameStructParam.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.i.different [symbolic]
// CHECK:STDOUT: %CallWrongNameStructParam.type: type = fn_type @CallWrongNameStructParam [template]
// CHECK:STDOUT: %CallWrongNameStructParam: %CallWrongNameStructParam.type = struct_value () [template]
// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template]
@@ -1222,6 +1266,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.i.different.loc4_61.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.2 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different)) {
// CHECK:STDOUT: !entry:
@@ -1256,6 +1301,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.first.second: type = struct_type {.first: %T, .second: %i32} [symbolic]
// CHECK:STDOUT: %WrongOrderStructParam.type: type = fn_type @WrongOrderStructParam [template]
// CHECK:STDOUT: %WrongOrderStructParam: %WrongOrderStructParam.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.first.second [symbolic]
// CHECK:STDOUT: %CallWrongOrderStructParam.type: type = fn_type @CallWrongOrderStructParam [template]
// CHECK:STDOUT: %CallWrongOrderStructParam: %CallWrongOrderStructParam.type = struct_value () [template]
// CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [template]
@@ -1304,6 +1350,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.first.second.loc4_63.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.2 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second)) {
// CHECK:STDOUT: !entry:
@@ -59,12 +59,14 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %Function.type: type = fn_type @Function [template]
// CHECK:STDOUT: %Function: %Function.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [template]
// CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [template]
// CHECK:STDOUT: %Function.specific_fn.1: <specific function> = specific_function %Function, @Function(%T) [symbolic]
// CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic]
// CHECK:STDOUT: %CallGenericPtr.type: type = fn_type @CallGenericPtr [template]
// CHECK:STDOUT: %CallGenericPtr: %CallGenericPtr.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.2: <witness> = require_complete_type %ptr.1 [symbolic]
// CHECK:STDOUT: %Function.specific_fn.2: <specific function> = specific_function %Function, @Function(%ptr.1) [symbolic]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
@@ -164,6 +166,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Function.%T.loc4_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @Function.%T.loc4_13.2 (%T)) -> @Function.%T.loc4_13.2 (%T) {
// CHECK:STDOUT: !entry:
@@ -177,6 +180,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc8_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallGeneric.%T.loc8_16.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)]
// CHECK:STDOUT: %Function.specific_fn.loc9_10.2: <specific function> = specific_function constants.%Function, @Function(%T.loc8_16.2) [symbolic = %Function.specific_fn.loc9_10.2 (constants.%Function.specific_fn.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGeneric.%T.loc8_16.2 (%T)) -> @CallGeneric.%T.loc8_16.2 (%T) {
@@ -198,6 +202,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %ptr.loc12_33.2: type = ptr_type @CallGenericPtr.%T.loc12_19.2 (%T) [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) [symbolic = %require_complete (constants.%require_complete.2)]
// CHECK:STDOUT: %Function.specific_fn.loc13_10.2: <specific function> = specific_function constants.%Function, @Function(%ptr.loc12_33.2) [symbolic = %Function.specific_fn.loc13_10.2 (constants.%Function.specific_fn.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1)) -> @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) {
@@ -230,6 +235,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @CallGeneric(constants.%T) {
@@ -253,6 +259,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%ptr.1
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Function(@CallGenericPtr.%ptr.loc12_33.2) {
@@ -265,6 +272,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%C
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- deduced.carbon
@@ -274,12 +282,14 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %Function.type: type = fn_type @Function [template]
// CHECK:STDOUT: %Function: %Function.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [template]
// CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [template]
// CHECK:STDOUT: %Function.specific_fn.1: <specific function> = specific_function %Function, @Function(%T) [symbolic]
// CHECK:STDOUT: %ptr.1: type = ptr_type %T [symbolic]
// CHECK:STDOUT: %CallGenericPtr.type: type = fn_type @CallGenericPtr [template]
// CHECK:STDOUT: %CallGenericPtr: %CallGenericPtr.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.2: <witness> = require_complete_type %ptr.1 [symbolic]
// CHECK:STDOUT: %Function.specific_fn.2: <specific function> = specific_function %Function, @Function(%ptr.1) [symbolic]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
@@ -379,6 +389,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Function.%T.loc4_13.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @Function.%T.loc4_13.2 (%T)) -> @Function.%T.loc4_13.2 (%T) {
// CHECK:STDOUT: !entry:
@@ -392,6 +403,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc8_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallGeneric.%T.loc8_16.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)]
// CHECK:STDOUT: %Function.specific_fn.loc9_10.2: <specific function> = specific_function constants.%Function, @Function(%T.loc8_16.2) [symbolic = %Function.specific_fn.loc9_10.2 (constants.%Function.specific_fn.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGeneric.%T.loc8_16.2 (%T)) -> @CallGeneric.%T.loc8_16.2 (%T) {
@@ -412,6 +424,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %ptr.loc12_33.2: type = ptr_type @CallGenericPtr.%T.loc12_19.2 (%T) [symbolic = %ptr.loc12_33.2 (constants.%ptr.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) [symbolic = %require_complete (constants.%require_complete.2)]
// CHECK:STDOUT: %Function.specific_fn.loc13_10.2: <specific function> = specific_function constants.%Function, @Function(%ptr.loc12_33.2) [symbolic = %Function.specific_fn.loc13_10.2 (constants.%Function.specific_fn.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1)) -> @CallGenericPtr.%ptr.loc12_33.2 (%ptr.1) {
@@ -441,6 +454,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @CallGeneric(constants.%T) {
@@ -464,6 +478,7 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%ptr.1
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Function(@CallGenericPtr.%ptr.loc12_33.2) {
@@ -476,5 +491,6 @@ fn CallSpecific(x: C) -> C {
// CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%C
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -26,6 +26,8 @@ fn F(T:! type, U:! type) {
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %ptr [symbolic]
// CHECK:STDOUT: %require_complete.2: <witness> = require_complete_type %U [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -53,6 +55,8 @@ fn F(T:! type, U:! type) {
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %ptr.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr.loc12_11.2 (constants.%ptr)]
// CHECK:STDOUT: %require_complete.loc12: <witness> = require_complete_type @F.%ptr.loc12_11.2 (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.1)]
// CHECK:STDOUT: %require_complete.loc16: <witness> = require_complete_type @F.%U.loc11_16.2 (%U) [symbolic = %require_complete.loc16 (constants.%require_complete.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) {
// CHECK:STDOUT: !entry:
@@ -21,6 +21,8 @@ fn F(T:! type, p: T**) -> T* {
// CHECK:STDOUT: %ptr.2: type = ptr_type %ptr.1 [symbolic]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %ptr.1 [symbolic]
// CHECK:STDOUT: %require_complete.2: <witness> = require_complete_type %ptr.2 [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -56,6 +58,8 @@ fn F(T:! type, p: T**) -> T* {
// CHECK:STDOUT: %ptr.loc11_21.2: type = ptr_type @F.%ptr.loc11_20.2 (%ptr.1) [symbolic = %ptr.loc11_21.2 (constants.%ptr.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc11_24: <witness> = require_complete_type @F.%ptr.loc11_20.2 (%ptr.1) [symbolic = %require_complete.loc11_24 (constants.%require_complete.1)]
// CHECK:STDOUT: %require_complete.loc11_17: <witness> = require_complete_type @F.%ptr.loc11_21.2 (%ptr.2) [symbolic = %require_complete.loc11_17 (constants.%require_complete.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %p.param_patt: @F.%ptr.loc11_21.2 (%ptr.2)) -> @F.%ptr.loc11_20.2 (%ptr.1) {
// CHECK:STDOUT: !entry:
@@ -21,6 +21,8 @@ fn F(T:! type) {
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %ptr [symbolic]
// CHECK:STDOUT: %require_complete.2: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -42,6 +44,8 @@ fn F(T:! type) {
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %ptr.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr.loc12_11.2 (constants.%ptr)]
// CHECK:STDOUT: %require_complete.loc12: <witness> = require_complete_type @F.%ptr.loc12_11.2 (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.1)]
// CHECK:STDOUT: %require_complete.loc13: <witness> = require_complete_type @F.%T.loc11_6.2 (%T) [symbolic = %require_complete.loc13 (constants.%require_complete.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type) {
// CHECK:STDOUT: !entry:
@@ -20,6 +20,7 @@ fn F(T:! type, n: T) -> T {
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -50,6 +51,7 @@ fn F(T:! type, n: T) -> T {
// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @F.%T.loc11_6.2 (%T) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %n.param_patt: @F.%T.loc11_6.2 (%T)) -> @F.%T.loc11_6.2 (%T) {
// CHECK:STDOUT: !entry:
@@ -97,6 +97,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr [symbolic]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%T) [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -147,6 +148,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %ptr.loc4_20.2: type = ptr_type @F.%T.loc4_6.2 (%T) [symbolic = %ptr.loc4_20.2 (constants.%ptr)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @F.%ptr.loc4_20.2 (%ptr) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT: %F.specific_fn.loc7_10.2: <specific function> = specific_function constants.%F, @F(%T.loc4_6.2) [symbolic = %F.specific_fn.loc7_10.2 (constants.%F.specific_fn)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type) -> %ptr {
@@ -167,6 +169,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %ptr.loc4_20.2 => constants.%ptr
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete
// CHECK:STDOUT: %F.specific_fn.loc7_10.2 => constants.%F.specific_fn
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -189,6 +192,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %ptr.2: type = ptr_type %U [symbolic]
// CHECK:STDOUT: %.type: type = fn_type @.1 [template]
// CHECK:STDOUT: %.1: %.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.2 [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -258,6 +262,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %ptr.loc13_30.2: type = ptr_type @.1.%U.loc13_16.2 (%U) [symbolic = %ptr.loc13_30.2 (constants.%ptr.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @.1.%ptr.loc13_30.2 (%ptr.2) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) -> @.1.%ptr.loc13_30.2 (%ptr.2) {
// CHECK:STDOUT: !entry:
@@ -300,6 +305,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %ptr.2: type = ptr_type %T.2 [symbolic]
// CHECK:STDOUT: %.type: type = fn_type @.1 [template]
// CHECK:STDOUT: %.1: %.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.2 [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -369,6 +375,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %ptr.loc13_30.2: type = ptr_type @.1.%T.loc13_16.2 (%T.2) [symbolic = %ptr.loc13_30.2 (constants.%ptr.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @.1.%ptr.loc13_30.2 (%ptr.2) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%U.param_patt: type, %T.param_patt: type) -> @.1.%ptr.loc13_30.2 (%ptr.2) {
// CHECK:STDOUT: !entry:
@@ -411,6 +418,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %ptr.2: type = ptr_type %U.2 [symbolic]
// CHECK:STDOUT: %.type: type = fn_type @.1 [template]
// CHECK:STDOUT: %.1: %.type = struct_value () [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.2 [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -480,6 +488,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %ptr.loc13_30.2: type = ptr_type @.1.%U.loc13_6.2 (%U.2) [symbolic = %ptr.loc13_30.2 (constants.%ptr.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @.1.%ptr.loc13_30.2 (%ptr.2) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%U.param_patt: type, %T.param_patt: type) -> @.1.%ptr.loc13_30.2 (%ptr.2) {
// CHECK:STDOUT: !entry:
@@ -40,6 +40,7 @@ fn CallNegative() {
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %iN [symbolic]
// CHECK:STDOUT: %CallNegative.type: type = fn_type @CallNegative [template]
// CHECK:STDOUT: %CallNegative: %CallNegative.type = struct_value () [template]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template]
@@ -85,6 +86,7 @@ fn CallNegative() {
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %iN: type = int_type signed, %N.loc4_19.2 [symbolic = %iN (constants.%iN)]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @ErrorIfNIsZero.%iN (%iN) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral) {
// CHECK:STDOUT: !entry:
@@ -120,5 +122,6 @@ fn CallNegative() {
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %iN => <error>
// CHECK:STDOUT: %require_complete => <error>
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -33,6 +33,7 @@ fn G() {
// CHECK:STDOUT: %Make.1: %Make.type.1 = struct_value () [symbolic]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %complete_type.1: <witness> = complete_type_witness %empty_struct_type [template]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: %Make.specific_fn.1: <specific function> = specific_function %Make.1, @Make(%T) [symbolic]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
@@ -58,6 +59,8 @@ fn G() {
// CHECK:STDOUT: %Make.type.4: type = fn_type @Make, @Wrap(%C) [template]
// CHECK:STDOUT: %Make.4: %Make.type.4 = struct_value () [template]
// CHECK:STDOUT: %Make.specific_fn.4: <specific function> = specific_function %Make.4, @Make(%C) [template]
// CHECK:STDOUT: %complete_type.3: <witness> = complete_type_witness %i32 [template]
// CHECK:STDOUT: %complete_type.4: <witness> = complete_type_witness %empty_tuple.type [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -133,6 +136,7 @@ fn G() {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Make.%T (%T) [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT: %Make.type: type = fn_type @Make, @Wrap(%T) [symbolic = %Make.type (constants.%Make.type.1)]
// CHECK:STDOUT: %Make: @Make.%Make.type (%Make.type.1) = struct_value () [symbolic = %Make (constants.%Make.1)]
// CHECK:STDOUT: %Make.specific_fn.loc12_27.2: <specific function> = specific_function %Make, @Make(%T) [symbolic = %Make.specific_fn.loc12_27.2 (constants.%Make.specific_fn.1)]
@@ -209,6 +213,7 @@ fn G() {
// CHECK:STDOUT: %T => constants.%T
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete
// CHECK:STDOUT: %Make.type => constants.%Make.type.1
// CHECK:STDOUT: %Make => constants.%Make.1
// CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.1
@@ -241,6 +246,7 @@ fn G() {
// CHECK:STDOUT: %T => constants.%i32
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.3
// CHECK:STDOUT: %Make.type => constants.%Make.type.2
// CHECK:STDOUT: %Make => constants.%Make.2
// CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.2
@@ -259,6 +265,7 @@ fn G() {
// CHECK:STDOUT: %T => constants.%empty_tuple.type
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.4
// CHECK:STDOUT: %Make.type => constants.%Make.type.3
// CHECK:STDOUT: %Make => constants.%Make.3
// CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.3
@@ -277,6 +284,7 @@ fn G() {
// CHECK:STDOUT: %T => constants.%C
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.2
// CHECK:STDOUT: %Make.type => constants.%Make.type.4
// CHECK:STDOUT: %Make => constants.%Make.4
// CHECK:STDOUT: %Make.specific_fn.loc12_27.2 => constants.%Make.specific_fn.4
@@ -57,6 +57,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %Defined.type: type = fn_type @Defined [template]
// CHECK:STDOUT: %Defined: %Defined.type = struct_value () [template]
// CHECK:STDOUT: %require_complete.1: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
@@ -72,6 +73,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.7(%int_32) [template]
// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
// CHECK:STDOUT: %Defined.specific_fn: <specific function> = specific_function %Defined, @Defined(%i32) [template]
// CHECK:STDOUT: %complete_type.2: <witness> = complete_type_witness %i32 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -125,6 +127,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %T.patt.loc4_12.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_12.2 (constants.%T.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.1)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @Defined.%T.loc4_12.2 (%T)) -> @Defined.%T.loc4_12.2 (%T) {
// CHECK:STDOUT: !entry:
@@ -164,6 +167,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %T.patt.loc4_12.2 => constants.%i32
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- call_defined_late.carbon
@@ -188,6 +192,8 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.7(%int_32) [template]
// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
// CHECK:STDOUT: %Defined.specific_fn: <specific function> = specific_function %Defined, @Defined(%i32) [template]
// CHECK:STDOUT: %require_complete.7: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: %complete_type.2: <witness> = complete_type_witness %i32 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -258,6 +264,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %T.patt.loc4: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4 (constants.%T.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.7)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: %T) -> %T {
// CHECK:STDOUT: !entry:
@@ -297,6 +304,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %T.patt.loc4 => constants.%i32
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_call_undefined.carbon