| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/no_prelude/access.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/no_prelude/access.carbon
- // --- access_assoc_fn.carbon
- library "[[@TEST_NAME]]";
- interface I {
- fn DoIt();
- }
- fn Use(T:! I) {
- T.DoIt();
- }
- // --- assoc_fn_using_self.carbon
- library "[[@TEST_NAME]]";
- interface I {
- fn Make() -> Self;
- }
- fn Use(T:! I) -> T {
- return T.Make();
- }
- // --- fail_todo_access_assoc_method.carbon
- library "[[@TEST_NAME]]";
- interface I {
- fn Copy[self: Self]() -> Self;
- }
- fn Use[T:! I](x: T) -> T {
- // CHECK:STDERR: fail_todo_access_assoc_method.carbon:[[@LINE+4]]:10: error: type `T` does not support qualified expressions [QualifiedExprUnsupported]
- // CHECK:STDERR: return x.Copy();
- // CHECK:STDERR: ^~~~~~
- // CHECK:STDERR:
- return x.Copy();
- }
- // --- access_assoc_method_indirect.carbon
- library "[[@TEST_NAME]]";
- interface I {
- fn Copy[self: Self]() -> Self;
- }
- fn UseIndirect[T:! I](x: T) -> T {
- return x.(T.Copy)();
- }
- // CHECK:STDOUT: --- access_assoc_fn.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
- // CHECK:STDOUT: %DoIt.type: type = fn_type @DoIt [template]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
- // CHECK:STDOUT: %DoIt: %DoIt.type = struct_value () [template]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [template]
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%DoIt.decl [template]
- // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %Use.type: type = fn_type @Use [template]
- // CHECK:STDOUT: %Use: %Use.type = struct_value () [template]
- // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
- // CHECK:STDOUT: %T.as_wit: <witness> = facet_access_witness %T [symbolic]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, %T.as_wit [symbolic]
- // CHECK:STDOUT: %.d9e: type = fn_type_with_self_type %DoIt.type, %I.facet [symbolic]
- // CHECK:STDOUT: %impl.elem0: %.d9e = impl_witness_access %T.as_wit, element0 [symbolic]
- // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @DoIt(%I.facet) [symbolic]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = %I.decl
- // CHECK:STDOUT: .Use = %Use.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
- // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] {
- // CHECK:STDOUT: %T.patt.loc8_8.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc8_8.1, runtime_param<none> [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.param: %I.type = value_param runtime_param<none>
- // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
- // CHECK:STDOUT: %T.loc8_8.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface @I {
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
- // CHECK:STDOUT: %DoIt.decl: %DoIt.type = fn_decl @DoIt [template = constants.%DoIt] {} {}
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %DoIt.decl [template = constants.%assoc0]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = %Self
- // CHECK:STDOUT: .DoIt = %assoc0
- // CHECK:STDOUT: witness = (%DoIt.decl)
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @DoIt(@I.%Self: %I.type) {
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Use(%T.loc8_8.1: %I.type) {
- // CHECK:STDOUT: %T.loc8_8.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %T.patt.loc8_8.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %T.as_type.loc9_4.2: type = facet_access_type %T.loc8_8.2 [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %T.as_wit.loc9_4.2: <witness> = facet_access_witness %T.loc8_8.2 [symbolic = %T.as_wit.loc9_4.2 (constants.%T.as_wit)]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc9_4.2, %T.as_wit.loc9_4.2 [symbolic = %I.facet (constants.%I.facet)]
- // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%DoIt.type, %I.facet [symbolic = %.loc9_4.2 (constants.%.d9e)]
- // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Use.%.loc9_4.2 (%.d9e) = impl_witness_access %T.as_wit.loc9_4.2, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)]
- // CHECK:STDOUT: %specific_fn.loc9_4.2: <specific function> = specific_function %impl.elem0.loc9_4.2, @DoIt(%I.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn(%T.param_patt: %I.type) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %T.ref: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %DoIt.ref: %I.assoc_type = name_ref DoIt, @I.%assoc0 [template = constants.%assoc0]
- // CHECK:STDOUT: %T.as_type.loc9_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc9_4.1: type = converted %T.ref, %T.as_type.loc9_4.1 [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %T.as_wit.loc9_4.1: <witness> = facet_access_witness %T.ref [symbolic = %T.as_wit.loc9_4.2 (constants.%T.as_wit)]
- // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Use.%.loc9_4.2 (%.d9e) = impl_witness_access %T.as_wit.loc9_4.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)]
- // CHECK:STDOUT: %specific_fn.loc9_4.1: <specific function> = specific_function %impl.elem0.loc9_4.1, @DoIt(constants.%I.facet) [symbolic = %specific_fn.loc9_4.2 (constants.%specific_fn)]
- // CHECK:STDOUT: %DoIt.call: init %empty_tuple.type = call %specific_fn.loc9_4.1()
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @DoIt(constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Use(constants.%T) {
- // CHECK:STDOUT: %T.loc8_8.2 => constants.%T
- // CHECK:STDOUT: %T.patt.loc8_8.2 => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @DoIt(constants.%I.facet) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @DoIt(@Use.%I.facet) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- assoc_fn_using_self.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
- // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
- // CHECK:STDOUT: %Make.type: type = fn_type @Make [template]
- // CHECK:STDOUT: %Make: %Make.type = struct_value () [template]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [template]
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Make.decl [template]
- // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
- // CHECK:STDOUT: %Use.type: type = fn_type @Use [template]
- // CHECK:STDOUT: %Use: %Use.type = struct_value () [template]
- // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type [symbolic]
- // CHECK:STDOUT: %T.as_wit: <witness> = facet_access_witness %T [symbolic]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, %T.as_wit [symbolic]
- // CHECK:STDOUT: %.aaf: type = fn_type_with_self_type %Make.type, %I.facet [symbolic]
- // CHECK:STDOUT: %impl.elem0: %.aaf = impl_witness_access %T.as_wit, element0 [symbolic]
- // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Make(%I.facet) [symbolic]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = %I.decl
- // CHECK:STDOUT: .Use = %Use.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
- // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] {
- // CHECK:STDOUT: %T.patt.loc8_8.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc8_8.1, runtime_param<none> [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)]
- // CHECK:STDOUT: %return.patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.ref.loc8: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %T.as_type.loc8_18.1: type = facet_access_type %T.ref.loc8 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc8: type = converted %T.ref.loc8, %T.as_type.loc8_18.1 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %T.param: %I.type = value_param runtime_param<none>
- // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
- // CHECK:STDOUT: %T.loc8_8.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %return.param: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = out_param runtime_param0
- // CHECK:STDOUT: %return: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface @I {
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
- // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {
- // CHECK:STDOUT: %return.patt: @Make.%Self.as_type.loc5_16.1 (%Self.as_type) = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: @Make.%Self.as_type.loc5_16.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Self.as_type.loc5_16.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_16.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: %.loc5: type = converted %Self.ref, %Self.as_type.loc5_16.2 [symbolic = %Self.as_type.loc5_16.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: %return.param: ref @Make.%Self.as_type.loc5_16.1 (%Self.as_type) = out_param runtime_param0
- // CHECK:STDOUT: %return: ref @Make.%Self.as_type.loc5_16.1 (%Self.as_type) = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %Make.decl [template = constants.%assoc0]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = %Self
- // CHECK:STDOUT: .Make = %assoc0
- // CHECK:STDOUT: witness = (%Make.decl)
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Make(@I.%Self: %I.type) {
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Self.as_type.loc5_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_16.1 (constants.%Self.as_type)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn() -> @Make.%Self.as_type.loc5_16.1 (%Self.as_type);
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Use(%T.loc8_8.1: %I.type) {
- // CHECK:STDOUT: %T.loc8_8.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %T.patt.loc8_8.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.as_type.loc8_18.2: type = facet_access_type %T.loc8_8.2 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Use.%T.as_type.loc8_18.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)]
- // CHECK:STDOUT: %T.as_wit.loc9_11.2: <witness> = facet_access_witness %T.loc8_8.2 [symbolic = %T.as_wit.loc9_11.2 (constants.%T.as_wit)]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_18.2, %T.as_wit.loc9_11.2 [symbolic = %I.facet (constants.%I.facet)]
- // CHECK:STDOUT: %.loc9_11.2: type = fn_type_with_self_type constants.%Make.type, %I.facet [symbolic = %.loc9_11.2 (constants.%.aaf)]
- // CHECK:STDOUT: %impl.elem0.loc9_11.2: @Use.%.loc9_11.2 (%.aaf) = impl_witness_access %T.as_wit.loc9_11.2, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)]
- // CHECK:STDOUT: %specific_fn.loc9_11.2: <specific function> = specific_function %impl.elem0.loc9_11.2, @Make(%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn(%T.param_patt: %I.type) -> @Use.%T.as_type.loc8_18.2 (%T.as_type) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %T.ref.loc9: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %Make.ref: %I.assoc_type = name_ref Make, @I.%assoc0 [template = constants.%assoc0]
- // CHECK:STDOUT: %T.as_type.loc9: type = facet_access_type %T.ref.loc9 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc9_11.1: type = converted %T.ref.loc9, %T.as_type.loc9 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %T.as_wit.loc9_11.1: <witness> = facet_access_witness %T.ref.loc9 [symbolic = %T.as_wit.loc9_11.2 (constants.%T.as_wit)]
- // CHECK:STDOUT: %impl.elem0.loc9_11.1: @Use.%.loc9_11.2 (%.aaf) = impl_witness_access %T.as_wit.loc9_11.1, element0 [symbolic = %impl.elem0.loc9_11.2 (constants.%impl.elem0)]
- // CHECK:STDOUT: %specific_fn.loc9_11.1: <specific function> = specific_function %impl.elem0.loc9_11.1, @Make(constants.%I.facet) [symbolic = %specific_fn.loc9_11.2 (constants.%specific_fn)]
- // CHECK:STDOUT: %Make.call: init @Use.%T.as_type.loc8_18.2 (%T.as_type) = call %specific_fn.loc9_11.1()
- // CHECK:STDOUT: %.loc9_17.1: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = temporary_storage
- // CHECK:STDOUT: %.loc9_17.2: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = temporary %.loc9_17.1, %Make.call
- // CHECK:STDOUT: %.loc9_17.3: @Use.%T.as_type.loc8_18.2 (%T.as_type) = bind_value %.loc9_17.2
- // CHECK:STDOUT: return %.loc9_17.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Make(constants.%Self) {
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %Self.as_type.loc5_16.1 => constants.%Self.as_type
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Use(constants.%T) {
- // CHECK:STDOUT: %T.loc8_8.2 => constants.%T
- // CHECK:STDOUT: %T.patt.loc8_8.2 => constants.%T
- // CHECK:STDOUT: %T.as_type.loc8_18.2 => constants.%T.as_type
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Make(constants.%I.facet) {
- // CHECK:STDOUT: %Self => constants.%I.facet
- // CHECK:STDOUT: %Self.as_type.loc5_16.1 => constants.%T.as_type
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Make(@Use.%I.facet) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_todo_access_assoc_method.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
- // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
- // CHECK:STDOUT: %Copy.type: type = fn_type @Copy [template]
- // CHECK:STDOUT: %Copy: %Copy.type = struct_value () [template]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [template]
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Copy.decl [template]
- // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
- // CHECK:STDOUT: %Use.type: type = fn_type @Use [template]
- // CHECK:STDOUT: %Use: %Use.type = struct_value () [template]
- // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type [symbolic]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = %I.decl
- // CHECK:STDOUT: .Use = %Use.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
- // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] {
- // CHECK:STDOUT: %T.patt.loc8_8.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc8_8.1, runtime_param<none> [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)]
- // CHECK:STDOUT: %x.patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = binding_pattern x
- // CHECK:STDOUT: %x.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = value_param_pattern %x.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type) = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.ref.loc8_24: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %T.as_type.loc8_24: type = facet_access_type %T.ref.loc8_24 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc8_24: type = converted %T.ref.loc8_24, %T.as_type.loc8_24 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %T.param: %I.type = value_param runtime_param<none>
- // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
- // CHECK:STDOUT: %T.loc8_8.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %x.param: @Use.%T.as_type.loc8_18.2 (%T.as_type) = value_param runtime_param0
- // CHECK:STDOUT: %.loc8_18.1: type = splice_block %.loc8_18.2 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)] {
- // CHECK:STDOUT: %T.ref.loc8_18: %I.type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %T.as_type.loc8_18.1: type = facet_access_type %T.ref.loc8_18 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc8_18.2: type = converted %T.ref.loc8_18, %T.as_type.loc8_18.1 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %x: @Use.%T.as_type.loc8_18.2 (%T.as_type) = bind_name x, %x.param
- // CHECK:STDOUT: %return.param: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = out_param runtime_param1
- // CHECK:STDOUT: %return: ref @Use.%T.as_type.loc8_18.2 (%T.as_type) = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface @I {
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
- // CHECK:STDOUT: %Copy.decl: %Copy.type = fn_decl @Copy [template = constants.%Copy] {
- // CHECK:STDOUT: %self.patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = binding_pattern self
- // CHECK:STDOUT: %self.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %Self.ref.loc5_28: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: %.loc5_28: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: %self.param: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = value_param runtime_param0
- // CHECK:STDOUT: %.loc5_17.1: type = splice_block %.loc5_17.2 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] {
- // CHECK:STDOUT: %Self.ref.loc5_17: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Self.as_type.loc5_17.2: type = facet_access_type %Self.ref.loc5_17 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: %.loc5_17.2: type = converted %Self.ref.loc5_17, %Self.as_type.loc5_17.2 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %self: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = bind_name self, %self.param
- // CHECK:STDOUT: %return.param: ref @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = out_param runtime_param1
- // CHECK:STDOUT: %return: ref @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %Copy.decl [template = constants.%assoc0]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = %Self
- // CHECK:STDOUT: .Copy = %assoc0
- // CHECK:STDOUT: witness = (%Copy.decl)
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Copy(@I.%Self: %I.type) {
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Self.as_type.loc5_17.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn[%self.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type)]() -> @Copy.%Self.as_type.loc5_17.1 (%Self.as_type);
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Use(%T.loc8_8.1: %I.type) {
- // CHECK:STDOUT: %T.loc8_8.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)]
- // CHECK:STDOUT: %T.patt.loc8_8.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_8.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.as_type.loc8_18.2: type = facet_access_type %T.loc8_8.2 [symbolic = %T.as_type.loc8_18.2 (constants.%T.as_type)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Use.%T.as_type.loc8_18.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn[%T.param_patt: %I.type](%x.param_patt: @Use.%T.as_type.loc8_18.2 (%T.as_type)) -> @Use.%T.as_type.loc8_18.2 (%T.as_type) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %x.ref: @Use.%T.as_type.loc8_18.2 (%T.as_type) = name_ref x, %x
- // CHECK:STDOUT: return <error>
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Copy(constants.%Self) {
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %Self.as_type.loc5_17.1 => constants.%Self.as_type
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Use(constants.%T) {
- // CHECK:STDOUT: %T.loc8_8.2 => constants.%T
- // CHECK:STDOUT: %T.patt.loc8_8.2 => constants.%T
- // CHECK:STDOUT: %T.as_type.loc8_18.2 => constants.%T.as_type
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- access_assoc_method_indirect.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
- // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
- // CHECK:STDOUT: %Copy.type: type = fn_type @Copy [template]
- // CHECK:STDOUT: %Copy: %Copy.type = struct_value () [template]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [template]
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Copy.decl [template]
- // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %T.patt: %I.type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
- // CHECK:STDOUT: %UseIndirect.type: type = fn_type @UseIndirect [template]
- // CHECK:STDOUT: %UseIndirect: %UseIndirect.type = struct_value () [template]
- // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type [symbolic]
- // CHECK:STDOUT: %T.as_wit: <witness> = facet_access_witness %T [symbolic]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type, %T.as_wit [symbolic]
- // CHECK:STDOUT: %.4ef: type = fn_type_with_self_type %Copy.type, %I.facet [symbolic]
- // CHECK:STDOUT: %impl.elem0: %.4ef = impl_witness_access %T.as_wit, element0 [symbolic]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = %I.decl
- // CHECK:STDOUT: .UseIndirect = %UseIndirect.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
- // CHECK:STDOUT: %UseIndirect.decl: %UseIndirect.type = fn_decl @UseIndirect [template = constants.%UseIndirect] {
- // CHECK:STDOUT: %T.patt.loc8_16.1: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.param_patt: %I.type = value_param_pattern %T.patt.loc8_16.1, runtime_param<none> [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)]
- // CHECK:STDOUT: %x.patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = binding_pattern x
- // CHECK:STDOUT: %x.param_patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = value_param_pattern %x.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.ref.loc8_32: %I.type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)]
- // CHECK:STDOUT: %T.as_type.loc8_32: type = facet_access_type %T.ref.loc8_32 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc8_32: type = converted %T.ref.loc8_32, %T.as_type.loc8_32 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %T.param: %I.type = value_param runtime_param<none>
- // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
- // CHECK:STDOUT: %T.loc8_16.1: %I.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_16.2 (constants.%T)]
- // CHECK:STDOUT: %x.param: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = value_param runtime_param0
- // CHECK:STDOUT: %.loc8_26.1: type = splice_block %.loc8_26.2 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)] {
- // CHECK:STDOUT: %T.ref.loc8_26: %I.type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)]
- // CHECK:STDOUT: %T.as_type.loc8_26.1: type = facet_access_type %T.ref.loc8_26 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc8_26.2: type = converted %T.ref.loc8_26, %T.as_type.loc8_26.1 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %x: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = bind_name x, %x.param
- // CHECK:STDOUT: %return.param: ref @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = out_param runtime_param1
- // CHECK:STDOUT: %return: ref @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface @I {
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
- // CHECK:STDOUT: %Copy.decl: %Copy.type = fn_decl @Copy [template = constants.%Copy] {
- // CHECK:STDOUT: %self.patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = binding_pattern self
- // CHECK:STDOUT: %self.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %Self.ref.loc5_28: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: %.loc5_28: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: %self.param: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = value_param runtime_param0
- // CHECK:STDOUT: %.loc5_17.1: type = splice_block %.loc5_17.2 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)] {
- // CHECK:STDOUT: %Self.ref.loc5_17: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Self.as_type.loc5_17.2: type = facet_access_type %Self.ref.loc5_17 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: %.loc5_17.2: type = converted %Self.ref.loc5_17, %Self.as_type.loc5_17.2 [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %self: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = bind_name self, %self.param
- // CHECK:STDOUT: %return.param: ref @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = out_param runtime_param1
- // CHECK:STDOUT: %return: ref @Copy.%Self.as_type.loc5_17.1 (%Self.as_type) = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %Copy.decl [template = constants.%assoc0]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = %Self
- // CHECK:STDOUT: .Copy = %assoc0
- // CHECK:STDOUT: witness = (%Copy.decl)
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Copy(@I.%Self: %I.type) {
- // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %Self.as_type.loc5_17.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_17.1 (constants.%Self.as_type)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn[%self.param_patt: @Copy.%Self.as_type.loc5_17.1 (%Self.as_type)]() -> @Copy.%Self.as_type.loc5_17.1 (%Self.as_type);
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @UseIndirect(%T.loc8_16.1: %I.type) {
- // CHECK:STDOUT: %T.loc8_16.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_16.2 (constants.%T)]
- // CHECK:STDOUT: %T.patt.loc8_16.2: %I.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_16.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.as_type.loc8_26.2: type = facet_access_type %T.loc8_16.2 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete)]
- // CHECK:STDOUT: %T.as_wit.loc9_14.2: <witness> = facet_access_witness %T.loc8_16.2 [symbolic = %T.as_wit.loc9_14.2 (constants.%T.as_wit)]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %T.as_type.loc8_26.2, %T.as_wit.loc9_14.2 [symbolic = %I.facet (constants.%I.facet)]
- // CHECK:STDOUT: %.loc9_14.2: type = fn_type_with_self_type constants.%Copy.type, %I.facet [symbolic = %.loc9_14.2 (constants.%.4ef)]
- // CHECK:STDOUT: %impl.elem0.loc9_14.2: @UseIndirect.%.loc9_14.2 (%.4ef) = impl_witness_access %T.as_wit.loc9_14.2, element0 [symbolic = %impl.elem0.loc9_14.2 (constants.%impl.elem0)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn[%T.param_patt: %I.type](%x.param_patt: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type)) -> @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %x.ref: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = name_ref x, %x
- // CHECK:STDOUT: %T.ref.loc9: %I.type = name_ref T, %T.loc8_16.1 [symbolic = %T.loc8_16.2 (constants.%T)]
- // CHECK:STDOUT: %Copy.ref: %I.assoc_type = name_ref Copy, @I.%assoc0 [template = constants.%assoc0]
- // CHECK:STDOUT: %T.as_type.loc9: type = facet_access_type %T.ref.loc9 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc9_14.1: type = converted %T.ref.loc9, %T.as_type.loc9 [symbolic = %T.as_type.loc8_26.2 (constants.%T.as_type)]
- // CHECK:STDOUT: %T.as_wit.loc9_14.1: <witness> = facet_access_witness %T.ref.loc9 [symbolic = %T.as_wit.loc9_14.2 (constants.%T.as_wit)]
- // CHECK:STDOUT: %impl.elem0.loc9_14.1: @UseIndirect.%.loc9_14.2 (%.4ef) = impl_witness_access %T.as_wit.loc9_14.1, element0 [symbolic = %impl.elem0.loc9_14.2 (constants.%impl.elem0)]
- // CHECK:STDOUT: %bound_method: <bound method> = bound_method %x.ref, %impl.elem0.loc9_14.1
- // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Copy(constants.%I.facet)
- // CHECK:STDOUT: %Copy.call: init @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = call %specific_fn(%x.ref)
- // CHECK:STDOUT: %.loc9_21.1: ref @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = temporary_storage
- // CHECK:STDOUT: %.loc9_21.2: ref @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = temporary %.loc9_21.1, %Copy.call
- // CHECK:STDOUT: %.loc9_21.3: @UseIndirect.%T.as_type.loc8_26.2 (%T.as_type) = bind_value %.loc9_21.2
- // CHECK:STDOUT: return %.loc9_21.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Copy(constants.%Self) {
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %Self.as_type.loc5_17.1 => constants.%Self.as_type
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @UseIndirect(constants.%T) {
- // CHECK:STDOUT: %T.loc8_16.2 => constants.%T
- // CHECK:STDOUT: %T.patt.loc8_16.2 => constants.%T
- // CHECK:STDOUT: %T.as_type.loc8_26.2 => constants.%T.as_type
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Copy(constants.%I.facet) {
- // CHECK:STDOUT: %Self => constants.%I.facet
- // CHECK:STDOUT: %Self.as_type.loc5_17.1 => constants.%T.as_type
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|