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
+18 -12
View File
@@ -25,11 +25,15 @@ fn RuntimeCall(a: i32, b: i32) -> i32 {
// CHECK:STDOUT: %Add: %Add.type.b1f = struct_value () [template]
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
// 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: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template]
// CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [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.f7f: %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.f7f [template]
// CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.70c: <specific function> = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
@@ -40,6 +44,8 @@ fn RuntimeCall(a: i32, b: i32) -> i32 {
// CHECK:STDOUT: %impl_witness.023: <witness> = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template]
// CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template]
// CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template]
// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [template]
// CHECK:STDOUT: %Convert.bound.2d6: <bound method> = bound_method %int_3.822, %Convert.960 [template]
// CHECK:STDOUT: %Convert.specific_fn.377: <specific function> = specific_function %Convert.bound.2d6, @Convert.3(%int_32) [template]
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
@@ -101,25 +107,25 @@ fn RuntimeCall(a: i32, b: i32) -> i32 {
// CHECK:STDOUT: %Add.ref: %Add.type.b1f = name_ref Add, %Add.decl [template = constants.%Add]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
// CHECK:STDOUT: %impl.elem0.loc13_20: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc13_20: <bound method> = bound_method %int_1, %impl.elem0.loc13_20 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %Convert.specific_fn.loc13_20: <specific function> = specific_function %Convert.bound.loc13_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc13_20: init %i32 = call %Convert.specific_fn.loc13_20(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc13_20: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc13_20: <bound method> = bound_method %int_1, %impl.elem0.loc13_20 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %specific_fn.loc13_20: <specific function> = specific_function %bound_method.loc13_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc13_20: init %i32 = call %specific_fn.loc13_20(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_1, %.loc13_20.1 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc13_23: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc13_23: <bound method> = bound_method %int_2, %impl.elem0.loc13_23 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %Convert.specific_fn.loc13_23: <specific function> = specific_function %Convert.bound.loc13_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc13_23: init %i32 = call %Convert.specific_fn.loc13_23(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0.loc13_23: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc13_23: <bound method> = bound_method %int_2, %impl.elem0.loc13_23 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc13_23: <specific function> = specific_function %bound_method.loc13_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc13_23: init %i32 = call %specific_fn.loc13_23(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc13_23.1: %i32 = value_of_initializer %int.convert_checked.loc13_23 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc13_23.2: %i32 = converted %int_2, %.loc13_23.1 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc13_20.2, %.loc13_23.2) [template = constants.%int_3.822]
// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
// CHECK:STDOUT: %Convert.bound.loc13_24: <bound method> = bound_method %int.sadd, %impl.elem0.loc13_24 [template = constants.%Convert.bound.2d6]
// CHECK:STDOUT: %Convert.specific_fn.loc13_24: <specific function> = specific_function %Convert.bound.loc13_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.377]
// CHECK:STDOUT: %impl.elem0.loc13_24: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
// CHECK:STDOUT: %bound_method.loc13_24: <bound method> = bound_method %int.sadd, %impl.elem0.loc13_24 [template = constants.%Convert.bound.2d6]
// CHECK:STDOUT: %specific_fn.loc13_24: <specific function> = specific_function %bound_method.loc13_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.377]
// CHECK:STDOUT: %.loc13_24.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.822]
// CHECK:STDOUT: %.loc13_24.2: %i32 = converted %int.sadd, %.loc13_24.1 [template = constants.%int_3.822]
// CHECK:STDOUT: %int.convert_checked.loc13_24: init Core.IntLiteral = call %Convert.specific_fn.loc13_24(%.loc13_24.2) [template = constants.%int_3.1ba]
// CHECK:STDOUT: %int.convert_checked.loc13_24: init Core.IntLiteral = call %specific_fn.loc13_24(%.loc13_24.2) [template = constants.%int_3.1ba]
// CHECK:STDOUT: %.loc13_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%int_3.1ba]
// CHECK:STDOUT: %.loc13_24.4: Core.IntLiteral = converted %int.sadd, %.loc13_24.3 [template = constants.%int_3.1ba]
// CHECK:STDOUT: %array_type: type = array_type %.loc13_24.4, %i32 [template = constants.%array_type]
+25 -15
View File
@@ -35,20 +35,28 @@ var arr: [i32; (1 as i32).(I.F)(2)];
// CHECK:STDOUT: %F.9ec: %F.type.066 = struct_value () [template]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, %impl_witness.da7 [template]
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template]
// CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template]
// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template]
// CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template]
// CHECK:STDOUT: %impl_witness.882: <witness> = impl_witness (imports.%Core.import_ref.78a), @impl.4(%int_32) [template]
// CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.4(%int_32) [template]
// CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template]
// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, %impl_witness.882 [template]
// CHECK:STDOUT: %.214: type = fn_type_with_self_type %Convert.type.99b, %As.facet [template]
// CHECK:STDOUT: %Convert.bound.c1b: <bound method> = bound_method %int_1.5b8, %Convert.197 [template]
// CHECK:STDOUT: %Convert.specific_fn.f9a: <specific function> = specific_function %Convert.bound.c1b, @Convert.5(%int_32) [template]
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
// CHECK:STDOUT: %.c3e: type = fn_type_with_self_type %F.type.cf0, %I.facet [template]
// CHECK:STDOUT: %F.bound: <bound method> = bound_method %int_1.5d2, %F.9ec [template]
// 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.2, @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.3, @impl.2(%int_32) [template]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet.f7f: %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.f7f [template]
// CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.787: <specific function> = specific_function %Convert.bound.ef9, @Convert.3(%int_32) [template]
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
@@ -56,6 +64,8 @@ var arr: [i32; (1 as i32).(I.F)(2)];
// CHECK:STDOUT: %impl_witness.023: <witness> = impl_witness (imports.%Core.import_ref.85c), @impl.3(%int_32) [template]
// CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.4, @impl.3(%int_32) [template]
// CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet.e25: %ImplicitAs.type.2fd = facet_value %i32, %impl_witness.023 [template]
// CHECK:STDOUT: %.10e: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.e25 [template]
// CHECK:STDOUT: %Convert.bound.2d6: <bound method> = bound_method %int_3.822, %Convert.960 [template]
// CHECK:STDOUT: %Convert.specific_fn.377: <specific function> = specific_function %Convert.bound.2d6, @Convert.4(%int_32) [template]
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
@@ -97,30 +107,30 @@ var arr: [i32; (1 as i32).(I.F)(2)];
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
// CHECK:STDOUT: %int_32.loc19_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %impl.elem0.loc19_19: %Convert.type.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197]
// CHECK:STDOUT: %Convert.bound.loc19_19: <bound method> = bound_method %int_1, %impl.elem0.loc19_19 [template = constants.%Convert.bound.c1b]
// CHECK:STDOUT: %Convert.specific_fn.loc19_19: <specific function> = specific_function %Convert.bound.loc19_19, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.f9a]
// CHECK:STDOUT: %int.convert_checked.loc19_19: init %i32 = call %Convert.specific_fn.loc19_19(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc19_19: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197]
// CHECK:STDOUT: %bound_method.loc19_19: <bound method> = bound_method %int_1, %impl.elem0.loc19_19 [template = constants.%Convert.bound.c1b]
// CHECK:STDOUT: %specific_fn.loc19_19: <specific function> = specific_function %bound_method.loc19_19, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.f9a]
// CHECK:STDOUT: %int.convert_checked.loc19_19: init %i32 = call %specific_fn.loc19_19(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc19_19.1: %i32 = value_of_initializer %int.convert_checked.loc19_19 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc19_19.2: %i32 = converted %int_1, %.loc19_19.1 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%I.type]
// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0.a5e]
// CHECK:STDOUT: %impl.elem0.loc19_26: %F.type.cf0 = impl_witness_access constants.%impl_witness.da7, element0 [template = constants.%F.9ec]
// CHECK:STDOUT: %F.bound: <bound method> = bound_method %.loc19_19.2, %impl.elem0.loc19_26 [template = constants.%F.bound]
// CHECK:STDOUT: %impl.elem0.loc19_26: %.c3e = impl_witness_access constants.%impl_witness.da7, element0 [template = constants.%F.9ec]
// CHECK:STDOUT: %bound_method.loc19_26: <bound method> = bound_method %.loc19_19.2, %impl.elem0.loc19_26 [template = constants.%F.bound]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
// CHECK:STDOUT: %impl.elem0.loc19_33: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc19_33: <bound method> = bound_method %int_2, %impl.elem0.loc19_33 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %Convert.specific_fn.loc19_33: <specific function> = specific_function %Convert.bound.loc19_33, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc19_33: init %i32 = call %Convert.specific_fn.loc19_33(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0.loc19_33: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc19_33: <bound method> = bound_method %int_2, %impl.elem0.loc19_33 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc19_33: <specific function> = specific_function %bound_method.loc19_33, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc19_33: init %i32 = call %specific_fn.loc19_33(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc19_33.1: %i32 = value_of_initializer %int.convert_checked.loc19_33 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc19_33.2: %i32 = converted %int_2, %.loc19_33.1 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %int.sadd: init %i32 = call %F.bound(%.loc19_19.2, %.loc19_33.2) [template = constants.%int_3.822]
// CHECK:STDOUT: %impl.elem0.loc19_34: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
// CHECK:STDOUT: %Convert.bound.loc19_34: <bound method> = bound_method %int.sadd, %impl.elem0.loc19_34 [template = constants.%Convert.bound.2d6]
// CHECK:STDOUT: %Convert.specific_fn.loc19_34: <specific function> = specific_function %Convert.bound.loc19_34, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.377]
// CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc19_26(%.loc19_19.2, %.loc19_33.2) [template = constants.%int_3.822]
// CHECK:STDOUT: %impl.elem0.loc19_34: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
// CHECK:STDOUT: %bound_method.loc19_34: <bound method> = bound_method %int.sadd, %impl.elem0.loc19_34 [template = constants.%Convert.bound.2d6]
// CHECK:STDOUT: %specific_fn.loc19_34: <specific function> = specific_function %bound_method.loc19_34, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.377]
// CHECK:STDOUT: %.loc19_34.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.822]
// CHECK:STDOUT: %.loc19_34.2: %i32 = converted %int.sadd, %.loc19_34.1 [template = constants.%int_3.822]
// CHECK:STDOUT: %int.convert_checked.loc19_34: init Core.IntLiteral = call %Convert.specific_fn.loc19_34(%.loc19_34.2) [template = constants.%int_3.1ba]
// CHECK:STDOUT: %int.convert_checked.loc19_34: init Core.IntLiteral = call %specific_fn.loc19_34(%.loc19_34.2) [template = constants.%int_3.1ba]
// CHECK:STDOUT: %.loc19_34.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc19_34 [template = constants.%int_3.1ba]
// CHECK:STDOUT: %.loc19_34.4: Core.IntLiteral = converted %int.sadd, %.loc19_34.3 [template = constants.%int_3.1ba]
// CHECK:STDOUT: %array_type: type = array_type %.loc19_34.4, %i32 [template = constants.%array_type]
@@ -97,7 +97,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %impl_witness.213: <witness> = impl_witness (@impl.2.%Convert.decl) [template]
// CHECK:STDOUT: %Convert.type.fc9: type = fn_type @Convert.3 [template]
// CHECK:STDOUT: %Convert.33c: %Convert.type.fc9 = struct_value () [template]
// CHECK:STDOUT: %As.facet: %As.type.8ba = facet_value Core.IntLiteral, %impl_witness.213 [symbolic]
// CHECK:STDOUT: %As.facet: %As.type.a09 = facet_value Core.IntLiteral, %impl_witness.213 [template]
// CHECK:STDOUT: %ImplicitAs.type.11a: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [template]
// CHECK:STDOUT: %Convert.type.752: type = fn_type @Convert.2, @ImplicitAs(%i32.builtin) [template]
// CHECK:STDOUT: %Convert.fcc: %Convert.type.752 = struct_value () [template]
@@ -106,7 +106,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %impl_witness.48c: <witness> = impl_witness (@impl.3.%Convert.decl) [template]
// CHECK:STDOUT: %Convert.type.c2a: type = fn_type @Convert.4 [template]
// CHECK:STDOUT: %Convert.40d: %Convert.type.c2a = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet.555: %ImplicitAs.type.07f = facet_value Core.IntLiteral, %impl_witness.48c [symbolic]
// CHECK:STDOUT: %ImplicitAs.facet.1ff: %ImplicitAs.type.11a = facet_value Core.IntLiteral, %impl_witness.48c [template]
// CHECK:STDOUT: %ImplicitAs.type.9fc: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template]
// CHECK:STDOUT: %Convert.type.60e: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template]
// CHECK:STDOUT: %Convert.c73: %Convert.type.60e = struct_value () [template]
@@ -115,7 +115,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %impl_witness.caf: <witness> = impl_witness (@impl.4.%Convert.decl) [template]
// CHECK:STDOUT: %Convert.type.295: type = fn_type @Convert.5 [template]
// CHECK:STDOUT: %Convert.2bf: %Convert.type.295 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet.2ca: %ImplicitAs.type.07f = facet_value %i32.builtin, %impl_witness.caf [symbolic]
// CHECK:STDOUT: %ImplicitAs.facet.72d: %ImplicitAs.type.9fc = facet_value %i32.builtin, %impl_witness.caf [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -540,10 +540,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.7cc
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Convert.2(constants.%i32.builtin, constants.%ImplicitAs.facet.555) {
// CHECK:STDOUT: specific @Convert.2(constants.%i32.builtin, constants.%ImplicitAs.facet.1ff) {
// CHECK:STDOUT: %T => constants.%i32.builtin
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.11a
// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.555
// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.1ff
// CHECK:STDOUT: %Self.as_type.loc16_20.1 => Core.IntLiteral
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -560,10 +560,10 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.80e
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Convert.2(Core.IntLiteral, constants.%ImplicitAs.facet.2ca) {
// CHECK:STDOUT: specific @Convert.2(Core.IntLiteral, constants.%ImplicitAs.facet.72d) {
// CHECK:STDOUT: %T => Core.IntLiteral
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.9fc
// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.2ca
// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.72d
// CHECK:STDOUT: %Self.as_type.loc16_20.1 => constants.%i32.builtin
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -610,6 +610,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %ImplicitAs.assoc_type.29f: type = assoc_entity_type %ImplicitAs.type.2fd [template]
// CHECK:STDOUT: %assoc0.ed3: %ImplicitAs.assoc_type.29f = assoc_entity element0, imports.%Core.import_ref.1c752f.2 [template]
// CHECK:STDOUT: %impl_witness.d9b: <witness> = impl_witness (imports.%Core.import_ref.73a) [template]
// CHECK:STDOUT: %As.facet: %As.type.a6d = facet_value Core.IntLiteral, %impl_witness.d9b [template]
// CHECK:STDOUT: %.dc4: type = fn_type_with_self_type %Convert.type.378, %As.facet [template]
// CHECK:STDOUT: %Convert.type.953: type = fn_type @Convert.3 [template]
// CHECK:STDOUT: %Convert.5bc: %Convert.type.953 = struct_value () [template]
// CHECK:STDOUT: %Convert.bound.b34: <bound method> = bound_method %int_1.5b8, %Convert.5bc [template]
@@ -622,12 +624,16 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %impl_witness.bd0: <witness> = impl_witness (imports.%Core.import_ref.db4) [template]
// CHECK:STDOUT: %Op.type.545: type = fn_type @Op.1 [template]
// CHECK:STDOUT: %Self.as_type.da9: type = facet_access_type %Self.a99 [symbolic]
// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %i32.builtin, %impl_witness.bd0 [template]
// CHECK:STDOUT: %.7c2: type = fn_type_with_self_type %Op.type.545, %Add.facet [template]
// CHECK:STDOUT: %Op.type.240: type = fn_type @Op.2 [template]
// CHECK:STDOUT: %Op.0e2: %Op.type.240 = struct_value () [template]
// CHECK:STDOUT: %Op.bound.393: <bound method> = bound_method %int_1.f38, %Op.0e2 [template]
// CHECK:STDOUT: %int_3.a0f: %i32.builtin = int_value 3 [template]
// CHECK:STDOUT: %assoc0.43db8b.2: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207961.2 [symbolic]
// CHECK:STDOUT: %impl_witness.8f3: <witness> = impl_witness (imports.%Core.import_ref.4f9) [template]
// CHECK:STDOUT: %ImplicitAs.facet.6ef: %ImplicitAs.type.2fd = facet_value %i32.builtin, %impl_witness.8f3 [template]
// CHECK:STDOUT: %.38f: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.6ef [template]
// CHECK:STDOUT: %Convert.type.0e4: type = fn_type @Convert.4 [template]
// CHECK:STDOUT: %Convert.b32: %Convert.type.0e4 = struct_value () [template]
// CHECK:STDOUT: %Convert.bound.65a: <bound method> = bound_method %int_3.a0f, %Convert.b32 [template]
@@ -642,6 +648,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, %i32.builtin) [template]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %impl_witness.39c: <witness> = impl_witness (imports.%Core.import_ref.f35) [template]
// CHECK:STDOUT: %ImplicitAs.facet.085: %ImplicitAs.type.61e = facet_value Core.IntLiteral, %impl_witness.39c [template]
// CHECK:STDOUT: %.624: type = fn_type_with_self_type %Convert.type.059, %ImplicitAs.facet.085 [template]
// CHECK:STDOUT: %Convert.type.49f: type = fn_type @Convert.5 [template]
// CHECK:STDOUT: %Convert.cb5: %Convert.type.49f = struct_value () [template]
// CHECK:STDOUT: %Convert.bound.b6b: <bound method> = bound_method %int_3.1ba, %Convert.cb5 [template]
@@ -657,9 +665,12 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
// CHECK:STDOUT: import Core//default
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import_ref.f6b058.1: type = import_ref Core//default, loc11_14, loaded [symbolic = @As.%T (constants.%T)]
// CHECK:STDOUT: %Core.import_ref.a7c = import_ref Core//default, inst85 [no loc], unloaded
// CHECK:STDOUT: %Core.import_ref.713: @As.%As.assoc_type (%As.assoc_type.a44) = import_ref Core//default, loc12_32, loaded [symbolic = @As.%assoc0 (constants.%assoc0.5bc)]
// CHECK:STDOUT: %Core.Convert.313 = import_ref Core//default, Convert, unloaded
// CHECK:STDOUT: %Core.import_ref.f6b058.2: type = import_ref Core//default, loc11_14, loaded [symbolic = @As.%T (constants.%T)]
// CHECK:STDOUT: %Core.import_ref.996: @As.%As.type (%As.type.eed) = import_ref Core//default, inst85 [no loc], loaded [symbolic = @As.%Self (constants.%Self.65a)]
// CHECK:STDOUT: %Core.import_ref.708: @As.%Convert.type (%Convert.type.843) = import_ref Core//default, loc12_32, loaded [symbolic = @As.%Convert (constants.%Convert.95f)]
// CHECK:STDOUT: %Core.import_ref.595: <witness> = import_ref Core//default, loc19_17, loaded [template = constants.%impl_witness.bd0]
// CHECK:STDOUT: %Core.import_ref.07c = import_ref Core//default, inst39 [no loc], unloaded
@@ -671,15 +682,19 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %Core.import_ref.8721d7.1: type = import_ref Core//default, loc23_17, loaded [template = Core.IntLiteral]
// CHECK:STDOUT: %Core.import_ref.1e5: type = import_ref Core//default, loc23_28, loaded [template = constants.%As.type.a6d]
// CHECK:STDOUT: %Core.import_ref.de9: <witness> = import_ref Core//default, loc27_38, loaded [template = constants.%impl_witness.39c]
// CHECK:STDOUT: %Core.import_ref.f6b058.3: type = import_ref Core//default, loc15_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)]
// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst128 [no loc], unloaded
// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc16_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)]
// CHECK:STDOUT: %Core.Convert.e69 = import_ref Core//default, Convert, unloaded
// CHECK:STDOUT: %Core.import_ref.8721d7.2: type = import_ref Core//default, loc27_17, loaded [template = Core.IntLiteral]
// CHECK:STDOUT: %Core.import_ref.4d9: type = import_ref Core//default, loc27_36, loaded [template = constants.%ImplicitAs.type.61e]
// CHECK:STDOUT: %Core.import_ref.f6b058.4: type = import_ref Core//default, loc15_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)]
// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst128 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)]
// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//default, loc16_32, unloaded
// CHECK:STDOUT: %Core.import_ref.3b6: <witness> = import_ref Core//default, loc31_38, loaded [template = constants.%impl_witness.8f3]
// CHECK:STDOUT: %Core.import_ref.c8c7cd.2: type = import_ref Core//default, loc31_6, loaded [template = constants.%i32.builtin]
// CHECK:STDOUT: %Core.import_ref.efb: type = import_ref Core//default, loc31_36, loaded [template = constants.%ImplicitAs.type.2fd]
// CHECK:STDOUT: %Core.import_ref.442: %Add.type = import_ref Core//default, inst39 [no loc], loaded [symbolic = constants.%Self.a99]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -701,9 +716,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%int_32.loc4_22) [template = constants.%i32.builtin]
// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32.builtin]
// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_signed.loc4_22, %.loc4_22.1 [template = constants.%i32.builtin]
// CHECK:STDOUT: %impl.elem0.loc4_19: %Convert.type.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
// CHECK:STDOUT: %Convert.bound.loc4_19: <bound method> = bound_method %int_1, %impl.elem0.loc4_19 [template = constants.%Convert.bound.b34]
// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32.builtin = call %Convert.bound.loc4_19(%int_1) [template = constants.%int_1.f38]
// CHECK:STDOUT: %impl.elem0.loc4_19: %.dc4 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
// CHECK:STDOUT: %bound_method.loc4_19: <bound method> = bound_method %int_1, %impl.elem0.loc4_19 [template = constants.%Convert.bound.b34]
// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32.builtin = call %bound_method.loc4_19(%int_1) [template = constants.%int_1.f38]
// CHECK:STDOUT: %.loc4_19.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%int_1.f38]
// CHECK:STDOUT: %.loc4_19.2: %i32.builtin = converted %int_1, %.loc4_19.1 [template = constants.%int_1.f38]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
@@ -711,21 +726,21 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %int.make_type_signed.loc4_35: init type = call constants.%Int(%int_32.loc4_35) [template = constants.%i32.builtin]
// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %int.make_type_signed.loc4_35 [template = constants.%i32.builtin]
// CHECK:STDOUT: %.loc4_35.2: type = converted %int.make_type_signed.loc4_35, %.loc4_35.1 [template = constants.%i32.builtin]
// CHECK:STDOUT: %impl.elem0.loc4_32: %Convert.type.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
// CHECK:STDOUT: %Convert.bound.loc4_32: <bound method> = bound_method %int_2, %impl.elem0.loc4_32 [template = constants.%Convert.bound.324]
// CHECK:STDOUT: %int.convert_checked.loc4_32: init %i32.builtin = call %Convert.bound.loc4_32(%int_2) [template = constants.%int_2.5a1]
// CHECK:STDOUT: %impl.elem0.loc4_32: %.dc4 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
// CHECK:STDOUT: %bound_method.loc4_32: <bound method> = bound_method %int_2, %impl.elem0.loc4_32 [template = constants.%Convert.bound.324]
// CHECK:STDOUT: %int.convert_checked.loc4_32: init %i32.builtin = call %bound_method.loc4_32(%int_2) [template = constants.%int_2.5a1]
// CHECK:STDOUT: %.loc4_32.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_32 [template = constants.%int_2.5a1]
// CHECK:STDOUT: %.loc4_32.2: %i32.builtin = converted %int_2, %.loc4_32.1 [template = constants.%int_2.5a1]
// CHECK:STDOUT: %impl.elem0.loc4_27.1: %Op.type.545 = impl_witness_access constants.%impl_witness.bd0, element0 [template = constants.%Op.0e2]
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %.loc4_19.2, %impl.elem0.loc4_27.1 [template = constants.%Op.bound.393]
// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %Op.bound(%.loc4_19.2, %.loc4_32.2) [template = constants.%int_3.a0f]
// CHECK:STDOUT: %impl.elem0.loc4_27.1: %.7c2 = impl_witness_access constants.%impl_witness.bd0, element0 [template = constants.%Op.0e2]
// CHECK:STDOUT: %bound_method.loc4_27.1: <bound method> = bound_method %.loc4_19.2, %impl.elem0.loc4_27.1 [template = constants.%Op.bound.393]
// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %bound_method.loc4_27.1(%.loc4_19.2, %.loc4_32.2) [template = constants.%int_3.a0f]
// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32.builtin]
// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32.builtin]
// CHECK:STDOUT: %impl.elem0.loc4_27.2: %Convert.type.71e = impl_witness_access constants.%impl_witness.8f3, element0 [template = constants.%Convert.b32]
// CHECK:STDOUT: %Convert.bound.loc4_27: <bound method> = bound_method %int.sadd, %impl.elem0.loc4_27.2 [template = constants.%Convert.bound.65a]
// CHECK:STDOUT: %impl.elem0.loc4_27.2: %.38f = impl_witness_access constants.%impl_witness.8f3, element0 [template = constants.%Convert.b32]
// CHECK:STDOUT: %bound_method.loc4_27.2: <bound method> = bound_method %int.sadd, %impl.elem0.loc4_27.2 [template = constants.%Convert.bound.65a]
// CHECK:STDOUT: %.loc4_27.1: %i32.builtin = value_of_initializer %int.sadd [template = constants.%int_3.a0f]
// CHECK:STDOUT: %.loc4_27.2: %i32.builtin = converted %int.sadd, %.loc4_27.1 [template = constants.%int_3.a0f]
// CHECK:STDOUT: %int.convert_checked.loc4_27: init Core.IntLiteral = call %Convert.bound.loc4_27(%.loc4_27.2) [template = constants.%int_3.1ba]
// CHECK:STDOUT: %int.convert_checked.loc4_27: init Core.IntLiteral = call %bound_method.loc4_27.2(%.loc4_27.2) [template = constants.%int_3.1ba]
// CHECK:STDOUT: %.loc4_27.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%int_3.1ba]
// CHECK:STDOUT: %.loc4_27.4: Core.IntLiteral = converted %int.sadd, %.loc4_27.3 [template = constants.%int_3.1ba]
// CHECK:STDOUT: %array_type: type = array_type %.loc4_27.4, %i32.builtin [template = constants.%array_type]
@@ -733,7 +748,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @As(constants.%T: type) [from "core.carbon"] {
// CHECK:STDOUT: generic interface @As(imports.%Core.import_ref.f6b058.1: type) [from "core.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:
@@ -760,7 +775,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: witness = (imports.%Core.Op)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @ImplicitAs(constants.%T: type) [from "core.carbon"] {
// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.f6b058.3: type) [from "core.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:
@@ -802,7 +817,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "core.carbon"];
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Convert.1(constants.%T: type, constants.%Self.65a: %As.type.eed) [from "core.carbon"] {
// CHECK:STDOUT: generic fn @Convert.1(imports.%Core.import_ref.f6b058.2: type, imports.%Core.import_ref.996: @As.%As.type (%As.type.eed)) [from "core.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T)> [symbolic = %As.type (constants.%As.type.eed)]
// CHECK:STDOUT: %Self: %As.type.eed = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.65a)]
@@ -811,7 +826,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type (%Self.as_type.04d)]() -> @Convert.1.%T (%T);
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Convert.2(constants.%T: type, constants.%Self.519: %ImplicitAs.type.d62) [from "core.carbon"] {
// CHECK:STDOUT: generic fn @Convert.2(imports.%Core.import_ref.f6b058.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] {
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
// CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
@@ -822,7 +837,7 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Convert.3[%self.param_patt: Core.IntLiteral]() -> %i32.builtin = "int.convert_checked" [from "core.carbon"];
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Op.1(constants.%Self.a99: %Add.type) [from "core.carbon"] {
// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.442: %Add.type) [from "core.carbon"] {
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.a99)]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.da9)]
// CHECK:STDOUT:
@@ -844,9 +859,9 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %int.make_type_signed.loc4_56: init type = call constants.%Int(%int_32.loc4_56) [template = constants.%i32.builtin]
// CHECK:STDOUT: %.loc4_56.1: type = value_of_initializer %int.make_type_signed.loc4_56 [template = constants.%i32.builtin]
// CHECK:STDOUT: %.loc4_56.2: type = converted %int.make_type_signed.loc4_56, %.loc4_56.1 [template = constants.%i32.builtin]
// CHECK:STDOUT: %impl.elem0.loc4_53: %Convert.type.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
// CHECK:STDOUT: %Convert.bound.loc4_53: <bound method> = bound_method %int_3.loc4_51, %impl.elem0.loc4_53 [template = constants.%Convert.bound.94d]
// CHECK:STDOUT: %int.convert_checked.loc4_53: init %i32.builtin = call %Convert.bound.loc4_53(%int_3.loc4_51) [template = constants.%int_3.a0f]
// CHECK:STDOUT: %impl.elem0.loc4_53: %.dc4 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
// CHECK:STDOUT: %bound_method.loc4_53: <bound method> = bound_method %int_3.loc4_51, %impl.elem0.loc4_53 [template = constants.%Convert.bound.94d]
// CHECK:STDOUT: %int.convert_checked.loc4_53: init %i32.builtin = call %bound_method.loc4_53(%int_3.loc4_51) [template = constants.%int_3.a0f]
// CHECK:STDOUT: %.loc4_53.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_53 [template = constants.%int_3.a0f]
// CHECK:STDOUT: %.loc4_53.2: %i32.builtin = converted %int_3.loc4_51, %.loc4_53.1 [template = constants.%int_3.a0f]
// CHECK:STDOUT: %int_4.loc4_64: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1]
@@ -854,25 +869,25 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
// CHECK:STDOUT: %int.make_type_signed.loc4_69: init type = call constants.%Int(%int_32.loc4_69) [template = constants.%i32.builtin]
// CHECK:STDOUT: %.loc4_69.1: type = value_of_initializer %int.make_type_signed.loc4_69 [template = constants.%i32.builtin]
// CHECK:STDOUT: %.loc4_69.2: type = converted %int.make_type_signed.loc4_69, %.loc4_69.1 [template = constants.%i32.builtin]
// CHECK:STDOUT: %impl.elem0.loc4_66: %Convert.type.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
// CHECK:STDOUT: %Convert.bound.loc4_66: <bound method> = bound_method %int_4.loc4_64, %impl.elem0.loc4_66 [template = constants.%Convert.bound.8fc]
// CHECK:STDOUT: %int.convert_checked.loc4_66: init %i32.builtin = call %Convert.bound.loc4_66(%int_4.loc4_64) [template = constants.%int_4.4f1]
// CHECK:STDOUT: %impl.elem0.loc4_66: %.dc4 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
// CHECK:STDOUT: %bound_method.loc4_66: <bound method> = bound_method %int_4.loc4_64, %impl.elem0.loc4_66 [template = constants.%Convert.bound.8fc]
// CHECK:STDOUT: %int.convert_checked.loc4_66: init %i32.builtin = call %bound_method.loc4_66(%int_4.loc4_64) [template = constants.%int_4.4f1]
// CHECK:STDOUT: %.loc4_66.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_66 [template = constants.%int_4.4f1]
// CHECK:STDOUT: %.loc4_66.2: %i32.builtin = converted %int_4.loc4_64, %.loc4_66.1 [template = constants.%int_4.4f1]
// CHECK:STDOUT: %impl.elem0.loc4_61: %Op.type.545 = impl_witness_access constants.%impl_witness.bd0, element0 [template = constants.%Op.0e2]
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %.loc4_53.2, %impl.elem0.loc4_61 [template = constants.%Op.bound.423]
// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %Op.bound(%.loc4_53.2, %.loc4_66.2) [template = constants.%int_7]
// CHECK:STDOUT: %impl.elem0.loc4_61: %.7c2 = impl_witness_access constants.%impl_witness.bd0, element0 [template = constants.%Op.0e2]
// CHECK:STDOUT: %bound_method.loc4_61: <bound method> = bound_method %.loc4_53.2, %impl.elem0.loc4_61 [template = constants.%Op.bound.423]
// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %bound_method.loc4_61(%.loc4_53.2, %.loc4_66.2) [template = constants.%int_7]
// CHECK:STDOUT: %.loc4_73.1: %tuple.type = tuple_literal (%int_3.loc4_44, %int_4.loc4_47, %int.sadd)
// CHECK:STDOUT: %impl.elem0.loc4_73.1: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5]
// CHECK:STDOUT: %Convert.bound.loc4_73.1: <bound method> = bound_method %int_3.loc4_44, %impl.elem0.loc4_73.1 [template = constants.%Convert.bound.b6b]
// CHECK:STDOUT: %int.convert_checked.loc4_73.1: init %i32.builtin = call %Convert.bound.loc4_73.1(%int_3.loc4_44) [template = constants.%int_3.a0f]
// CHECK:STDOUT: %impl.elem0.loc4_73.1: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5]
// CHECK:STDOUT: %bound_method.loc4_73.1: <bound method> = bound_method %int_3.loc4_44, %impl.elem0.loc4_73.1 [template = constants.%Convert.bound.b6b]
// CHECK:STDOUT: %int.convert_checked.loc4_73.1: init %i32.builtin = call %bound_method.loc4_73.1(%int_3.loc4_44) [template = constants.%int_3.a0f]
// CHECK:STDOUT: %.loc4_73.2: init %i32.builtin = converted %int_3.loc4_44, %int.convert_checked.loc4_73.1 [template = constants.%int_3.a0f]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
// CHECK:STDOUT: %.loc4_73.3: ref %i32.builtin = array_index file.%arr.var, %int_0
// CHECK:STDOUT: %.loc4_73.4: init %i32.builtin = initialize_from %.loc4_73.2 to %.loc4_73.3 [template = constants.%int_3.a0f]
// CHECK:STDOUT: %impl.elem0.loc4_73.2: %Convert.type.059 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5]
// CHECK:STDOUT: %Convert.bound.loc4_73.2: <bound method> = bound_method %int_4.loc4_47, %impl.elem0.loc4_73.2 [template = constants.%Convert.bound.626]
// CHECK:STDOUT: %int.convert_checked.loc4_73.2: init %i32.builtin = call %Convert.bound.loc4_73.2(%int_4.loc4_47) [template = constants.%int_4.4f1]
// CHECK:STDOUT: %impl.elem0.loc4_73.2: %.624 = impl_witness_access constants.%impl_witness.39c, element0 [template = constants.%Convert.cb5]
// CHECK:STDOUT: %bound_method.loc4_73.2: <bound method> = bound_method %int_4.loc4_47, %impl.elem0.loc4_73.2 [template = constants.%Convert.bound.626]
// CHECK:STDOUT: %int.convert_checked.loc4_73.2: init %i32.builtin = call %bound_method.loc4_73.2(%int_4.loc4_47) [template = constants.%int_4.4f1]
// CHECK:STDOUT: %.loc4_73.5: init %i32.builtin = converted %int_4.loc4_47, %int.convert_checked.loc4_73.2 [template = constants.%int_4.4f1]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
// CHECK:STDOUT: %.loc4_73.6: ref %i32.builtin = array_index file.%arr.var, %int_1