method.carbon 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/builtin/method.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/method.carbon
  13. interface I {
  14. fn F[self: Self](other: Self) -> Self;
  15. }
  16. impl i32 as I {
  17. fn F[self: i32](other: i32) -> i32 = "int.sadd";
  18. }
  19. var arr: array(i32, (1 as i32).(I.F)(2));
  20. // CHECK:STDOUT: --- method.carbon
  21. // CHECK:STDOUT:
  22. // CHECK:STDOUT: constants {
  23. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  24. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  25. // CHECK:STDOUT: %Self.as_type.b70: type = facet_access_type %Self.826 [symbolic]
  26. // CHECK:STDOUT: %pattern_type.6de: type = pattern_type %Self.as_type.b70 [symbolic]
  27. // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
  28. // CHECK:STDOUT: %F.bc6: %F.type.cf0 = struct_value () [concrete]
  29. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  30. // CHECK:STDOUT: %assoc0.82e: %I.assoc_type = assoc_entity element0, @I.%F.decl [concrete]
  31. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  32. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  33. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  34. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  35. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  36. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  37. // CHECK:STDOUT: %F.type.066: type = fn_type @F.2 [concrete]
  38. // CHECK:STDOUT: %F.9ec: %F.type.066 = struct_value () [concrete]
  39. // CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, (%I.impl_witness) [concrete]
  40. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  41. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  42. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  43. // CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [concrete]
  44. // CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [concrete]
  45. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  46. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  47. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  48. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.3, @impl.4f9(%To.c80) [symbolic]
  49. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  50. // CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  51. // CHECK:STDOUT: %From: Core.IntLiteral = bind_symbolic_name From, 0 [symbolic]
  52. // CHECK:STDOUT: %Convert.type.708: type = fn_type @Convert.4, @impl.971(%From) [symbolic]
  53. // CHECK:STDOUT: %Convert.c68: %Convert.type.708 = struct_value () [symbolic]
  54. // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [concrete]
  55. // CHECK:STDOUT: %Convert.type.062: type = fn_type @Convert.5, @impl.686(%To.c80) [symbolic]
  56. // CHECK:STDOUT: %Convert.527: %Convert.type.062 = struct_value () [symbolic]
  57. // CHECK:STDOUT: %As.impl_witness.6b4: <witness> = impl_witness imports.%As.impl_witness_table.eb4, @impl.686(%int_32) [concrete]
  58. // CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.686(%int_32) [concrete]
  59. // CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [concrete]
  60. // CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, (%As.impl_witness.6b4) [concrete]
  61. // CHECK:STDOUT: %.982: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete]
  62. // CHECK:STDOUT: %Convert.bound.c1b: <bound method> = bound_method %int_1.5b8, %Convert.197 [concrete]
  63. // CHECK:STDOUT: %Convert.specific_fn.aad: <specific function> = specific_function %Convert.197, @Convert.5(%int_32) [concrete]
  64. // CHECK:STDOUT: %bound_method.082: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn.aad [concrete]
  65. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  66. // CHECK:STDOUT: %.5c7: type = fn_type_with_self_type %F.type.cf0, %I.facet [concrete]
  67. // CHECK:STDOUT: %F.bound: <bound method> = bound_method %int_1.5d2, %F.9ec [concrete]
  68. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  69. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  70. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.2, @ImplicitAs(%i32) [concrete]
  71. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  72. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.4f9(%int_32) [concrete]
  73. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  74. // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  75. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
  76. // CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
  77. // CHECK:STDOUT: %Convert.specific_fn.b6f: <specific function> = specific_function %Convert.956, @Convert.3(%int_32) [concrete]
  78. // CHECK:STDOUT: %bound_method.b92: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn.b6f [concrete]
  79. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  80. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  81. // CHECK:STDOUT: %ImplicitAs.impl_witness.a11: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.1d9, @impl.971(%int_32) [concrete]
  82. // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.4, @impl.971(%int_32) [concrete]
  83. // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [concrete]
  84. // CHECK:STDOUT: %ImplicitAs.facet.f49: %ImplicitAs.type.2fd = facet_value %i32, (%ImplicitAs.impl_witness.a11) [concrete]
  85. // CHECK:STDOUT: %.0ea: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.f49 [concrete]
  86. // CHECK:STDOUT: %Convert.bound.2d6: <bound method> = bound_method %int_3.822, %Convert.960 [concrete]
  87. // CHECK:STDOUT: %Convert.specific_fn.8a8: <specific function> = specific_function %Convert.960, @Convert.4(%int_32) [concrete]
  88. // CHECK:STDOUT: %bound_method.c6f: <bound method> = bound_method %int_3.822, %Convert.specific_fn.8a8 [concrete]
  89. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  90. // CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32 [concrete]
  91. // CHECK:STDOUT: %pattern_type.5d8: type = pattern_type %array_type [concrete]
  92. // CHECK:STDOUT: }
  93. // CHECK:STDOUT:
  94. // CHECK:STDOUT: imports {
  95. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  96. // CHECK:STDOUT: .Int = %Core.Int
  97. // CHECK:STDOUT: .As = %Core.As
  98. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  99. // CHECK:STDOUT: import Core//prelude
  100. // CHECK:STDOUT: import Core//prelude/...
  101. // CHECK:STDOUT: }
  102. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  103. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic]
  104. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  105. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  106. // CHECK:STDOUT: %Core.import_ref.85c: @impl.971.%Convert.type (%Convert.type.708) = import_ref Core//prelude/types/int, loc23_44, loaded [symbolic = @impl.971.%Convert (constants.%Convert.c68)]
  107. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1d9 = impl_witness_table (%Core.import_ref.85c), @impl.971 [concrete]
  108. // CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude/types/int, loc28_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)]
  109. // CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete]
  110. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  111. // CHECK:STDOUT: }
  112. // CHECK:STDOUT:
  113. // CHECK:STDOUT: file {
  114. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  115. // CHECK:STDOUT: .Core = imports.%Core
  116. // CHECK:STDOUT: .I = %I.decl
  117. // CHECK:STDOUT: .arr = %arr
  118. // CHECK:STDOUT: }
  119. // CHECK:STDOUT: %Core.import = import Core
  120. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  121. // CHECK:STDOUT: impl_decl @impl.a9a [concrete] {} {
  122. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  123. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  124. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  125. // CHECK:STDOUT: }
  126. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.a9a.%F.decl), @impl.a9a [concrete]
  127. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  128. // CHECK:STDOUT: name_binding_decl {
  129. // CHECK:STDOUT: %arr.patt: %pattern_type.5d8 = binding_pattern arr [concrete]
  130. // CHECK:STDOUT: %arr.var_patt: %pattern_type.5d8 = var_pattern %arr.patt [concrete]
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT: %arr.var: ref %array_type = var %arr.var_patt [concrete]
  133. // CHECK:STDOUT: %.loc22_40: type = splice_block %array_type [concrete = constants.%array_type] {
  134. // CHECK:STDOUT: %int_32.loc22_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  135. // CHECK:STDOUT: %i32.loc22_16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  136. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  137. // CHECK:STDOUT: %int_32.loc22_27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  138. // CHECK:STDOUT: %i32.loc22_27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  139. // CHECK:STDOUT: %impl.elem0.loc22_24: %.982 = impl_witness_access constants.%As.impl_witness.6b4, element0 [concrete = constants.%Convert.197]
  140. // CHECK:STDOUT: %bound_method.loc22_24.1: <bound method> = bound_method %int_1, %impl.elem0.loc22_24 [concrete = constants.%Convert.bound.c1b]
  141. // CHECK:STDOUT: %specific_fn.loc22_24: <specific function> = specific_function %impl.elem0.loc22_24, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.aad]
  142. // CHECK:STDOUT: %bound_method.loc22_24.2: <bound method> = bound_method %int_1, %specific_fn.loc22_24 [concrete = constants.%bound_method.082]
  143. // CHECK:STDOUT: %int.convert_checked.loc22_24: init %i32 = call %bound_method.loc22_24.2(%int_1) [concrete = constants.%int_1.5d2]
  144. // CHECK:STDOUT: %.loc22_24.1: %i32 = value_of_initializer %int.convert_checked.loc22_24 [concrete = constants.%int_1.5d2]
  145. // CHECK:STDOUT: %.loc22_24.2: %i32 = converted %int_1, %.loc22_24.1 [concrete = constants.%int_1.5d2]
  146. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  147. // CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.%assoc0 [concrete = constants.%assoc0.82e]
  148. // CHECK:STDOUT: %impl.elem0.loc22_31: %.5c7 = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%F.9ec]
  149. // CHECK:STDOUT: %bound_method.loc22_31: <bound method> = bound_method %.loc22_24.2, %impl.elem0.loc22_31 [concrete = constants.%F.bound]
  150. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  151. // CHECK:STDOUT: %impl.elem0.loc22_38: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  152. // CHECK:STDOUT: %bound_method.loc22_38.1: <bound method> = bound_method %int_2, %impl.elem0.loc22_38 [concrete = constants.%Convert.bound.ef9]
  153. // CHECK:STDOUT: %specific_fn.loc22_38: <specific function> = specific_function %impl.elem0.loc22_38, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f]
  154. // CHECK:STDOUT: %bound_method.loc22_38.2: <bound method> = bound_method %int_2, %specific_fn.loc22_38 [concrete = constants.%bound_method.b92]
  155. // CHECK:STDOUT: %int.convert_checked.loc22_38: init %i32 = call %bound_method.loc22_38.2(%int_2) [concrete = constants.%int_2.ef8]
  156. // CHECK:STDOUT: %.loc22_38.1: %i32 = value_of_initializer %int.convert_checked.loc22_38 [concrete = constants.%int_2.ef8]
  157. // CHECK:STDOUT: %.loc22_38.2: %i32 = converted %int_2, %.loc22_38.1 [concrete = constants.%int_2.ef8]
  158. // CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc22_31(%.loc22_24.2, %.loc22_38.2) [concrete = constants.%int_3.822]
  159. // CHECK:STDOUT: %impl.elem0.loc22_39: %.0ea = impl_witness_access constants.%ImplicitAs.impl_witness.a11, element0 [concrete = constants.%Convert.960]
  160. // CHECK:STDOUT: %bound_method.loc22_39.1: <bound method> = bound_method %int.sadd, %impl.elem0.loc22_39 [concrete = constants.%Convert.bound.2d6]
  161. // CHECK:STDOUT: %specific_fn.loc22_39: <specific function> = specific_function %impl.elem0.loc22_39, @Convert.4(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8]
  162. // CHECK:STDOUT: %bound_method.loc22_39.2: <bound method> = bound_method %int.sadd, %specific_fn.loc22_39 [concrete = constants.%bound_method.c6f]
  163. // CHECK:STDOUT: %.loc22_39.1: %i32 = value_of_initializer %int.sadd [concrete = constants.%int_3.822]
  164. // CHECK:STDOUT: %.loc22_39.2: %i32 = converted %int.sadd, %.loc22_39.1 [concrete = constants.%int_3.822]
  165. // CHECK:STDOUT: %int.convert_checked.loc22_39: init Core.IntLiteral = call %bound_method.loc22_39.2(%.loc22_39.2) [concrete = constants.%int_3.1ba]
  166. // CHECK:STDOUT: %.loc22_39.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc22_39 [concrete = constants.%int_3.1ba]
  167. // CHECK:STDOUT: %.loc22_39.4: Core.IntLiteral = converted %int.sadd, %.loc22_39.3 [concrete = constants.%int_3.1ba]
  168. // CHECK:STDOUT: %array_type: type = array_type %.loc22_39.4, %i32.loc22_16 [concrete = constants.%array_type]
  169. // CHECK:STDOUT: }
  170. // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT:
  173. // CHECK:STDOUT: interface @I {
  174. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  175. // CHECK:STDOUT: %F.decl: %F.type.cf0 = fn_decl @F.1 [concrete = constants.%F.bc6] {
  176. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type (%pattern_type.6de) = binding_pattern self [concrete]
  177. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type (%pattern_type.6de) = value_param_pattern %self.patt, call_param0 [concrete]
  178. // CHECK:STDOUT: %other.patt: @F.1.%pattern_type (%pattern_type.6de) = binding_pattern other [concrete]
  179. // CHECK:STDOUT: %other.param_patt: @F.1.%pattern_type (%pattern_type.6de) = value_param_pattern %other.patt, call_param1 [concrete]
  180. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.6de) = return_slot_pattern [concrete]
  181. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.6de) = out_param_pattern %return.patt, call_param2 [concrete]
  182. // CHECK:STDOUT: } {
  183. // CHECK:STDOUT: %Self.ref.loc15_36: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)]
  184. // CHECK:STDOUT: %Self.as_type.loc15_36: type = facet_access_type %Self.ref.loc15_36 [symbolic = %Self.as_type.loc15_14.1 (constants.%Self.as_type.b70)]
  185. // CHECK:STDOUT: %.loc15_36: type = converted %Self.ref.loc15_36, %Self.as_type.loc15_36 [symbolic = %Self.as_type.loc15_14.1 (constants.%Self.as_type.b70)]
  186. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc15_14.1 (%Self.as_type.b70) = value_param call_param0
  187. // CHECK:STDOUT: %.loc15_14.1: type = splice_block %.loc15_14.2 [symbolic = %Self.as_type.loc15_14.1 (constants.%Self.as_type.b70)] {
  188. // CHECK:STDOUT: %Self.ref.loc15_14: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)]
  189. // CHECK:STDOUT: %Self.as_type.loc15_14.2: type = facet_access_type %Self.ref.loc15_14 [symbolic = %Self.as_type.loc15_14.1 (constants.%Self.as_type.b70)]
  190. // CHECK:STDOUT: %.loc15_14.2: type = converted %Self.ref.loc15_14, %Self.as_type.loc15_14.2 [symbolic = %Self.as_type.loc15_14.1 (constants.%Self.as_type.b70)]
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc15_14.1 (%Self.as_type.b70) = bind_name self, %self.param
  193. // CHECK:STDOUT: %other.param: @F.1.%Self.as_type.loc15_14.1 (%Self.as_type.b70) = value_param call_param1
  194. // CHECK:STDOUT: %.loc15_27.1: type = splice_block %.loc15_27.2 [symbolic = %Self.as_type.loc15_14.1 (constants.%Self.as_type.b70)] {
  195. // CHECK:STDOUT: %Self.ref.loc15_27: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)]
  196. // CHECK:STDOUT: %Self.as_type.loc15_27: type = facet_access_type %Self.ref.loc15_27 [symbolic = %Self.as_type.loc15_14.1 (constants.%Self.as_type.b70)]
  197. // CHECK:STDOUT: %.loc15_27.2: type = converted %Self.ref.loc15_27, %Self.as_type.loc15_27 [symbolic = %Self.as_type.loc15_14.1 (constants.%Self.as_type.b70)]
  198. // CHECK:STDOUT: }
  199. // CHECK:STDOUT: %other: @F.1.%Self.as_type.loc15_14.1 (%Self.as_type.b70) = bind_name other, %other.param
  200. // CHECK:STDOUT: %return.param: ref @F.1.%Self.as_type.loc15_14.1 (%Self.as_type.b70) = out_param call_param2
  201. // CHECK:STDOUT: %return: ref @F.1.%Self.as_type.loc15_14.1 (%Self.as_type.b70) = return_slot %return.param
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0.82e]
  204. // CHECK:STDOUT:
  205. // CHECK:STDOUT: !members:
  206. // CHECK:STDOUT: .Self = %Self
  207. // CHECK:STDOUT: .F = %assoc0
  208. // CHECK:STDOUT: witness = (%F.decl)
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: impl @impl.a9a: %i32 as %I.ref {
  212. // CHECK:STDOUT: %F.decl: %F.type.066 = fn_decl @F.2 [concrete = constants.%F.9ec] {
  213. // CHECK:STDOUT: %self.patt: %pattern_type.7ce = binding_pattern self [concrete]
  214. // CHECK:STDOUT: %self.param_patt: %pattern_type.7ce = value_param_pattern %self.patt, call_param0 [concrete]
  215. // CHECK:STDOUT: %other.patt: %pattern_type.7ce = binding_pattern other [concrete]
  216. // CHECK:STDOUT: %other.param_patt: %pattern_type.7ce = value_param_pattern %other.patt, call_param1 [concrete]
  217. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  218. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete]
  219. // CHECK:STDOUT: } {
  220. // CHECK:STDOUT: %int_32.loc19_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  221. // CHECK:STDOUT: %i32.loc19_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  222. // CHECK:STDOUT: %self.param: %i32 = value_param call_param0
  223. // CHECK:STDOUT: %.loc19_14: type = splice_block %i32.loc19_14 [concrete = constants.%i32] {
  224. // CHECK:STDOUT: %int_32.loc19_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  225. // CHECK:STDOUT: %i32.loc19_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT: %self: %i32 = bind_name self, %self.param
  228. // CHECK:STDOUT: %other.param: %i32 = value_param call_param1
  229. // CHECK:STDOUT: %.loc19_26: type = splice_block %i32.loc19_26 [concrete = constants.%i32] {
  230. // CHECK:STDOUT: %int_32.loc19_26: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  231. // CHECK:STDOUT: %i32.loc19_26: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT: %other: %i32 = bind_name other, %other.param
  234. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
  235. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: !members:
  239. // CHECK:STDOUT: .F = %F.decl
  240. // CHECK:STDOUT: witness = file.%I.impl_witness
  241. // CHECK:STDOUT: }
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  244. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.826)]
  245. // CHECK:STDOUT: %Self.as_type.loc15_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc15_14.1 (constants.%Self.as_type.b70)]
  246. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc15_14.1 [symbolic = %pattern_type (constants.%pattern_type.6de)]
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc15_14.1 (%Self.as_type.b70), %other.param: @F.1.%Self.as_type.loc15_14.1 (%Self.as_type.b70)) -> @F.1.%Self.as_type.loc15_14.1 (%Self.as_type.b70);
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: fn @F.2(%self.param: %i32, %other.param: %i32) -> %i32 = "int.sadd";
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: specific @F.1(constants.%Self.826) {
  254. // CHECK:STDOUT: %Self => constants.%Self.826
  255. // CHECK:STDOUT: %Self.as_type.loc15_14.1 => constants.%Self.as_type.b70
  256. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6de
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT:
  259. // CHECK:STDOUT: specific @F.1(constants.%I.facet) {
  260. // CHECK:STDOUT: %Self => constants.%I.facet
  261. // CHECK:STDOUT: %Self.as_type.loc15_14.1 => constants.%i32
  262. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT: