mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 22:02:45 +01:00
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:
co-authored by
Jon Ross-Perkins
parent
dcfccd3187
commit
fcfb1345d5
+55
-40
@@ -453,10 +453,13 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
|
||||
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [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_1.5b8, %Convert.956 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
|
||||
@@ -576,10 +579,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: assign file.%a.var, %A.call
|
||||
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [template = constants.%B]
|
||||
// CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc7: <bound method> = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc7: <specific function> = specific_function %Convert.bound.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %Convert.specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc7: <bound method> = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc7: <specific function> = specific_function %bound_method.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc7_16.1: %i32 = value_of_initializer %int.convert_checked.loc7 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc7_16.2: %i32 = converted %int_1.loc7, %.loc7_16.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc7_16.2)
|
||||
@@ -587,10 +590,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [template = constants.%C]
|
||||
// CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc8_25.1: %tuple.type.985 = tuple_literal (%int_1.loc8)
|
||||
// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc8: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc8: <specific function> = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc8: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc8: <specific function> = specific_function %bound_method.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc8_25.2: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc8_25.3: %i32 = converted %int_1.loc8, %.loc8_25.2 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc8_25.3) [template = constants.%tuple]
|
||||
@@ -627,10 +630,13 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %E.type: type = fn_type @E [template]
|
||||
// CHECK:STDOUT: %E: %E.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [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_1.5b8, %Convert.956 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
|
||||
@@ -767,10 +773,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: assign file.%a.var, %A.call
|
||||
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B]
|
||||
// CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc53: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc53: <specific function> = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc53: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc53: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc53: <specific function> = specific_function %bound_method.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2)
|
||||
@@ -778,10 +784,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54)
|
||||
// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc54: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc54: <specific function> = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc54: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc54: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc54: <specific function> = specific_function %bound_method.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [template = constants.%tuple]
|
||||
@@ -818,10 +824,13 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %E.type: type = fn_type @E [template]
|
||||
// CHECK:STDOUT: %E: %E.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [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_1.5b8, %Convert.956 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
|
||||
@@ -958,10 +967,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: assign file.%a.var, %A.call
|
||||
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B]
|
||||
// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc13: <bound method> = bound_method %int_1.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc13: <specific function> = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_1.loc13) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc13: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %int_1.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc13: <specific function> = specific_function %bound_method.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %specific_fn.loc13(%int_1.loc13) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc13_16.1: %i32 = value_of_initializer %int.convert_checked.loc13 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc13_16.2: %i32 = converted %int_1.loc13, %.loc13_16.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc13_16.2)
|
||||
@@ -969,10 +978,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc14_25.1: %tuple.type.985 = tuple_literal (%int_1.loc14)
|
||||
// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc14: <bound method> = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc14: <specific function> = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc14: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc14: <bound method> = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc14: <specific function> = specific_function %bound_method.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc14_25.2: %i32 = value_of_initializer %int.convert_checked.loc14 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc14_25.3: %i32 = converted %int_1.loc14, %.loc14_25.2 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc14_25.3) [template = constants.%tuple]
|
||||
@@ -1000,10 +1009,13 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
|
||||
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [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_1.5b8, %Convert.956 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
|
||||
@@ -1123,10 +1135,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: assign file.%a.var, %A.call
|
||||
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [template = constants.%B]
|
||||
// CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc53: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc53: <specific function> = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc53: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc53: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc53: <specific function> = specific_function %bound_method.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2)
|
||||
@@ -1134,10 +1146,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [template = constants.%C]
|
||||
// CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54)
|
||||
// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc54: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc54: <specific function> = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc54: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc54: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc54: <specific function> = specific_function %bound_method.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [template = constants.%tuple]
|
||||
@@ -1165,10 +1177,13 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
|
||||
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [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_1.5b8, %Convert.956 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
|
||||
@@ -1288,10 +1303,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: assign file.%a.var, %A.call
|
||||
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [template = constants.%B]
|
||||
// CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc53: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc53: <specific function> = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc53: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc53: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc53: <specific function> = specific_function %bound_method.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2)
|
||||
@@ -1299,10 +1314,10 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [template = constants.%C]
|
||||
// CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54)
|
||||
// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc54: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc54: <specific function> = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc54: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc54: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc54: <specific function> = specific_function %bound_method.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [template = constants.%tuple]
|
||||
|
||||
Reference in New Issue
Block a user