Support accessing associated functions by member access into facets (#4872)

For an expression such as `(Type as Interface).AssocFn()`, track the
`Self` type `Type` in the result of the member access so that it's
available when checking the function call.

This introduces a new kind of type, `ImplFunctionType`, that represents
the type of a function that is expected within an impl, modeled as the
type of the function within the interface plus a value to use as `Self`.
Calls to values of this type behave like calls to the underlying
function except that the `Self` parameter is pre-bound to the self type
from the facet.

In order to support this, fix an issue where the imported list of
generic bindings lost their association with their enclosing generic.
This adds a little complexity to `import_ref`, including a new recursive
cycle that I intend to address in a follow-up PR.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Richard Smith
2025-02-04 22:38:38 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent dcfccd3187
commit fcfb1345d5
234 changed files with 4213 additions and 2531 deletions
+19 -11
View File
@@ -128,10 +128,13 @@ fn CallF() {
// CHECK:STDOUT: %I.facet.401: %I.type = facet_value %i32, %impl_witness.6f4 [template]
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [template]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.2(%int_32) [template]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.2(%int_32) [template]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template]
@@ -189,10 +192,10 @@ fn CallF() {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %impl_witness.loc10: <witness> = impl_witness (constants.%int_0.6a9) [template = constants.%impl_witness.6f4]
// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method constants.%int_0.5c6, %impl.elem0 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(constants.%int_0.5c6) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method constants.%int_0.5c6, %impl.elem0 [template = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(constants.%int_0.5c6) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc10_15.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc10_15.2: %i32 = converted constants.%int_0.5c6, %.loc10_15.1 [template = constants.%int_0.6a9]
// CHECK:STDOUT: }
@@ -372,6 +375,7 @@ fn CallF() {
// CHECK:STDOUT: %impl_witness.3db: <witness> = impl_witness (@impl.1.%Convert.decl) [template]
// CHECK:STDOUT: %Convert.type.721: type = fn_type @Convert.2 [template]
// CHECK:STDOUT: %Convert.155: %Convert.type.721 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.15e = facet_value %empty_tuple.type, %impl_witness.3db [template]
// CHECK:STDOUT: %C.val: %C = struct_value () [template]
// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic]
@@ -383,6 +387,7 @@ fn CallF() {
// CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple> [template]
// CHECK:STDOUT: %impl_witness.85b: <witness> = impl_witness (<error>) [template]
// CHECK:STDOUT: %I.facet.b45: %I.type = facet_value %C, %impl_witness.85b [template]
// CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %Convert.type.56d, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %empty_tuple, %Convert.155 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -431,10 +436,10 @@ fn CallF() {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %impl_witness.loc18: <witness> = impl_witness (<error>) [template = constants.%impl_witness.85b]
// CHECK:STDOUT: %impl.elem0: %Convert.type.56d = impl_witness_access constants.%impl_witness.3db, element0 [template = constants.%Convert.155]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method constants.%empty_tuple, %impl.elem0 [template = constants.%Convert.bound]
// CHECK:STDOUT: %impl.elem0: %.d4d = impl_witness_access constants.%impl_witness.3db, element0 [template = constants.%Convert.155]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method constants.%empty_tuple, %impl.elem0 [template = constants.%Convert.bound]
// CHECK:STDOUT: %.loc18_13.1: ref %C = temporary_storage
// CHECK:STDOUT: %Convert.call: init %C = call %Convert.bound(constants.%empty_tuple) to %.loc18_13.1
// CHECK:STDOUT: %Convert.call: init %C = call %bound_method(constants.%empty_tuple) to %.loc18_13.1
// CHECK:STDOUT: %.loc18_13.2: init %C = converted constants.%empty_tuple, %Convert.call
// CHECK:STDOUT: %.loc18_13.3: ref %C = temporary %.loc18_13.1, %.loc18_13.2
// CHECK:STDOUT: %.loc18_13.4: %C = bind_value %.loc18_13.3
@@ -541,8 +546,11 @@ fn CallF() {
// CHECK:STDOUT: %assoc0.6db: %I.assoc_type.656 = assoc_entity element0, @I.%V [symbolic]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [template]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Core.import_ref.c15) [template]
// CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.1 [template]
// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value Core.IntLiteral, %impl_witness [template]
// CHECK:STDOUT: %.45d: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [template]
// CHECK:STDOUT: %Op.type.1be: type = fn_type @Op.2 [template]
// CHECK:STDOUT: %Op.bba: %Op.type.1be = struct_value () [template]
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %int_1, %Op.bba [template]
@@ -553,7 +561,7 @@ fn CallF() {
// CHECK:STDOUT: %assoc0.34f: %I.assoc_type.3f5 = assoc_entity element0, @I.%V [template]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic]
// CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self [symbolic]
// CHECK:STDOUT: %I.facet: %I.type.8a1 = facet_value %.Self.as_type, %.Self.as_wit [symbolic]
// CHECK:STDOUT: %I.facet: %I.type.057 = facet_value %.Self.as_type, %.Self.as_wit [symbolic]
// CHECK:STDOUT: %impl.elem0: <error> = impl_witness_access %.Self.as_wit, element0 [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -592,9 +600,9 @@ fn CallF() {
// CHECK:STDOUT: %.loc15_7.2: type = converted %.loc15_7.1, constants.%empty_struct_type [template = constants.%empty_struct_type]
// CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, file.%I.decl [template = constants.%I.generic]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
// CHECK:STDOUT: %impl.elem0.loc15_14: %Op.type.e42 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.bba]
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %int_1, %impl.elem0.loc15_14 [template = constants.%Op.bound]
// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %Op.bound(%int_1) [template = constants.%int_-1]
// CHECK:STDOUT: %impl.elem0.loc15_14: %.45d = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.bba]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1, %impl.elem0.loc15_14 [template = constants.%Op.bound]
// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %bound_method(%int_1) [template = constants.%int_-1]
// CHECK:STDOUT: %.loc15_16.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-1]
// CHECK:STDOUT: %.loc15_16.2: Core.IntLiteral = converted %int.snegate, %.loc15_16.1 [template = constants.%int_-1]
// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%int_-1)> [template = constants.%I.type.057]
+10 -8
View File
@@ -58,8 +58,10 @@ fn InstanceCallIndirect(p: i32*) {
// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %impl_witness.5b2 [template]
// CHECK:STDOUT: %NonInstanceCall.type: type = fn_type @NonInstanceCall [template]
// CHECK:STDOUT: %NonInstanceCall: %NonInstanceCall.type = struct_value () [template]
// CHECK:STDOUT: %.187: type = fn_type_with_self_type %F.type.e2e, %Simple.facet [template]
// CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [template]
// CHECK:STDOUT: %InstanceCall: %InstanceCall.type = struct_value () [template]
// CHECK:STDOUT: %.b73: type = fn_type_with_self_type %G.type.b60, %Simple.facet [template]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template]
// CHECK:STDOUT: %NonInstanceCallIndirect.type: type = fn_type @NonInstanceCallIndirect [template]
// CHECK:STDOUT: %NonInstanceCallIndirect: %NonInstanceCallIndirect.type = struct_value () [template]
@@ -205,7 +207,7 @@ fn InstanceCallIndirect(p: i32*) {
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type]
// CHECK:STDOUT: %F.ref: %Simple.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0.9ca]
// CHECK:STDOUT: %impl.elem0: %F.type.e2e = impl_witness_access constants.%impl_witness.5b2, element0 [template = constants.%F.df1]
// CHECK:STDOUT: %impl.elem0: %.187 = impl_witness_access constants.%impl_witness.5b2, element0 [template = constants.%F.df1]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -215,9 +217,9 @@ fn InstanceCallIndirect(p: i32*) {
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type]
// CHECK:STDOUT: %G.ref: %Simple.assoc_type = name_ref G, @Simple.%assoc1 [template = constants.%assoc1]
// CHECK:STDOUT: %impl.elem1: %G.type.b60 = impl_witness_access constants.%impl_witness.5b2, element1 [template = constants.%G.e73]
// CHECK:STDOUT: %G.bound: <bound method> = bound_method %n.ref, %impl.elem1
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.bound(%n.ref)
// CHECK:STDOUT: %impl.elem1: %.b73 = impl_witness_access constants.%impl_witness.5b2, element1 [template = constants.%G.e73]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %n.ref, %impl.elem1
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %bound_method(%n.ref)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -227,7 +229,7 @@ fn InstanceCallIndirect(p: i32*) {
// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type]
// CHECK:STDOUT: %F.ref: %Simple.assoc_type = name_ref F, @Simple.%assoc0 [template = constants.%assoc0.9ca]
// CHECK:STDOUT: %.loc30: ref %i32 = deref %p.ref
// CHECK:STDOUT: %impl.elem0: %F.type.e2e = impl_witness_access constants.%impl_witness.5b2, element0 [template = constants.%F.df1]
// CHECK:STDOUT: %impl.elem0: %.187 = impl_witness_access constants.%impl_witness.5b2, element0 [template = constants.%F.df1]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -238,10 +240,10 @@ fn InstanceCallIndirect(p: i32*) {
// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type]
// CHECK:STDOUT: %G.ref: %Simple.assoc_type = name_ref G, @Simple.%assoc1 [template = constants.%assoc1]
// CHECK:STDOUT: %.loc34_4.1: ref %i32 = deref %p.ref
// CHECK:STDOUT: %impl.elem1: %G.type.b60 = impl_witness_access constants.%impl_witness.5b2, element1 [template = constants.%G.e73]
// CHECK:STDOUT: %G.bound: <bound method> = bound_method %.loc34_4.1, %impl.elem1
// CHECK:STDOUT: %impl.elem1: %.b73 = impl_witness_access constants.%impl_witness.5b2, element1 [template = constants.%G.e73]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc34_4.1, %impl.elem1
// CHECK:STDOUT: %.loc34_4.2: %i32 = bind_value %.loc34_4.1
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.bound(%.loc34_4.2)
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %bound_method(%.loc34_4.2)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
+3 -2
View File
@@ -42,6 +42,7 @@ fn G(c: C) {
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %.626: type = fn_type_with_self_type %F.type.b7b, %HasF.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -117,11 +118,11 @@ fn G(c: C) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc22: %F.type.b7b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.ad8]
// CHECK:STDOUT: %impl.elem0.loc22: %.626 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.ad8]
// CHECK:STDOUT: %F.call.loc22: init %empty_tuple.type = call %impl.elem0.loc22()
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
// CHECK:STDOUT: %F.ref.loc23: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc23: %F.type.b7b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.ad8]
// CHECK:STDOUT: %impl.elem0.loc23: %.626 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.ad8]
// CHECK:STDOUT: %F.call.loc23: init %empty_tuple.type = call %impl.elem0.loc23()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+12 -8
View File
@@ -75,21 +75,25 @@ class X(U:! type) {
// CHECK:STDOUT: %impl_witness.9bf: <witness> = impl_witness (@impl.1.%F.decl) [template]
// CHECK:STDOUT: %F.type.94c: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.901: %F.type.94c = struct_value () [template]
// CHECK:STDOUT: %HasF.facet: %HasF.type.901 = facet_value %C, %impl_witness.9bf [symbolic]
// CHECK:STDOUT: %HasF.facet: %HasF.type.b18 = facet_value %C, %impl_witness.9bf [template]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %struct_type.x.c96: type = struct_type {.x: Core.IntLiteral} [template]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.2(%int_32) [template]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.2(%int_32) [template]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
// CHECK:STDOUT: %Param.val: %Param = struct_value (%int_2.ef8) [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %.da8: type = fn_type_with_self_type %F.type.7f1, %HasF.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -215,10 +219,10 @@ class X(U:! type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
// CHECK:STDOUT: %.loc15_21.1: %struct_type.x.c96 = struct_literal (%int_2)
// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc15_21.2: init %i32 = converted %int_2, %int.convert_checked [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc15_21.3: ref %i32 = class_element_access %return, element0
// CHECK:STDOUT: %.loc15_21.4: init %i32 = initialize_from %.loc15_21.2 to %.loc15_21.3 [template = constants.%int_2.ef8]
@@ -235,7 +239,7 @@ class X(U:! type) {
// CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %.loc21_17: %HasF.assoc_type.dc4 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [template = constants.%assoc0.a6b]
// CHECK:STDOUT: %F.ref.loc21: %HasF.assoc_type.dc4 = name_ref F, %.loc21_17 [template = constants.%assoc0.a6b]
// CHECK:STDOUT: %impl.elem0.loc21: %F.type.7f1 = impl_witness_access constants.%impl_witness.9bf, element0 [template = constants.%F.901]
// CHECK:STDOUT: %impl.elem0.loc21: %.da8 = impl_witness_access constants.%impl_witness.9bf, element0 [template = constants.%F.901]
// CHECK:STDOUT: %.loc21_20.1: ref %Param = temporary_storage
// CHECK:STDOUT: %F.call.loc21: init %Param = call %impl.elem0.loc21() to %.loc21_20.1
// CHECK:STDOUT: %.loc21_20.2: ref %Param = temporary %.loc21_20.1, %F.call.loc21
@@ -254,7 +258,7 @@ class X(U:! type) {
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
// CHECK:STDOUT: %.loc22_17: %HasF.assoc_type.dc4 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [template = constants.%assoc0.a6b]
// CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type.dc4 = name_ref F, %.loc22_17 [template = constants.%assoc0.a6b]
// CHECK:STDOUT: %impl.elem0.loc22: %F.type.7f1 = impl_witness_access constants.%impl_witness.9bf, element0 [template = constants.%F.901]
// CHECK:STDOUT: %impl.elem0.loc22: %.da8 = impl_witness_access constants.%impl_witness.9bf, element0 [template = constants.%F.901]
// CHECK:STDOUT: %.loc22_20.1: ref %Param = temporary_storage
// CHECK:STDOUT: %F.call.loc22: init %Param = call %impl.elem0.loc22() to %.loc22_20.1
// CHECK:STDOUT: %.loc22_20.2: ref %Param = temporary %.loc22_20.1, %F.call.loc22
@@ -326,7 +330,7 @@ class X(U:! type) {
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl), @impl(%U) [symbolic]
// CHECK:STDOUT: %F.type.e88: type = fn_type @F.2, @impl(%U) [symbolic]
// CHECK:STDOUT: %F.b02: %F.type.e88 = struct_value () [symbolic]
// CHECK:STDOUT: %I.facet: %I.type.325e65.1 = facet_value %X, %impl_witness [symbolic]
// CHECK:STDOUT: %I.facet: %I.type.325e65.2 = facet_value %X, %impl_witness [symbolic]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
// CHECK:STDOUT: %require_complete.441: <witness> = require_complete_type %X [symbolic]
+2 -2
View File
@@ -42,6 +42,7 @@ fn InstanceCall(n: i32) {
// CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, %impl_witness.85b [template]
// CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [template]
// CHECK:STDOUT: %InstanceCall: %InstanceCall.type = struct_value () [template]
// CHECK:STDOUT: %.eac: type = fn_type_with_self_type %G.type.b60, %Simple.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -130,8 +131,7 @@ fn InstanceCall(n: i32) {
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
// CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%Simple.type]
// CHECK:STDOUT: %G.ref: %Simple.assoc_type = name_ref G, @Simple.%assoc0 [template = constants.%assoc0.45f]
// CHECK:STDOUT: %impl.elem0: %G.type.b60 = impl_witness_access constants.%impl_witness.85b, element0 [template = <error>]
// CHECK:STDOUT: %G.bound: <bound method> = bound_method %n.ref, %impl.elem0
// CHECK:STDOUT: %impl.elem0: %.eac = impl_witness_access constants.%impl_witness.85b, element0 [template = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -468,10 +468,13 @@ impl () as I where .N = 2 {
// CHECK:STDOUT: %I.facet.1f7: %I.type = facet_value %.Self.as_type, %.Self.as_wit [symbolic]
// CHECK:STDOUT: %impl.elem0: %i32 = impl_witness_access %.Self.as_wit, element0 [symbolic]
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
@@ -518,10 +521,10 @@ impl () as I where .N = 2 {
// CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit]
// CHECK:STDOUT: %impl.elem0.loc15_20: %i32 = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
// CHECK:STDOUT: %impl.elem0.loc15_25: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2, %impl.elem0.loc15_25 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0.loc15_25: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2, %impl.elem0.loc15_25 [template = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc15_25.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc15_25.2: %i32 = converted %int_2, %.loc15_25.1 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc15_14: type = where_expr %.Self [template = constants.%I_where.type] {
+3 -2
View File
@@ -44,6 +44,7 @@ fn G(c: C) {
// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %impl_witness [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %.447: type = fn_type_with_self_type %F.type.b7b, %HasF.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -122,11 +123,11 @@ fn G(c: C) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %G.ref.loc24: %HasF.assoc_type = name_ref G, @C.%G [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc24: %F.type.b7b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.dc7]
// CHECK:STDOUT: %impl.elem0.loc24: %.447 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.dc7]
// CHECK:STDOUT: %F.call.loc24: init %empty_tuple.type = call %impl.elem0.loc24()
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
// CHECK:STDOUT: %G.ref.loc25: %HasF.assoc_type = name_ref G, @C.%G [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc25: %F.type.b7b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.dc7]
// CHECK:STDOUT: %impl.elem0.loc25: %.447 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.dc7]
// CHECK:STDOUT: %F.call.loc25: init %empty_tuple.type = call %impl.elem0.loc25()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -53,10 +53,12 @@ impl C as I {
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [template]
// CHECK:STDOUT: %I.facet.b45: %I.type = facet_value %C, %impl_witness.85b [template]
// CHECK:STDOUT: %.575: type = fn_type_with_self_type %F.type.cf0, %I.facet.b45 [template]
// CHECK:STDOUT: %impl_witness.054: <witness> = impl_witness (@impl.2.%F.decl) [template]
// CHECK:STDOUT: %F.type.5d6: type = fn_type @F.3 [template]
// CHECK:STDOUT: %F.a2e: %F.type.5d6 = struct_value () [template]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness.054 [template]
// CHECK:STDOUT: %I.facet.4ac: %I.type = facet_value %C, %impl_witness.054 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -136,7 +138,7 @@ impl C as I {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %F.type.cf0 = impl_witness_access constants.%impl_witness.85b, element0 [template = <error>]
// CHECK:STDOUT: %impl.elem0: %.575 = impl_witness_access constants.%impl_witness.85b, element0 [template = <error>]
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -147,5 +149,5 @@ impl C as I {
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%Self) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%I.facet) {}
// CHECK:STDOUT: specific @F.1(constants.%I.facet.4ac) {}
// CHECK:STDOUT:
+30 -22
View File
@@ -137,13 +137,15 @@ fn G(x: A) {
// CHECK:STDOUT: %impl_witness.d55: <witness> = impl_witness (@impl.%F.decl), @impl(%T) [symbolic]
// CHECK:STDOUT: %F.type.3fd: type = fn_type @F.2, @impl(%T) [symbolic]
// CHECK:STDOUT: %F.c98: %F.type.3fd = struct_value () [symbolic]
// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %impl_witness.d55 [symbolic]
// CHECK:STDOUT: %HasF.facet.6fc: %HasF.type = facet_value %T, %impl_witness.d55 [symbolic]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %impl_witness.d9b: <witness> = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.type.2e4: type = fn_type @F.2, @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.f13: %F.type.2e4 = struct_value () [template]
// CHECK:STDOUT: %HasF.facet.18f: %HasF.type = facet_value %empty_struct_type, %impl_witness.d9b [template]
// CHECK:STDOUT: %.658: type = fn_type_with_self_type %F.type.b7b, %HasF.facet.18f [template]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.f13, @F.2(%empty_struct_type) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -232,9 +234,9 @@ fn G(x: A) {
// CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x
// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
// CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %F.type.b7b = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%F.f13]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
// CHECK:STDOUT: %impl.elem0: %.658 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%F.f13]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -254,7 +256,7 @@ fn G(x: A) {
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.2(constants.%T) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {}
// CHECK:STDOUT: specific @F.1(constants.%HasF.facet.6fc) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @impl(constants.%empty_struct_type) {
// CHECK:STDOUT: %T.loc8_14.2 => constants.%empty_struct_type
@@ -285,7 +287,7 @@ fn G(x: A) {
// CHECK:STDOUT: %impl_witness.d55: <witness> = impl_witness (@impl.%F.decl), @impl(%T) [symbolic]
// CHECK:STDOUT: %F.type.3fd: type = fn_type @F.2, @impl(%T) [symbolic]
// CHECK:STDOUT: %F.c98: %F.type.3fd = struct_value () [symbolic]
// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %T, %impl_witness.d55 [symbolic]
// CHECK:STDOUT: %HasF.facet.6fc: %HasF.type = facet_value %T, %impl_witness.d55 [symbolic]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
@@ -293,6 +295,8 @@ fn G(x: A) {
// CHECK:STDOUT: %impl_witness.d9b: <witness> = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.type.2e4: type = fn_type @F.2, @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.f13: %F.type.2e4 = struct_value () [template]
// CHECK:STDOUT: %HasF.facet.18f: %HasF.type = facet_value %empty_struct_type, %impl_witness.d9b [template]
// CHECK:STDOUT: %.658: type = fn_type_with_self_type %F.type.b7b, %HasF.facet.18f [template]
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
// CHECK:STDOUT: }
@@ -425,10 +429,10 @@ fn G(x: A) {
// CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x
// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
// CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %F.type.b7b = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%F.f13]
// CHECK:STDOUT: %F.bound: <bound method> = bound_method %x.ref, %impl.elem0
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.bound, @F.2(constants.%empty_struct_type)
// CHECK:STDOUT: %F.call: init %empty_struct_type = call %F.specific_fn(%x.ref)
// CHECK:STDOUT: %impl.elem0: %.658 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%F.f13]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %x.ref, %impl.elem0
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @F.2(constants.%empty_struct_type)
// CHECK:STDOUT: %F.call: init %empty_struct_type = call %specific_fn(%x.ref)
// CHECK:STDOUT: %.loc13_21.1: ref %empty_struct_type = temporary_storage
// CHECK:STDOUT: %.loc13_21.2: ref %empty_struct_type = temporary %.loc13_21.1, %F.call
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template = constants.%empty_struct]
@@ -457,8 +461,8 @@ fn G(x: A) {
// CHECK:STDOUT: %T => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {
// CHECK:STDOUT: %Self => constants.%HasF.facet
// CHECK:STDOUT: specific @F.1(constants.%HasF.facet.6fc) {
// CHECK:STDOUT: %Self => constants.%HasF.facet.6fc
// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -499,13 +503,15 @@ fn G(x: A) {
// CHECK:STDOUT: %impl_witness.7d1: <witness> = impl_witness (@impl.%F.decl), @impl(%T) [symbolic]
// CHECK:STDOUT: %F.type.8fe: type = fn_type @F.2, @impl(%T) [symbolic]
// CHECK:STDOUT: %F.92a: %F.type.8fe = struct_value () [symbolic]
// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C.f2e, %impl_witness.7d1 [symbolic]
// CHECK:STDOUT: %HasF.facet.83b: %HasF.type = facet_value %C.f2e, %impl_witness.7d1 [symbolic]
// CHECK:STDOUT: %C.7a7: type = class_type @C, @C(%empty_struct_type) [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %impl_witness.770: <witness> = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.type.2e5: type = fn_type @F.2, @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.c77: %F.type.2e5 = struct_value () [template]
// CHECK:STDOUT: %HasF.facet.007: %HasF.type = facet_value %C.7a7, %impl_witness.770 [template]
// CHECK:STDOUT: %.4df: type = fn_type_with_self_type %F.type.b7b, %HasF.facet.007 [template]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.c77, @F.2(%empty_struct_type) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -622,9 +628,9 @@ fn G(x: A) {
// CHECK:STDOUT: %x.ref: %C.7a7 = name_ref x, %x
// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
// CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %F.type.b7b = impl_witness_access constants.%impl_witness.770, element0 [template = constants.%F.c77]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
// CHECK:STDOUT: %impl.elem0: %.4df = impl_witness_access constants.%impl_witness.770, element0 [template = constants.%F.c77]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -652,7 +658,7 @@ fn G(x: A) {
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.2(constants.%T) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {}
// CHECK:STDOUT: specific @F.1(constants.%HasF.facet.83b) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C(constants.%empty_struct_type) {
// CHECK:STDOUT: %T.loc8_9.2 => constants.%empty_struct_type
@@ -695,7 +701,7 @@ fn G(x: A) {
// CHECK:STDOUT: %impl_witness.142: <witness> = impl_witness (@impl.%F.decl), @impl(%T) [symbolic]
// CHECK:STDOUT: %F.type.6c8: type = fn_type @F.2, @impl(%T) [symbolic]
// CHECK:STDOUT: %F.008: %F.type.6c8 = struct_value () [symbolic]
// CHECK:STDOUT: %HasF.facet: %HasF.type.901 = facet_value %empty_struct_type, %impl_witness.142 [symbolic]
// CHECK:STDOUT: %HasF.facet.77c: %HasF.type.901 = facet_value %empty_struct_type, %impl_witness.142 [symbolic]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %HasF.type.072: type = facet_type <@HasF, @HasF(%empty_struct_type)> [template]
@@ -707,6 +713,8 @@ fn G(x: A) {
// CHECK:STDOUT: %impl_witness.221: <witness> = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.type.a13: type = fn_type @F.2, @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.8c6: %F.type.a13 = struct_value () [template]
// CHECK:STDOUT: %HasF.facet.075: %HasF.type.072 = facet_value %empty_struct_type, %impl_witness.221 [template]
// CHECK:STDOUT: %.a00: type = fn_type_with_self_type %F.type.b0b, %HasF.facet.075 [template]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.8c6, @F.2(%empty_struct_type) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -823,9 +831,9 @@ fn G(x: A) {
// CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%empty_struct_type)> [template = constants.%HasF.type.072]
// CHECK:STDOUT: %.loc13_14: %HasF.assoc_type.60b = specific_constant @HasF.%assoc0.loc5_9.1, @HasF(constants.%empty_struct_type) [template = constants.%assoc0.46d]
// CHECK:STDOUT: %F.ref: %HasF.assoc_type.60b = name_ref F, %.loc13_14 [template = constants.%assoc0.46d]
// CHECK:STDOUT: %impl.elem0: %F.type.b0b = impl_witness_access constants.%impl_witness.221, element0 [template = constants.%F.8c6]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
// CHECK:STDOUT: %impl.elem0: %.a00 = impl_witness_access constants.%impl_witness.221, element0 [template = constants.%F.8c6]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -864,7 +872,7 @@ fn G(x: A) {
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.2(constants.%T) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%T, constants.%HasF.facet) {}
// CHECK:STDOUT: specific @F.1(constants.%T, constants.%HasF.facet.77c) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @HasF(constants.%empty_struct_type) {
// CHECK:STDOUT: %T.loc4_16.2 => constants.%empty_struct_type
@@ -45,6 +45,7 @@ fn F(c: C) -> i32 {
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
// CHECK:STDOUT: %F.type.b25: type = fn_type @F.3 [template]
// CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [template]
// CHECK:STDOUT: %.f8b: type = fn_type_with_self_type %F.type.cf0, %I.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -158,9 +159,9 @@ fn F(c: C) -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %F.type.cf0 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3]
// CHECK:STDOUT: %F.bound: <bound method> = bound_method %c.ref, %impl.elem0
// CHECK:STDOUT: %F.call: init %i32 = call %F.bound(%c.ref)
// CHECK:STDOUT: %impl.elem0: %.f8b = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.ref, %impl.elem0
// CHECK:STDOUT: %F.call: init %i32 = call %bound_method(%c.ref)
// CHECK:STDOUT: %.loc24_15.1: %i32 = value_of_initializer %F.call
// CHECK:STDOUT: %.loc24_15.2: %i32 = converted %F.call, %.loc24_15.1
// CHECK:STDOUT: return %.loc24_15.2
@@ -67,7 +67,7 @@ fn TestSpecific(a: A({})) -> {} {
// CHECK:STDOUT: %impl_witness.ab3b51.1: <witness> = impl_witness (@impl.%F.decl), @impl(%V) [symbolic]
// CHECK:STDOUT: %F.type.0fea45.1: type = fn_type @F.2, @impl(%V) [symbolic]
// CHECK:STDOUT: %F.d6ae34.1: %F.type.0fea45.1 = struct_value () [symbolic]
// CHECK:STDOUT: %I.facet: %I.type.325e65.1 = facet_value %A.13025a.2, %impl_witness.ab3b51.1 [symbolic]
// CHECK:STDOUT: %I.facet.5b0ece.1: %I.type.325e65.2 = facet_value %A.13025a.2, %impl_witness.ab3b51.1 [symbolic]
// CHECK:STDOUT: %require_complete.4aeca8.2: <witness> = require_complete_type %V [symbolic]
// CHECK:STDOUT: %A.elem.1ceb36.2: type = unbound_element_type %A.13025a.2, %V [symbolic]
// CHECK:STDOUT: %struct_type.n.848971.2: type = struct_type {.n: %V} [symbolic]
@@ -92,6 +92,8 @@ fn TestSpecific(a: A({})) -> {} {
// CHECK:STDOUT: %impl_witness.ab3b51.2: <witness> = impl_witness (@impl.%F.decl), @impl(%W) [symbolic]
// CHECK:STDOUT: %F.type.0fea45.2: type = fn_type @F.2, @impl(%W) [symbolic]
// CHECK:STDOUT: %F.d6ae34.2: %F.type.0fea45.2 = struct_value () [symbolic]
// CHECK:STDOUT: %I.facet.5b0ece.2: %I.type.325e65.3 = facet_value %A.13025a.3, %impl_witness.ab3b51.2 [symbolic]
// CHECK:STDOUT: %.051: type = fn_type_with_self_type %F.type.2aef59.3, %I.facet.5b0ece.2 [symbolic]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %A.235: type = class_type @A, @A(%empty_struct_type) [template]
// CHECK:STDOUT: %TestSpecific.type: type = fn_type @TestSpecific [template]
@@ -109,6 +111,8 @@ fn TestSpecific(a: A({})) -> {} {
// CHECK:STDOUT: %impl_witness.f35: <witness> = impl_witness (@impl.%F.decl), @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.type.875: type = fn_type @F.2, @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.158: %F.type.875 = struct_value () [template]
// CHECK:STDOUT: %I.facet.f67: %I.type.885 = facet_value %A.235, %impl_witness.f35 [template]
// CHECK:STDOUT: %.f01: type = fn_type_with_self_type %F.type.684, %I.facet.f67 [template]
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -330,6 +334,9 @@ fn TestSpecific(a: A({})) -> {} {
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @TestGeneric.%I.type.loc17_16.2 (%I.type.325e65.3) [symbolic = %I.assoc_type (constants.%I.assoc_type.955255.3)]
// CHECK:STDOUT: %assoc0: @TestGeneric.%I.assoc_type (%I.assoc_type.955255.3) = assoc_entity element0, @I.%F.decl [symbolic = %assoc0 (constants.%assoc0.fef501.3)]
// CHECK:STDOUT: %F.type.loc17_11.1: type = fn_type @F.1, @I(%W.loc16_16.2) [symbolic = %F.type.loc17_11.1 (constants.%F.type.2aef59.3)]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl), @impl(%W.loc16_16.2) [symbolic = %impl_witness (constants.%impl_witness.ab3b51.2)]
// CHECK:STDOUT: %I.facet: @TestGeneric.%I.type.loc17_16.2 (%I.type.325e65.3) = facet_value %A.loc16_32.2, %impl_witness [symbolic = %I.facet (constants.%I.facet.5b0ece.2)]
// CHECK:STDOUT: %.loc17_11: type = fn_type_with_self_type %F.type.loc17_11.1, %I.facet [symbolic = %.loc17_11 (constants.%.051)]
// CHECK:STDOUT: %F.type.loc17_11.2: type = fn_type @F.2, @impl(%W.loc16_16.2) [symbolic = %F.type.loc17_11.2 (constants.%F.type.0fea45.2)]
// CHECK:STDOUT: %F: @TestGeneric.%F.type.loc17_11.2 (%F.type.0fea45.2) = struct_value () [symbolic = %F (constants.%F.d6ae34.2)]
// CHECK:STDOUT:
@@ -341,10 +348,10 @@ fn TestSpecific(a: A({})) -> {} {
// CHECK:STDOUT: %I.type.loc17_16.1: type = facet_type <@I, @I(constants.%W)> [symbolic = %I.type.loc17_16.2 (constants.%I.type.325e65.3)]
// CHECK:STDOUT: %.loc17_17: @TestGeneric.%I.assoc_type (%I.assoc_type.955255.3) = specific_constant @I.%assoc0.loc7_26.1, @I(constants.%W) [symbolic = %assoc0 (constants.%assoc0.fef501.3)]
// CHECK:STDOUT: %F.ref: @TestGeneric.%I.assoc_type (%I.assoc_type.955255.3) = name_ref F, %.loc17_17 [symbolic = %assoc0 (constants.%assoc0.fef501.3)]
// CHECK:STDOUT: %impl.elem0: @TestGeneric.%F.type.loc17_11.1 (%F.type.2aef59.3) = impl_witness_access constants.%impl_witness.ab3b51.2, element0 [symbolic = %F (constants.%F.d6ae34.2)]
// CHECK:STDOUT: %F.bound: <bound method> = bound_method %a.ref, %impl.elem0
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.bound, @F.2(constants.%W)
// CHECK:STDOUT: %F.call: init @TestGeneric.%W.loc16_16.2 (%W) = call %F.specific_fn(%a.ref)
// CHECK:STDOUT: %impl.elem0: @TestGeneric.%.loc17_11 (%.051) = impl_witness_access constants.%impl_witness.ab3b51.2, element0 [symbolic = %F (constants.%F.d6ae34.2)]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem0
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @F.2(constants.%W)
// CHECK:STDOUT: %F.call: init @TestGeneric.%W.loc16_16.2 (%W) = call %specific_fn(%a.ref)
// CHECK:STDOUT: %.loc17_22.1: @TestGeneric.%W.loc16_16.2 (%W) = value_of_initializer %F.call
// CHECK:STDOUT: %.loc17_22.2: @TestGeneric.%W.loc16_16.2 (%W) = converted %F.call, %.loc17_22.1
// CHECK:STDOUT: return %.loc17_22.2
@@ -360,10 +367,10 @@ fn TestSpecific(a: A({})) -> {} {
// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%empty_struct_type)> [template = constants.%I.type.885]
// CHECK:STDOUT: %.loc21_18: %I.assoc_type.67f = specific_constant @I.%assoc0.loc7_26.1, @I(constants.%empty_struct_type) [template = constants.%assoc0.639]
// CHECK:STDOUT: %F.ref: %I.assoc_type.67f = name_ref F, %.loc21_18 [template = constants.%assoc0.639]
// CHECK:STDOUT: %impl.elem0: %F.type.684 = impl_witness_access constants.%impl_witness.f35, element0 [template = constants.%F.158]
// CHECK:STDOUT: %F.bound: <bound method> = bound_method %a.ref, %impl.elem0
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.bound, @F.2(constants.%empty_struct_type)
// CHECK:STDOUT: %F.call: init %empty_struct_type = call %F.specific_fn(%a.ref)
// CHECK:STDOUT: %impl.elem0: %.f01 = impl_witness_access constants.%impl_witness.f35, element0 [template = constants.%F.158]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem0
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @F.2(constants.%empty_struct_type)
// CHECK:STDOUT: %F.call: init %empty_struct_type = call %specific_fn(%a.ref)
// CHECK:STDOUT: %.loc21_22.1: ref %empty_struct_type = temporary_storage
// CHECK:STDOUT: %.loc21_22.2: ref %empty_struct_type = temporary %.loc21_22.1, %F.call
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template = constants.%empty_struct]
@@ -445,10 +452,10 @@ fn TestSpecific(a: A({})) -> {} {
// CHECK:STDOUT:
// CHECK:STDOUT: specific @A(@F.2.%V) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%V, constants.%I.facet) {
// CHECK:STDOUT: specific @F.1(constants.%V, constants.%I.facet.5b0ece.1) {
// CHECK:STDOUT: %U => constants.%V
// CHECK:STDOUT: %I.type => constants.%I.type.325e65.2
// CHECK:STDOUT: %Self => constants.%I.facet
// CHECK:STDOUT: %Self => constants.%I.facet.5b0ece.1
// CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%A.13025a.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
+46 -19
View File
@@ -306,6 +306,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageA.import_ref.28c = import_ref PackageA//default, inst15 [no loc], unloaded
// CHECK:STDOUT: %PackageA.import_ref.a2a = import_ref PackageA//default, loc5_9, unloaded
// CHECK:STDOUT: %PackageA.F: %F.type.dbc = import_ref PackageA//default, F, loaded [template = constants.%F.a2b]
// CHECK:STDOUT: %PackageA.import_ref.e73: %HasF.type = import_ref PackageA//default, inst15 [no loc], loaded [symbolic = constants.%Self.cf3]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -402,7 +403,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%Self.cf3: %HasF.type) [from "package_a.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%PackageA.import_ref.e73: %HasF.type) [from "package_a.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -441,6 +442,8 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, imports.%PackageA.import_ref.ab2 [template]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%PackageA.import_ref.148) [template]
// CHECK:STDOUT: %F.type.dbc: type = fn_type @F.1 [template]
// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %impl_witness [template]
// CHECK:STDOUT: %.e6d: type = fn_type_with_self_type %F.type.dbc, %HasF.facet [template]
// CHECK:STDOUT: %F.type.4e3: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.857: %F.type.4e3 = struct_value () [template]
// CHECK:STDOUT: }
@@ -461,6 +464,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageA.import_ref.a71: <witness> = import_ref PackageA//default, loc11_16, loaded [template = constants.%impl_witness]
// CHECK:STDOUT: %PackageA.import_ref.29a: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C]
// CHECK:STDOUT: %PackageA.import_ref.e8c: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type]
// CHECK:STDOUT: %PackageA.import_ref.e73: %HasF.type = import_ref PackageA//default, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -507,12 +511,12 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageA.ref.loc7: <namespace> = name_ref PackageA, imports.%PackageA [template = imports.%PackageA]
// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%PackageA.HasF [template = constants.%HasF.type]
// CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, imports.%PackageA.import_ref.566 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %F.type.dbc = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.857]
// CHECK:STDOUT: %impl.elem0: %.e6d = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.857]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%Self: %HasF.type) [from "package_a.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%PackageA.import_ref.e73: %HasF.type) [from "package_a.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -537,6 +541,8 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [template]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%PackageB.import_ref.0cd) [template]
// CHECK:STDOUT: %F.type.dbc: type = fn_type @F.1 [template]
// CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %D, %impl_witness [template]
// CHECK:STDOUT: %.205: type = fn_type_with_self_type %F.type.dbc, %HasF.facet [template]
// CHECK:STDOUT: %F.type.394: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.1fc: %F.type.394 = struct_value () [template]
// CHECK:STDOUT: }
@@ -574,6 +580,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageB.import_ref.231 = import_ref PackageB//default, loc23_16, unloaded
// CHECK:STDOUT: %PackageB.import_ref.aa9f8a.2: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D]
// CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type]
// CHECK:STDOUT: %PackageA.import_ref.e73: %HasF.type = import_ref PackageA//default, inst15 [no loc], loaded [symbolic = constants.%Self.cf3]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -651,12 +658,12 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [template = imports.%PackageA]
// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%PackageA.HasF [template = constants.%HasF.type]
// CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, imports.%PackageA.import_ref.566 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %F.type.dbc = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.1fc]
// CHECK:STDOUT: %impl.elem0: %.205 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.1fc]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%Self.cf3: %HasF.type) [from "package_a.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%PackageA.import_ref.e73: %HasF.type) [from "package_a.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -681,6 +688,8 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %D: type = class_type @D [template]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%PackageB.import_ref.9ec) [template]
// CHECK:STDOUT: %G.type.d9e: type = fn_type @G.1 [template]
// CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %C, %impl_witness [template]
// CHECK:STDOUT: %.25a: type = fn_type_with_self_type %G.type.d9e, %HasG.facet [template]
// CHECK:STDOUT: %G.type.18e: type = fn_type @G.2 [template]
// CHECK:STDOUT: %G.dbb: %G.type.18e = struct_value () [template]
// CHECK:STDOUT: }
@@ -718,6 +727,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageB.import_ref.231 = import_ref PackageB//default, loc23_16, unloaded
// CHECK:STDOUT: %PackageB.import_ref.aa9f8a.2: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D]
// CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type]
// CHECK:STDOUT: %PackageB.import_ref.ef5: %HasG.type = import_ref PackageB//default, inst17 [no loc], loaded [symbolic = constants.%Self.fcb]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -795,12 +805,12 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageB.ref: <namespace> = name_ref PackageB, imports.%PackageB [template = imports.%PackageB]
// CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%PackageB.HasG [template = constants.%HasG.type]
// CHECK:STDOUT: %G.ref: %HasG.assoc_type = name_ref G, imports.%PackageB.import_ref.604 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %G.type.d9e = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.dbb]
// CHECK:STDOUT: %impl.elem0: %.25a = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.dbb]
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @G.1(constants.%Self.fcb: %HasG.type) [from "package_b.carbon"] {
// CHECK:STDOUT: generic fn @G.1(imports.%PackageB.import_ref.ef5: %HasG.type) [from "package_b.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -825,6 +835,8 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%PackageB.import_ref.b0a) [template]
// CHECK:STDOUT: %G.type.d9e: type = fn_type @G.1 [template]
// CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %D, %impl_witness [template]
// CHECK:STDOUT: %.b8e: type = fn_type_with_self_type %G.type.d9e, %HasG.facet [template]
// CHECK:STDOUT: %G.type.405: type = fn_type @G.2 [template]
// CHECK:STDOUT: %G.703: %G.type.405 = struct_value () [template]
// CHECK:STDOUT: }
@@ -856,6 +868,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageB.import_ref.240: <witness> = import_ref PackageB//default, loc23_16, loaded [template = constants.%impl_witness]
// CHECK:STDOUT: %PackageB.import_ref.aa9f8a.2: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D]
// CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type]
// CHECK:STDOUT: %PackageB.import_ref.ef5: %HasG.type = import_ref PackageB//default, inst17 [no loc], loaded [symbolic = constants.%Self.fcb]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -926,12 +939,12 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageB.ref.loc7: <namespace> = name_ref PackageB, imports.%PackageB [template = imports.%PackageB]
// CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%PackageB.HasG [template = constants.%HasG.type]
// CHECK:STDOUT: %G.ref: %HasG.assoc_type = name_ref G, imports.%PackageB.import_ref.604 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %G.type.d9e = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.703]
// CHECK:STDOUT: %impl.elem0: %.b8e = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.703]
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @G.1(constants.%Self.fcb: %HasG.type) [from "package_b.carbon"] {
// CHECK:STDOUT: generic fn @G.1(imports.%PackageB.import_ref.ef5: %HasG.type) [from "package_b.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1012,6 +1025,8 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, imports.%PackageAssociatedInterface.import_ref.250 [template]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%PackageAssociatedInterface.import_ref.6d7) [template]
// CHECK:STDOUT: %H.type.386: type = fn_type @H.1 [template]
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, %impl_witness [template]
// CHECK:STDOUT: %.a8b: type = fn_type_with_self_type %H.type.386, %Z.facet [template]
// CHECK:STDOUT: %H.type.ab3: type = fn_type @H.2 [template]
// CHECK:STDOUT: %H.c25: %H.type.ab3 = struct_value () [template]
// CHECK:STDOUT: }
@@ -1028,6 +1043,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.998: <witness> = import_ref PackageAssociatedInterface//default, loc8_14, loaded [template = constants.%impl_witness]
// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.e5c: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [template = constants.%empty_tuple.type]
// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.df1: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [template = constants.%Z.type]
// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.d26: %Z.type = import_ref PackageAssociatedInterface//default, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1057,12 +1073,12 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageAssociatedInterface.ref: <namespace> = name_ref PackageAssociatedInterface, imports.%PackageAssociatedInterface [template = imports.%PackageAssociatedInterface]
// CHECK:STDOUT: %Z.ref: type = name_ref Z, imports.%PackageAssociatedInterface.Z [template = constants.%Z.type]
// CHECK:STDOUT: %H.ref: %Z.assoc_type = name_ref H, imports.%PackageAssociatedInterface.import_ref.ddc [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %H.type.386 = impl_witness_access constants.%impl_witness, element0 [template = constants.%H.c25]
// CHECK:STDOUT: %impl.elem0: %.a8b = impl_witness_access constants.%impl_witness, element0 [template = constants.%H.c25]
// CHECK:STDOUT: %H.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @H.1(constants.%Self: %Z.type) [from "associated_interface.carbon"] {
// CHECK:STDOUT: generic fn @H.1(imports.%PackageAssociatedInterface.import_ref.d26: %Z.type) [from "associated_interface.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1188,6 +1204,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %AnyParam.val: %AnyParam.241 = struct_value () [template]
// CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type %Y.type [template]
// CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [template]
// CHECK:STDOUT: %.572: type = fn_type_with_self_type %K.type.311, %Y.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -1197,12 +1214,15 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: import PackageHasParam//default
// CHECK:STDOUT: }
// CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [template = constants.%AnyParam.generic]
// CHECK:STDOUT: %PackageHasParam.import_ref.f6b: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
// CHECK:STDOUT: %PackageHasParam.import_ref.e96: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
// CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst34 [no loc], unloaded
// CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type]
// CHECK:STDOUT: %PackageHasParam.import_ref.dc1 = import_ref PackageHasParam//default, inst40 [no loc], unloaded
// CHECK:STDOUT: %PackageHasParam.import_ref.5e7: %Y.assoc_type = import_ref PackageHasParam//default, loc7_10, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %PackageHasParam.K: %K.type.311 = import_ref PackageHasParam//default, K, loaded [template = constants.%K.7a1]
// CHECK:STDOUT: %PackageHasParam.import_ref.292: %Y.type = import_ref PackageHasParam//default, inst40 [no loc], loaded [symbolic = constants.%Self.f64]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1263,7 +1283,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: witness = file.%impl_witness
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @AnyParam(constants.%T: type, constants.%X: %T) [from "has_param.carbon"] {
// CHECK:STDOUT: generic class @AnyParam(imports.%PackageHasParam.import_ref.f6b: type, imports.%PackageHasParam.import_ref.e96: @AnyParam.%T (%T)) [from "has_param.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
@@ -1279,7 +1299,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @K.1(constants.%Self.f64: %Y.type) [from "has_param.carbon"] {
// CHECK:STDOUT: generic fn @K.1(imports.%PackageHasParam.import_ref.292: %Y.type) [from "has_param.carbon"] {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
@@ -1312,7 +1332,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageHasParam.ref.loc14: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam]
// CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [template = constants.%Y.type]
// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.5e7 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %K.type.311 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.2e9]
// CHECK:STDOUT: %impl.elem0: %.572 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.2e9]
// CHECK:STDOUT: %K.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -1372,6 +1392,8 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [template]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%PackageGenericInterface.import_ref.456) [template]
// CHECK:STDOUT: %K.type.311: type = fn_type @K.1 [template]
// CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.861, %impl_witness [template]
// CHECK:STDOUT: %.0fb: type = fn_type_with_self_type %K.type.311, %Y.facet [template]
// CHECK:STDOUT: %K.type.7f9: type = fn_type @K.2 [template]
// CHECK:STDOUT: %K.c3c: %K.type.7f9 = struct_value () [template]
// CHECK:STDOUT: }
@@ -1387,9 +1409,12 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: import PackageGenericInterface//default
// CHECK:STDOUT: }
// CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [template = constants.%AnyParam.generic]
// CHECK:STDOUT: %PackageHasParam.import_ref.f6b: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
// CHECK:STDOUT: %PackageHasParam.import_ref.e96: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
// CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst34 [no loc], unloaded
// CHECK:STDOUT: %PackageGenericInterface.GenericInterface: %GenericInterface.type.0da = import_ref PackageGenericInterface//default, GenericInterface, loaded [template = constants.%GenericInterface.generic]
// CHECK:STDOUT: %PackageGenericInterface.import_ref.86d: type = import_ref PackageGenericInterface//default, loc6_28, loaded [symbolic = @GenericInterface.%U (constants.%U)]
// CHECK:STDOUT: %PackageGenericInterface.import_ref.c3b = import_ref PackageGenericInterface//default, inst28 [no loc], unloaded
// CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type]
// CHECK:STDOUT: %PackageHasParam.import_ref.dc1 = import_ref PackageHasParam//default, inst40 [no loc], unloaded
@@ -1398,6 +1423,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageGenericInterface.import_ref.ca8: <witness> = import_ref PackageGenericInterface//default, loc8_70, loaded [template = constants.%impl_witness]
// CHECK:STDOUT: %PackageGenericInterface.import_ref.321: type = import_ref PackageGenericInterface//default, loc8_47, loaded [template = constants.%AnyParam.861]
// CHECK:STDOUT: %PackageGenericInterface.import_ref.ca6: type = import_ref PackageGenericInterface//default, loc8_67, loaded [template = constants.%Y.type]
// CHECK:STDOUT: %PackageHasParam.import_ref.292: %Y.type = import_ref PackageHasParam//default, inst40 [no loc], loaded [symbolic = constants.%Self.f64]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1411,7 +1437,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %M.decl: %M.type = fn_decl @M [template = constants.%M] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @GenericInterface(constants.%U: type) [from "has_generic_interface.carbon"] {
// CHECK:STDOUT: generic interface @GenericInterface(imports.%PackageGenericInterface.import_ref.86d: type) [from "has_generic_interface.carbon"] {
// CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt (constants.%U.patt)]
// CHECK:STDOUT:
@@ -1438,7 +1464,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: witness = imports.%PackageGenericInterface.import_ref.ca8
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @AnyParam(constants.%T: type, constants.%X: %T) [from "has_param.carbon"] {
// CHECK:STDOUT: generic class @AnyParam(imports.%PackageHasParam.import_ref.f6b: type, imports.%PackageHasParam.import_ref.e96: @AnyParam.%T (%T)) [from "has_param.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
@@ -1477,12 +1503,12 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageHasParam.ref.loc10: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam]
// CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [template = constants.%Y.type]
// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.5e7 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %K.type.311 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.c3c]
// CHECK:STDOUT: %impl.elem0: %.0fb = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.c3c]
// CHECK:STDOUT: %K.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @K.1(constants.%Self.f64: %Y.type) [from "has_param.carbon"] {
// CHECK:STDOUT: generic fn @K.1(imports.%PackageHasParam.import_ref.292: %Y.type) [from "has_param.carbon"] {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
@@ -1758,6 +1784,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: import HasExtraInterfaces//default
// CHECK:STDOUT: }
// CHECK:STDOUT: %HasExtraInterfaces.C: %C.type = import_ref HasExtraInterfaces//default, C, loaded [template = constants.%C.generic]
// CHECK:STDOUT: %HasExtraInterfaces.import_ref.f6b: type = import_ref HasExtraInterfaces//default, loc13_9, loaded [symbolic = @C.%T (constants.%T)]
// CHECK:STDOUT: %HasExtraInterfaces.import_ref.8f2: <witness> = import_ref HasExtraInterfaces//default, loc13_20, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %HasExtraInterfaces.import_ref.4c0 = import_ref HasExtraInterfaces//default, inst57 [no loc], unloaded
// CHECK:STDOUT: %HasExtraInterfaces.I: type = import_ref HasExtraInterfaces//default, I, loaded [template = constants.%I.type]
@@ -1857,7 +1884,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: witness = imports.%HasExtraInterfaces.import_ref.1c8
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(constants.%T: type) [from "has_extra_interfaces.carbon"] {
// CHECK:STDOUT: generic class @C(imports.%HasExtraInterfaces.import_ref.f6b: type) [from "has_extra_interfaces.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -185,7 +185,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template]
// CHECK:STDOUT: %F.type.b63: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.d5f: %F.type.b63 = struct_value () [template]
// CHECK:STDOUT: %I.facet: %I.type.325 = facet_value %X, %impl_witness [symbolic]
// CHECK:STDOUT: %I.facet: %I.type.e45 = facet_value %X, %impl_witness [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -194,9 +194,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X]
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.cbe = import_ref Main//types, loc4_31, unloaded
// CHECK:STDOUT: %Main.F: @I.%F.type (%F.type.2ae) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.bb2)]
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.479 = import_ref Main//types, loc4_31, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -218,7 +221,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template = constants.%impl_witness]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @I(constants.%T: type) [from "types.carbon"] {
// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -261,7 +264,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: .Self = imports.%Main.import_ref.acf
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self: %I.type.325) [from "types.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -321,6 +324,8 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %assoc0.0fc: %I.assoc_type.9f3 = assoc_entity element0, imports.%Main.import_ref.e54 [template]
// CHECK:STDOUT: %assoc0.249: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.479 [symbolic]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.7f5) [template]
// CHECK:STDOUT: %I.facet: %I.type.e45 = facet_value %X, %impl_witness [template]
// CHECK:STDOUT: %.e37: type = fn_type_with_self_type %F.type.14f, %I.facet [template]
// CHECK:STDOUT: %F.type.b63: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.d5f: %F.type.b63 = struct_value () [template]
// CHECK:STDOUT: }
@@ -332,9 +337,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %Main.InInterfaceArgs: type = import_ref Main//impl_in_interface_args, InInterfaceArgs, loaded [template = constants.%InInterfaceArgs]
// CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.cd3: @I.%I.assoc_type (%I.assoc_type.955) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%assoc0 (constants.%assoc0.249)]
// CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.e54: @I.%F.type (%F.type.2ae) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%F (constants.%F.bb2)]
// CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//impl_in_interface_args, loc5_24, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.bf8 = import_ref Main//impl_in_interface_args, inst18 [no loc], unloaded
@@ -362,7 +370,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @I(constants.%T: type) [from "types.carbon"] {
// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -409,12 +417,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%InInterfaceArgs)> [template = constants.%I.type.e45]
// CHECK:STDOUT: %.loc6: %I.assoc_type.9f3 = specific_constant imports.%Main.import_ref.cd3, @I(constants.%InInterfaceArgs) [template = constants.%assoc0.0fc]
// CHECK:STDOUT: %F.ref: %I.assoc_type.9f3 = name_ref F, %.loc6 [template = constants.%assoc0.0fc]
// CHECK:STDOUT: %impl.elem0: %F.type.14f = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.d5f]
// CHECK:STDOUT: %impl.elem0: %.e37 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.d5f]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self: %I.type.325) [from "types.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -470,18 +478,22 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template]
// CHECK:STDOUT: %F.type.fab: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.7ab: %F.type.fab = struct_value () [template]
// CHECK:STDOUT: %I.facet: %I.type.325 = facet_value %C.23b, %impl_witness [symbolic]
// CHECK:STDOUT: %I.facet: %I.type.45c = facet_value %C.23b, %impl_witness [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Main.I: %I.type.dac = import_ref Main//types, I, loaded [template = constants.%I.generic]
// CHECK:STDOUT: %Main.C: %C.type = import_ref Main//types, C, loaded [template = constants.%C.generic]
// CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X]
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc5_9, loaded [symbolic = @C.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//types, loc5_20, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//types, inst49 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.cbe = import_ref Main//types, loc4_31, unloaded
// CHECK:STDOUT: %Main.F: @I.%F.type (%F.type.2ae) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.bb2)]
// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.479 = import_ref Main//types, loc4_31, unloaded
// CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded
@@ -507,7 +519,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template = constants.%impl_witness]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @I(constants.%T: type) [from "types.carbon"] {
// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.2: type) [from "types.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -543,7 +555,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: .Self = constants.%InClassArgs
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(constants.%T: type) [from "types.carbon"] {
// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -564,7 +576,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: .Self = imports.%Main.import_ref.acf
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self: %I.type.325) [from "types.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.3: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -637,6 +649,8 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %assoc0.ba0: %I.assoc_type.a7e = assoc_entity element0, imports.%Main.import_ref.e54 [template]
// CHECK:STDOUT: %assoc0.249: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.479 [symbolic]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.ae4) [template]
// CHECK:STDOUT: %I.facet: %I.type.45c = facet_value %C.23b, %impl_witness [template]
// CHECK:STDOUT: %.c87: type = fn_type_with_self_type %F.type.56a, %I.facet [template]
// CHECK:STDOUT: %F.type.fab: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.7ab: %F.type.fab = struct_value () [template]
// CHECK:STDOUT: }
@@ -646,13 +660,17 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %Main.C: %C.type = import_ref Main//types, C, loaded [template = constants.%C.generic]
// CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X]
// CHECK:STDOUT: %Main.InClassArgs: type = import_ref Main//impl_in_class_args, InClassArgs, loaded [template = constants.%InClassArgs]
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc5_9, loaded [symbolic = @C.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//types, loc5_20, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//types, inst49 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//impl_in_class_args, loc5_20, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.683 = import_ref Main//impl_in_class_args, inst18 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.cd3: @I.%I.assoc_type (%I.assoc_type.955) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%assoc0 (constants.%assoc0.249)]
// CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.e54: @I.%F.type (%F.type.2ae) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%F (constants.%F.bb2)]
// CHECK:STDOUT: %Main.import_ref.8f24d3.3: <witness> = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded
@@ -684,7 +702,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @I(constants.%T: type) [from "types.carbon"] {
// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.2: type) [from "types.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -709,7 +727,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: witness = imports.%Main.import_ref.6de
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(constants.%T: type) [from "types.carbon"] {
// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -745,12 +763,12 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%X)> [template = constants.%I.type.45c]
// CHECK:STDOUT: %.loc6_34: %I.assoc_type.a7e = specific_constant imports.%Main.import_ref.cd3, @I(constants.%X) [template = constants.%assoc0.ba0]
// CHECK:STDOUT: %F.ref: %I.assoc_type.a7e = name_ref F, %.loc6_34 [template = constants.%assoc0.ba0]
// CHECK:STDOUT: %impl.elem0: %F.type.56a = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.7ab]
// CHECK:STDOUT: %impl.elem0: %.c87 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.7ab]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self: %I.type.325) [from "types.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.3: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
+7 -3
View File
@@ -112,6 +112,7 @@ fn Call() {
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//i, inst17 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.1e0 = import_ref Main//i, loc4_21, unloaded
// CHECK:STDOUT: %Main.F: %F.type.cf0 = import_ref Main//i, F, loaded [template = constants.%F.bc6]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//i, inst17 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -153,7 +154,7 @@ fn Call() {
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%Self: %I.type) [from "i.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.5dd: %I.type) [from "i.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -230,6 +231,8 @@ fn Call() {
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.e03 [template]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.742) [template]
// CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [template]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [template]
// CHECK:STDOUT: %.076: type = fn_type_with_self_type %F.type.cf0, %I.facet [template]
// CHECK:STDOUT: %F.type.5d6: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.a2e: %F.type.5d6 = struct_value () [template]
// CHECK:STDOUT: }
@@ -249,6 +252,7 @@ fn Call() {
// CHECK:STDOUT: %Main.import_ref.e53: <witness> = import_ref Main//c, loc7_13, loaded [template = constants.%impl_witness]
// CHECK:STDOUT: %Main.import_ref.29a: type = import_ref Main//c, loc7_6, loaded [template = constants.%C]
// CHECK:STDOUT: %Main.import_ref.f50: type = import_ref Main//c, loc7_11, loaded [template = constants.%I.type]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//i, inst17 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -289,14 +293,14 @@ fn Call() {
// CHECK:STDOUT: %Get.call: init %C = call %Get.ref() to %.loc9
// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [template = constants.%I.type]
// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, imports.%Main.import_ref.bcb [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %F.type.cf0 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.a2e]
// CHECK:STDOUT: %impl.elem0: %.076 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.a2e]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Get() -> %C [from "get.carbon"];
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%Self: %I.type) [from "i.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.5dd: %I.type) [from "i.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
+9 -6
View File
@@ -189,6 +189,8 @@ fn P(o: O) {
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
// CHECK:STDOUT: %H.type: type = fn_type @H [template]
// CHECK:STDOUT: %H: %H.type = struct_value () [template]
// CHECK:STDOUT: %.626: type = fn_type_with_self_type %F.type.b7b, %HasF.facet [template]
// CHECK:STDOUT: %.790: type = fn_type_with_self_type %G.type.d27, %HasG.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -300,19 +302,19 @@ fn P(o: O) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0.992]
// CHECK:STDOUT: %impl.elem0.loc22: %F.type.b7b = impl_witness_access constants.%impl_witness.329, element0 [template = constants.%F.ad8]
// CHECK:STDOUT: %impl.elem0.loc22: %.626 = impl_witness_access constants.%impl_witness.329, element0 [template = constants.%F.ad8]
// CHECK:STDOUT: %F.call.loc22: init %empty_tuple.type = call %impl.elem0.loc22()
// CHECK:STDOUT: %c.ref.loc23: %C = name_ref c, %c
// CHECK:STDOUT: %F.ref.loc23: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [template = constants.%assoc0.992]
// CHECK:STDOUT: %impl.elem0.loc23: %F.type.b7b = impl_witness_access constants.%impl_witness.329, element0 [template = constants.%F.ad8]
// CHECK:STDOUT: %impl.elem0.loc23: %.626 = impl_witness_access constants.%impl_witness.329, element0 [template = constants.%F.ad8]
// CHECK:STDOUT: %F.call.loc23: init %empty_tuple.type = call %impl.elem0.loc23()
// CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %G.ref.loc24: %HasG.assoc_type = name_ref G, @HasG.%assoc0 [template = constants.%assoc0.58a]
// CHECK:STDOUT: %impl.elem0.loc24: %G.type.d27 = impl_witness_access constants.%impl_witness.42a, element0 [template = constants.%G.957]
// CHECK:STDOUT: %impl.elem0.loc24: %.790 = impl_witness_access constants.%impl_witness.42a, element0 [template = constants.%G.957]
// CHECK:STDOUT: %G.call.loc24: init %empty_tuple.type = call %impl.elem0.loc24()
// CHECK:STDOUT: %c.ref.loc25: %C = name_ref c, %c
// CHECK:STDOUT: %G.ref.loc25: %HasG.assoc_type = name_ref G, @HasG.%assoc0 [template = constants.%assoc0.58a]
// CHECK:STDOUT: %impl.elem0.loc25: %G.type.d27 = impl_witness_access constants.%impl_witness.42a, element0 [template = constants.%G.957]
// CHECK:STDOUT: %impl.elem0.loc25: %.790 = impl_witness_access constants.%impl_witness.42a, element0 [template = constants.%G.957]
// CHECK:STDOUT: %G.call.loc25: init %empty_tuple.type = call %impl.elem0.loc25()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -502,6 +504,7 @@ fn P(o: O) {
// CHECK:STDOUT: %complete_type.98e: <witness> = complete_type_witness %struct_type.base.0ff [template]
// CHECK:STDOUT: %H.type: type = fn_type @H [template]
// CHECK:STDOUT: %H: %H.type = struct_value () [template]
// CHECK:STDOUT: %.83f: type = fn_type_with_self_type %I.type.9bd, %HasI.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -598,11 +601,11 @@ fn P(o: O) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %E.ref.loc20: type = name_ref E, file.%E.decl [template = constants.%E]
// CHECK:STDOUT: %I.ref.loc20: %HasI.assoc_type = name_ref I, @HasI.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc20: %I.type.9bd = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.e74]
// CHECK:STDOUT: %impl.elem0.loc20: %.83f = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.e74]
// CHECK:STDOUT: %I.call.loc20: init %empty_tuple.type = call %impl.elem0.loc20()
// CHECK:STDOUT: %e.ref.loc21: %E = name_ref e, %e
// CHECK:STDOUT: %I.ref.loc21: %HasI.assoc_type = name_ref I, @HasI.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc21: %I.type.9bd = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.e74]
// CHECK:STDOUT: %impl.elem0.loc21: %.83f = impl_witness_access constants.%impl_witness, element0 [template = constants.%I.e74]
// CHECK:STDOUT: %I.call.loc21: init %empty_tuple.type = call %impl.elem0.loc21()
// CHECK:STDOUT: %E.ref.loc22: type = name_ref E, file.%E.decl [template = constants.%E]
// CHECK:STDOUT: %J.ref.loc22: %J.type = name_ref J, @B.%J.decl [template = constants.%J]
@@ -105,6 +105,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, %impl_witness [symbolic]
// CHECK:STDOUT: %Double.type: type = fn_type @Double [template]
// CHECK:STDOUT: %Double: %Double.type = struct_value () [template]
// CHECK:STDOUT: %.dcc: type = fn_type_with_self_type %Op.type.31b, %Add.facet [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -328,6 +329,9 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Double.%MyInt.loc19_39.2 (%MyInt) [symbolic = %require_complete (constants.%require_complete.fc7)]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl), @impl(%N.loc19_11.2) [symbolic = %impl_witness (constants.%impl_witness)]
// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt.loc19_39.2, %impl_witness [symbolic = %Add.facet (constants.%Add.facet)]
// CHECK:STDOUT: %.loc20_11: type = fn_type_with_self_type constants.%Op.type.31b, %Add.facet [symbolic = %.loc20_11 (constants.%.dcc)]
// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N.loc19_11.2) [symbolic = %Op.type (constants.%Op.type.883)]
// CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)]
// CHECK:STDOUT:
@@ -336,11 +340,11 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: %x.ref.loc20_10: @Double.%MyInt.loc19_39.2 (%MyInt) = name_ref x, %x
// CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type]
// CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, @Add.%assoc0 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %Op.type.31b = impl_witness_access constants.%impl_witness, element0 [symbolic = %Op (constants.%Op.8bc)]
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %x.ref.loc20_10, %impl.elem0
// CHECK:STDOUT: %impl.elem0: @Double.%.loc20_11 (%.dcc) = impl_witness_access constants.%impl_witness, element0 [symbolic = %Op (constants.%Op.8bc)]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %x.ref.loc20_10, %impl.elem0
// CHECK:STDOUT: %x.ref.loc20_21: @Double.%MyInt.loc19_39.2 (%MyInt) = name_ref x, %x
// CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.bound, @Op.2(constants.%N)
// CHECK:STDOUT: %int.sadd: init @Double.%MyInt.loc19_39.2 (%MyInt) = call %Op.specific_fn(%x.ref.loc20_10, %x.ref.loc20_21)
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Op.2(constants.%N)
// CHECK:STDOUT: %int.sadd: init @Double.%MyInt.loc19_39.2 (%MyInt) = call %specific_fn(%x.ref.loc20_10, %x.ref.loc20_21)
// CHECK:STDOUT: %.loc20_23.1: @Double.%MyInt.loc19_39.2 (%MyInt) = value_of_initializer %int.sadd
// CHECK:STDOUT: %.loc20_23.2: @Double.%MyInt.loc19_39.2 (%MyInt) = converted %int.sadd, %.loc20_23.1
// CHECK:STDOUT: return %.loc20_23.2
@@ -428,16 +432,24 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: %Op.8bc: %Op.type.883 = struct_value () [symbolic]
// CHECK:STDOUT: %require_complete.fc7: <witness> = require_complete_type %MyInt.09f [symbolic]
// CHECK:STDOUT: %impl_witness.8d6: <witness> = impl_witness (imports.%Main.import_ref.19b), @impl(%int_64) [template]
// CHECK:STDOUT: %impl_witness.7e5: <witness> = impl_witness (imports.%Main.import_ref.464), @impl(%N) [symbolic]
// CHECK:STDOUT: %impl_witness.7e5be3.1: <witness> = impl_witness (imports.%Main.import_ref.464c51.1), @impl(%N) [symbolic]
// CHECK:STDOUT: %Op.type.5a6: type = fn_type @Op.1, @impl(%int_64) [template]
// CHECK:STDOUT: %Op.cf9: %Op.type.5a6 = struct_value () [template]
// CHECK:STDOUT: %Op.type.31b: type = fn_type @Op.2 [template]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
// CHECK:STDOUT: %Add.facet.3ca: %Add.type = facet_value %MyInt.f30, %impl_witness.8d6 [template]
// CHECK:STDOUT: %.3ca: type = fn_type_with_self_type %Op.type.31b, %Add.facet.3ca [template]
// CHECK:STDOUT: %CallImportedDouble.type: type = fn_type @CallImportedDouble [template]
// CHECK:STDOUT: %CallImportedDouble: %CallImportedDouble.type = struct_value () [template]
// CHECK:STDOUT: %Double.type: type = fn_type @Double [template]
// CHECK:STDOUT: %Double: %Double.type = struct_value () [template]
// CHECK:STDOUT: %impl_witness.7e5be3.2: <witness> = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%N) [symbolic]
// CHECK:STDOUT: %Add.facet.9a8: %Add.type = facet_value %MyInt.09f, %impl_witness.7e5be3.2 [symbolic]
// CHECK:STDOUT: %.72d: type = fn_type_with_self_type %Op.type.31b, %Add.facet.9a8 [symbolic]
// CHECK:STDOUT: %Double.specific_fn: <specific function> = specific_function %Double, @Double(%int_64) [template]
// CHECK:STDOUT: %impl_witness.bb3: <witness> = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%int_64) [template]
// CHECK:STDOUT: %Add.facet.22c: %Add.type = facet_value %MyInt.f30, %impl_witness.bb3 [template]
// CHECK:STDOUT: %.41c: type = fn_type_with_self_type %Op.type.31b, %Add.facet.22c [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -446,15 +458,21 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: %Main.Int = import_ref Main//generic_impl, Int, unloaded
// CHECK:STDOUT: %Main.MyInt: %MyInt.type = import_ref Main//generic_impl, MyInt, loaded [template = constants.%MyInt.generic]
// CHECK:STDOUT: %Main.Double: %Double.type = import_ref Main//generic_impl, Double, loaded [template = constants.%Double]
// CHECK:STDOUT: %Main.import_ref.50eccf.1: Core.IntLiteral = import_ref Main//generic_impl, loc11_13, loaded [symbolic = @MyInt.%N (constants.%N)]
// CHECK:STDOUT: %Main.import_ref.9e9: <witness> = import_ref Main//generic_impl, loc13_1, loaded [symbolic = @MyInt.%complete_type (constants.%complete_type.a87)]
// CHECK:STDOUT: %Main.import_ref.697 = import_ref Main//generic_impl, inst89 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.07c = import_ref Main//generic_impl, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.db7: %Add.assoc_type = import_ref Main//generic_impl, loc5_41, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.Op = import_ref Main//generic_impl, Op, unloaded
// CHECK:STDOUT: %Main.import_ref.33b: <witness> = import_ref Main//generic_impl, loc15_48, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.7e5)]
// CHECK:STDOUT: %Main.import_ref.33b: <witness> = import_ref Main//generic_impl, loc15_48, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.7e5be3.1)]
// CHECK:STDOUT: %Main.import_ref.50eccf.2: Core.IntLiteral = import_ref Main//generic_impl, loc15_14, loaded [symbolic = @impl.%N (constants.%N)]
// CHECK:STDOUT: %Main.import_ref.719: type = import_ref Main//generic_impl, loc15_39, loaded [symbolic = @impl.%MyInt (constants.%MyInt.09f)]
// CHECK:STDOUT: %Main.import_ref.bf0: type = import_ref Main//generic_impl, loc15_44, loaded [template = constants.%Add.type]
// CHECK:STDOUT: %Main.import_ref.19b: @impl.%Op.type (%Op.type.883) = import_ref Main//generic_impl, loc16_42, loaded [symbolic = @impl.%Op (constants.%Op.8bc)]
// CHECK:STDOUT: %Main.import_ref.50eccf.3: Core.IntLiteral = import_ref Main//generic_impl, loc15_14, loaded [symbolic = @impl.%N (constants.%N)]
// CHECK:STDOUT: %Main.import_ref.e5e: %Add.type = import_ref Main//generic_impl, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: %Main.import_ref.50eccf.4: Core.IntLiteral = import_ref Main//generic_impl, loc19_11, loaded [symbolic = @Double.%N (constants.%N)]
// CHECK:STDOUT: %Main.import_ref.464c51.2 = import_ref Main//generic_impl, loc16_42, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -515,7 +533,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: witness = (imports.%Main.Op)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @impl(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] {
// CHECK:STDOUT: generic impl @impl(imports.%Main.import_ref.50eccf.2: Core.IntLiteral) [from "generic_impl.carbon"] {
// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.09f)]
@@ -532,7 +550,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @MyInt(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] {
// CHECK:STDOUT: generic class @MyInt(imports.%Main.import_ref.50eccf.1: Core.IntLiteral) [from "generic_impl.carbon"] {
// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
// CHECK:STDOUT:
@@ -554,17 +572,17 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: %x.ref.loc9_10: %MyInt.f30 = name_ref x, %x
// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%Main.Add [template = constants.%Add.type]
// CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, imports.%Main.import_ref.db7 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %Op.type.31b = impl_witness_access constants.%impl_witness.8d6, element0 [template = constants.%Op.cf9]
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %x.ref.loc9_10, %impl.elem0
// CHECK:STDOUT: %impl.elem0: %.3ca = impl_witness_access constants.%impl_witness.8d6, element0 [template = constants.%Op.cf9]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %x.ref.loc9_10, %impl.elem0
// CHECK:STDOUT: %x.ref.loc9_21: %MyInt.f30 = name_ref x, %x
// CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.bound, @Op.1(constants.%int_64)
// CHECK:STDOUT: %int.sadd: init %MyInt.f30 = call %Op.specific_fn(%x.ref.loc9_10, %x.ref.loc9_21)
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Op.1(constants.%int_64)
// CHECK:STDOUT: %int.sadd: init %MyInt.f30 = call %specific_fn(%x.ref.loc9_10, %x.ref.loc9_21)
// CHECK:STDOUT: %.loc9_23.1: %MyInt.f30 = value_of_initializer %int.sadd
// CHECK:STDOUT: %.loc9_23.2: %MyInt.f30 = converted %int.sadd, %.loc9_23.1
// CHECK:STDOUT: return %.loc9_23.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Op.1(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] {
// CHECK:STDOUT: generic fn @Op.1(imports.%Main.import_ref.50eccf.3: Core.IntLiteral) [from "generic_impl.carbon"] {
// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.09f)]
// CHECK:STDOUT:
@@ -573,7 +591,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%MyInt (%MyInt.09f)](%other.param_patt: @Op.1.%MyInt (%MyInt.09f)) -> @Op.1.%MyInt (%MyInt.09f) = "int.sadd";
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Add.type) [from "generic_impl.carbon"] {
// CHECK:STDOUT: generic fn @Op.2(imports.%Main.import_ref.e5e: %Add.type) [from "generic_impl.carbon"] {
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
// CHECK:STDOUT:
@@ -591,13 +609,16 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: return %.loc13_19.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Double(constants.%N: Core.IntLiteral) [from "generic_impl.carbon"] {
// CHECK:STDOUT: generic fn @Double(imports.%Main.import_ref.50eccf.4: Core.IntLiteral) [from "generic_impl.carbon"] {
// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.09f)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Double.%MyInt (%MyInt.09f) [symbolic = %require_complete (constants.%require_complete.fc7)]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%N) [symbolic = %impl_witness (constants.%impl_witness.7e5be3.2)]
// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, %impl_witness [symbolic = %Add.facet (constants.%Add.facet.9a8)]
// CHECK:STDOUT: %.1: type = fn_type_with_self_type constants.%Op.type.31b, %Add.facet [symbolic = %.1 (constants.%.72d)]
// CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @impl(%N) [symbolic = %Op.type (constants.%Op.type.883)]
// CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)]
// CHECK:STDOUT:
@@ -690,6 +711,9 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.4a1
// CHECK:STDOUT: %impl_witness => constants.%impl_witness.bb3
// CHECK:STDOUT: %Add.facet => constants.%Add.facet.22c
// CHECK:STDOUT: %.1 => constants.%.41c
// CHECK:STDOUT: %Op.type => constants.%Op.type.5a6
// CHECK:STDOUT: %Op => constants.%Op.cf9
// CHECK:STDOUT: }
@@ -1000,8 +1024,8 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: %Make: %Make.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %N.987: %i32.builtin = bind_symbolic_name N, 0 [symbolic]
// CHECK:STDOUT: %N.patt.36b: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic]
// CHECK:STDOUT: %N.987: %i32.builtin = bind_symbolic_name N, 0 [symbolic]
// CHECK:STDOUT: %ToLiteral.type.e7c: type = fn_type @ToLiteral.1 [template]
// CHECK:STDOUT: %ToLiteral.cf3: %ToLiteral.type.e7c = struct_value () [template]
// CHECK:STDOUT: %int.convert_checked.346: init Core.IntLiteral = call %ToLiteral.cf3(%N.987) [symbolic]
@@ -1016,8 +1040,8 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: %MakeFromClass: %MakeFromClass.type = struct_value () [template]
// CHECK:STDOUT: %OtherInt: type = class_type @OtherInt [template]
// CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [template]
// CHECK:STDOUT: %N.335: %OtherInt = bind_symbolic_name N, 0 [symbolic]
// CHECK:STDOUT: %N.patt.59d: %OtherInt = symbolic_binding_pattern N, 0 [symbolic]
// CHECK:STDOUT: %N.335: %OtherInt = bind_symbolic_name N, 0 [symbolic]
// CHECK:STDOUT: %ToLiteral.type.67d: type = fn_type @ToLiteral.2 [template]
// CHECK:STDOUT: %ToLiteral.ec2: %ToLiteral.type.67d = struct_value () [template]
// CHECK:STDOUT: %ToLiteral.bound.8e3: <bound method> = bound_method %N.335, %ToLiteral.ec2 [symbolic]
@@ -1038,9 +1062,11 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT: %Main.Make: %Make.type = import_ref Main//convert_symbolic, Make, loaded [template = constants.%Make]
// CHECK:STDOUT: %Main.OtherInt: type = import_ref Main//convert_symbolic, OtherInt, loaded [template = constants.%OtherInt]
// CHECK:STDOUT: %Main.MakeFromClass: %MakeFromClass.type = import_ref Main//convert_symbolic, MakeFromClass, loaded [template = constants.%MakeFromClass]
// CHECK:STDOUT: %Main.import_ref.512: %i32.builtin = import_ref Main//convert_symbolic, loc9_9, loaded [symbolic = @Make.%N (constants.%N.987)]
// CHECK:STDOUT: %Main.import_ref.b03: <witness> = import_ref Main//convert_symbolic, loc14_1, loaded [template = constants.%complete_type.f8a]
// CHECK:STDOUT: %Main.import_ref.d11 = import_ref Main//convert_symbolic, inst129 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.8f7 = import_ref Main//convert_symbolic, loc13_45, unloaded
// CHECK:STDOUT: %Main.import_ref.b3c: %OtherInt = import_ref Main//convert_symbolic, loc18_18, loaded [symbolic = @MakeFromClass.%N (constants.%N.335)]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1094,7 +1120,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "convert_symbolic.carbon"];
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Make(constants.%N.987: %i32.builtin) [from "convert_symbolic.carbon"] {
// CHECK:STDOUT: generic fn @Make(imports.%Main.import_ref.512: %i32.builtin) [from "convert_symbolic.carbon"] {
// CHECK:STDOUT: %N: %i32.builtin = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.987)]
// CHECK:STDOUT: %N.patt: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.36b)]
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call constants.%ToLiteral.cf3(%N) [symbolic = %int.convert_checked (constants.%int.convert_checked.346)]
@@ -1111,7 +1137,7 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @FromLiteral(%n.param_patt: Core.IntLiteral) -> %i32.builtin = "int.convert_checked" [from "convert_symbolic.carbon"];
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @MakeFromClass(constants.%N.335: %OtherInt) [from "convert_symbolic.carbon"] {
// CHECK:STDOUT: generic fn @MakeFromClass(imports.%Main.import_ref.b3c: %OtherInt) [from "convert_symbolic.carbon"] {
// CHECK:STDOUT: %N: %OtherInt = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.335)]
// CHECK:STDOUT: %N.patt: %OtherInt = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.59d)]
// CHECK:STDOUT: %ToLiteral.bound: <bound method> = bound_method %N, constants.%ToLiteral.ec2 [symbolic = %ToLiteral.bound (constants.%ToLiteral.bound.8e3)]
@@ -121,6 +121,8 @@ fn G(c: C) {
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.e03 [template]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.f6d) [template]
// CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [template]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [template]
// CHECK:STDOUT: %.8b3: type = fn_type_with_self_type %F.type.cf0, %I.facet [template]
// CHECK:STDOUT: %F.type.f36: type = fn_type @F.2 [template]
// CHECK:STDOUT: %F.4c3: %F.type.f36 = struct_value () [template]
// CHECK:STDOUT: }
@@ -137,6 +139,7 @@ fn G(c: C) {
// CHECK:STDOUT: %Main.import_ref.b86: <witness> = import_ref Main//extend_impl_library, loc9_20, loaded [template = constants.%impl_witness]
// CHECK:STDOUT: %Main.import_ref.0ed: type = import_ref Main//extend_impl_library, loc9_15, loaded [template = constants.%C]
// CHECK:STDOUT: %Main.import_ref.3019d1.2: type = import_ref Main//extend_impl_library, loc9_18, loaded [template = constants.%I.type]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//extend_impl_library, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -180,16 +183,16 @@ fn G(c: C) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, imports.%Main.C [template = constants.%C]
// CHECK:STDOUT: %F.ref.loc7: %I.assoc_type = name_ref F, imports.%Main.import_ref.bcb [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc7: %F.type.cf0 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3]
// CHECK:STDOUT: %impl.elem0.loc7: %.8b3 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3]
// CHECK:STDOUT: %F.call.loc7: init %empty_tuple.type = call %impl.elem0.loc7()
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
// CHECK:STDOUT: %F.ref.loc8: %I.assoc_type = name_ref F, imports.%Main.import_ref.bcb [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc8: %F.type.cf0 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3]
// CHECK:STDOUT: %impl.elem0.loc8: %.8b3 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.4c3]
// CHECK:STDOUT: %F.call.loc8: init %empty_tuple.type = call %impl.elem0.loc8()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%Self: %I.type) [from "extend_impl_library.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.5dd: %I.type) [from "extend_impl_library.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -297,12 +297,15 @@ impl forall [T:! type] D as J(T*) {}
// CHECK:STDOUT: %Main.C: type = import_ref Main//import_generic, C, loaded [template = constants.%C]
// CHECK:STDOUT: %Main.I: %I.type.dac = import_ref Main//import_generic, I, loaded [template = constants.%I.generic]
// CHECK:STDOUT: %Main.import_ref.003 = import_ref Main//import_generic, loc8_33, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//import_generic, loc5_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//import_generic, inst31 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//import_generic, loc4_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//import_generic, inst14 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//import_generic, loc8_14, loaded [symbolic = @impl.1.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.29aca8.1: type = import_ref Main//import_generic, loc8_24, loaded [template = constants.%C]
// CHECK:STDOUT: %Main.import_ref.4be: type = import_ref Main//import_generic, loc8_32, loaded [symbolic = @impl.1.%I.type (constants.%I.type.325)]
// CHECK:STDOUT: %Main.import_ref.4e1 = import_ref Main//import_generic, loc12_35, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//import_generic, loc12_14, loaded [symbolic = @impl.2.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.29aca8.2: type = import_ref Main//import_generic, loc12_24, loaded [template = constants.%C]
// CHECK:STDOUT: %Main.import_ref.3e2: type = import_ref Main//import_generic, loc12_33, loaded [symbolic = @impl.2.%I.type (constants.%I.type.0e2)]
// CHECK:STDOUT: }
@@ -366,7 +369,7 @@ impl forall [T:! type] D as J(T*) {}
// CHECK:STDOUT: %impl_witness.loc26: <witness> = impl_witness (), @impl.6(constants.%T) [symbolic = @impl.6.%impl_witness (constants.%impl_witness.46542c.3)]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @I(constants.%T: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.1: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -381,7 +384,7 @@ impl forall [T:! type] D as J(T*) {}
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @impl.1(constants.%T: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: generic impl @impl.1(imports.%Main.import_ref.f6b058.2: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.325)]
@@ -396,7 +399,7 @@ impl forall [T:! type] D as J(T*) {}
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @impl.2(constants.%T: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: generic impl @impl.2(imports.%Main.import_ref.f6b058.3: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %ptr: type = ptr_type @impl.2.%T (%T) [symbolic = %ptr (constants.%ptr)]
@@ -744,11 +747,14 @@ impl forall [T:! type] D as J(T*) {}
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Main.D: type = import_ref Main//import_generic_decl, D, loaded [template = constants.%D]
// CHECK:STDOUT: %Main.J: %J.type.2b8 = import_ref Main//import_generic_decl, J, loaded [template = constants.%J.generic]
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//import_generic_decl, loc5_13, loaded [symbolic = @J.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.ff5 = import_ref Main//import_generic_decl, inst31 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//import_generic_decl, loc4_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.cab = import_ref Main//import_generic_decl, inst14 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//import_generic_decl, loc11_14, loaded [symbolic = @impl.1.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.aa9f8a.1: type = import_ref Main//import_generic_decl, loc11_24, loaded [template = constants.%D]
// CHECK:STDOUT: %Main.import_ref.ded: type = import_ref Main//import_generic_decl, loc11_32, loaded [symbolic = @impl.1.%J.type (constants.%J.type.b72)]
// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//import_generic_decl, loc17_14, loaded [symbolic = @impl.2.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.aa9f8a.2: type = import_ref Main//import_generic_decl, loc17_24, loaded [template = constants.%D]
// CHECK:STDOUT: %Main.import_ref.0d3: type = import_ref Main//import_generic_decl, loc17_33, loaded [symbolic = @impl.2.%J.type (constants.%J.type.628)]
// CHECK:STDOUT: }
@@ -812,7 +818,7 @@ impl forall [T:! type] D as J(T*) {}
// CHECK:STDOUT: %impl_witness.loc26: <witness> = impl_witness (), @impl.6(constants.%T) [symbolic = @impl.6.%impl_witness (constants.%impl_witness.b80f53.3)]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @J(constants.%T: type) [from "fail_import_generic_decl.carbon"] {
// CHECK:STDOUT: generic interface @J(imports.%Main.import_ref.f6b058.1: type) [from "fail_import_generic_decl.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -827,7 +833,7 @@ impl forall [T:! type] D as J(T*) {}
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @impl.1(constants.%T: type) [from "fail_import_generic_decl.carbon"] {
// CHECK:STDOUT: generic impl @impl.1(imports.%Main.import_ref.f6b058.2: type) [from "fail_import_generic_decl.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %J.type: type = facet_type <@J, @J(%T)> [symbolic = %J.type (constants.%J.type.b72)]
@@ -837,7 +843,7 @@ impl forall [T:! type] D as J(T*) {}
// CHECK:STDOUT: impl: imports.%Main.import_ref.aa9f8a.1 as imports.%Main.import_ref.ded;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @impl.2(constants.%T: type) [from "fail_import_generic_decl.carbon"] {
// CHECK:STDOUT: generic impl @impl.2(imports.%Main.import_ref.f6b058.3: type) [from "fail_import_generic_decl.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %ptr: type = ptr_type @impl.2.%T (%T) [symbolic = %ptr (constants.%ptr)]
@@ -316,6 +316,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -353,7 +354,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -400,6 +401,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -453,7 +455,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -501,6 +503,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -543,7 +546,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -595,6 +598,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -649,7 +653,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -706,6 +710,9 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.T1 = import_ref Main//interface, T1, unloaded
// CHECK:STDOUT: %Main.T2 = import_ref Main//interface, T2, unloaded
// CHECK:STDOUT: %Main.T3 = import_ref Main//interface, T3, unloaded
// CHECK:STDOUT: %Main.import_ref.8a8474.1: %I3.type = import_ref Main//interface, inst23 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: %Main.import_ref.8a8474.2: %I3.type = import_ref Main//interface, inst23 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: %Main.import_ref.8a8474.3: %I3.type = import_ref Main//interface, inst23 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -794,15 +801,15 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T1, imports.%Main.T2, imports.%Main.T3)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T1(constants.%Self: %I3.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T1(imports.%Main.import_ref.8a8474.1: %I3.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T1:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T2(constants.%Self: %I3.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T2(imports.%Main.import_ref.8a8474.2: %I3.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T2:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T3(constants.%Self: %I3.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T3(imports.%Main.import_ref.8a8474.3: %I3.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T3:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -860,6 +867,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -902,7 +910,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -952,6 +960,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -998,7 +1007,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1044,6 +1053,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1088,7 +1098,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1133,6 +1143,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1177,7 +1188,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1222,6 +1233,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1265,7 +1277,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1312,6 +1324,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//interface, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.585: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [template = %T]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//interface, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1358,7 +1371,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.T)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @T(constants.%Self: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.5dd: %I.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const T:! type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1408,6 +1421,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: %Main.import_ref.8b7 = import_ref Main//interface, inst37 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.99f: %NonType.assoc_type = import_ref Main//interface, loc12_8, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.Y: %struct_type.a.225 = import_ref Main//interface, Y, loaded [template = %Y]
// CHECK:STDOUT: %Main.import_ref.86c: %NonType.type = import_ref Main//interface, inst37 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1449,7 +1463,7 @@ impl CC as NonType where .Y = {.a = {}} { }
// CHECK:STDOUT: witness = (imports.%Main.Y)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic assoc_const @Y(constants.%Self: %NonType.type) [from "interface.carbon"] {
// CHECK:STDOUT: generic assoc_const @Y(imports.%Main.import_ref.86c: %NonType.type) [from "interface.carbon"] {
// CHECK:STDOUT: assoc_const Y:! %struct_type.a.225;
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -117,6 +117,7 @@ fn F(x: (), y: ()) -> () {
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %Add.assoc_type: type = assoc_entity_type %Add.type [template]
// CHECK:STDOUT: %assoc0: %Add.assoc_type = assoc_entity element0, imports.%Main.import_ref.5a3 [template]
// CHECK:STDOUT: %.a26: type = fn_type_with_self_type %Op.type.31b, %Add.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -124,6 +125,7 @@ fn F(x: (), y: ()) -> () {
// CHECK:STDOUT: %Main.import_ref.07c = import_ref Main//a, inst15 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.db7: %Add.assoc_type = import_ref Main//a, loc5_41, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.Op: %Op.type.31b = import_ref Main//a, Op, loaded [template = constants.%Op.d59]
// CHECK:STDOUT: %Main.import_ref.e5e: %Add.type = import_ref Main//a, inst15 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -197,7 +199,7 @@ fn F(x: (), y: ()) -> () {
// CHECK:STDOUT: witness = file.%impl_witness
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Op.1(constants.%Self: %Add.type) [from "a.carbon"] {
// CHECK:STDOUT: generic fn @Op.1(imports.%Main.import_ref.e5e: %Add.type) [from "a.carbon"] {
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
// CHECK:STDOUT:
@@ -217,10 +219,10 @@ fn F(x: (), y: ()) -> () {
// CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, %x
// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%Main.Add [template = constants.%Add.type]
// CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, imports.%Main.import_ref.db7 [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %Op.type.31b = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.489]
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %x.ref, %impl.elem0
// CHECK:STDOUT: %impl.elem0: %.a26 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.489]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %x.ref, %impl.elem0
// CHECK:STDOUT: %y.ref: %empty_tuple.type = name_ref y, %y
// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%x.ref, %y.ref)
// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%x.ref, %y.ref)
// CHECK:STDOUT: %.loc11_22.1: ref %empty_tuple.type = temporary_storage
// CHECK:STDOUT: %.loc11_22.2: ref %empty_tuple.type = temporary %.loc11_22.1, %Op.call
// CHECK:STDOUT: %tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple]
@@ -198,6 +198,8 @@ fn F() -> c.(I.F)() {}
// CHECK:STDOUT: %F.type.4a4: type = fn_type @F.1, @impl(%empty_struct_type) [template]
// CHECK:STDOUT: %F.9e6: %F.type.4a4 = struct_value () [template]
// CHECK:STDOUT: %F.type.cf0: type = fn_type @F.2 [template]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C.7a7, %impl_witness.02b [template]
// CHECK:STDOUT: %.c06: type = fn_type_with_self_type %F.type.cf0, %I.facet [template]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.9e6, @F.1(%empty_struct_type) [template]
// CHECK:STDOUT: %F.type.b25: type = fn_type @F.3 [template]
// CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [template]
@@ -206,15 +208,19 @@ fn F() -> c.(I.F)() {}
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Main.C: %C.type = import_ref Main//import_generic, C, loaded [template = constants.%C.generic]
// CHECK:STDOUT: %Main.I: type = import_ref Main//import_generic, I, loaded [template = constants.%I.type]
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//import_generic, loc4_9, loaded [symbolic = @C.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//import_generic, loc4_20, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//import_generic, inst25 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//import_generic, inst31 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.bcb: %I.assoc_type = import_ref Main//import_generic, loc7_9, loaded [template = constants.%assoc0]
// CHECK:STDOUT: %Main.F = import_ref Main//import_generic, F, unloaded
// CHECK:STDOUT: %Main.import_ref.d91: <witness> = import_ref Main//import_generic, loc10_34, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.bbe)]
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//import_generic, loc10_14, loaded [symbolic = @impl.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.499: type = import_ref Main//import_generic, loc10_27, loaded [symbolic = @impl.%C (constants.%C.f2e)]
// CHECK:STDOUT: %Main.import_ref.301: type = import_ref Main//import_generic, loc10_32, loaded [template = constants.%I.type]
// CHECK:STDOUT: %Main.import_ref.e2c: @impl.%F.type (%F.type.40c) = import_ref Main//import_generic, loc11_10, loaded [symbolic = @impl.%F (constants.%F.071)]
// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//import_generic, loc10_14, loaded [symbolic = @impl.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//import_generic, inst31 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -244,9 +250,9 @@ fn F() -> c.(I.F)() {}
// CHECK:STDOUT: %c.ref: ref %C.7a7 = name_ref c, file.%c
// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [template = constants.%I.type]
// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, imports.%Main.import_ref.bcb [template = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: %F.type.cf0 = impl_witness_access constants.%impl_witness.02b, element0 [template = constants.%F.9e6]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %impl.elem0, @F.1(constants.%empty_struct_type) [template = constants.%F.specific_fn]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
// CHECK:STDOUT: %impl.elem0: %.c06 = impl_witness_access constants.%impl_witness.02b, element0 [template = constants.%F.9e6]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @F.1(constants.%empty_struct_type) [template = constants.%F.specific_fn]
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %specific_fn()
// CHECK:STDOUT: %.loc16_19.1: ref %empty_tuple.type = temporary_storage
// CHECK:STDOUT: %.loc16_19.2: ref %empty_tuple.type = temporary %.loc16_19.1, %F.call
// CHECK:STDOUT: %.loc16_19.3: type = converted %F.call, <error> [template = <error>]
@@ -262,7 +268,7 @@ fn F() -> c.(I.F)() {}
// CHECK:STDOUT: witness = (imports.%Main.F)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @impl(constants.%T: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: generic impl @impl(imports.%Main.import_ref.f6b058.2: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)]
@@ -278,7 +284,7 @@ fn F() -> c.(I.F)() {}
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(constants.%T: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b058.1: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -292,13 +298,13 @@ fn F() -> c.(I.F)() {}
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(constants.%T: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.3: type) [from "import_generic.carbon"] {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.2(constants.%Self: %I.type) [from "import_generic.carbon"] {
// CHECK:STDOUT: generic fn @F.2(imports.%Main.import_ref.5dd: %I.type) [from "import_generic.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -106,9 +106,10 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl) [template]
// CHECK:STDOUT: %Op.type.4b4: type = fn_type @Op.2 [template]
// CHECK:STDOUT: %Op.40d: %Op.type.4b4 = struct_value () [template]
// CHECK:STDOUT: %Action.facet: %Action.type.cca = facet_value %A, %impl_witness [symbolic]
// CHECK:STDOUT: %Action.facet: %Action.type.cb0 = facet_value %A, %impl_witness [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %.920: type = fn_type_with_self_type %Op.type.54d, %Action.facet [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -219,7 +220,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [template = constants.%Action.type.cb0]
// CHECK:STDOUT: %.loc16: %Action.assoc_type.827 = specific_constant @Action.%assoc0.loc5_10.1, @Action(constants.%B) [template = constants.%assoc0.035]
// CHECK:STDOUT: %Op.ref: %Action.assoc_type.827 = name_ref Op, %.loc16 [template = constants.%assoc0.035]
// CHECK:STDOUT: %impl.elem0: %Op.type.54d = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.40d]
// CHECK:STDOUT: %impl.elem0: %.920 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.40d]
// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -275,6 +276,8 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %assoc0.905ab9.2: %Action.assoc_type.8f9 = assoc_entity element0, imports.%Main.import_ref.0e3753.2 [symbolic]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.d0b) [template]
// CHECK:STDOUT: %Action.facet: %Action.type.cb0 = facet_value %A, %impl_witness [template]
// CHECK:STDOUT: %.ae7: type = fn_type_with_self_type %Op.type.54d, %Action.facet [template]
// CHECK:STDOUT: %Op.type.4b4: type = fn_type @Op.2 [template]
// CHECK:STDOUT: %Op.40d: %Op.type.4b4 = struct_value () [template]
// CHECK:STDOUT: }
@@ -288,6 +291,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.71c: <witness> = import_ref Main//action, loc12_21, loaded [template = constants.%impl_witness]
// CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//action, inst46 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.ddc = import_ref Main//action, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.318: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.905ab9.2)]
// CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded
@@ -296,6 +300,8 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//action, loc12_6, loaded [template = constants.%A]
// CHECK:STDOUT: %Main.import_ref.bb2: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.cb0]
// CHECK:STDOUT: %Main.import_ref.7b5 = import_ref Main//action, loc13_11, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.835: @Action.%Action.type (%Action.type.cca) = import_ref Main//action, inst26 [no loc], loaded [symbolic = @Action.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.0e3753.1 = import_ref Main//action, loc5_10, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -320,7 +326,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @Action(constants.%T: type) [from "action.carbon"] {
// CHECK:STDOUT: generic interface @Action(imports.%Main.import_ref.f6b058.1: type) [from "action.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -360,7 +366,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Op.1(constants.%T: type, constants.%Self: %Action.type.cca) [from "action.carbon"] {
// CHECK:STDOUT: generic fn @Op.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.835: @Action.%Action.type (%Action.type.cca)) [from "action.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -372,7 +378,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [template = constants.%Action.type.cb0]
// CHECK:STDOUT: %.loc4: %Action.assoc_type.827 = specific_constant imports.%Main.import_ref.318, @Action(constants.%B) [template = constants.%assoc0.4cc]
// CHECK:STDOUT: %Op.ref: %Action.assoc_type.827 = name_ref Op, %.loc4 [template = constants.%assoc0.4cc]
// CHECK:STDOUT: %impl.elem0: %Op.type.54d = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.40d]
// CHECK:STDOUT: %impl.elem0: %.ae7 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.40d]
// CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -443,6 +449,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.7a1 = import_ref Main//action, loc12_21, unloaded
// CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//action, loc9_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//action, inst46 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.ddc = import_ref Main//action, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.318: @Action.%Action.assoc_type (%Action.assoc_type.8f9) = import_ref Main//action, loc5_10, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.905ab9.2)]
// CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded
@@ -451,6 +458,8 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//action, loc12_6, loaded [template = constants.%A]
// CHECK:STDOUT: %Main.import_ref.bb2: type = import_ref Main//action, loc12_19, loaded [template = constants.%Action.type.cb0]
// CHECK:STDOUT: %Main.import_ref.7b5 = import_ref Main//action, loc13_11, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.835: @Action.%Action.type (%Action.type.cca) = import_ref Main//action, inst26 [no loc], loaded [symbolic = @Action.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.0e3753.1 = import_ref Main//action, loc5_10, unloaded
// CHECK:STDOUT: %Main.import_ref.8f24d3.3: <witness> = import_ref Main//action, loc10_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//action, inst49 [no loc], unloaded
@@ -477,7 +486,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @Action(constants.%T: type) [from "action.carbon"] {
// CHECK:STDOUT: generic interface @Action(imports.%Main.import_ref.f6b058.1: type) [from "action.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -524,7 +533,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Op(constants.%T: type, constants.%Self: %Action.type.cca) [from "action.carbon"] {
// CHECK:STDOUT: generic fn @Op(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.835: @Action.%Action.type (%Action.type.cca)) [from "action.carbon"] {
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -599,7 +608,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Make.decl) [template]
// CHECK:STDOUT: %Make.type.ec4: type = fn_type @Make.2 [template]
// CHECK:STDOUT: %Make.377: %Make.type.ec4 = struct_value () [template]
// CHECK:STDOUT: %Factory.facet: %Factory.type.c96 = facet_value %A, %impl_witness [symbolic]
// CHECK:STDOUT: %Factory.facet: %Factory.type.a5d = facet_value %A, %impl_witness [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -750,6 +759,8 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %MakeB: %MakeB.type = struct_value () [template]
// CHECK:STDOUT: %assoc0.35472f.2: %Factory.assoc_type.ca7 = assoc_entity element0, imports.%Main.import_ref.21018a.2 [symbolic]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.9ec) [template]
// CHECK:STDOUT: %Factory.facet: %Factory.type.a5d = facet_value %A, %impl_witness [template]
// CHECK:STDOUT: %.357: type = fn_type_with_self_type %Make.type.c59, %Factory.facet [template]
// CHECK:STDOUT: %Make.type.ec4: type = fn_type @Make.2 [template]
// CHECK:STDOUT: %Make.377: %Make.type.ec4 = struct_value () [template]
// CHECK:STDOUT: }
@@ -761,6 +772,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.72b: <witness> = import_ref Main//factory, loc11_22, loaded [template = constants.%impl_witness]
// CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//factory, inst52 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.fbb = import_ref Main//factory, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.8d5: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.35472f.2)]
// CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded
@@ -769,6 +781,8 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A]
// CHECK:STDOUT: %Main.import_ref.bd2: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.a5d]
// CHECK:STDOUT: %Main.import_ref.a27 = import_ref Main//factory, loc12_17, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst26 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.21018a.1 = import_ref Main//factory, loc5_17, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -796,7 +810,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @Factory(constants.%T: type) [from "factory.carbon"] {
// CHECK:STDOUT: generic interface @Factory(imports.%Main.import_ref.f6b058.1: type) [from "factory.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -836,7 +850,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Make.1(constants.%T: type, constants.%Self: %Factory.type.c96) [from "factory.carbon"] {
// CHECK:STDOUT: generic fn @Make.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn() -> @Make.1.%T (%T);
@@ -850,7 +864,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [template = constants.%Factory.type.a5d]
// CHECK:STDOUT: %.loc5: %Factory.assoc_type.668 = specific_constant imports.%Main.import_ref.8d5, @Factory(constants.%B) [template = constants.%assoc0.503]
// CHECK:STDOUT: %Make.ref: %Factory.assoc_type.668 = name_ref Make, %.loc5 [template = constants.%assoc0.503]
// CHECK:STDOUT: %impl.elem0: %Make.type.c59 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Make.377]
// CHECK:STDOUT: %impl.elem0: %.357 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Make.377]
// CHECK:STDOUT: %.loc4: ref %B = splice_block %return {}
// CHECK:STDOUT: %Make.call: init %B = call %impl.elem0() to %.loc4
// CHECK:STDOUT: return %Make.call to %return
@@ -922,6 +936,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.3e9 = import_ref Main//factory, loc11_22, unloaded
// CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//factory, loc9_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//factory, inst52 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.fbb = import_ref Main//factory, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.8d5: @Factory.%Factory.assoc_type (%Factory.assoc_type.ca7) = import_ref Main//factory, loc5_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.35472f.2)]
// CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded
@@ -930,6 +945,8 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//factory, loc11_6, loaded [template = constants.%A]
// CHECK:STDOUT: %Main.import_ref.bd2: type = import_ref Main//factory, loc11_20, loaded [template = constants.%Factory.type.a5d]
// CHECK:STDOUT: %Main.import_ref.a27 = import_ref Main//factory, loc12_17, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst26 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.21018a.1 = import_ref Main//factory, loc5_17, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -959,7 +976,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @Factory(constants.%T: type) [from "factory.carbon"] {
// CHECK:STDOUT: generic interface @Factory(imports.%Main.import_ref.f6b058.1: type) [from "factory.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT:
@@ -1007,7 +1024,7 @@ fn MakeC(a: A) -> C {
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Make(constants.%T: type, constants.%Self: %Factory.type.c96) [from "factory.carbon"] {
// CHECK:STDOUT: generic fn @Make(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.91b: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn() -> @Make.%T (%T);