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
@@ -21,10 +21,13 @@ var c: i32 = b.0;
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template]
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template]
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (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.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_12.6a3, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template]
@@ -89,10 +92,10 @@ var c: i32 = b.0;
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3]
// CHECK:STDOUT: %.loc11_21.1: %tuple.type.985 = tuple_literal (%int_12)
// 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_12, %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_12) [template = constants.%int_12.1e1]
// 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_12, %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_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_21.2: init %i32 = converted %int_12, %int.convert_checked [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_21.3: init %tuple.type.a1c = tuple_init (%.loc11_21.2) to file.%a.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_21.1, %.loc11_21.3 [template = constants.%tuple]
@@ -25,10 +25,13 @@ var b: i32 = a.(oops);
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template]
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, 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.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.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.9a9: <specific function> = specific_function %Convert.bound.221, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template]
@@ -85,17 +88,17 @@ var b: i32 = a.(oops);
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3]
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462]
// CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6)
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: <specific function> = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %specific_fn.loc11_27.1: <specific function> = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0
// CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_27.2: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: <specific function> = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_27.2: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %specific_fn.loc11_27.2: <specific function> = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [template = constants.%int_6.e56]
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1
// CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [template = constants.%int_6.e56]
@@ -30,10 +30,13 @@ var d: i32 = b.(0x7FFF_FFFF);
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template]
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template]
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (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.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_12.6a3, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template]
@@ -110,10 +113,10 @@ var d: i32 = b.(0x7FFF_FFFF);
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3]
// CHECK:STDOUT: %.loc11_21.1: %tuple.type.985 = tuple_literal (%int_12)
// 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_12, %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_12) [template = constants.%int_12.1e1]
// 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_12, %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_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_21.2: init %i32 = converted %int_12, %int.convert_checked [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_21.3: init %tuple.type.a1c = tuple_init (%.loc11_21.2) to file.%a.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_21.1, %.loc11_21.3 [template = constants.%tuple]
@@ -25,10 +25,14 @@ var b: i32 = a.(-10);
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template]
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, 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: %Negate.type: type = facet_type <@Negate> [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.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.9a9: <specific function> = specific_function %Convert.bound.221, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template]
@@ -39,6 +43,8 @@ var b: i32 = a.(-10);
// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template]
// CHECK:STDOUT: %impl_witness.0f6: <witness> = impl_witness (imports.%Core.import_ref.c15) [template]
// CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.13 [template]
// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value Core.IntLiteral, %impl_witness.0f6 [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.14 [template]
// CHECK:STDOUT: %Op.bba: %Op.type.1be = struct_value () [template]
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %int_10, %Op.bba [template]
@@ -93,17 +99,17 @@ var b: i32 = a.(-10);
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3]
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462]
// CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6)
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: <specific function> = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %specific_fn.loc11_27.1: <specific function> = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0
// CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_27.2: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: <specific function> = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_27.2: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %specific_fn.loc11_27.2: <specific function> = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [template = constants.%int_6.e56]
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1
// CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [template = constants.%int_6.e56]
@@ -112,9 +118,9 @@ var b: i32 = a.(-10);
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
// CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a
// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10]
// CHECK:STDOUT: %impl.elem0.loc16: %Op.type.e42 = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba]
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %int_10, %impl.elem0.loc16 [template = constants.%Op.bound]
// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %Op.bound(%int_10) [template = constants.%int_-10]
// CHECK:STDOUT: %impl.elem0.loc16: %.45d = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba]
// CHECK:STDOUT: %bound_method.loc16: <bound method> = bound_method %int_10, %impl.elem0.loc16 [template = constants.%Op.bound]
// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %bound_method.loc16(%int_10) [template = constants.%int_-10]
// CHECK:STDOUT: %.loc16_17.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-10]
// CHECK:STDOUT: %.loc16_17.2: Core.IntLiteral = converted %int.snegate, %.loc16_17.1 [template = constants.%int_-10]
// CHECK:STDOUT: assign file.%b.var, <error>
@@ -26,10 +26,13 @@ var c: i32 = a.(b);
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, 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.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.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.2(%int_32) [template]
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
@@ -101,17 +104,17 @@ var c: i32 = a.(b);
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
// CHECK:STDOUT: %.loc11_26.1: %tuple.type.f94 = tuple_literal (%int_2, %int_3)
// CHECK:STDOUT: %impl.elem0.loc11_26.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_26.1: <bound method> = bound_method %int_2, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %Convert.specific_fn.loc11_26.1: <specific function> = specific_function %Convert.bound.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %Convert.specific_fn.loc11_26.1(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0.loc11_26.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_26.1: <bound method> = bound_method %int_2, %impl.elem0.loc11_26.1 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc11_26.1: <specific function> = specific_function %bound_method.loc11_26.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %specific_fn.loc11_26.1(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc11_26.2: init %i32 = converted %int_2, %int.convert_checked.loc11_26.1 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0
// CHECK:STDOUT: %.loc11_26.3: init %i32 = initialize_from %.loc11_26.2 to %tuple.elem0 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0.loc11_26.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_26.2: <bound method> = bound_method %int_3, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.b30]
// CHECK:STDOUT: %Convert.specific_fn.loc11_26.2: <specific function> = specific_function %Convert.bound.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42]
// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %Convert.specific_fn.loc11_26.2(%int_3) [template = constants.%int_3.822]
// CHECK:STDOUT: %impl.elem0.loc11_26.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_26.2: <bound method> = bound_method %int_3, %impl.elem0.loc11_26.2 [template = constants.%Convert.bound.b30]
// CHECK:STDOUT: %specific_fn.loc11_26.2: <specific function> = specific_function %bound_method.loc11_26.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42]
// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %specific_fn.loc11_26.2(%int_3) [template = constants.%int_3.822]
// CHECK:STDOUT: %.loc11_26.4: init %i32 = converted %int_3, %int.convert_checked.loc11_26.2 [template = constants.%int_3.822]
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1
// CHECK:STDOUT: %.loc11_26.5: init %i32 = initialize_from %.loc11_26.4 to %tuple.elem1 [template = constants.%int_3.822]
@@ -119,10 +122,10 @@ var c: i32 = a.(b);
// CHECK:STDOUT: %.loc11_1: init %tuple.type.d07 = converted %.loc11_26.1, %.loc11_26.6 [template = constants.%tuple]
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc12: <bound method> = bound_method %int_0, %impl.elem0.loc12 [template = constants.%Convert.bound.d04]
// CHECK:STDOUT: %Convert.specific_fn.loc12: <specific function> = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62]
// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %Convert.specific_fn.loc12(%int_0) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %impl.elem0.loc12: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc12: <bound method> = bound_method %int_0, %impl.elem0.loc12 [template = constants.%Convert.bound.d04]
// CHECK:STDOUT: %specific_fn.loc12: <specific function> = specific_function %bound_method.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62]
// CHECK:STDOUT: %int.convert_checked.loc12: init %i32 = call %specific_fn.loc12(%int_0) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc12: init %i32 = converted %int_0, %int.convert_checked.loc12 [template = constants.%int_0.6a9]
// CHECK:STDOUT: assign file.%b.var, %.loc12
// CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a
@@ -28,10 +28,13 @@ var b: i32 = a.(2.6);
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template]
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, 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.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.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.9a9: <specific function> = specific_function %Convert.bound.221, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template]
@@ -89,17 +92,17 @@ var b: i32 = a.(2.6);
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3]
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462]
// CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6)
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: <specific function> = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %specific_fn.loc11_27.1: <specific function> = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0
// CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_27.2: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: <specific function> = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_27.2: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %specific_fn.loc11_27.2: <specific function> = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [template = constants.%int_6.e56]
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1
// CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [template = constants.%int_6.e56]
@@ -36,10 +36,13 @@ fn Main() {
// CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [template]
// CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [template]
// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, 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.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_5.64b, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template]
@@ -77,18 +80,18 @@ fn Main() {
// CHECK:STDOUT: %int_5.loc18_30: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b]
// CHECK:STDOUT: %int_5.loc18_33: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b]
// CHECK:STDOUT: %.loc18_34.1: %tuple.type = tuple_literal (%int_5.loc18_30, %int_5.loc18_33)
// CHECK:STDOUT: %impl.elem0.loc18_34.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc18_34.1: <bound method> = bound_method %int_5.loc18_30, %impl.elem0.loc18_34.1 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc18_34.1: <specific function> = specific_function %Convert.bound.loc18_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc18_34.1: init %i32 = call %Convert.specific_fn.loc18_34.1(%int_5.loc18_30) [template = constants.%int_5.0f6]
// CHECK:STDOUT: %impl.elem0.loc18_34.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc18_34.1: <bound method> = bound_method %int_5.loc18_30, %impl.elem0.loc18_34.1 [template = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn.loc18_34.1: <specific function> = specific_function %bound_method.loc18_34.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc18_34.1: init %i32 = call %specific_fn.loc18_34.1(%int_5.loc18_30) [template = constants.%int_5.0f6]
// CHECK:STDOUT: %.loc18_34.2: init %i32 = converted %int_5.loc18_30, %int.convert_checked.loc18_34.1 [template = constants.%int_5.0f6]
// CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [template = constants.%int_0]
// CHECK:STDOUT: %.loc18_34.3: ref %i32 = array_index %non_tuple.var, %int_0.loc18
// CHECK:STDOUT: %.loc18_34.4: init %i32 = initialize_from %.loc18_34.2 to %.loc18_34.3 [template = constants.%int_5.0f6]
// CHECK:STDOUT: %impl.elem0.loc18_34.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc18_34.2: <bound method> = bound_method %int_5.loc18_33, %impl.elem0.loc18_34.2 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc18_34.2: <specific function> = specific_function %Convert.bound.loc18_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc18_34.2: init %i32 = call %Convert.specific_fn.loc18_34.2(%int_5.loc18_33) [template = constants.%int_5.0f6]
// CHECK:STDOUT: %impl.elem0.loc18_34.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc18_34.2: <bound method> = bound_method %int_5.loc18_33, %impl.elem0.loc18_34.2 [template = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn.loc18_34.2: <specific function> = specific_function %bound_method.loc18_34.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc18_34.2: init %i32 = call %specific_fn.loc18_34.2(%int_5.loc18_33) [template = constants.%int_5.0f6]
// CHECK:STDOUT: %.loc18_34.5: init %i32 = converted %int_5.loc18_33, %int.convert_checked.loc18_34.2 [template = constants.%int_5.0f6]
// CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1]
// CHECK:STDOUT: %.loc18_34.6: ref %i32 = array_index %non_tuple.var, %int_1.loc18
@@ -25,10 +25,13 @@ var b: i32 = a.2;
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template]
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, 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.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.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.9a9: <specific function> = specific_function %Convert.bound.221, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template]
@@ -86,17 +89,17 @@ var b: i32 = a.2;
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3]
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462]
// CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6)
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %Convert.specific_fn.loc11_27.1: <specific function> = specific_function %Convert.bound.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %Convert.specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %specific_fn.loc11_27.1: <specific function> = specific_function %bound_method.loc11_27.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %specific_fn.loc11_27.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0
// CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_27.2: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %Convert.specific_fn.loc11_27.2: <specific function> = specific_function %Convert.bound.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %Convert.specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_27.2: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %specific_fn.loc11_27.2: <specific function> = specific_function %bound_method.loc11_27.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %specific_fn.loc11_27.2(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [template = constants.%int_6.e56]
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1
// CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [template = constants.%int_6.e56]
@@ -25,10 +25,13 @@ var b: i32 = a.({.index = 2}.index);
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [template]
// CHECK:STDOUT: %int_34.3f9: Core.IntLiteral = int_value 34 [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, 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.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.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.9a9: <specific function> = specific_function %Convert.bound.221, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template]
@@ -88,17 +91,17 @@ var b: i32 = a.({.index = 2}.index);
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12.6a3]
// CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [template = constants.%int_34.3f9]
// CHECK:STDOUT: %.loc11_28.1: %tuple.type.f94 = tuple_literal (%int_12, %int_34)
// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_28.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %Convert.specific_fn.loc11_28.1: <specific function> = specific_function %Convert.bound.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_28.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %specific_fn.loc11_28.1: <specific function> = specific_function %bound_method.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %specific_fn.loc11_28.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11_28.1 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0
// CHECK:STDOUT: %.loc11_28.3: init %i32 = initialize_from %.loc11_28.2 to %tuple.elem0 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_28.2: <bound method> = bound_method %int_34, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.82c]
// CHECK:STDOUT: %Convert.specific_fn.loc11_28.2: <specific function> = specific_function %Convert.bound.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6d4]
// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(%int_34) [template = constants.%int_34.980]
// CHECK:STDOUT: %impl.elem0.loc11_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_28.2: <bound method> = bound_method %int_34, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.82c]
// CHECK:STDOUT: %specific_fn.loc11_28.2: <specific function> = specific_function %bound_method.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6d4]
// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %specific_fn.loc11_28.2(%int_34) [template = constants.%int_34.980]
// CHECK:STDOUT: %.loc11_28.4: init %i32 = converted %int_34, %int.convert_checked.loc11_28.2 [template = constants.%int_34.980]
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1
// CHECK:STDOUT: %.loc11_28.5: init %i32 = initialize_from %.loc11_28.4 to %tuple.elem1 [template = constants.%int_34.980]
@@ -25,11 +25,15 @@ var d: i32 = a.({.index = 1 as i32}.index);
// CHECK:STDOUT: %true: bool = bool_literal true [template]
// CHECK:STDOUT: %int_34.3f9: Core.IntLiteral = int_value 34 [template]
// CHECK:STDOUT: %tuple.type.3c2: type = tuple_type (bool, 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: %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.82c: <bound method> = bound_method %int_34.3f9, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.6d4: <specific function> = specific_function %Convert.bound.82c, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_34.980: %i32 = int_value 34 [template]
@@ -38,16 +42,21 @@ var d: i32 = a.({.index = 1 as i32}.index);
// CHECK:STDOUT: %struct_type.index.b1b: type = struct_type {.index: Core.IntLiteral} [template]
// CHECK:STDOUT: %struct.972: %struct_type.index.b1b = struct_value (%int_1.5b8) [template]
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [template]
// CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.4, @As(%i32) [template]
// CHECK:STDOUT: %impl_witness.882: <witness> = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template]
// CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%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.129: <bound method> = bound_method %int_0.5c6, %Convert.197 [template]
// CHECK:STDOUT: %Convert.specific_fn.dc5: <specific function> = specific_function %Convert.bound.129, @Convert.5(%int_32) [template]
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template]
// 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.0fd: <bound method> = bound_method %int_0.6a9, %Convert.960 [template]
// CHECK:STDOUT: %Convert.specific_fn.f3f: <specific function> = specific_function %Convert.bound.0fd, @Convert.3(%int_32) [template]
// CHECK:STDOUT: %Convert.bound.c1b: <bound method> = bound_method %int_1.5b8, %Convert.197 [template]
@@ -134,10 +143,10 @@ var d: i32 = a.({.index = 1 as i32}.index);
// CHECK:STDOUT: %.loc11_31.1: %tuple.type.3c2 = tuple_literal (%true, %int_34)
// CHECK:STDOUT: %tuple.elem0.loc11: ref bool = tuple_access file.%a.var, element0
// CHECK:STDOUT: %.loc11_31.2: init bool = initialize_from %true to %tuple.elem0.loc11 [template = constants.%true]
// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11: <bound method> = bound_method %int_34, %impl.elem0.loc11 [template = constants.%Convert.bound.82c]
// CHECK:STDOUT: %Convert.specific_fn.loc11: <specific function> = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6d4]
// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %Convert.specific_fn.loc11(%int_34) [template = constants.%int_34.980]
// CHECK:STDOUT: %impl.elem0.loc11: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11: <bound method> = bound_method %int_34, %impl.elem0.loc11 [template = constants.%Convert.bound.82c]
// CHECK:STDOUT: %specific_fn.loc11: <specific function> = specific_function %bound_method.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.6d4]
// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %specific_fn.loc11(%int_34) [template = constants.%int_34.980]
// CHECK:STDOUT: %.loc11_31.3: init %i32 = converted %int_34, %int.convert_checked.loc11 [template = constants.%int_34.980]
// CHECK:STDOUT: %tuple.elem1.loc11: ref %i32 = tuple_access file.%a.var, element1
// CHECK:STDOUT: %.loc11_31.4: init %i32 = initialize_from %.loc11_31.3 to %tuple.elem1.loc11 [template = constants.%int_34.980]
@@ -157,16 +166,16 @@ var d: i32 = a.({.index = 1 as i32}.index);
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %impl.elem0.loc13_20.1: %Convert.type.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197]
// CHECK:STDOUT: %Convert.bound.loc13_20.1: <bound method> = bound_method %int_0, %impl.elem0.loc13_20.1 [template = constants.%Convert.bound.129]
// CHECK:STDOUT: %Convert.specific_fn.loc13_20.1: <specific function> = specific_function %Convert.bound.loc13_20.1, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.dc5]
// CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %Convert.specific_fn.loc13_20.1(%int_0) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %impl.elem0.loc13_20.1: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197]
// CHECK:STDOUT: %bound_method.loc13_20.1: <bound method> = bound_method %int_0, %impl.elem0.loc13_20.1 [template = constants.%Convert.bound.129]
// CHECK:STDOUT: %specific_fn.loc13_20.1: <specific function> = specific_function %bound_method.loc13_20.1, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.dc5]
// CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %specific_fn.loc13_20.1(%int_0) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20.1 [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_0, %.loc13_20.1 [template = constants.%int_0.6a9]
// CHECK:STDOUT: %impl.elem0.loc13_20.2: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
// CHECK:STDOUT: %Convert.bound.loc13_20.2: <bound method> = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [template = constants.%Convert.bound.0fd]
// CHECK:STDOUT: %Convert.specific_fn.loc13_20.2: <specific function> = specific_function %Convert.bound.loc13_20.2, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.f3f]
// CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %Convert.specific_fn.loc13_20.2(%.loc13_20.2) [template = constants.%int_0.5c6]
// CHECK:STDOUT: %impl.elem0.loc13_20.2: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
// CHECK:STDOUT: %bound_method.loc13_20.2: <bound method> = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [template = constants.%Convert.bound.0fd]
// CHECK:STDOUT: %specific_fn.loc13_20.2: <specific function> = specific_function %bound_method.loc13_20.2, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.f3f]
// CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %specific_fn.loc13_20.2(%.loc13_20.2) [template = constants.%int_0.5c6]
// CHECK:STDOUT: %.loc13_20.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_20.2 [template = constants.%int_0.5c6]
// CHECK:STDOUT: %.loc13_20.4: Core.IntLiteral = converted %.loc13_20.2, %.loc13_20.3 [template = constants.%int_0.5c6]
// CHECK:STDOUT: %tuple.elem0.loc13: ref bool = tuple_access %a.ref.loc13, element0
@@ -176,20 +185,20 @@ var d: i32 = a.({.index = 1 as i32}.index);
// CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %impl.elem0.loc14_29: %Convert.type.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197]
// CHECK:STDOUT: %Convert.bound.loc14_29: <bound method> = bound_method %int_1.loc14, %impl.elem0.loc14_29 [template = constants.%Convert.bound.c1b]
// CHECK:STDOUT: %Convert.specific_fn.loc14_29: <specific function> = specific_function %Convert.bound.loc14_29, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.f9a]
// CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %Convert.specific_fn.loc14_29(%int_1.loc14) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc14_29: %.214 = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197]
// CHECK:STDOUT: %bound_method.loc14_29: <bound method> = bound_method %int_1.loc14, %impl.elem0.loc14_29 [template = constants.%Convert.bound.c1b]
// CHECK:STDOUT: %specific_fn.loc14_29: <specific function> = specific_function %bound_method.loc14_29, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.f9a]
// CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %specific_fn.loc14_29(%int_1.loc14) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc14_29.1: %i32 = value_of_initializer %int.convert_checked.loc14_29 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc14_29.2: %i32 = converted %int_1.loc14, %.loc14_29.1 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc14_35.1: %struct_type.index.6ea = struct_literal (%.loc14_29.2)
// CHECK:STDOUT: %struct.loc14: %struct_type.index.6ea = struct_value (%.loc14_29.2) [template = constants.%struct.63a]
// CHECK:STDOUT: %.loc14_35.2: %struct_type.index.6ea = converted %.loc14_35.1, %struct.loc14 [template = constants.%struct.63a]
// CHECK:STDOUT: %.loc14_36.1: %i32 = struct_access %.loc14_35.2, element0 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc14_36: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
// CHECK:STDOUT: %Convert.bound.loc14_36: <bound method> = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [template = constants.%Convert.bound.faf]
// CHECK:STDOUT: %Convert.specific_fn.loc14_36: <specific function> = specific_function %Convert.bound.loc14_36, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.a84]
// CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %Convert.specific_fn.loc14_36(%.loc14_36.1) [template = constants.%int_1.5b8]
// CHECK:STDOUT: %impl.elem0.loc14_36: %.10e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
// CHECK:STDOUT: %bound_method.loc14_36: <bound method> = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [template = constants.%Convert.bound.faf]
// CHECK:STDOUT: %specific_fn.loc14_36: <specific function> = specific_function %bound_method.loc14_36, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.a84]
// CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %specific_fn.loc14_36(%.loc14_36.1) [template = constants.%int_1.5b8]
// CHECK:STDOUT: %.loc14_36.2: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_36 [template = constants.%int_1.5b8]
// CHECK:STDOUT: %.loc14_36.3: Core.IntLiteral = converted %.loc14_36.1, %.loc14_36.2 [template = constants.%int_1.5b8]
// CHECK:STDOUT: %tuple.elem1.loc14: ref %i32 = tuple_access %a.ref.loc14, element1
@@ -25,10 +25,13 @@ fn Run() -> i32 {
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (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.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_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]
@@ -81,10 +84,10 @@ fn Run() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
// CHECK:STDOUT: %.loc11_30.1: %tuple.type.985 = tuple_literal (%int_0)
// 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_0, %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_0) [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 %int_0, %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_0) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc11_30.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc11_30.3: %i32 = converted %int_0, %.loc11_30.2 [template = constants.%int_0.6a9]
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc11_30.3) [template = constants.%tuple]
@@ -27,10 +27,13 @@ var x: (i32, i32) = (2, 65.89);
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template]
// CHECK:STDOUT: %tuple.type.2c1: type = tuple_type (Core.IntLiteral, f64) [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]
@@ -72,10 +75,10 @@ var x: (i32, i32) = (2, 65.89);
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
// CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template = constants.%float]
// CHECK:STDOUT: %.loc18_30.1: %tuple.type.2c1 = tuple_literal (%int_2, %float)
// 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: %.loc18_30.2: init %i32 = converted %int_2, %int.convert_checked [template = constants.%int_2.ef8]
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%x.var, element0
// CHECK:STDOUT: %.loc18_30.3: init %i32 = initialize_from %.loc18_30.2 to %tuple.elem0 [template = constants.%int_2.ef8]
+62 -50
View File
@@ -63,10 +63,13 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template]
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (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.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.d04: <bound method> = bound_method %int_0.5c6, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.d62: <specific function> = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template]
@@ -185,16 +188,16 @@ var c_bad: C((3, 4)) = F();
// 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: %.loc9_18.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
// CHECK:STDOUT: %impl.elem0.loc9_18.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc9_18.1: <bound method> = bound_method %int_1, %impl.elem0.loc9_18.1 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %Convert.specific_fn.loc9_18.1: <specific function> = specific_function %Convert.bound.loc9_18.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %Convert.specific_fn.loc9_18.1(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc9_18.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc9_18.1: <bound method> = bound_method %int_1, %impl.elem0.loc9_18.1 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %specific_fn.loc9_18.1: <specific function> = specific_function %bound_method.loc9_18.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %specific_fn.loc9_18.1(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc9_18.2: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc9_18.3: %i32 = converted %int_1, %.loc9_18.2 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc9_18.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc9_18.2: <bound method> = bound_method %int_2, %impl.elem0.loc9_18.2 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %Convert.specific_fn.loc9_18.2: <specific function> = specific_function %Convert.bound.loc9_18.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %Convert.specific_fn.loc9_18.2(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0.loc9_18.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc9_18.2: <bound method> = bound_method %int_2, %impl.elem0.loc9_18.2 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc9_18.2: <specific function> = specific_function %bound_method.loc9_18.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %specific_fn.loc9_18.2(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc9_18.4: %i32 = value_of_initializer %int.convert_checked.loc9_18.2 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc9_18.5: %i32 = converted %int_2, %.loc9_18.4 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc9_18.3, %.loc9_18.5) [template = constants.%tuple.21c]
@@ -226,10 +229,10 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
// CHECK:STDOUT: %.loc4_24.1: %tuple.type.985 = tuple_literal (%int_0.loc4)
// CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc4: <bound method> = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.d04]
// CHECK:STDOUT: %Convert.specific_fn.loc4: <specific function> = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62]
// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %impl.elem0.loc4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc4: <bound method> = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.d04]
// CHECK:STDOUT: %specific_fn.loc4: <specific function> = specific_function %bound_method.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62]
// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc4_24.2: init %i32 = converted %int_0.loc4, %int.convert_checked.loc4 [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc4_24.3: init %tuple.type.a1c = tuple_init (%.loc4_24.2) to file.%a_ref.var [template = constants.%tuple.592]
// CHECK:STDOUT: %.loc4_1: init %tuple.type.a1c = converted %.loc4_24.1, %.loc4_24.3 [template = constants.%tuple.592]
@@ -242,37 +245,37 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
// CHECK:STDOUT: %.loc5_59.1: %tuple.type.f94 = tuple_literal (%int_2, %int_3)
// CHECK:STDOUT: %.loc5_60.1: %tuple.type.d47 = tuple_literal (%.loc5_51.1, %.loc5_59.1)
// CHECK:STDOUT: %impl.elem0.loc5_47: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc5_47: <bound method> = bound_method %int_0.loc5, %impl.elem0.loc5_47 [template = constants.%Convert.bound.d04]
// CHECK:STDOUT: %Convert.specific_fn.loc5_47: <specific function> = specific_function %Convert.bound.loc5_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62]
// CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %Convert.specific_fn.loc5_47(%int_0.loc5) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %impl.elem0.loc5_47: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc5_47: <bound method> = bound_method %int_0.loc5, %impl.elem0.loc5_47 [template = constants.%Convert.bound.d04]
// CHECK:STDOUT: %specific_fn.loc5_47: <specific function> = specific_function %bound_method.loc5_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62]
// CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %specific_fn.loc5_47(%int_0.loc5) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc5_47.2: init %i32 = converted %int_0.loc5, %int.convert_checked.loc5_47 [template = constants.%int_0.6a9]
// CHECK:STDOUT: %tuple.elem0.loc5_60: ref %tuple.type.fe6 = tuple_access file.%b_ref.var, element0
// CHECK:STDOUT: %tuple.elem0.loc5_51: ref %tuple.type.a1c = tuple_access %tuple.elem0.loc5_60, element0
// CHECK:STDOUT: %.loc5_47.3: init %tuple.type.a1c = tuple_init (%.loc5_47.2) to %tuple.elem0.loc5_51 [template = constants.%tuple.592]
// CHECK:STDOUT: %.loc5_51.2: init %tuple.type.a1c = converted %.loc5_47.1, %.loc5_47.3 [template = constants.%tuple.592]
// CHECK:STDOUT: %.loc5_51.3: init %tuple.type.a1c = initialize_from %.loc5_51.2 to %tuple.elem0.loc5_51 [template = constants.%tuple.592]
// CHECK:STDOUT: %impl.elem0.loc5_51: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc5_51: <bound method> = bound_method %int_1, %impl.elem0.loc5_51 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %Convert.specific_fn.loc5_51: <specific function> = specific_function %Convert.bound.loc5_51, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %Convert.specific_fn.loc5_51(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc5_51: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc5_51: <bound method> = bound_method %int_1, %impl.elem0.loc5_51 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %specific_fn.loc5_51: <specific function> = specific_function %bound_method.loc5_51, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %specific_fn.loc5_51(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc5_51.4: init %i32 = converted %int_1, %int.convert_checked.loc5_51 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %tuple.elem1.loc5_51: ref %i32 = tuple_access %tuple.elem0.loc5_60, element1
// CHECK:STDOUT: %.loc5_51.5: init %i32 = initialize_from %.loc5_51.4 to %tuple.elem1.loc5_51 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc5_51.6: init %tuple.type.fe6 = tuple_init (%.loc5_51.3, %.loc5_51.5) to %tuple.elem0.loc5_60 [template = constants.%tuple.236]
// CHECK:STDOUT: %.loc5_60.2: init %tuple.type.fe6 = converted %.loc5_51.1, %.loc5_51.6 [template = constants.%tuple.236]
// CHECK:STDOUT: %impl.elem0.loc5_59.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc5_59.1: <bound method> = bound_method %int_2, %impl.elem0.loc5_59.1 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %Convert.specific_fn.loc5_59.1: <specific function> = specific_function %Convert.bound.loc5_59.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %Convert.specific_fn.loc5_59.1(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0.loc5_59.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc5_59.1: <bound method> = bound_method %int_2, %impl.elem0.loc5_59.1 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc5_59.1: <specific function> = specific_function %bound_method.loc5_59.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %specific_fn.loc5_59.1(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc5_59.2: init %i32 = converted %int_2, %int.convert_checked.loc5_59.1 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %tuple.elem1.loc5_60: ref %tuple.type.d07 = tuple_access file.%b_ref.var, element1
// CHECK:STDOUT: %tuple.elem0.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element0
// CHECK:STDOUT: %.loc5_59.3: init %i32 = initialize_from %.loc5_59.2 to %tuple.elem0.loc5_59 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0.loc5_59.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc5_59.2: <bound method> = bound_method %int_3, %impl.elem0.loc5_59.2 [template = constants.%Convert.bound.b30]
// CHECK:STDOUT: %Convert.specific_fn.loc5_59.2: <specific function> = specific_function %Convert.bound.loc5_59.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42]
// CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %Convert.specific_fn.loc5_59.2(%int_3) [template = constants.%int_3.822]
// CHECK:STDOUT: %impl.elem0.loc5_59.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc5_59.2: <bound method> = bound_method %int_3, %impl.elem0.loc5_59.2 [template = constants.%Convert.bound.b30]
// CHECK:STDOUT: %specific_fn.loc5_59.2: <specific function> = specific_function %bound_method.loc5_59.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42]
// CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %specific_fn.loc5_59.2(%int_3) [template = constants.%int_3.822]
// CHECK:STDOUT: %.loc5_59.4: init %i32 = converted %int_3, %int.convert_checked.loc5_59.2 [template = constants.%int_3.822]
// CHECK:STDOUT: %tuple.elem1.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element1
// CHECK:STDOUT: %.loc5_59.5: init %i32 = initialize_from %.loc5_59.4 to %tuple.elem1.loc5_59 [template = constants.%int_3.822]
@@ -316,10 +319,13 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
// CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %impl_witness.847: <witness> = impl_witness (imports.%Implicit.import_ref.773), @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [template]
// CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound.dc5: <bound method> = bound_method %int_1.5b8, %Convert.4cb [template]
// CHECK:STDOUT: %Convert.specific_fn.51b: <specific function> = specific_function %Convert.bound.dc5, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [template]
@@ -343,8 +349,9 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Implicit.import_ref.554: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)]
// CHECK:STDOUT: %Implicit.import_ref.8f2: <witness> = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.357]
// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1108 [no loc], unloaded
// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1161 [no loc], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -407,16 +414,16 @@ var c_bad: C((3, 4)) = F();
// 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: %.loc6_15.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
// CHECK:STDOUT: %impl.elem0.loc6_15.1: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
// CHECK:STDOUT: %Convert.bound.loc6_15.1: <bound method> = bound_method %int_1, %impl.elem0.loc6_15.1 [template = constants.%Convert.bound.dc5]
// CHECK:STDOUT: %Convert.specific_fn.loc6_15.1: <specific function> = specific_function %Convert.bound.loc6_15.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.51b]
// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %Convert.specific_fn.loc6_15.1(%int_1) [template = constants.%int_1.47b]
// CHECK:STDOUT: %impl.elem0.loc6_15.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
// CHECK:STDOUT: %bound_method.loc6_15.1: <bound method> = bound_method %int_1, %impl.elem0.loc6_15.1 [template = constants.%Convert.bound.dc5]
// CHECK:STDOUT: %specific_fn.loc6_15.1: <specific function> = specific_function %bound_method.loc6_15.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.51b]
// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %specific_fn.loc6_15.1(%int_1) [template = constants.%int_1.47b]
// CHECK:STDOUT: %.loc6_15.2: %i32 = value_of_initializer %int.convert_checked.loc6_15.1 [template = constants.%int_1.47b]
// CHECK:STDOUT: %.loc6_15.3: %i32 = converted %int_1, %.loc6_15.2 [template = constants.%int_1.47b]
// CHECK:STDOUT: %impl.elem0.loc6_15.2: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
// CHECK:STDOUT: %Convert.bound.loc6_15.2: <bound method> = bound_method %int_2, %impl.elem0.loc6_15.2 [template = constants.%Convert.bound.30f]
// CHECK:STDOUT: %Convert.specific_fn.loc6_15.2: <specific function> = specific_function %Convert.bound.loc6_15.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b5]
// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %Convert.specific_fn.loc6_15.2(%int_2) [template = constants.%int_2.d0d]
// CHECK:STDOUT: %impl.elem0.loc6_15.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
// CHECK:STDOUT: %bound_method.loc6_15.2: <bound method> = bound_method %int_2, %impl.elem0.loc6_15.2 [template = constants.%Convert.bound.30f]
// CHECK:STDOUT: %specific_fn.loc6_15.2: <specific function> = specific_function %bound_method.loc6_15.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b5]
// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %specific_fn.loc6_15.2(%int_2) [template = constants.%int_2.d0d]
// CHECK:STDOUT: %.loc6_15.4: %i32 = value_of_initializer %int.convert_checked.loc6_15.2 [template = constants.%int_2.d0d]
// CHECK:STDOUT: %.loc6_15.5: %i32 = converted %int_2, %.loc6_15.4 [template = constants.%int_2.d0d]
// CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc6_15.3, %.loc6_15.5) [template = constants.%tuple]
@@ -426,7 +433,7 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: %c: ref %C.cf0 = bind_name c, %c.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(constants.%X: %tuple.type.c2c) [from "implicit.carbon"] {
// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.554: %tuple.type.c2c) [from "implicit.carbon"] {
// CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
// CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)]
// CHECK:STDOUT:
@@ -533,8 +540,9 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Implicit.import_ref.554: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)]
// CHECK:STDOUT: %Implicit.import_ref.8f2: <witness> = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.357]
// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1108 [no loc], unloaded
// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1161 [no loc], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -564,7 +572,7 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: %c_bad: <error> = bind_name c_bad, <error>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(constants.%X: %tuple.type.c2c) [from "implicit.carbon"] {
// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.554: %tuple.type.c2c) [from "implicit.carbon"] {
// CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
// CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)]
// CHECK:STDOUT:
@@ -616,10 +624,13 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
// CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %impl_witness.847: <witness> = impl_witness (imports.%Implicit.import_ref.773), @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [template]
// CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound.a00: <bound method> = bound_method %int_3.1ba, %Convert.4cb [template]
// CHECK:STDOUT: %Convert.specific_fn.dec: <specific function> = specific_function %Convert.bound.a00, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_3.d47: %i32 = int_value 3 [template]
@@ -646,8 +657,9 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Implicit.import_ref.554: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)]
// CHECK:STDOUT: %Implicit.import_ref.8f2: <witness> = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.357]
// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1108 [no loc], unloaded
// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1161 [no loc], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -672,16 +684,16 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1]
// CHECK:STDOUT: %.loc11_19.1: %tuple.type.f94 = tuple_literal (%int_3, %int_4)
// CHECK:STDOUT: %impl.elem0.loc11_19.1: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
// CHECK:STDOUT: %Convert.bound.loc11_19.1: <bound method> = bound_method %int_3, %impl.elem0.loc11_19.1 [template = constants.%Convert.bound.a00]
// CHECK:STDOUT: %Convert.specific_fn.loc11_19.1: <specific function> = specific_function %Convert.bound.loc11_19.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.dec]
// CHECK:STDOUT: %int.convert_checked.loc11_19.1: init %i32 = call %Convert.specific_fn.loc11_19.1(%int_3) [template = constants.%int_3.d47]
// CHECK:STDOUT: %impl.elem0.loc11_19.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
// CHECK:STDOUT: %bound_method.loc11_19.1: <bound method> = bound_method %int_3, %impl.elem0.loc11_19.1 [template = constants.%Convert.bound.a00]
// CHECK:STDOUT: %specific_fn.loc11_19.1: <specific function> = specific_function %bound_method.loc11_19.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.dec]
// CHECK:STDOUT: %int.convert_checked.loc11_19.1: init %i32 = call %specific_fn.loc11_19.1(%int_3) [template = constants.%int_3.d47]
// CHECK:STDOUT: %.loc11_19.2: %i32 = value_of_initializer %int.convert_checked.loc11_19.1 [template = constants.%int_3.d47]
// CHECK:STDOUT: %.loc11_19.3: %i32 = converted %int_3, %.loc11_19.2 [template = constants.%int_3.d47]
// CHECK:STDOUT: %impl.elem0.loc11_19.2: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
// CHECK:STDOUT: %Convert.bound.loc11_19.2: <bound method> = bound_method %int_4, %impl.elem0.loc11_19.2 [template = constants.%Convert.bound.694]
// CHECK:STDOUT: %Convert.specific_fn.loc11_19.2: <specific function> = specific_function %Convert.bound.loc11_19.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.739]
// CHECK:STDOUT: %int.convert_checked.loc11_19.2: init %i32 = call %Convert.specific_fn.loc11_19.2(%int_4) [template = constants.%int_4.ea3]
// CHECK:STDOUT: %impl.elem0.loc11_19.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
// CHECK:STDOUT: %bound_method.loc11_19.2: <bound method> = bound_method %int_4, %impl.elem0.loc11_19.2 [template = constants.%Convert.bound.694]
// CHECK:STDOUT: %specific_fn.loc11_19.2: <specific function> = specific_function %bound_method.loc11_19.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.739]
// CHECK:STDOUT: %int.convert_checked.loc11_19.2: init %i32 = call %specific_fn.loc11_19.2(%int_4) [template = constants.%int_4.ea3]
// CHECK:STDOUT: %.loc11_19.4: %i32 = value_of_initializer %int.convert_checked.loc11_19.2 [template = constants.%int_4.ea3]
// CHECK:STDOUT: %.loc11_19.5: %i32 = converted %int_4, %.loc11_19.4 [template = constants.%int_4.ea3]
// CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc11_19.3, %.loc11_19.5) [template = constants.%tuple.5de]
@@ -691,7 +703,7 @@ var c_bad: C((3, 4)) = F();
// CHECK:STDOUT: %c_bad: ref %C.ed5 = bind_name c_bad, %c_bad.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(constants.%X: %tuple.type.c2c) [from "implicit.carbon"] {
// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.554: %tuple.type.c2c) [from "implicit.carbon"] {
// CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
// CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)]
// CHECK:STDOUT:
+15 -12
View File
@@ -24,10 +24,13 @@ var x: ((i32, i32), i32) = ((12, 76), 6);
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [template]
// CHECK:STDOUT: %tuple.type.acf: type = tuple_type (%tuple.type.f94, 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.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.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.9a9: <specific function> = specific_function %Convert.bound.221, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [template]
@@ -83,27 +86,27 @@ var x: ((i32, i32), i32) = ((12, 76), 6);
// CHECK:STDOUT: %.loc11_36.1: %tuple.type.f94 = tuple_literal (%int_12, %int_76)
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6.462]
// CHECK:STDOUT: %.loc11_40.1: %tuple.type.acf = tuple_literal (%.loc11_36.1, %int_6)
// CHECK:STDOUT: %impl.elem0.loc11_36.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_36.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_36.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %Convert.specific_fn.loc11_36.1: <specific function> = specific_function %Convert.bound.loc11_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %Convert.specific_fn.loc11_36.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_36.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_36.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_36.1 [template = constants.%Convert.bound.221]
// CHECK:STDOUT: %specific_fn.loc11_36.1: <specific function> = specific_function %bound_method.loc11_36.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9a9]
// CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %specific_fn.loc11_36.1(%int_12) [template = constants.%int_12.1e1]
// CHECK:STDOUT: %.loc11_36.2: init %i32 = converted %int_12, %int.convert_checked.loc11_36.1 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %tuple.elem0.loc11_40: ref %tuple.type.d07 = tuple_access file.%x.var, element0
// CHECK:STDOUT: %tuple.elem0.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element0
// CHECK:STDOUT: %.loc11_36.3: init %i32 = initialize_from %.loc11_36.2 to %tuple.elem0.loc11_36 [template = constants.%int_12.1e1]
// CHECK:STDOUT: %impl.elem0.loc11_36.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_36.2: <bound method> = bound_method %int_76, %impl.elem0.loc11_36.2 [template = constants.%Convert.bound.033]
// CHECK:STDOUT: %Convert.specific_fn.loc11_36.2: <specific function> = specific_function %Convert.bound.loc11_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.454]
// CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %Convert.specific_fn.loc11_36.2(%int_76) [template = constants.%int_76.8dd]
// CHECK:STDOUT: %impl.elem0.loc11_36.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_36.2: <bound method> = bound_method %int_76, %impl.elem0.loc11_36.2 [template = constants.%Convert.bound.033]
// CHECK:STDOUT: %specific_fn.loc11_36.2: <specific function> = specific_function %bound_method.loc11_36.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.454]
// CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %specific_fn.loc11_36.2(%int_76) [template = constants.%int_76.8dd]
// CHECK:STDOUT: %.loc11_36.4: init %i32 = converted %int_76, %int.convert_checked.loc11_36.2 [template = constants.%int_76.8dd]
// CHECK:STDOUT: %tuple.elem1.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element1
// CHECK:STDOUT: %.loc11_36.5: init %i32 = initialize_from %.loc11_36.4 to %tuple.elem1.loc11_36 [template = constants.%int_76.8dd]
// CHECK:STDOUT: %.loc11_36.6: init %tuple.type.d07 = tuple_init (%.loc11_36.3, %.loc11_36.5) to %tuple.elem0.loc11_40 [template = constants.%tuple.737]
// CHECK:STDOUT: %.loc11_40.2: init %tuple.type.d07 = converted %.loc11_36.1, %.loc11_36.6 [template = constants.%tuple.737]
// CHECK:STDOUT: %impl.elem0.loc11_40: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_40: <bound method> = bound_method %int_6, %impl.elem0.loc11_40 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %Convert.specific_fn.loc11_40: <specific function> = specific_function %Convert.bound.loc11_40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %Convert.specific_fn.loc11_40(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %impl.elem0.loc11_40: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_40: <bound method> = bound_method %int_6, %impl.elem0.loc11_40 [template = constants.%Convert.bound.ce9]
// CHECK:STDOUT: %specific_fn.loc11_40: <specific function> = specific_function %bound_method.loc11_40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.631]
// CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %specific_fn.loc11_40(%int_6) [template = constants.%int_6.e56]
// CHECK:STDOUT: %.loc11_40.3: init %i32 = converted %int_6, %int.convert_checked.loc11_40 [template = constants.%int_6.e56]
// CHECK:STDOUT: %tuple.elem1.loc11_40: ref %i32 = tuple_access file.%x.var, element1
// CHECK:STDOUT: %.loc11_40.4: init %i32 = initialize_from %.loc11_40.3 to %tuple.elem1.loc11_40 [template = constants.%int_6.e56]
+11 -8
View File
@@ -38,10 +38,13 @@ fn H() {
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %tuple.type.667: type = tuple_type (Core.IntLiteral, %tuple.type.189, 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.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.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]
@@ -142,17 +145,17 @@ fn H() {
// CHECK:STDOUT: %F.call: init %tuple.type.189 = call %F.ref() to %tuple.elem1
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
// CHECK:STDOUT: %.loc18_50.1: %tuple.type.667 = tuple_literal (%int_1, %F.call, %int_2)
// CHECK:STDOUT: %impl.elem0.loc18_50.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc18_50.1: <bound method> = bound_method %int_1, %impl.elem0.loc18_50.1 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %Convert.specific_fn.loc18_50.1: <specific function> = specific_function %Convert.bound.loc18_50.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %Convert.specific_fn.loc18_50.1(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc18_50.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc18_50.1: <bound method> = bound_method %int_1, %impl.elem0.loc18_50.1 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %specific_fn.loc18_50.1: <specific function> = specific_function %bound_method.loc18_50.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %specific_fn.loc18_50.1(%int_1) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc18_50.2: init %i32 = converted %int_1, %int.convert_checked.loc18_50.1 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0
// CHECK:STDOUT: %.loc18_50.3: init %i32 = initialize_from %.loc18_50.2 to %tuple.elem0 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc18_50.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc18_50.2: <bound method> = bound_method %int_2, %impl.elem0.loc18_50.2 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %Convert.specific_fn.loc18_50.2: <specific function> = specific_function %Convert.bound.loc18_50.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %Convert.specific_fn.loc18_50.2(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %impl.elem0.loc18_50.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc18_50.2: <bound method> = bound_method %int_2, %impl.elem0.loc18_50.2 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc18_50.2: <specific function> = specific_function %bound_method.loc18_50.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %specific_fn.loc18_50.2(%int_2) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc18_50.4: init %i32 = converted %int_2, %int.convert_checked.loc18_50.2 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2
// CHECK:STDOUT: %.loc18_50.5: init %i32 = initialize_from %.loc18_50.4 to %tuple.elem2 [template = constants.%int_2.ef8]
+7 -4
View File
@@ -20,10 +20,13 @@ var y: (i32,) = x;
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template]
// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template]
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (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.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_4.0c1, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template]
@@ -76,10 +79,10 @@ var y: (i32,) = x;
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1]
// CHECK:STDOUT: %.loc11_20.1: %tuple.type.985 = tuple_literal (%int_4)
// 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_4, %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_4) [template = constants.%int_4.940]
// 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_4, %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_4) [template = constants.%int_4.940]
// CHECK:STDOUT: %.loc11_20.2: init %i32 = converted %int_4, %int.convert_checked [template = constants.%int_4.940]
// CHECK:STDOUT: %.loc11_20.3: init %tuple.type.a1c = tuple_init (%.loc11_20.2) to file.%x.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_20.1, %.loc11_20.3 [template = constants.%tuple]
+19 -16
View File
@@ -24,10 +24,13 @@ var y: (i32, i32) = x;
// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template]
// CHECK:STDOUT: %int_102.b54: Core.IntLiteral = int_value 102 [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, 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.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.ac3: <bound method> = bound_method %int_4.0c1, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.450: <specific function> = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template]
@@ -66,16 +69,16 @@ var y: (i32, i32) = x;
// CHECK:STDOUT: %.loc11_17.2: %tuple.type.24b = tuple_literal (%i32.loc11_9, %i32.loc11_14)
// CHECK:STDOUT: %.loc11_17.3: type = converted %.loc11_17.2, constants.%tuple.type.d07 [template = constants.%tuple.type.d07]
// CHECK:STDOUT: }
// CHECK:STDOUT: %impl.elem0.loc11_28.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_28.1: <bound method> = bound_method @__global_init.%int_4.loc11, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.ac3]
// CHECK:STDOUT: %Convert.specific_fn.loc11_28.1: <specific function> = specific_function %Convert.bound.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450]
// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %Convert.specific_fn.loc11_28.1(@__global_init.%int_4.loc11) [template = constants.%int_4.940]
// CHECK:STDOUT: %impl.elem0.loc11_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_28.1: <bound method> = bound_method @__global_init.%int_4.loc11, %impl.elem0.loc11_28.1 [template = constants.%Convert.bound.ac3]
// CHECK:STDOUT: %specific_fn.loc11_28.1: <specific function> = specific_function %bound_method.loc11_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450]
// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %specific_fn.loc11_28.1(@__global_init.%int_4.loc11) [template = constants.%int_4.940]
// CHECK:STDOUT: %.loc11_28.1: %i32 = value_of_initializer %int.convert_checked.loc11_28.1 [template = constants.%int_4.940]
// CHECK:STDOUT: %.loc11_28.2: %i32 = converted @__global_init.%int_4.loc11, %.loc11_28.1 [template = constants.%int_4.940]
// CHECK:STDOUT: %impl.elem0.loc11_28.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc11_28.2: <bound method> = bound_method @__global_init.%int_102.loc11, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.063]
// CHECK:STDOUT: %Convert.specific_fn.loc11_28.2: <specific function> = specific_function %Convert.bound.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b4]
// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %Convert.specific_fn.loc11_28.2(@__global_init.%int_102.loc11) [template = constants.%int_102.b91]
// CHECK:STDOUT: %impl.elem0.loc11_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc11_28.2: <bound method> = bound_method @__global_init.%int_102.loc11, %impl.elem0.loc11_28.2 [template = constants.%Convert.bound.063]
// CHECK:STDOUT: %specific_fn.loc11_28.2: <specific function> = specific_function %bound_method.loc11_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b4]
// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %specific_fn.loc11_28.2(@__global_init.%int_102.loc11) [template = constants.%int_102.b91]
// CHECK:STDOUT: %.loc11_28.3: %i32 = value_of_initializer %int.convert_checked.loc11_28.2 [template = constants.%int_102.b91]
// CHECK:STDOUT: %.loc11_28.4: %i32 = converted @__global_init.%int_102.loc11, %.loc11_28.3 [template = constants.%int_102.b91]
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc11_28.2, %.loc11_28.4) [template = constants.%tuple]
@@ -132,17 +135,17 @@ var y: (i32, i32) = x;
// CHECK:STDOUT: %int_4.loc14: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1]
// CHECK:STDOUT: %int_102.loc14: Core.IntLiteral = int_value 102 [template = constants.%int_102.b54]
// CHECK:STDOUT: %.loc14_28.1: %tuple.type.f94 = tuple_literal (%int_4.loc14, %int_102.loc14)
// CHECK:STDOUT: %impl.elem0.loc14_28.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc14_28.1: <bound method> = bound_method %int_4.loc14, %impl.elem0.loc14_28.1 [template = constants.%Convert.bound.ac3]
// CHECK:STDOUT: %Convert.specific_fn.loc14_28.1: <specific function> = specific_function %Convert.bound.loc14_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450]
// CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %Convert.specific_fn.loc14_28.1(%int_4.loc14) [template = constants.%int_4.940]
// CHECK:STDOUT: %impl.elem0.loc14_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc14_28.1: <bound method> = bound_method %int_4.loc14, %impl.elem0.loc14_28.1 [template = constants.%Convert.bound.ac3]
// CHECK:STDOUT: %specific_fn.loc14_28.1: <specific function> = specific_function %bound_method.loc14_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450]
// CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %specific_fn.loc14_28.1(%int_4.loc14) [template = constants.%int_4.940]
// CHECK:STDOUT: %.loc14_28.2: init %i32 = converted %int_4.loc14, %int.convert_checked.loc14_28.1 [template = constants.%int_4.940]
// CHECK:STDOUT: %tuple.elem0.loc14: ref %i32 = tuple_access file.%x.var, element0
// CHECK:STDOUT: %.loc14_28.3: init %i32 = initialize_from %.loc14_28.2 to %tuple.elem0.loc14 [template = constants.%int_4.940]
// CHECK:STDOUT: %impl.elem0.loc14_28.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %Convert.bound.loc14_28.2: <bound method> = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [template = constants.%Convert.bound.063]
// CHECK:STDOUT: %Convert.specific_fn.loc14_28.2: <specific function> = specific_function %Convert.bound.loc14_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b4]
// CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %Convert.specific_fn.loc14_28.2(%int_102.loc14) [template = constants.%int_102.b91]
// CHECK:STDOUT: %impl.elem0.loc14_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc14_28.2: <bound method> = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [template = constants.%Convert.bound.063]
// CHECK:STDOUT: %specific_fn.loc14_28.2: <specific function> = specific_function %bound_method.loc14_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b4]
// CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %specific_fn.loc14_28.2(%int_102.loc14) [template = constants.%int_102.b91]
// CHECK:STDOUT: %.loc14_28.4: init %i32 = converted %int_102.loc14, %int.convert_checked.loc14_28.2 [template = constants.%int_102.b91]
// CHECK:STDOUT: %tuple.elem1.loc14: ref %i32 = tuple_access file.%x.var, element1
// CHECK:STDOUT: %.loc14_28.5: init %i32 = initialize_from %.loc14_28.4 to %tuple.elem1.loc14 [template = constants.%int_102.b91]