generic_method.carbon 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/generic_method.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/generic_method.carbon
  10. // --- generic_method_fewer_params.carbon
  11. library "[[@TEST_NAME]]";
  12. // T has index 0, Self has index 1, U has index 2.
  13. interface A(T:! type) {
  14. fn F(U:! type, u: U) -> (T, Self, U);
  15. }
  16. class X {}
  17. class Y {}
  18. class Z {}
  19. impl Y as A(X) {
  20. // Here, U has index 0. The specific used for A.F needs to renumber its U from
  21. // index 2 to index 0.
  22. fn F(U:! type, u: U) -> (X, Y, U) {
  23. return ({}, {}, u);
  24. }
  25. }
  26. fn Call() {
  27. (Y as A(X)).F(Z, {});
  28. }
  29. fn CallGeneric(T:! A(X)) {
  30. T.F(Z, {});
  31. }
  32. fn CallIndirect() {
  33. CallGeneric(Y);
  34. }
  35. // --- generic_method_more_params.carbon
  36. library "[[@TEST_NAME]]";
  37. // T has index 0, Self has index 1, U has index 2.
  38. interface A(T:! type) {
  39. fn F(U:! type, u: U) -> (T, Self, U);
  40. }
  41. class X {}
  42. class Y1 {}
  43. class Y2 {}
  44. class Z {}
  45. impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) {
  46. // Here, U has index 3. The specific used for A.F needs to renumber its U from
  47. // index 2 to index 3.
  48. fn F(U:! type, u: U) -> (W, (V1, V2), U) {
  49. return F(U, u);
  50. }
  51. }
  52. fn Call() {
  53. // TODO: The `as type` here should not be necessary.
  54. (((Y1, Y2) as type) as A(X)).F(Z, {});
  55. }
  56. fn CallGeneric(T:! A(X)) {
  57. T.F(Z, {});
  58. }
  59. fn CallIndirect() {
  60. // TODO: The `as type` here should not be necessary.
  61. CallGeneric((Y1, Y2) as type);
  62. }
  63. // CHECK:STDOUT: --- generic_method_fewer_params.carbon
  64. // CHECK:STDOUT:
  65. // CHECK:STDOUT: constants {
  66. // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
  67. // CHECK:STDOUT: %T.patt.e01: type = symbolic_binding_pattern T, 0 [symbolic]
  68. // CHECK:STDOUT: %A.type.495: type = generic_interface_type @A [concrete]
  69. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  70. // CHECK:STDOUT: %A.generic: %A.type.495 = struct_value () [concrete]
  71. // CHECK:STDOUT: %A.type.75a: type = facet_type <@A, @A(%T.8b3)> [symbolic]
  72. // CHECK:STDOUT: %Self.753: %A.type.75a = bind_symbolic_name Self, 1 [symbolic]
  73. // CHECK:STDOUT: %U.2cb: type = bind_symbolic_name U, 2 [symbolic]
  74. // CHECK:STDOUT: %U.patt.b3a: type = symbolic_binding_pattern U, 2 [symbolic]
  75. // CHECK:STDOUT: %tuple.type.e59: type = tuple_type (type, %A.type.75a, type) [symbolic]
  76. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.753 [symbolic]
  77. // CHECK:STDOUT: %tuple.type.bd2: type = tuple_type (%T.8b3, %Self.as_type, %U.2cb) [symbolic]
  78. // CHECK:STDOUT: %F.type.17a: type = fn_type @F.1, @A(%T.8b3) [symbolic]
  79. // CHECK:STDOUT: %F.0d8: %F.type.17a = struct_value () [symbolic]
  80. // CHECK:STDOUT: %A.assoc_type.ed3: type = assoc_entity_type @A, @A(%T.8b3) [symbolic]
  81. // CHECK:STDOUT: %assoc0.fcb: %A.assoc_type.ed3 = assoc_entity element0, @A.%F.decl [symbolic]
  82. // CHECK:STDOUT: %X: type = class_type @X [concrete]
  83. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  84. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  85. // CHECK:STDOUT: %Y: type = class_type @Y [concrete]
  86. // CHECK:STDOUT: %Z: type = class_type @Z [concrete]
  87. // CHECK:STDOUT: %A.type.91f: type = facet_type <@A, @A(%X)> [concrete]
  88. // CHECK:STDOUT: %Self.1bb: %A.type.91f = bind_symbolic_name Self, 1 [symbolic]
  89. // CHECK:STDOUT: %F.type.13d: type = fn_type @F.1, @A(%X) [concrete]
  90. // CHECK:STDOUT: %F.d83: %F.type.13d = struct_value () [concrete]
  91. // CHECK:STDOUT: %A.assoc_type.296: type = assoc_entity_type @A, @A(%X) [concrete]
  92. // CHECK:STDOUT: %assoc0.5f6: %A.assoc_type.296 = assoc_entity element0, @A.%F.decl [concrete]
  93. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [concrete]
  94. // CHECK:STDOUT: %U.8b3: type = bind_symbolic_name U, 0 [symbolic]
  95. // CHECK:STDOUT: %U.patt.e01: type = symbolic_binding_pattern U, 0 [symbolic]
  96. // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete]
  97. // CHECK:STDOUT: %tuple.type.765: type = tuple_type (%X, %Y, %U.8b3) [symbolic]
  98. // CHECK:STDOUT: %F.type.436: type = fn_type @F.2 [concrete]
  99. // CHECK:STDOUT: %F.ce9: %F.type.436 = struct_value () [concrete]
  100. // CHECK:STDOUT: %A.facet.166: %A.type.91f = facet_value %Y, (%impl_witness) [concrete]
  101. // CHECK:STDOUT: %tuple.type.a0c: type = tuple_type (type, %A.type.91f, type) [concrete]
  102. // CHECK:STDOUT: %require_complete.816: <witness> = require_complete_type %tuple.type.765 [symbolic]
  103. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %U.8b3 [symbolic]
  104. // CHECK:STDOUT: %tuple.type.a41: type = tuple_type (%empty_struct_type, %empty_struct_type, %U.8b3) [symbolic]
  105. // CHECK:STDOUT: %X.val: %X = struct_value () [concrete]
  106. // CHECK:STDOUT: %Y.val: %Y = struct_value () [concrete]
  107. // CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete]
  108. // CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete]
  109. // CHECK:STDOUT: %.6fe: type = fn_type_with_self_type %F.type.13d, %A.facet.166 [concrete]
  110. // CHECK:STDOUT: %tuple.type.f6b: type = tuple_type (%X, %Y, %Z) [concrete]
  111. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ce9, @F.2(%Z) [concrete]
  112. // CHECK:STDOUT: %Z.val: %Z = struct_value () [concrete]
  113. // CHECK:STDOUT: %T.9c2: %A.type.91f = bind_symbolic_name T, 0 [symbolic]
  114. // CHECK:STDOUT: %T.patt.e81: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic]
  115. // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete]
  116. // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete]
  117. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.9c2 [symbolic]
  118. // CHECK:STDOUT: %T.as_wit.iface0: <witness> = facet_access_witness %T.9c2, element0 [symbolic]
  119. // CHECK:STDOUT: %A.facet.834: %A.type.91f = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic]
  120. // CHECK:STDOUT: %.591: type = fn_type_with_self_type %F.type.13d, %A.facet.834 [symbolic]
  121. // CHECK:STDOUT: %impl.elem0: %.591 = impl_witness_access %T.as_wit.iface0, element0 [symbolic]
  122. // CHECK:STDOUT: %tuple.type.e28: type = tuple_type (%X, %T.as_type, %Z) [symbolic]
  123. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @F.1(%X, %A.facet.834, %Z) [symbolic]
  124. // CHECK:STDOUT: %require_complete.500: <witness> = require_complete_type %tuple.type.e28 [symbolic]
  125. // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete]
  126. // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete]
  127. // CHECK:STDOUT: %CallGeneric.specific_fn: <specific function> = specific_function %CallGeneric, @CallGeneric(%A.facet.166) [concrete]
  128. // CHECK:STDOUT: %complete_type.a64: <witness> = complete_type_witness %tuple.type.f6b [concrete]
  129. // CHECK:STDOUT: %tuple.type.9c8: type = tuple_type (%empty_struct_type, %empty_struct_type, %Z) [concrete]
  130. // CHECK:STDOUT: }
  131. // CHECK:STDOUT:
  132. // CHECK:STDOUT: file {
  133. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  134. // CHECK:STDOUT: .A = %A.decl
  135. // CHECK:STDOUT: .X = %X.decl
  136. // CHECK:STDOUT: .Y = %Y.decl
  137. // CHECK:STDOUT: .Z = %Z.decl
  138. // CHECK:STDOUT: .Call = %Call.decl
  139. // CHECK:STDOUT: .CallGeneric = %CallGeneric.decl
  140. // CHECK:STDOUT: .CallIndirect = %CallIndirect.decl
  141. // CHECK:STDOUT: }
  142. // CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [concrete = constants.%A.generic] {
  143. // CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)]
  144. // CHECK:STDOUT: } {
  145. // CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)]
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
  148. // CHECK:STDOUT: %Y.decl: type = class_decl @Y [concrete = constants.%Y] {} {}
  149. // CHECK:STDOUT: %Z.decl: type = class_decl @Z [concrete = constants.%Z] {} {}
  150. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  151. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y]
  152. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  153. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  154. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [concrete = constants.%impl_witness]
  157. // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {}
  158. // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] {
  159. // CHECK:STDOUT: %T.patt.loc25_16.1: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_16.2 (constants.%T.patt.e81)]
  160. // CHECK:STDOUT: } {
  161. // CHECK:STDOUT: %.loc25: type = splice_block %A.type [concrete = constants.%A.type.91f] {
  162. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  163. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  164. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT: %T.loc25_16.1: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc25_16.2 (constants.%T.9c2)]
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {}
  169. // CHECK:STDOUT: }
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: generic interface @A(%T.loc5_13.1: type) {
  172. // CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)]
  173. // CHECK:STDOUT: %T.patt.loc5_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)]
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: !definition:
  176. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T.loc5_13.2)> [symbolic = %A.type (constants.%A.type.75a)]
  177. // CHECK:STDOUT: %Self.2: @A.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.753)]
  178. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @A(%T.loc5_13.2) [symbolic = %F.type (constants.%F.type.17a)]
  179. // CHECK:STDOUT: %F: @A.%F.type (%F.type.17a) = struct_value () [symbolic = %F (constants.%F.0d8)]
  180. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A, @A(%T.loc5_13.2) [symbolic = %A.assoc_type (constants.%A.assoc_type.ed3)]
  181. // CHECK:STDOUT: %assoc0.loc6_39.2: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)]
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: interface {
  184. // CHECK:STDOUT: %Self.1: @A.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.753)]
  185. // CHECK:STDOUT: %F.decl: @A.%F.type (%F.type.17a) = fn_decl @F.1 [symbolic = @A.%F (constants.%F.0d8)] {
  186. // CHECK:STDOUT: %U.patt.loc6_8.1: type = symbolic_binding_pattern U, 2 [symbolic = %U.patt.loc6_8.2 (constants.%U.patt.b3a)]
  187. // CHECK:STDOUT: %u.patt: @F.1.%U.loc6_8.1 (%U.2cb) = binding_pattern u
  188. // CHECK:STDOUT: %u.param_patt: @F.1.%U.loc6_8.1 (%U.2cb) = value_param_pattern %u.patt, call_param0
  189. // CHECK:STDOUT: %return.patt: @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = return_slot_pattern
  190. // CHECK:STDOUT: %return.param_patt: @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = out_param_pattern %return.patt, call_param1
  191. // CHECK:STDOUT: } {
  192. // CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_13.1 [symbolic = %T (constants.%T.8b3)]
  193. // CHECK:STDOUT: %.loc6_31: @F.1.%A.type (%A.type.75a) = specific_constant @A.%Self.1, @A(constants.%T.8b3) [symbolic = %Self (constants.%Self.753)]
  194. // CHECK:STDOUT: %Self.ref: @F.1.%A.type (%A.type.75a) = name_ref Self, %.loc6_31 [symbolic = %Self (constants.%Self.753)]
  195. // CHECK:STDOUT: %U.ref.loc6_37: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  196. // CHECK:STDOUT: %.loc6_38.1: @F.1.%tuple.type.loc6_38.1 (%tuple.type.e59) = tuple_literal (%T.ref, %Self.ref, %U.ref.loc6_37)
  197. // CHECK:STDOUT: %Self.as_type.loc6_38.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  198. // CHECK:STDOUT: %.loc6_38.2: type = converted %Self.ref, %Self.as_type.loc6_38.2 [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  199. // CHECK:STDOUT: %.loc6_38.3: type = converted %.loc6_38.1, constants.%tuple.type.bd2 [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)]
  200. // CHECK:STDOUT: %U.loc6_8.2: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  201. // CHECK:STDOUT: %u.param: @F.1.%U.loc6_8.1 (%U.2cb) = value_param call_param0
  202. // CHECK:STDOUT: %U.ref.loc6_21: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  203. // CHECK:STDOUT: %u: @F.1.%U.loc6_8.1 (%U.2cb) = bind_name u, %u.param
  204. // CHECK:STDOUT: %return.param: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = out_param call_param1
  205. // CHECK:STDOUT: %return: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = return_slot %return.param
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT: %assoc0.loc6_39.1: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)]
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: !members:
  210. // CHECK:STDOUT: .Self = %Self.1
  211. // CHECK:STDOUT: .T = <poisoned>
  212. // CHECK:STDOUT: .F = %assoc0.loc6_39.1
  213. // CHECK:STDOUT: witness = (%F.decl)
  214. // CHECK:STDOUT: }
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT:
  217. // CHECK:STDOUT: impl @impl: %Y.ref as %A.type {
  218. // CHECK:STDOUT: %F.decl: %F.type.436 = fn_decl @F.2 [concrete = constants.%F.ce9] {
  219. // CHECK:STDOUT: %U.patt.loc16_8.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc16_8.2 (constants.%U.patt.e01)]
  220. // CHECK:STDOUT: %u.patt: @F.2.%U.loc16_8.1 (%U.8b3) = binding_pattern u
  221. // CHECK:STDOUT: %u.param_patt: @F.2.%U.loc16_8.1 (%U.8b3) = value_param_pattern %u.patt, call_param0
  222. // CHECK:STDOUT: %return.patt: @F.2.%tuple.type.loc16 (%tuple.type.765) = return_slot_pattern
  223. // CHECK:STDOUT: %return.param_patt: @F.2.%tuple.type.loc16 (%tuple.type.765) = out_param_pattern %return.patt, call_param1
  224. // CHECK:STDOUT: } {
  225. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  226. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y]
  227. // CHECK:STDOUT: %U.ref.loc16_34: type = name_ref U, %U.loc16_8.2 [symbolic = %U.loc16_8.1 (constants.%U.8b3)]
  228. // CHECK:STDOUT: %.loc16_35.1: %tuple.type.ff9 = tuple_literal (%X.ref, %Y.ref, %U.ref.loc16_34)
  229. // CHECK:STDOUT: %.loc16_35.2: type = converted %.loc16_35.1, constants.%tuple.type.765 [symbolic = %tuple.type.loc16 (constants.%tuple.type.765)]
  230. // CHECK:STDOUT: %U.loc16_8.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc16_8.1 (constants.%U.8b3)]
  231. // CHECK:STDOUT: %u.param: @F.2.%U.loc16_8.1 (%U.8b3) = value_param call_param0
  232. // CHECK:STDOUT: %U.ref.loc16_21: type = name_ref U, %U.loc16_8.2 [symbolic = %U.loc16_8.1 (constants.%U.8b3)]
  233. // CHECK:STDOUT: %u: @F.2.%U.loc16_8.1 (%U.8b3) = bind_name u, %u.param
  234. // CHECK:STDOUT: %return.param: ref @F.2.%tuple.type.loc16 (%tuple.type.765) = out_param call_param1
  235. // CHECK:STDOUT: %return: ref @F.2.%tuple.type.loc16 (%tuple.type.765) = return_slot %return.param
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: !members:
  239. // CHECK:STDOUT: .X = <poisoned>
  240. // CHECK:STDOUT: .Y = <poisoned>
  241. // CHECK:STDOUT: .F = %F.decl
  242. // CHECK:STDOUT: witness = file.%impl_witness
  243. // CHECK:STDOUT: }
  244. // CHECK:STDOUT:
  245. // CHECK:STDOUT: class @X {
  246. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  247. // CHECK:STDOUT: complete_type_witness = %complete_type
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: !members:
  250. // CHECK:STDOUT: .Self = constants.%X
  251. // CHECK:STDOUT: }
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: class @Y {
  254. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  255. // CHECK:STDOUT: complete_type_witness = %complete_type
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: !members:
  258. // CHECK:STDOUT: .Self = constants.%Y
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: class @Z {
  262. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  263. // CHECK:STDOUT: complete_type_witness = %complete_type
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: !members:
  266. // CHECK:STDOUT: .Self = constants.%Z
  267. // CHECK:STDOUT: }
  268. // CHECK:STDOUT:
  269. // CHECK:STDOUT: generic fn @F.1(@A.%T.loc5_13.1: type, @A.%Self.1: @A.%A.type (%A.type.75a), %U.loc6_8.2: type) {
  270. // CHECK:STDOUT: %U.loc6_8.1: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  271. // CHECK:STDOUT: %U.patt.loc6_8.2: type = symbolic_binding_pattern U, 2 [symbolic = %U.patt.loc6_8.2 (constants.%U.patt.b3a)]
  272. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
  273. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T)> [symbolic = %A.type (constants.%A.type.75a)]
  274. // CHECK:STDOUT: %Self: @F.1.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.753)]
  275. // CHECK:STDOUT: %tuple.type.loc6_38.1: type = tuple_type (type, @F.1.%A.type (%A.type.75a), type) [symbolic = %tuple.type.loc6_38.1 (constants.%tuple.type.e59)]
  276. // CHECK:STDOUT: %Self.as_type.loc6_38.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  277. // CHECK:STDOUT: %tuple.type.loc6_38.2: type = tuple_type (@F.1.%T (%T.8b3), @F.1.%Self.as_type.loc6_38.1 (%Self.as_type), @F.1.%U.loc6_8.1 (%U.2cb)) [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)]
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: fn(%U.patt.loc6_8.1: type, %u.param_patt: @F.1.%U.loc6_8.1 (%U.2cb)) -> @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2);
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: generic fn @F.2(%U.loc16_8.2: type) {
  283. // CHECK:STDOUT: %U.loc16_8.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc16_8.1 (constants.%U.8b3)]
  284. // CHECK:STDOUT: %U.patt.loc16_8.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc16_8.2 (constants.%U.patt.e01)]
  285. // CHECK:STDOUT: %tuple.type.loc16: type = tuple_type (%X, %Y, @F.2.%U.loc16_8.1 (%U.8b3)) [symbolic = %tuple.type.loc16 (constants.%tuple.type.765)]
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: !definition:
  288. // CHECK:STDOUT: %require_complete.loc16_24: <witness> = require_complete_type @F.2.%tuple.type.loc16 (%tuple.type.765) [symbolic = %require_complete.loc16_24 (constants.%require_complete.816)]
  289. // CHECK:STDOUT: %require_complete.loc16_19: <witness> = require_complete_type @F.2.%U.loc16_8.1 (%U.8b3) [symbolic = %require_complete.loc16_19 (constants.%require_complete.4ae)]
  290. // CHECK:STDOUT: %tuple.type.loc17: type = tuple_type (%empty_struct_type, %empty_struct_type, @F.2.%U.loc16_8.1 (%U.8b3)) [symbolic = %tuple.type.loc17 (constants.%tuple.type.a41)]
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: fn(%U.patt.loc16_8.1: type, %u.param_patt: @F.2.%U.loc16_8.1 (%U.8b3)) -> %return.param_patt: @F.2.%tuple.type.loc16 (%tuple.type.765) {
  293. // CHECK:STDOUT: !entry:
  294. // CHECK:STDOUT: %.loc17_14.1: %empty_struct_type = struct_literal ()
  295. // CHECK:STDOUT: %.loc17_18.1: %empty_struct_type = struct_literal ()
  296. // CHECK:STDOUT: %u.ref: @F.2.%U.loc16_8.1 (%U.8b3) = name_ref u, %u
  297. // CHECK:STDOUT: %.loc17_22.1: @F.2.%tuple.type.loc17 (%tuple.type.a41) = tuple_literal (%.loc17_14.1, %.loc17_18.1, %u.ref)
  298. // CHECK:STDOUT: %tuple.elem0: ref %X = tuple_access %return, element0
  299. // CHECK:STDOUT: %.loc17_14.2: init %X = class_init (), %tuple.elem0 [concrete = constants.%X.val]
  300. // CHECK:STDOUT: %.loc17_22.2: init %X = converted %.loc17_14.1, %.loc17_14.2 [concrete = constants.%X.val]
  301. // CHECK:STDOUT: %tuple.elem1: ref %Y = tuple_access %return, element1
  302. // CHECK:STDOUT: %.loc17_18.2: init %Y = class_init (), %tuple.elem1 [concrete = constants.%Y.val]
  303. // CHECK:STDOUT: %.loc17_22.3: init %Y = converted %.loc17_18.1, %.loc17_18.2 [concrete = constants.%Y.val]
  304. // CHECK:STDOUT: %tuple.elem2: ref @F.2.%U.loc16_8.1 (%U.8b3) = tuple_access %return, element2
  305. // CHECK:STDOUT: %.loc17_22.4: init @F.2.%U.loc16_8.1 (%U.8b3) = initialize_from %u.ref to %tuple.elem2
  306. // CHECK:STDOUT: %.loc17_22.5: init @F.2.%tuple.type.loc16 (%tuple.type.765) = tuple_init (%.loc17_22.2, %.loc17_22.3, %.loc17_22.4) to %return
  307. // CHECK:STDOUT: %.loc17_23: init @F.2.%tuple.type.loc16 (%tuple.type.765) = converted %.loc17_22.1, %.loc17_22.5
  308. // CHECK:STDOUT: return %.loc17_23 to %return
  309. // CHECK:STDOUT: }
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: fn @Call() {
  313. // CHECK:STDOUT: !entry:
  314. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y]
  315. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  316. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  317. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  318. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%Y, (constants.%impl_witness) [concrete = constants.%A.facet.166]
  319. // CHECK:STDOUT: %.loc22_6: %A.type.91f = converted %Y.ref, %A.facet [concrete = constants.%A.facet.166]
  320. // CHECK:STDOUT: %.loc22_14.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6]
  321. // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc22_14.1 [concrete = constants.%assoc0.5f6]
  322. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc22_6 [concrete = constants.%Y]
  323. // CHECK:STDOUT: %.loc22_14.2: type = converted %.loc22_6, %as_type [concrete = constants.%Y]
  324. // CHECK:STDOUT: %as_wit.iface0: <witness> = facet_access_witness %.loc22_6, element0 [concrete = constants.%impl_witness]
  325. // CHECK:STDOUT: %impl.elem0: %.6fe = impl_witness_access %as_wit.iface0, element0 [concrete = constants.%F.ce9]
  326. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z]
  327. // CHECK:STDOUT: %.loc22_21.1: %empty_struct_type = struct_literal ()
  328. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%Z) [concrete = constants.%F.specific_fn]
  329. // CHECK:STDOUT: %.loc22_22.1: ref %tuple.type.f6b = temporary_storage
  330. // CHECK:STDOUT: %.loc22_21.2: ref %Z = temporary_storage
  331. // CHECK:STDOUT: %.loc22_21.3: init %Z = class_init (), %.loc22_21.2 [concrete = constants.%Z.val]
  332. // CHECK:STDOUT: %.loc22_21.4: ref %Z = temporary %.loc22_21.2, %.loc22_21.3
  333. // CHECK:STDOUT: %.loc22_21.5: ref %Z = converted %.loc22_21.1, %.loc22_21.4
  334. // CHECK:STDOUT: %.loc22_21.6: %Z = bind_value %.loc22_21.5
  335. // CHECK:STDOUT: %F.call: init %tuple.type.f6b = call %specific_fn(%.loc22_21.6) to %.loc22_22.1
  336. // CHECK:STDOUT: %.loc22_22.2: ref %tuple.type.f6b = temporary %.loc22_22.1, %F.call
  337. // CHECK:STDOUT: return
  338. // CHECK:STDOUT: }
  339. // CHECK:STDOUT:
  340. // CHECK:STDOUT: generic fn @CallGeneric(%T.loc25_16.1: %A.type.91f) {
  341. // CHECK:STDOUT: %T.loc25_16.2: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc25_16.2 (constants.%T.9c2)]
  342. // CHECK:STDOUT: %T.patt.loc25_16.2: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_16.2 (constants.%T.patt.e81)]
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: !definition:
  345. // CHECK:STDOUT: %T.as_type.loc26_4.2: type = facet_access_type %T.loc25_16.2 [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)]
  346. // CHECK:STDOUT: %T.as_wit.iface0.loc26_4.2: <witness> = facet_access_witness %T.loc25_16.2, element0 [symbolic = %T.as_wit.iface0.loc26_4.2 (constants.%T.as_wit.iface0)]
  347. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value %T.as_type.loc26_4.2, (%T.as_wit.iface0.loc26_4.2) [symbolic = %A.facet (constants.%A.facet.834)]
  348. // CHECK:STDOUT: %.loc26_4.3: type = fn_type_with_self_type constants.%F.type.13d, %A.facet [symbolic = %.loc26_4.3 (constants.%.591)]
  349. // CHECK:STDOUT: %impl.elem0.loc26_4.2: @CallGeneric.%.loc26_4.3 (%.591) = impl_witness_access %T.as_wit.iface0.loc26_4.2, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0)]
  350. // CHECK:STDOUT: %specific_impl_fn.loc26_4.2: <specific function> = specific_impl_function %impl.elem0.loc26_4.2, @F.1(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn)]
  351. // CHECK:STDOUT: %tuple.type: type = tuple_type (%X, @CallGeneric.%T.as_type.loc26_4.2 (%T.as_type), %Z) [symbolic = %tuple.type (constants.%tuple.type.e28)]
  352. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallGeneric.%tuple.type (%tuple.type.e28) [symbolic = %require_complete (constants.%require_complete.500)]
  353. // CHECK:STDOUT:
  354. // CHECK:STDOUT: fn(%T.patt.loc25_16.1: %A.type.91f) {
  355. // CHECK:STDOUT: !entry:
  356. // CHECK:STDOUT: %T.ref: %A.type.91f = name_ref T, %T.loc25_16.1 [symbolic = %T.loc25_16.2 (constants.%T.9c2)]
  357. // CHECK:STDOUT: %.loc26_4.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6]
  358. // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc26_4.1 [concrete = constants.%assoc0.5f6]
  359. // CHECK:STDOUT: %T.as_type.loc26_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)]
  360. // CHECK:STDOUT: %.loc26_4.2: type = converted %T.ref, %T.as_type.loc26_4.1 [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)]
  361. // CHECK:STDOUT: %T.as_wit.iface0.loc26_4.1: <witness> = facet_access_witness %T.ref, element0 [symbolic = %T.as_wit.iface0.loc26_4.2 (constants.%T.as_wit.iface0)]
  362. // CHECK:STDOUT: %impl.elem0.loc26_4.1: @CallGeneric.%.loc26_4.3 (%.591) = impl_witness_access %T.as_wit.iface0.loc26_4.1, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0)]
  363. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z]
  364. // CHECK:STDOUT: %.loc26_11.1: %empty_struct_type = struct_literal ()
  365. // CHECK:STDOUT: %specific_impl_fn.loc26_4.1: <specific function> = specific_impl_function %impl.elem0.loc26_4.1, @F.1(constants.%X, constants.%A.facet.834, constants.%Z) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn)]
  366. // CHECK:STDOUT: %.loc26_12.1: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary_storage
  367. // CHECK:STDOUT: %.loc26_11.2: ref %Z = temporary_storage
  368. // CHECK:STDOUT: %.loc26_11.3: init %Z = class_init (), %.loc26_11.2 [concrete = constants.%Z.val]
  369. // CHECK:STDOUT: %.loc26_11.4: ref %Z = temporary %.loc26_11.2, %.loc26_11.3
  370. // CHECK:STDOUT: %.loc26_11.5: ref %Z = converted %.loc26_11.1, %.loc26_11.4
  371. // CHECK:STDOUT: %.loc26_11.6: %Z = bind_value %.loc26_11.5
  372. // CHECK:STDOUT: %.loc26_12.2: init @CallGeneric.%tuple.type (%tuple.type.e28) = call %specific_impl_fn.loc26_4.1(%.loc26_11.6) to %.loc26_12.1
  373. // CHECK:STDOUT: %.loc26_12.3: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary %.loc26_12.1, %.loc26_12.2
  374. // CHECK:STDOUT: return
  375. // CHECK:STDOUT: }
  376. // CHECK:STDOUT: }
  377. // CHECK:STDOUT:
  378. // CHECK:STDOUT: fn @CallIndirect() {
  379. // CHECK:STDOUT: !entry:
  380. // CHECK:STDOUT: %CallGeneric.ref: %CallGeneric.type = name_ref CallGeneric, file.%CallGeneric.decl [concrete = constants.%CallGeneric]
  381. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y]
  382. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%Y, (constants.%impl_witness) [concrete = constants.%A.facet.166]
  383. // CHECK:STDOUT: %.loc30: %A.type.91f = converted %Y.ref, %A.facet [concrete = constants.%A.facet.166]
  384. // CHECK:STDOUT: %CallGeneric.specific_fn: <specific function> = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet.166) [concrete = constants.%CallGeneric.specific_fn]
  385. // CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn()
  386. // CHECK:STDOUT: return
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT:
  389. // CHECK:STDOUT: specific @A(constants.%T.8b3) {
  390. // CHECK:STDOUT: %T.loc5_13.2 => constants.%T.8b3
  391. // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.patt.e01
  392. // CHECK:STDOUT: }
  393. // CHECK:STDOUT:
  394. // CHECK:STDOUT: specific @F.1(constants.%T.8b3, constants.%Self.753, constants.%U.2cb) {
  395. // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.2cb
  396. // CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.patt.b3a
  397. // CHECK:STDOUT: %T => constants.%T.8b3
  398. // CHECK:STDOUT: %A.type => constants.%A.type.75a
  399. // CHECK:STDOUT: %Self => constants.%Self.753
  400. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.e59
  401. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Self.as_type
  402. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.bd2
  403. // CHECK:STDOUT: }
  404. // CHECK:STDOUT:
  405. // CHECK:STDOUT: specific @A(@F.1.%T) {}
  406. // CHECK:STDOUT:
  407. // CHECK:STDOUT: specific @A(%T.loc5_13.2) {}
  408. // CHECK:STDOUT:
  409. // CHECK:STDOUT: specific @A(constants.%X) {
  410. // CHECK:STDOUT: %T.loc5_13.2 => constants.%X
  411. // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.patt.e01
  412. // CHECK:STDOUT:
  413. // CHECK:STDOUT: !definition:
  414. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  415. // CHECK:STDOUT: %Self.2 => constants.%Self.1bb
  416. // CHECK:STDOUT: %F.type => constants.%F.type.13d
  417. // CHECK:STDOUT: %F => constants.%F.d83
  418. // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.296
  419. // CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.5f6
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: specific @F.2(constants.%U.8b3) {
  423. // CHECK:STDOUT: %U.loc16_8.1 => constants.%U.8b3
  424. // CHECK:STDOUT: %U.patt.loc16_8.2 => constants.%U.patt.e01
  425. // CHECK:STDOUT: %tuple.type.loc16 => constants.%tuple.type.765
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.166, constants.%U.8b3) {
  429. // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.8b3
  430. // CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.patt.b3a
  431. // CHECK:STDOUT: %T => constants.%X
  432. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  433. // CHECK:STDOUT: %Self => constants.%A.facet.166
  434. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  435. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Y
  436. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.765
  437. // CHECK:STDOUT: }
  438. // CHECK:STDOUT:
  439. // CHECK:STDOUT: specific @F.2(constants.%Z) {
  440. // CHECK:STDOUT: %U.loc16_8.1 => constants.%Z
  441. // CHECK:STDOUT: %U.patt.loc16_8.2 => constants.%U.patt.e01
  442. // CHECK:STDOUT: %tuple.type.loc16 => constants.%tuple.type.f6b
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: !definition:
  445. // CHECK:STDOUT: %require_complete.loc16_24 => constants.%complete_type.a64
  446. // CHECK:STDOUT: %require_complete.loc16_19 => constants.%complete_type.357
  447. // CHECK:STDOUT: %tuple.type.loc17 => constants.%tuple.type.9c8
  448. // CHECK:STDOUT: }
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: specific @CallGeneric(constants.%T.9c2) {
  451. // CHECK:STDOUT: %T.loc25_16.2 => constants.%T.9c2
  452. // CHECK:STDOUT: %T.patt.loc25_16.2 => constants.%T.patt.e81
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.834, constants.%Z) {
  456. // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z
  457. // CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.patt.b3a
  458. // CHECK:STDOUT: %T => constants.%X
  459. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  460. // CHECK:STDOUT: %Self => constants.%A.facet.834
  461. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  462. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%T.as_type
  463. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.e28
  464. // CHECK:STDOUT: }
  465. // CHECK:STDOUT:
  466. // CHECK:STDOUT: specific @F.1(constants.%X, @CallGeneric.%A.facet, constants.%Z) {}
  467. // CHECK:STDOUT:
  468. // CHECK:STDOUT: specific @CallGeneric(constants.%A.facet.166) {
  469. // CHECK:STDOUT: %T.loc25_16.2 => constants.%A.facet.166
  470. // CHECK:STDOUT: %T.patt.loc25_16.2 => constants.%T.patt.e81
  471. // CHECK:STDOUT:
  472. // CHECK:STDOUT: !definition:
  473. // CHECK:STDOUT: %T.as_type.loc26_4.2 => constants.%Y
  474. // CHECK:STDOUT: %T.as_wit.iface0.loc26_4.2 => constants.%impl_witness
  475. // CHECK:STDOUT: %A.facet => constants.%A.facet.166
  476. // CHECK:STDOUT: %.loc26_4.3 => constants.%.6fe
  477. // CHECK:STDOUT: %impl.elem0.loc26_4.2 => constants.%F.ce9
  478. // CHECK:STDOUT: %specific_impl_fn.loc26_4.2 => constants.%F.specific_fn
  479. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.f6b
  480. // CHECK:STDOUT: %require_complete => constants.%complete_type.a64
  481. // CHECK:STDOUT: }
  482. // CHECK:STDOUT:
  483. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.166, constants.%Z) {
  484. // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z
  485. // CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.patt.b3a
  486. // CHECK:STDOUT: %T => constants.%X
  487. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  488. // CHECK:STDOUT: %Self => constants.%A.facet.166
  489. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  490. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Y
  491. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.f6b
  492. // CHECK:STDOUT: }
  493. // CHECK:STDOUT:
  494. // CHECK:STDOUT: --- generic_method_more_params.carbon
  495. // CHECK:STDOUT:
  496. // CHECK:STDOUT: constants {
  497. // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
  498. // CHECK:STDOUT: %T.patt.e01: type = symbolic_binding_pattern T, 0 [symbolic]
  499. // CHECK:STDOUT: %A.type.495: type = generic_interface_type @A [concrete]
  500. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  501. // CHECK:STDOUT: %A.generic: %A.type.495 = struct_value () [concrete]
  502. // CHECK:STDOUT: %A.type.75a: type = facet_type <@A, @A(%T.8b3)> [symbolic]
  503. // CHECK:STDOUT: %Self.753: %A.type.75a = bind_symbolic_name Self, 1 [symbolic]
  504. // CHECK:STDOUT: %U.2cb: type = bind_symbolic_name U, 2 [symbolic]
  505. // CHECK:STDOUT: %U.patt.b3a: type = symbolic_binding_pattern U, 2 [symbolic]
  506. // CHECK:STDOUT: %tuple.type.e59: type = tuple_type (type, %A.type.75a, type) [symbolic]
  507. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.753 [symbolic]
  508. // CHECK:STDOUT: %tuple.type.bd2: type = tuple_type (%T.8b3, %Self.as_type, %U.2cb) [symbolic]
  509. // CHECK:STDOUT: %F.type.17a: type = fn_type @F.1, @A(%T.8b3) [symbolic]
  510. // CHECK:STDOUT: %F.0d8: %F.type.17a = struct_value () [symbolic]
  511. // CHECK:STDOUT: %A.assoc_type.ed3: type = assoc_entity_type @A, @A(%T.8b3) [symbolic]
  512. // CHECK:STDOUT: %assoc0.fcb: %A.assoc_type.ed3 = assoc_entity element0, @A.%F.decl [symbolic]
  513. // CHECK:STDOUT: %X: type = class_type @X [concrete]
  514. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  515. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  516. // CHECK:STDOUT: %Y1: type = class_type @Y1 [concrete]
  517. // CHECK:STDOUT: %Y2: type = class_type @Y2 [concrete]
  518. // CHECK:STDOUT: %Z: type = class_type @Z [concrete]
  519. // CHECK:STDOUT: %V1: type = bind_symbolic_name V1, 0 [symbolic]
  520. // CHECK:STDOUT: %V1.patt: type = symbolic_binding_pattern V1, 0 [symbolic]
  521. // CHECK:STDOUT: %V2: type = bind_symbolic_name V2, 1 [symbolic]
  522. // CHECK:STDOUT: %V2.patt: type = symbolic_binding_pattern V2, 1 [symbolic]
  523. // CHECK:STDOUT: %W: type = bind_symbolic_name W, 2 [symbolic]
  524. // CHECK:STDOUT: %W.patt: type = symbolic_binding_pattern W, 2 [symbolic]
  525. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
  526. // CHECK:STDOUT: %tuple.type.30b: type = tuple_type (%V1, %V2) [symbolic]
  527. // CHECK:STDOUT: %A.type.f21: type = facet_type <@A, @A(%W)> [symbolic]
  528. // CHECK:STDOUT: %Self.4fe: %A.type.f21 = bind_symbolic_name Self, 1 [symbolic]
  529. // CHECK:STDOUT: %F.type.904: type = fn_type @F.1, @A(%W) [symbolic]
  530. // CHECK:STDOUT: %F.1ee: %F.type.904 = struct_value () [symbolic]
  531. // CHECK:STDOUT: %A.assoc_type.b05: type = assoc_entity_type @A, @A(%W) [symbolic]
  532. // CHECK:STDOUT: %assoc0.c82: %A.assoc_type.b05 = assoc_entity element0, @A.%F.decl [symbolic]
  533. // CHECK:STDOUT: %require_complete.796: <witness> = require_complete_type %A.type.f21 [symbolic]
  534. // CHECK:STDOUT: %impl_witness.0d8: <witness> = impl_witness (@impl.%F.decl), @impl(%V1, %V2, %W) [symbolic]
  535. // CHECK:STDOUT: %U.753: type = bind_symbolic_name U, 3 [symbolic]
  536. // CHECK:STDOUT: %U.patt.cfd: type = symbolic_binding_pattern U, 3 [symbolic]
  537. // CHECK:STDOUT: %tuple.type.11f: type = tuple_type (type, %tuple.type.24b, type) [concrete]
  538. // CHECK:STDOUT: %tuple.type.8ae: type = tuple_type (%W, %tuple.type.30b, %U.753) [symbolic]
  539. // CHECK:STDOUT: %F.type.b3e: type = fn_type @F.2, @impl(%V1, %V2, %W) [symbolic]
  540. // CHECK:STDOUT: %F.d79: %F.type.b3e = struct_value () [symbolic]
  541. // CHECK:STDOUT: %A.facet.412: %A.type.f21 = facet_value %tuple.type.30b, (%impl_witness.0d8) [symbolic]
  542. // CHECK:STDOUT: %tuple.type.136: type = tuple_type (type, %A.type.f21, type) [symbolic]
  543. // CHECK:STDOUT: %require_complete.d4d: <witness> = require_complete_type %tuple.type.8ae [symbolic]
  544. // CHECK:STDOUT: %require_complete.ed4: <witness> = require_complete_type %U.753 [symbolic]
  545. // CHECK:STDOUT: %F.specific_fn.7d9: <specific function> = specific_function %F.d79, @F.2(%V1, %V2, %W, %U.753) [symbolic]
  546. // CHECK:STDOUT: %require_complete.f7f: <witness> = require_complete_type %W [symbolic]
  547. // CHECK:STDOUT: %require_complete.fe1: <witness> = require_complete_type %tuple.type.30b [symbolic]
  548. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %V1 [symbolic]
  549. // CHECK:STDOUT: %require_complete.b54: <witness> = require_complete_type %V2 [symbolic]
  550. // CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete]
  551. // CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete]
  552. // CHECK:STDOUT: %tuple.type.a46: type = tuple_type (%Y1, %Y2) [concrete]
  553. // CHECK:STDOUT: %A.type.91f: type = facet_type <@A, @A(%X)> [concrete]
  554. // CHECK:STDOUT: %Self.1bb: %A.type.91f = bind_symbolic_name Self, 1 [symbolic]
  555. // CHECK:STDOUT: %F.type.13d: type = fn_type @F.1, @A(%X) [concrete]
  556. // CHECK:STDOUT: %F.d83: %F.type.13d = struct_value () [concrete]
  557. // CHECK:STDOUT: %A.assoc_type.296: type = assoc_entity_type @A, @A(%X) [concrete]
  558. // CHECK:STDOUT: %assoc0.5f6: %A.assoc_type.296 = assoc_entity element0, @A.%F.decl [concrete]
  559. // CHECK:STDOUT: %complete_type.d76: <witness> = complete_type_witness %A.type.91f [concrete]
  560. // CHECK:STDOUT: %impl_witness.14a: <witness> = impl_witness (@impl.%F.decl), @impl(%Y1, %Y2, %X) [concrete]
  561. // CHECK:STDOUT: %F.type.bf7: type = fn_type @F.2, @impl(%Y1, %Y2, %X) [concrete]
  562. // CHECK:STDOUT: %F.93b: %F.type.bf7 = struct_value () [concrete]
  563. // CHECK:STDOUT: %A.facet.058: %A.type.91f = facet_value %tuple.type.a46, (%impl_witness.14a) [concrete]
  564. // CHECK:STDOUT: %.0b0: type = fn_type_with_self_type %F.type.13d, %A.facet.058 [concrete]
  565. // CHECK:STDOUT: %tuple.type.415: type = tuple_type (%X, %tuple.type.a46, %Z) [concrete]
  566. // CHECK:STDOUT: %F.specific_fn.79b: <specific function> = specific_function %F.93b, @F.2(%Y1, %Y2, %X, %Z) [concrete]
  567. // CHECK:STDOUT: %Z.val: %Z = struct_value () [concrete]
  568. // CHECK:STDOUT: %T.9c2: %A.type.91f = bind_symbolic_name T, 0 [symbolic]
  569. // CHECK:STDOUT: %T.patt.e81: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic]
  570. // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete]
  571. // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete]
  572. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.9c2 [symbolic]
  573. // CHECK:STDOUT: %T.as_wit.iface0: <witness> = facet_access_witness %T.9c2, element0 [symbolic]
  574. // CHECK:STDOUT: %A.facet.834: %A.type.91f = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic]
  575. // CHECK:STDOUT: %.591: type = fn_type_with_self_type %F.type.13d, %A.facet.834 [symbolic]
  576. // CHECK:STDOUT: %impl.elem0: %.591 = impl_witness_access %T.as_wit.iface0, element0 [symbolic]
  577. // CHECK:STDOUT: %tuple.type.a0c: type = tuple_type (type, %A.type.91f, type) [concrete]
  578. // CHECK:STDOUT: %tuple.type.e28: type = tuple_type (%X, %T.as_type, %Z) [symbolic]
  579. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @F.1(%X, %A.facet.834, %Z) [symbolic]
  580. // CHECK:STDOUT: %require_complete.500: <witness> = require_complete_type %tuple.type.e28 [symbolic]
  581. // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete]
  582. // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete]
  583. // CHECK:STDOUT: %CallGeneric.specific_fn: <specific function> = specific_function %CallGeneric, @CallGeneric(%A.facet.058) [concrete]
  584. // CHECK:STDOUT: %complete_type.aa8: <witness> = complete_type_witness %tuple.type.415 [concrete]
  585. // CHECK:STDOUT: %complete_type.4d1: <witness> = complete_type_witness %tuple.type.a46 [concrete]
  586. // CHECK:STDOUT: }
  587. // CHECK:STDOUT:
  588. // CHECK:STDOUT: file {
  589. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  590. // CHECK:STDOUT: .A = %A.decl
  591. // CHECK:STDOUT: .X = %X.decl
  592. // CHECK:STDOUT: .Y1 = %Y1.decl
  593. // CHECK:STDOUT: .Y2 = %Y2.decl
  594. // CHECK:STDOUT: .Z = %Z.decl
  595. // CHECK:STDOUT: .Call = %Call.decl
  596. // CHECK:STDOUT: .CallGeneric = %CallGeneric.decl
  597. // CHECK:STDOUT: .CallIndirect = %CallIndirect.decl
  598. // CHECK:STDOUT: }
  599. // CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [concrete = constants.%A.generic] {
  600. // CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)]
  601. // CHECK:STDOUT: } {
  602. // CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)]
  603. // CHECK:STDOUT: }
  604. // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
  605. // CHECK:STDOUT: %Y1.decl: type = class_decl @Y1 [concrete = constants.%Y1] {} {}
  606. // CHECK:STDOUT: %Y2.decl: type = class_decl @Y2 [concrete = constants.%Y2] {} {}
  607. // CHECK:STDOUT: %Z.decl: type = class_decl @Z [concrete = constants.%Z] {} {}
  608. // CHECK:STDOUT: impl_decl @impl [concrete] {
  609. // CHECK:STDOUT: %V1.patt.loc14_14.1: type = symbolic_binding_pattern V1, 0 [symbolic = %V1.patt.loc14_14.2 (constants.%V1.patt)]
  610. // CHECK:STDOUT: %V2.patt.loc14_25.1: type = symbolic_binding_pattern V2, 1 [symbolic = %V2.patt.loc14_25.2 (constants.%V2.patt)]
  611. // CHECK:STDOUT: %W.patt.loc14_36.1: type = symbolic_binding_pattern W, 2 [symbolic = %W.patt.loc14_36.2 (constants.%W.patt)]
  612. // CHECK:STDOUT: } {
  613. // CHECK:STDOUT: %V1.ref: type = name_ref V1, %V1.loc14_14.1 [symbolic = %V1.loc14_14.2 (constants.%V1)]
  614. // CHECK:STDOUT: %V2.ref: type = name_ref V2, %V2.loc14_25.1 [symbolic = %V2.loc14_25.2 (constants.%V2)]
  615. // CHECK:STDOUT: %.loc14_53.1: %tuple.type.24b = tuple_literal (%V1.ref, %V2.ref)
  616. // CHECK:STDOUT: %.loc14_53.2: type = converted %.loc14_53.1, constants.%tuple.type.30b [symbolic = %tuple.type (constants.%tuple.type.30b)]
  617. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  618. // CHECK:STDOUT: %W.ref: type = name_ref W, %W.loc14_36.1 [symbolic = %W.loc14_36.2 (constants.%W)]
  619. // CHECK:STDOUT: %A.type.loc14_61.1: type = facet_type <@A, @A(constants.%W)> [symbolic = %A.type.loc14_61.2 (constants.%A.type.f21)]
  620. // CHECK:STDOUT: %V1.loc14_14.1: type = bind_symbolic_name V1, 0 [symbolic = %V1.loc14_14.2 (constants.%V1)]
  621. // CHECK:STDOUT: %V2.loc14_25.1: type = bind_symbolic_name V2, 1 [symbolic = %V2.loc14_25.2 (constants.%V2)]
  622. // CHECK:STDOUT: %W.loc14_36.1: type = bind_symbolic_name W, 2 [symbolic = %W.loc14_36.2 (constants.%W)]
  623. // CHECK:STDOUT: }
  624. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl), @impl(constants.%V1, constants.%V2, constants.%W) [symbolic = @impl.%impl_witness (constants.%impl_witness.0d8)]
  625. // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {}
  626. // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] {
  627. // CHECK:STDOUT: %T.patt.loc27_16.1: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc27_16.2 (constants.%T.patt.e81)]
  628. // CHECK:STDOUT: } {
  629. // CHECK:STDOUT: %.loc27: type = splice_block %A.type [concrete = constants.%A.type.91f] {
  630. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  631. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  632. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT: %T.loc27_16.1: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.2 (constants.%T.9c2)]
  635. // CHECK:STDOUT: }
  636. // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {}
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT:
  639. // CHECK:STDOUT: generic interface @A(%T.loc5_13.1: type) {
  640. // CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)]
  641. // CHECK:STDOUT: %T.patt.loc5_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)]
  642. // CHECK:STDOUT:
  643. // CHECK:STDOUT: !definition:
  644. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T.loc5_13.2)> [symbolic = %A.type (constants.%A.type.75a)]
  645. // CHECK:STDOUT: %Self.2: @A.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.753)]
  646. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @A(%T.loc5_13.2) [symbolic = %F.type (constants.%F.type.17a)]
  647. // CHECK:STDOUT: %F: @A.%F.type (%F.type.17a) = struct_value () [symbolic = %F (constants.%F.0d8)]
  648. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A, @A(%T.loc5_13.2) [symbolic = %A.assoc_type (constants.%A.assoc_type.ed3)]
  649. // CHECK:STDOUT: %assoc0.loc6_39.2: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)]
  650. // CHECK:STDOUT:
  651. // CHECK:STDOUT: interface {
  652. // CHECK:STDOUT: %Self.1: @A.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.753)]
  653. // CHECK:STDOUT: %F.decl: @A.%F.type (%F.type.17a) = fn_decl @F.1 [symbolic = @A.%F (constants.%F.0d8)] {
  654. // CHECK:STDOUT: %U.patt.loc6_8.1: type = symbolic_binding_pattern U, 2 [symbolic = %U.patt.loc6_8.2 (constants.%U.patt.b3a)]
  655. // CHECK:STDOUT: %u.patt: @F.1.%U.loc6_8.1 (%U.2cb) = binding_pattern u
  656. // CHECK:STDOUT: %u.param_patt: @F.1.%U.loc6_8.1 (%U.2cb) = value_param_pattern %u.patt, call_param0
  657. // CHECK:STDOUT: %return.patt: @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = return_slot_pattern
  658. // CHECK:STDOUT: %return.param_patt: @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = out_param_pattern %return.patt, call_param1
  659. // CHECK:STDOUT: } {
  660. // CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_13.1 [symbolic = %T (constants.%T.8b3)]
  661. // CHECK:STDOUT: %.loc6_31: @F.1.%A.type (%A.type.75a) = specific_constant @A.%Self.1, @A(constants.%T.8b3) [symbolic = %Self (constants.%Self.753)]
  662. // CHECK:STDOUT: %Self.ref: @F.1.%A.type (%A.type.75a) = name_ref Self, %.loc6_31 [symbolic = %Self (constants.%Self.753)]
  663. // CHECK:STDOUT: %U.ref.loc6_37: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  664. // CHECK:STDOUT: %.loc6_38.1: @F.1.%tuple.type.loc6_38.1 (%tuple.type.e59) = tuple_literal (%T.ref, %Self.ref, %U.ref.loc6_37)
  665. // CHECK:STDOUT: %Self.as_type.loc6_38.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  666. // CHECK:STDOUT: %.loc6_38.2: type = converted %Self.ref, %Self.as_type.loc6_38.2 [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  667. // CHECK:STDOUT: %.loc6_38.3: type = converted %.loc6_38.1, constants.%tuple.type.bd2 [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)]
  668. // CHECK:STDOUT: %U.loc6_8.2: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  669. // CHECK:STDOUT: %u.param: @F.1.%U.loc6_8.1 (%U.2cb) = value_param call_param0
  670. // CHECK:STDOUT: %U.ref.loc6_21: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  671. // CHECK:STDOUT: %u: @F.1.%U.loc6_8.1 (%U.2cb) = bind_name u, %u.param
  672. // CHECK:STDOUT: %return.param: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = out_param call_param1
  673. // CHECK:STDOUT: %return: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = return_slot %return.param
  674. // CHECK:STDOUT: }
  675. // CHECK:STDOUT: %assoc0.loc6_39.1: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)]
  676. // CHECK:STDOUT:
  677. // CHECK:STDOUT: !members:
  678. // CHECK:STDOUT: .Self = %Self.1
  679. // CHECK:STDOUT: .T = <poisoned>
  680. // CHECK:STDOUT: .F = %assoc0.loc6_39.1
  681. // CHECK:STDOUT: witness = (%F.decl)
  682. // CHECK:STDOUT: }
  683. // CHECK:STDOUT: }
  684. // CHECK:STDOUT:
  685. // CHECK:STDOUT: generic impl @impl(%V1.loc14_14.1: type, %V2.loc14_25.1: type, %W.loc14_36.1: type) {
  686. // CHECK:STDOUT: %V1.loc14_14.2: type = bind_symbolic_name V1, 0 [symbolic = %V1.loc14_14.2 (constants.%V1)]
  687. // CHECK:STDOUT: %V1.patt.loc14_14.2: type = symbolic_binding_pattern V1, 0 [symbolic = %V1.patt.loc14_14.2 (constants.%V1.patt)]
  688. // CHECK:STDOUT: %V2.loc14_25.2: type = bind_symbolic_name V2, 1 [symbolic = %V2.loc14_25.2 (constants.%V2)]
  689. // CHECK:STDOUT: %V2.patt.loc14_25.2: type = symbolic_binding_pattern V2, 1 [symbolic = %V2.patt.loc14_25.2 (constants.%V2.patt)]
  690. // CHECK:STDOUT: %W.loc14_36.2: type = bind_symbolic_name W, 2 [symbolic = %W.loc14_36.2 (constants.%W)]
  691. // CHECK:STDOUT: %W.patt.loc14_36.2: type = symbolic_binding_pattern W, 2 [symbolic = %W.patt.loc14_36.2 (constants.%W.patt)]
  692. // CHECK:STDOUT: %tuple.type: type = tuple_type (@impl.%V1.loc14_14.2 (%V1), @impl.%V2.loc14_25.2 (%V2)) [symbolic = %tuple.type (constants.%tuple.type.30b)]
  693. // CHECK:STDOUT: %A.type.loc14_61.2: type = facet_type <@A, @A(%W.loc14_36.2)> [symbolic = %A.type.loc14_61.2 (constants.%A.type.f21)]
  694. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.%A.type.loc14_61.2 (%A.type.f21) [symbolic = %require_complete (constants.%require_complete.796)]
  695. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (%F.decl), @impl(%V1.loc14_14.2, %V2.loc14_25.2, %W.loc14_36.2) [symbolic = %impl_witness (constants.%impl_witness.0d8)]
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: !definition:
  698. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%V1.loc14_14.2, %V2.loc14_25.2, %W.loc14_36.2) [symbolic = %F.type (constants.%F.type.b3e)]
  699. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.b3e) = struct_value () [symbolic = %F (constants.%F.d79)]
  700. // CHECK:STDOUT:
  701. // CHECK:STDOUT: impl: %.loc14_53.2 as %A.type.loc14_61.1 {
  702. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.b3e) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.d79)] {
  703. // CHECK:STDOUT: %U.patt.loc17_8.1: type = symbolic_binding_pattern U, 3 [symbolic = %U.patt.loc17_8.2 (constants.%U.patt.cfd)]
  704. // CHECK:STDOUT: %u.patt: @F.2.%U.loc17_8.1 (%U.753) = binding_pattern u
  705. // CHECK:STDOUT: %u.param_patt: @F.2.%U.loc17_8.1 (%U.753) = value_param_pattern %u.patt, call_param0
  706. // CHECK:STDOUT: %return.patt: @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = return_slot_pattern
  707. // CHECK:STDOUT: %return.param_patt: @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = out_param_pattern %return.patt, call_param1
  708. // CHECK:STDOUT: } {
  709. // CHECK:STDOUT: %W.ref: type = name_ref W, @impl.%W.loc14_36.1 [symbolic = %W (constants.%W)]
  710. // CHECK:STDOUT: %V1.ref: type = name_ref V1, @impl.%V1.loc14_14.1 [symbolic = %V1 (constants.%V1)]
  711. // CHECK:STDOUT: %V2.ref: type = name_ref V2, @impl.%V2.loc14_25.1 [symbolic = %V2 (constants.%V2)]
  712. // CHECK:STDOUT: %.loc17_38: %tuple.type.24b = tuple_literal (%V1.ref, %V2.ref)
  713. // CHECK:STDOUT: %U.ref.loc17_41: type = name_ref U, %U.loc17_8.2 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  714. // CHECK:STDOUT: %.loc17_42.1: %tuple.type.11f = tuple_literal (%W.ref, %.loc17_38, %U.ref.loc17_41)
  715. // CHECK:STDOUT: %.loc17_42.2: type = converted %.loc17_38, constants.%tuple.type.30b [symbolic = %tuple.type.loc17_42.1 (constants.%tuple.type.30b)]
  716. // CHECK:STDOUT: %.loc17_42.3: type = converted %.loc17_42.1, constants.%tuple.type.8ae [symbolic = %tuple.type.loc17_42.2 (constants.%tuple.type.8ae)]
  717. // CHECK:STDOUT: %U.loc17_8.2: type = bind_symbolic_name U, 3 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  718. // CHECK:STDOUT: %u.param: @F.2.%U.loc17_8.1 (%U.753) = value_param call_param0
  719. // CHECK:STDOUT: %U.ref.loc17_21: type = name_ref U, %U.loc17_8.2 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  720. // CHECK:STDOUT: %u: @F.2.%U.loc17_8.1 (%U.753) = bind_name u, %u.param
  721. // CHECK:STDOUT: %return.param: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = out_param call_param1
  722. // CHECK:STDOUT: %return: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = return_slot %return.param
  723. // CHECK:STDOUT: }
  724. // CHECK:STDOUT:
  725. // CHECK:STDOUT: !members:
  726. // CHECK:STDOUT: .W = <poisoned>
  727. // CHECK:STDOUT: .V1 = <poisoned>
  728. // CHECK:STDOUT: .V2 = <poisoned>
  729. // CHECK:STDOUT: .F = %F.decl
  730. // CHECK:STDOUT: witness = file.%impl_witness
  731. // CHECK:STDOUT: }
  732. // CHECK:STDOUT: }
  733. // CHECK:STDOUT:
  734. // CHECK:STDOUT: class @X {
  735. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  736. // CHECK:STDOUT: complete_type_witness = %complete_type
  737. // CHECK:STDOUT:
  738. // CHECK:STDOUT: !members:
  739. // CHECK:STDOUT: .Self = constants.%X
  740. // CHECK:STDOUT: }
  741. // CHECK:STDOUT:
  742. // CHECK:STDOUT: class @Y1 {
  743. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  744. // CHECK:STDOUT: complete_type_witness = %complete_type
  745. // CHECK:STDOUT:
  746. // CHECK:STDOUT: !members:
  747. // CHECK:STDOUT: .Self = constants.%Y1
  748. // CHECK:STDOUT: }
  749. // CHECK:STDOUT:
  750. // CHECK:STDOUT: class @Y2 {
  751. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  752. // CHECK:STDOUT: complete_type_witness = %complete_type
  753. // CHECK:STDOUT:
  754. // CHECK:STDOUT: !members:
  755. // CHECK:STDOUT: .Self = constants.%Y2
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: class @Z {
  759. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  760. // CHECK:STDOUT: complete_type_witness = %complete_type
  761. // CHECK:STDOUT:
  762. // CHECK:STDOUT: !members:
  763. // CHECK:STDOUT: .Self = constants.%Z
  764. // CHECK:STDOUT: }
  765. // CHECK:STDOUT:
  766. // CHECK:STDOUT: generic fn @F.1(@A.%T.loc5_13.1: type, @A.%Self.1: @A.%A.type (%A.type.75a), %U.loc6_8.2: type) {
  767. // CHECK:STDOUT: %U.loc6_8.1: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  768. // CHECK:STDOUT: %U.patt.loc6_8.2: type = symbolic_binding_pattern U, 2 [symbolic = %U.patt.loc6_8.2 (constants.%U.patt.b3a)]
  769. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
  770. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T)> [symbolic = %A.type (constants.%A.type.75a)]
  771. // CHECK:STDOUT: %Self: @F.1.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.753)]
  772. // CHECK:STDOUT: %tuple.type.loc6_38.1: type = tuple_type (type, @F.1.%A.type (%A.type.75a), type) [symbolic = %tuple.type.loc6_38.1 (constants.%tuple.type.e59)]
  773. // CHECK:STDOUT: %Self.as_type.loc6_38.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  774. // CHECK:STDOUT: %tuple.type.loc6_38.2: type = tuple_type (@F.1.%T (%T.8b3), @F.1.%Self.as_type.loc6_38.1 (%Self.as_type), @F.1.%U.loc6_8.1 (%U.2cb)) [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)]
  775. // CHECK:STDOUT:
  776. // CHECK:STDOUT: fn(%U.patt.loc6_8.1: type, %u.param_patt: @F.1.%U.loc6_8.1 (%U.2cb)) -> @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2);
  777. // CHECK:STDOUT: }
  778. // CHECK:STDOUT:
  779. // CHECK:STDOUT: generic fn @F.2(@impl.%V1.loc14_14.1: type, @impl.%V2.loc14_25.1: type, @impl.%W.loc14_36.1: type, %U.loc17_8.2: type) {
  780. // CHECK:STDOUT: %U.loc17_8.1: type = bind_symbolic_name U, 3 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  781. // CHECK:STDOUT: %U.patt.loc17_8.2: type = symbolic_binding_pattern U, 3 [symbolic = %U.patt.loc17_8.2 (constants.%U.patt.cfd)]
  782. // CHECK:STDOUT: %W: type = bind_symbolic_name W, 2 [symbolic = %W (constants.%W)]
  783. // CHECK:STDOUT: %V1: type = bind_symbolic_name V1, 0 [symbolic = %V1 (constants.%V1)]
  784. // CHECK:STDOUT: %V2: type = bind_symbolic_name V2, 1 [symbolic = %V2 (constants.%V2)]
  785. // CHECK:STDOUT: %tuple.type.loc17_42.1: type = tuple_type (@F.2.%V1 (%V1), @F.2.%V2 (%V2)) [symbolic = %tuple.type.loc17_42.1 (constants.%tuple.type.30b)]
  786. // CHECK:STDOUT: %tuple.type.loc17_42.2: type = tuple_type (@F.2.%W (%W), @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b), @F.2.%U.loc17_8.1 (%U.753)) [symbolic = %tuple.type.loc17_42.2 (constants.%tuple.type.8ae)]
  787. // CHECK:STDOUT:
  788. // CHECK:STDOUT: !definition:
  789. // CHECK:STDOUT: %require_complete.loc17_24: <witness> = require_complete_type @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) [symbolic = %require_complete.loc17_24 (constants.%require_complete.d4d)]
  790. // CHECK:STDOUT: %require_complete.loc17_19: <witness> = require_complete_type @F.2.%U.loc17_8.1 (%U.753) [symbolic = %require_complete.loc17_19 (constants.%require_complete.ed4)]
  791. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%V1, %V2, %W) [symbolic = %F.type (constants.%F.type.b3e)]
  792. // CHECK:STDOUT: %F: @F.2.%F.type (%F.type.b3e) = struct_value () [symbolic = %F (constants.%F.d79)]
  793. // CHECK:STDOUT: %F.specific_fn.loc18_12.2: <specific function> = specific_function %F, @F.2(%V1, %V2, %W, %U.loc17_8.1) [symbolic = %F.specific_fn.loc18_12.2 (constants.%F.specific_fn.7d9)]
  794. // CHECK:STDOUT: %require_complete.loc18_18.1: <witness> = require_complete_type @F.2.%W (%W) [symbolic = %require_complete.loc18_18.1 (constants.%require_complete.f7f)]
  795. // CHECK:STDOUT: %require_complete.loc18_18.2: <witness> = require_complete_type @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) [symbolic = %require_complete.loc18_18.2 (constants.%require_complete.fe1)]
  796. // CHECK:STDOUT: %require_complete.loc18_18.3: <witness> = require_complete_type @F.2.%V1 (%V1) [symbolic = %require_complete.loc18_18.3 (constants.%require_complete.4ae)]
  797. // CHECK:STDOUT: %require_complete.loc18_18.4: <witness> = require_complete_type @F.2.%V2 (%V2) [symbolic = %require_complete.loc18_18.4 (constants.%require_complete.b54)]
  798. // CHECK:STDOUT:
  799. // CHECK:STDOUT: fn(%U.patt.loc17_8.1: type, %u.param_patt: @F.2.%U.loc17_8.1 (%U.753)) -> %return.param_patt: @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) {
  800. // CHECK:STDOUT: !entry:
  801. // CHECK:STDOUT: %.loc18_12: @F.2.%F.type (%F.type.b3e) = specific_constant @impl.%F.decl, @impl(constants.%V1, constants.%V2, constants.%W) [symbolic = %F (constants.%F.d79)]
  802. // CHECK:STDOUT: %F.ref: @F.2.%F.type (%F.type.b3e) = name_ref F, %.loc18_12 [symbolic = %F (constants.%F.d79)]
  803. // CHECK:STDOUT: %U.ref.loc18: type = name_ref U, %U.loc17_8.2 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  804. // CHECK:STDOUT: %u.ref: @F.2.%U.loc17_8.1 (%U.753) = name_ref u, %u
  805. // CHECK:STDOUT: %F.specific_fn.loc18_12.1: <specific function> = specific_function %F.ref, @F.2(constants.%V1, constants.%V2, constants.%W, constants.%U.753) [symbolic = %F.specific_fn.loc18_12.2 (constants.%F.specific_fn.7d9)]
  806. // CHECK:STDOUT: %.loc18_18.1: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = temporary_storage
  807. // CHECK:STDOUT: %F.call: init @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = call %F.specific_fn.loc18_12.1(%u.ref) to %.loc18_18.1
  808. // CHECK:STDOUT: %.loc18_18.2: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = temporary %.loc18_18.1, %F.call
  809. // CHECK:STDOUT: %tuple.elem0.loc18_18.1: ref @F.2.%W (%W) = tuple_access %.loc18_18.2, element0
  810. // CHECK:STDOUT: %.loc18_18.3: @F.2.%W (%W) = bind_value %tuple.elem0.loc18_18.1
  811. // CHECK:STDOUT: %tuple.elem0.loc18_18.2: ref @F.2.%W (%W) = tuple_access %return, element0
  812. // CHECK:STDOUT: %.loc18_18.4: init @F.2.%W (%W) = initialize_from %.loc18_18.3 to %tuple.elem0.loc18_18.2
  813. // CHECK:STDOUT: %tuple.elem1.loc18_18.1: ref @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) = tuple_access %.loc18_18.2, element1
  814. // CHECK:STDOUT: %tuple.elem0.loc18_18.3: ref @F.2.%V1 (%V1) = tuple_access %tuple.elem1.loc18_18.1, element0
  815. // CHECK:STDOUT: %.loc18_18.5: @F.2.%V1 (%V1) = bind_value %tuple.elem0.loc18_18.3
  816. // CHECK:STDOUT: %tuple.elem1.loc18_18.2: ref @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) = tuple_access %return, element1
  817. // CHECK:STDOUT: %tuple.elem0.loc18_18.4: ref @F.2.%V1 (%V1) = tuple_access %tuple.elem1.loc18_18.2, element0
  818. // CHECK:STDOUT: %.loc18_18.6: init @F.2.%V1 (%V1) = initialize_from %.loc18_18.5 to %tuple.elem0.loc18_18.4
  819. // CHECK:STDOUT: %tuple.elem1.loc18_18.3: ref @F.2.%V2 (%V2) = tuple_access %tuple.elem1.loc18_18.1, element1
  820. // CHECK:STDOUT: %.loc18_18.7: @F.2.%V2 (%V2) = bind_value %tuple.elem1.loc18_18.3
  821. // CHECK:STDOUT: %tuple.elem1.loc18_18.4: ref @F.2.%V2 (%V2) = tuple_access %tuple.elem1.loc18_18.2, element1
  822. // CHECK:STDOUT: %.loc18_18.8: init @F.2.%V2 (%V2) = initialize_from %.loc18_18.7 to %tuple.elem1.loc18_18.4
  823. // CHECK:STDOUT: %.loc18_18.9: init @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) = tuple_init (%.loc18_18.6, %.loc18_18.8) to %tuple.elem1.loc18_18.2
  824. // CHECK:STDOUT: %.loc18_18.10: init @F.2.%tuple.type.loc17_42.1 (%tuple.type.30b) = converted %tuple.elem1.loc18_18.1, %.loc18_18.9
  825. // CHECK:STDOUT: %tuple.elem2.loc18_18.1: ref @F.2.%U.loc17_8.1 (%U.753) = tuple_access %.loc18_18.2, element2
  826. // CHECK:STDOUT: %.loc18_18.11: @F.2.%U.loc17_8.1 (%U.753) = bind_value %tuple.elem2.loc18_18.1
  827. // CHECK:STDOUT: %tuple.elem2.loc18_18.2: ref @F.2.%U.loc17_8.1 (%U.753) = tuple_access %return, element2
  828. // CHECK:STDOUT: %.loc18_18.12: init @F.2.%U.loc17_8.1 (%U.753) = initialize_from %.loc18_18.11 to %tuple.elem2.loc18_18.2
  829. // CHECK:STDOUT: %.loc18_18.13: init @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = tuple_init (%.loc18_18.4, %.loc18_18.10, %.loc18_18.12) to %return
  830. // CHECK:STDOUT: %.loc18_19: init @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = converted %F.call, %.loc18_18.13
  831. // CHECK:STDOUT: return %.loc18_19 to %return
  832. // CHECK:STDOUT: }
  833. // CHECK:STDOUT: }
  834. // CHECK:STDOUT:
  835. // CHECK:STDOUT: fn @Call() {
  836. // CHECK:STDOUT: !entry:
  837. // CHECK:STDOUT: %Y1.ref: type = name_ref Y1, file.%Y1.decl [concrete = constants.%Y1]
  838. // CHECK:STDOUT: %Y2.ref: type = name_ref Y2, file.%Y2.decl [concrete = constants.%Y2]
  839. // CHECK:STDOUT: %.loc24_12: %tuple.type.24b = tuple_literal (%Y1.ref, %Y2.ref)
  840. // CHECK:STDOUT: %.loc24_14: type = converted %.loc24_12, constants.%tuple.type.a46 [concrete = constants.%tuple.type.a46]
  841. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  842. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  843. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  844. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%tuple.type.a46, (constants.%impl_witness.14a) [concrete = constants.%A.facet.058]
  845. // CHECK:STDOUT: %.loc24_23: %A.type.91f = converted %.loc24_14, %A.facet [concrete = constants.%A.facet.058]
  846. // CHECK:STDOUT: %.loc24_31.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6]
  847. // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc24_31.1 [concrete = constants.%assoc0.5f6]
  848. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc24_23 [concrete = constants.%tuple.type.a46]
  849. // CHECK:STDOUT: %.loc24_31.2: type = converted %.loc24_23, %as_type [concrete = constants.%tuple.type.a46]
  850. // CHECK:STDOUT: %as_wit.iface0: <witness> = facet_access_witness %.loc24_23, element0 [concrete = constants.%impl_witness.14a]
  851. // CHECK:STDOUT: %impl.elem0: %.0b0 = impl_witness_access %as_wit.iface0, element0 [concrete = constants.%F.93b]
  852. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z]
  853. // CHECK:STDOUT: %.loc24_38.1: %empty_struct_type = struct_literal ()
  854. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%Y1, constants.%Y2, constants.%X, constants.%Z) [concrete = constants.%F.specific_fn.79b]
  855. // CHECK:STDOUT: %.loc24_39.1: ref %tuple.type.415 = temporary_storage
  856. // CHECK:STDOUT: %.loc24_38.2: ref %Z = temporary_storage
  857. // CHECK:STDOUT: %.loc24_38.3: init %Z = class_init (), %.loc24_38.2 [concrete = constants.%Z.val]
  858. // CHECK:STDOUT: %.loc24_38.4: ref %Z = temporary %.loc24_38.2, %.loc24_38.3
  859. // CHECK:STDOUT: %.loc24_38.5: ref %Z = converted %.loc24_38.1, %.loc24_38.4
  860. // CHECK:STDOUT: %.loc24_38.6: %Z = bind_value %.loc24_38.5
  861. // CHECK:STDOUT: %F.call: init %tuple.type.415 = call %specific_fn(%.loc24_38.6) to %.loc24_39.1
  862. // CHECK:STDOUT: %.loc24_39.2: ref %tuple.type.415 = temporary %.loc24_39.1, %F.call
  863. // CHECK:STDOUT: return
  864. // CHECK:STDOUT: }
  865. // CHECK:STDOUT:
  866. // CHECK:STDOUT: generic fn @CallGeneric(%T.loc27_16.1: %A.type.91f) {
  867. // CHECK:STDOUT: %T.loc27_16.2: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.2 (constants.%T.9c2)]
  868. // CHECK:STDOUT: %T.patt.loc27_16.2: %A.type.91f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc27_16.2 (constants.%T.patt.e81)]
  869. // CHECK:STDOUT:
  870. // CHECK:STDOUT: !definition:
  871. // CHECK:STDOUT: %T.as_type.loc28_4.2: type = facet_access_type %T.loc27_16.2 [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type)]
  872. // CHECK:STDOUT: %T.as_wit.iface0.loc28_4.2: <witness> = facet_access_witness %T.loc27_16.2, element0 [symbolic = %T.as_wit.iface0.loc28_4.2 (constants.%T.as_wit.iface0)]
  873. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value %T.as_type.loc28_4.2, (%T.as_wit.iface0.loc28_4.2) [symbolic = %A.facet (constants.%A.facet.834)]
  874. // CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type constants.%F.type.13d, %A.facet [symbolic = %.loc28_4.3 (constants.%.591)]
  875. // CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.591) = impl_witness_access %T.as_wit.iface0.loc28_4.2, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)]
  876. // CHECK:STDOUT: %specific_impl_fn.loc28_4.2: <specific function> = specific_impl_function %impl.elem0.loc28_4.2, @F.1(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)]
  877. // CHECK:STDOUT: %tuple.type: type = tuple_type (%X, @CallGeneric.%T.as_type.loc28_4.2 (%T.as_type), %Z) [symbolic = %tuple.type (constants.%tuple.type.e28)]
  878. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallGeneric.%tuple.type (%tuple.type.e28) [symbolic = %require_complete (constants.%require_complete.500)]
  879. // CHECK:STDOUT:
  880. // CHECK:STDOUT: fn(%T.patt.loc27_16.1: %A.type.91f) {
  881. // CHECK:STDOUT: !entry:
  882. // CHECK:STDOUT: %T.ref: %A.type.91f = name_ref T, %T.loc27_16.1 [symbolic = %T.loc27_16.2 (constants.%T.9c2)]
  883. // CHECK:STDOUT: %.loc28_4.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6]
  884. // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc28_4.1 [concrete = constants.%assoc0.5f6]
  885. // CHECK:STDOUT: %T.as_type.loc28_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type)]
  886. // CHECK:STDOUT: %.loc28_4.2: type = converted %T.ref, %T.as_type.loc28_4.1 [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type)]
  887. // CHECK:STDOUT: %T.as_wit.iface0.loc28_4.1: <witness> = facet_access_witness %T.ref, element0 [symbolic = %T.as_wit.iface0.loc28_4.2 (constants.%T.as_wit.iface0)]
  888. // CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.591) = impl_witness_access %T.as_wit.iface0.loc28_4.1, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)]
  889. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z]
  890. // CHECK:STDOUT: %.loc28_11.1: %empty_struct_type = struct_literal ()
  891. // CHECK:STDOUT: %specific_impl_fn.loc28_4.1: <specific function> = specific_impl_function %impl.elem0.loc28_4.1, @F.1(constants.%X, constants.%A.facet.834, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)]
  892. // CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary_storage
  893. // CHECK:STDOUT: %.loc28_11.2: ref %Z = temporary_storage
  894. // CHECK:STDOUT: %.loc28_11.3: init %Z = class_init (), %.loc28_11.2 [concrete = constants.%Z.val]
  895. // CHECK:STDOUT: %.loc28_11.4: ref %Z = temporary %.loc28_11.2, %.loc28_11.3
  896. // CHECK:STDOUT: %.loc28_11.5: ref %Z = converted %.loc28_11.1, %.loc28_11.4
  897. // CHECK:STDOUT: %.loc28_11.6: %Z = bind_value %.loc28_11.5
  898. // CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.e28) = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) to %.loc28_12.1
  899. // CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary %.loc28_12.1, %.loc28_12.2
  900. // CHECK:STDOUT: return
  901. // CHECK:STDOUT: }
  902. // CHECK:STDOUT: }
  903. // CHECK:STDOUT:
  904. // CHECK:STDOUT: fn @CallIndirect() {
  905. // CHECK:STDOUT: !entry:
  906. // CHECK:STDOUT: %CallGeneric.ref: %CallGeneric.type = name_ref CallGeneric, file.%CallGeneric.decl [concrete = constants.%CallGeneric]
  907. // CHECK:STDOUT: %Y1.ref: type = name_ref Y1, file.%Y1.decl [concrete = constants.%Y1]
  908. // CHECK:STDOUT: %Y2.ref: type = name_ref Y2, file.%Y2.decl [concrete = constants.%Y2]
  909. // CHECK:STDOUT: %.loc33_22: %tuple.type.24b = tuple_literal (%Y1.ref, %Y2.ref)
  910. // CHECK:STDOUT: %.loc33_24: type = converted %.loc33_22, constants.%tuple.type.a46 [concrete = constants.%tuple.type.a46]
  911. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%tuple.type.a46, (constants.%impl_witness.14a) [concrete = constants.%A.facet.058]
  912. // CHECK:STDOUT: %.loc33_31: %A.type.91f = converted %.loc33_24, %A.facet [concrete = constants.%A.facet.058]
  913. // CHECK:STDOUT: %CallGeneric.specific_fn: <specific function> = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet.058) [concrete = constants.%CallGeneric.specific_fn]
  914. // CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn()
  915. // CHECK:STDOUT: return
  916. // CHECK:STDOUT: }
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: specific @A(constants.%T.8b3) {
  919. // CHECK:STDOUT: %T.loc5_13.2 => constants.%T.8b3
  920. // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.patt.e01
  921. // CHECK:STDOUT: }
  922. // CHECK:STDOUT:
  923. // CHECK:STDOUT: specific @F.1(constants.%T.8b3, constants.%Self.753, constants.%U.2cb) {
  924. // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.2cb
  925. // CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.patt.b3a
  926. // CHECK:STDOUT: %T => constants.%T.8b3
  927. // CHECK:STDOUT: %A.type => constants.%A.type.75a
  928. // CHECK:STDOUT: %Self => constants.%Self.753
  929. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.e59
  930. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Self.as_type
  931. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.bd2
  932. // CHECK:STDOUT: }
  933. // CHECK:STDOUT:
  934. // CHECK:STDOUT: specific @A(@F.1.%T) {}
  935. // CHECK:STDOUT:
  936. // CHECK:STDOUT: specific @A(%T.loc5_13.2) {}
  937. // CHECK:STDOUT:
  938. // CHECK:STDOUT: specific @A(constants.%W) {
  939. // CHECK:STDOUT: %T.loc5_13.2 => constants.%W
  940. // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.patt.e01
  941. // CHECK:STDOUT:
  942. // CHECK:STDOUT: !definition:
  943. // CHECK:STDOUT: %A.type => constants.%A.type.f21
  944. // CHECK:STDOUT: %Self.2 => constants.%Self.4fe
  945. // CHECK:STDOUT: %F.type => constants.%F.type.904
  946. // CHECK:STDOUT: %F => constants.%F.1ee
  947. // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.b05
  948. // CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.c82
  949. // CHECK:STDOUT: }
  950. // CHECK:STDOUT:
  951. // CHECK:STDOUT: specific @impl(constants.%V1, constants.%V2, constants.%W) {
  952. // CHECK:STDOUT: %V1.loc14_14.2 => constants.%V1
  953. // CHECK:STDOUT: %V1.patt.loc14_14.2 => constants.%V1.patt
  954. // CHECK:STDOUT: %V2.loc14_25.2 => constants.%V2
  955. // CHECK:STDOUT: %V2.patt.loc14_25.2 => constants.%V2.patt
  956. // CHECK:STDOUT: %W.loc14_36.2 => constants.%W
  957. // CHECK:STDOUT: %W.patt.loc14_36.2 => constants.%W.patt
  958. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.30b
  959. // CHECK:STDOUT: %A.type.loc14_61.2 => constants.%A.type.f21
  960. // CHECK:STDOUT: %require_complete => constants.%require_complete.796
  961. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.0d8
  962. // CHECK:STDOUT:
  963. // CHECK:STDOUT: !definition:
  964. // CHECK:STDOUT: %F.type => constants.%F.type.b3e
  965. // CHECK:STDOUT: %F => constants.%F.d79
  966. // CHECK:STDOUT: }
  967. // CHECK:STDOUT:
  968. // CHECK:STDOUT: specific @A(@impl.%W.loc14_36.2) {}
  969. // CHECK:STDOUT:
  970. // CHECK:STDOUT: specific @impl(%V1.loc14_14.2, %V2.loc14_25.2, %W.loc14_36.2) {}
  971. // CHECK:STDOUT:
  972. // CHECK:STDOUT: specific @F.2(constants.%V1, constants.%V2, constants.%W, constants.%U.753) {
  973. // CHECK:STDOUT: %U.loc17_8.1 => constants.%U.753
  974. // CHECK:STDOUT: %U.patt.loc17_8.2 => constants.%U.patt.cfd
  975. // CHECK:STDOUT: %W => constants.%W
  976. // CHECK:STDOUT: %V1 => constants.%V1
  977. // CHECK:STDOUT: %V2 => constants.%V2
  978. // CHECK:STDOUT: %tuple.type.loc17_42.1 => constants.%tuple.type.30b
  979. // CHECK:STDOUT: %tuple.type.loc17_42.2 => constants.%tuple.type.8ae
  980. // CHECK:STDOUT:
  981. // CHECK:STDOUT: !definition:
  982. // CHECK:STDOUT: %require_complete.loc17_24 => constants.%require_complete.d4d
  983. // CHECK:STDOUT: %require_complete.loc17_19 => constants.%require_complete.ed4
  984. // CHECK:STDOUT: %F.type => constants.%F.type.b3e
  985. // CHECK:STDOUT: %F => constants.%F.d79
  986. // CHECK:STDOUT: %F.specific_fn.loc18_12.2 => constants.%F.specific_fn.7d9
  987. // CHECK:STDOUT: %require_complete.loc18_18.1 => constants.%require_complete.f7f
  988. // CHECK:STDOUT: %require_complete.loc18_18.2 => constants.%require_complete.fe1
  989. // CHECK:STDOUT: %require_complete.loc18_18.3 => constants.%require_complete.4ae
  990. // CHECK:STDOUT: %require_complete.loc18_18.4 => constants.%require_complete.b54
  991. // CHECK:STDOUT: }
  992. // CHECK:STDOUT:
  993. // CHECK:STDOUT: specific @F.1(constants.%W, constants.%A.facet.412, constants.%U.753) {
  994. // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.753
  995. // CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.patt.b3a
  996. // CHECK:STDOUT: %T => constants.%W
  997. // CHECK:STDOUT: %A.type => constants.%A.type.f21
  998. // CHECK:STDOUT: %Self => constants.%A.facet.412
  999. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.136
  1000. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%tuple.type.30b
  1001. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.8ae
  1002. // CHECK:STDOUT: }
  1003. // CHECK:STDOUT:
  1004. // CHECK:STDOUT: specific @impl(@F.2.%V1, @F.2.%V2, @F.2.%W) {}
  1005. // CHECK:STDOUT:
  1006. // CHECK:STDOUT: specific @F.2(%V1, %V2, %W, %U.loc17_8.1) {}
  1007. // CHECK:STDOUT:
  1008. // CHECK:STDOUT: specific @A(constants.%X) {
  1009. // CHECK:STDOUT: %T.loc5_13.2 => constants.%X
  1010. // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.patt.e01
  1011. // CHECK:STDOUT:
  1012. // CHECK:STDOUT: !definition:
  1013. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  1014. // CHECK:STDOUT: %Self.2 => constants.%Self.1bb
  1015. // CHECK:STDOUT: %F.type => constants.%F.type.13d
  1016. // CHECK:STDOUT: %F => constants.%F.d83
  1017. // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.296
  1018. // CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.5f6
  1019. // CHECK:STDOUT: }
  1020. // CHECK:STDOUT:
  1021. // CHECK:STDOUT: specific @impl(constants.%Y1, constants.%Y2, constants.%X) {
  1022. // CHECK:STDOUT: %V1.loc14_14.2 => constants.%Y1
  1023. // CHECK:STDOUT: %V1.patt.loc14_14.2 => constants.%V1.patt
  1024. // CHECK:STDOUT: %V2.loc14_25.2 => constants.%Y2
  1025. // CHECK:STDOUT: %V2.patt.loc14_25.2 => constants.%V2.patt
  1026. // CHECK:STDOUT: %W.loc14_36.2 => constants.%X
  1027. // CHECK:STDOUT: %W.patt.loc14_36.2 => constants.%W.patt
  1028. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.a46
  1029. // CHECK:STDOUT: %A.type.loc14_61.2 => constants.%A.type.91f
  1030. // CHECK:STDOUT: %require_complete => constants.%complete_type.d76
  1031. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.14a
  1032. // CHECK:STDOUT:
  1033. // CHECK:STDOUT: !definition:
  1034. // CHECK:STDOUT: %F.type => constants.%F.type.bf7
  1035. // CHECK:STDOUT: %F => constants.%F.93b
  1036. // CHECK:STDOUT: }
  1037. // CHECK:STDOUT:
  1038. // CHECK:STDOUT: specific @F.2(constants.%Y1, constants.%Y2, constants.%X, constants.%Z) {
  1039. // CHECK:STDOUT: %U.loc17_8.1 => constants.%Z
  1040. // CHECK:STDOUT: %U.patt.loc17_8.2 => constants.%U.patt.cfd
  1041. // CHECK:STDOUT: %W => constants.%X
  1042. // CHECK:STDOUT: %V1 => constants.%Y1
  1043. // CHECK:STDOUT: %V2 => constants.%Y2
  1044. // CHECK:STDOUT: %tuple.type.loc17_42.1 => constants.%tuple.type.a46
  1045. // CHECK:STDOUT: %tuple.type.loc17_42.2 => constants.%tuple.type.415
  1046. // CHECK:STDOUT:
  1047. // CHECK:STDOUT: !definition:
  1048. // CHECK:STDOUT: %require_complete.loc17_24 => constants.%complete_type.aa8
  1049. // CHECK:STDOUT: %require_complete.loc17_19 => constants.%complete_type.357
  1050. // CHECK:STDOUT: %F.type => constants.%F.type.bf7
  1051. // CHECK:STDOUT: %F => constants.%F.93b
  1052. // CHECK:STDOUT: %F.specific_fn.loc18_12.2 => constants.%F.specific_fn.79b
  1053. // CHECK:STDOUT: %require_complete.loc18_18.1 => constants.%complete_type.357
  1054. // CHECK:STDOUT: %require_complete.loc18_18.2 => constants.%complete_type.4d1
  1055. // CHECK:STDOUT: %require_complete.loc18_18.3 => constants.%complete_type.357
  1056. // CHECK:STDOUT: %require_complete.loc18_18.4 => constants.%complete_type.357
  1057. // CHECK:STDOUT: }
  1058. // CHECK:STDOUT:
  1059. // CHECK:STDOUT: specific @CallGeneric(constants.%T.9c2) {
  1060. // CHECK:STDOUT: %T.loc27_16.2 => constants.%T.9c2
  1061. // CHECK:STDOUT: %T.patt.loc27_16.2 => constants.%T.patt.e81
  1062. // CHECK:STDOUT: }
  1063. // CHECK:STDOUT:
  1064. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.834, constants.%Z) {
  1065. // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z
  1066. // CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.patt.b3a
  1067. // CHECK:STDOUT: %T => constants.%X
  1068. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  1069. // CHECK:STDOUT: %Self => constants.%A.facet.834
  1070. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  1071. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%T.as_type
  1072. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.e28
  1073. // CHECK:STDOUT: }
  1074. // CHECK:STDOUT:
  1075. // CHECK:STDOUT: specific @F.1(constants.%X, @CallGeneric.%A.facet, constants.%Z) {}
  1076. // CHECK:STDOUT:
  1077. // CHECK:STDOUT: specific @CallGeneric(constants.%A.facet.058) {
  1078. // CHECK:STDOUT: %T.loc27_16.2 => constants.%A.facet.058
  1079. // CHECK:STDOUT: %T.patt.loc27_16.2 => constants.%T.patt.e81
  1080. // CHECK:STDOUT:
  1081. // CHECK:STDOUT: !definition:
  1082. // CHECK:STDOUT: %T.as_type.loc28_4.2 => constants.%tuple.type.a46
  1083. // CHECK:STDOUT: %T.as_wit.iface0.loc28_4.2 => constants.%impl_witness.14a
  1084. // CHECK:STDOUT: %A.facet => constants.%A.facet.058
  1085. // CHECK:STDOUT: %.loc28_4.3 => constants.%.0b0
  1086. // CHECK:STDOUT: %impl.elem0.loc28_4.2 => constants.%F.93b
  1087. // CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%F.specific_fn.79b
  1088. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.415
  1089. // CHECK:STDOUT: %require_complete => constants.%complete_type.aa8
  1090. // CHECK:STDOUT: }
  1091. // CHECK:STDOUT:
  1092. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.058, constants.%Z) {
  1093. // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z
  1094. // CHECK:STDOUT: %U.patt.loc6_8.2 => constants.%U.patt.b3a
  1095. // CHECK:STDOUT: %T => constants.%X
  1096. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  1097. // CHECK:STDOUT: %Self => constants.%A.facet.058
  1098. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  1099. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%tuple.type.a46
  1100. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.415
  1101. // CHECK:STDOUT: }
  1102. // CHECK:STDOUT: