fail_todo_use_assoc_const.carbon 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  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/impl/fail_todo_use_assoc_const.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon
  10. // --- fail_todo_associated_type_in_signature.carbon
  11. library "[[@TEST_NAME]]";
  12. interface J {
  13. let U:! type;
  14. // CHECK:STDERR: fail_todo_associated_type_in_signature.carbon:[[@LINE+14]]:23: error: cannot implicitly convert value of type `<associated entity in J>` to `type` [ImplicitAsConversionFailure]
  15. // CHECK:STDERR: fn F[self: Self](u: U) -> U;
  16. // CHECK:STDERR: ^
  17. // CHECK:STDERR: fail_todo_associated_type_in_signature.carbon:[[@LINE+11]]:23: note: type `<associated entity in J>` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
  18. // CHECK:STDERR: fn F[self: Self](u: U) -> U;
  19. // CHECK:STDERR: ^
  20. // CHECK:STDERR:
  21. // CHECK:STDERR: fail_todo_associated_type_in_signature.carbon:[[@LINE+7]]:29: error: cannot implicitly convert value of type `<associated entity in J>` to `type` [ImplicitAsConversionFailure]
  22. // CHECK:STDERR: fn F[self: Self](u: U) -> U;
  23. // CHECK:STDERR: ^
  24. // CHECK:STDERR: fail_todo_associated_type_in_signature.carbon:[[@LINE+4]]:29: note: type `<associated entity in J>` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
  25. // CHECK:STDERR: fn F[self: Self](u: U) -> U;
  26. // CHECK:STDERR: ^
  27. // CHECK:STDERR:
  28. fn F[self: Self](u: U) -> U;
  29. }
  30. impl () as J where .U = {} {
  31. fn F[self: Self](u: {}) -> {} { return u; }
  32. }
  33. class C {
  34. // This allows the type to be copyable so it can be returned.
  35. adapt {};
  36. }
  37. impl C as J where .U = C {
  38. fn F[self: Self](u: C) -> C { return self; }
  39. }
  40. // --- use_non-type_in_function.carbon
  41. library "[[@TEST_NAME]]";
  42. interface M {
  43. let Z:! {.b: {}};
  44. fn G() -> {};
  45. }
  46. impl () as M where .Z = {.b = {}} {
  47. fn G() -> {} {
  48. return (Self as M).Z.b;
  49. }
  50. }
  51. // --- self_as_uses_correct_rewrite_constraint.carbon
  52. library "[[@TEST_NAME]]";
  53. class C(T:! type) {}
  54. interface M {
  55. let Z:! {.b: type};
  56. fn G() -> type;
  57. }
  58. impl C({}) as M where .Z = {.b = {}} {
  59. fn G() -> type {
  60. return (Self as M).Z.b;
  61. }
  62. }
  63. impl C(()) as M where .Z = {.b = ()} {
  64. fn G() -> type {
  65. return (Self as M).Z.b;
  66. }
  67. }
  68. // --- fail_todo_associated_int_in_array.carbon
  69. library "[[@TEST_NAME]]";
  70. interface I {
  71. let N:! i32;
  72. // CHECK:STDERR: fail_todo_associated_int_in_array.carbon:[[@LINE+7]]:37: error: cannot implicitly convert value of type `<associated entity in I>` to `Core.IntLiteral` [ImplicitAsConversionFailure]
  73. // CHECK:STDERR: fn F[self: Self]() -> array(bool, N);
  74. // CHECK:STDERR: ^
  75. // CHECK:STDERR: fail_todo_associated_int_in_array.carbon:[[@LINE+4]]:37: note: type `<associated entity in I>` does not implement interface `Core.ImplicitAs(Core.IntLiteral)` [MissingImplInMemberAccessNote]
  76. // CHECK:STDERR: fn F[self: Self]() -> array(bool, N);
  77. // CHECK:STDERR: ^
  78. // CHECK:STDERR:
  79. fn F[self: Self]() -> array(bool, N);
  80. }
  81. impl () as I where .N = 2 {
  82. fn F[self: Self]() -> array(bool, 2) { return (true, false); }
  83. }
  84. // CHECK:STDOUT: --- fail_todo_associated_type_in_signature.carbon
  85. // CHECK:STDOUT:
  86. // CHECK:STDOUT: constants {
  87. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  88. // CHECK:STDOUT: %Self.ccd: %J.type = bind_symbolic_name Self, 0 [symbolic]
  89. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type %J.type [concrete]
  90. // CHECK:STDOUT: %assoc0.1e6: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  91. // CHECK:STDOUT: %Self.as_type.3df: type = facet_access_type %Self.ccd [symbolic]
  92. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  93. // CHECK:STDOUT: %F.type.c14: type = fn_type @F.1 [concrete]
  94. // CHECK:STDOUT: %F.b71: %F.type.c14 = struct_value () [concrete]
  95. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%F.decl [concrete]
  96. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self]
  97. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  98. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  99. // CHECK:STDOUT: %J.facet.28c: %J.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  100. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  101. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  102. // CHECK:STDOUT: %J_where.type.5f6: type = facet_type <@J where %impl.elem0 = %empty_struct_type> [concrete]
  103. // CHECK:STDOUT: %impl_witness.f71: <witness> = impl_witness (%empty_struct_type, <error>) [concrete]
  104. // CHECK:STDOUT: %F.type.b97: type = fn_type @F.2 [concrete]
  105. // CHECK:STDOUT: %F.747: %F.type.b97 = struct_value () [concrete]
  106. // CHECK:STDOUT: %J.facet.506: %J.type = facet_value %empty_tuple.type, (%impl_witness.f71) [concrete]
  107. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  108. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  109. // CHECK:STDOUT: %J_where.type.6f2: type = facet_type <@J where %impl.elem0 = %C> [concrete]
  110. // CHECK:STDOUT: %impl_witness.c2b: <witness> = impl_witness (%C, <error>) [concrete]
  111. // CHECK:STDOUT: %F.type.69d: type = fn_type @F.3 [concrete]
  112. // CHECK:STDOUT: %F.451: %F.type.69d = struct_value () [concrete]
  113. // CHECK:STDOUT: %J.facet.e8d: %J.type = facet_value %C, (%impl_witness.c2b) [concrete]
  114. // CHECK:STDOUT: }
  115. // CHECK:STDOUT:
  116. // CHECK:STDOUT: imports {
  117. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  118. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  119. // CHECK:STDOUT: import Core//prelude
  120. // CHECK:STDOUT: import Core//prelude/...
  121. // CHECK:STDOUT: }
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT:
  124. // CHECK:STDOUT: file {
  125. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  126. // CHECK:STDOUT: .Core = imports.%Core
  127. // CHECK:STDOUT: .J = %J.decl
  128. // CHECK:STDOUT: .C = %C.decl
  129. // CHECK:STDOUT: }
  130. // CHECK:STDOUT: %Core.import = import Core
  131. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  132. // CHECK:STDOUT: impl_decl @impl.8c7 [concrete] {} {
  133. // CHECK:STDOUT: %.loc22_7.1: %empty_tuple.type = tuple_literal ()
  134. // CHECK:STDOUT: %.loc22_7.2: type = converted %.loc22_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  135. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  136. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  137. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  138. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.1e6]
  139. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  140. // CHECK:STDOUT: %.loc22_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  141. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  142. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  143. // CHECK:STDOUT: %.loc22_26.1: %empty_struct_type = struct_literal ()
  144. // CHECK:STDOUT: %.loc22_26.2: type = converted %.loc22_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  145. // CHECK:STDOUT: %.loc22_14: type = where_expr %.Self [concrete = constants.%J_where.type.5f6] {
  146. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc22_26.2
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT: }
  149. // CHECK:STDOUT: %impl_witness.loc22: <witness> = impl_witness (constants.%empty_struct_type, <error>) [concrete = constants.%impl_witness.f71]
  150. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  151. // CHECK:STDOUT: impl_decl @impl.f57 [concrete] {} {
  152. // CHECK:STDOUT: %C.ref.loc31_6: type = name_ref C, file.%C.decl [concrete = constants.%C]
  153. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  154. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  155. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  156. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.1e6]
  157. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  158. // CHECK:STDOUT: %.loc31_19: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  159. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  160. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  161. // CHECK:STDOUT: %C.ref.loc31_24: type = name_ref C, file.%C.decl [concrete = constants.%C]
  162. // CHECK:STDOUT: %.loc31_13: type = where_expr %.Self [concrete = constants.%J_where.type.6f2] {
  163. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.ref.loc31_24
  164. // CHECK:STDOUT: }
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT: %impl_witness.loc31: <witness> = impl_witness (constants.%C, <error>) [concrete = constants.%impl_witness.c2b]
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: interface @J {
  170. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.ccd]
  171. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  172. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.1e6]
  173. // CHECK:STDOUT: }
  174. // CHECK:STDOUT: %F.decl: %F.type.c14 = fn_decl @F.1 [concrete = constants.%F.b71] {
  175. // CHECK:STDOUT: %self.patt: @F.1.%Self.as_type.loc19_14.1 (%Self.as_type.3df) = binding_pattern self
  176. // CHECK:STDOUT: %self.param_patt: @F.1.%Self.as_type.loc19_14.1 (%Self.as_type.3df) = value_param_pattern %self.patt, call_param0
  177. // CHECK:STDOUT: %u.patt: <error> = binding_pattern u
  178. // CHECK:STDOUT: %u.param_patt: <error> = value_param_pattern %u.patt, call_param1 [concrete = <error>]
  179. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern
  180. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, call_param2
  181. // CHECK:STDOUT: } {
  182. // CHECK:STDOUT: %U.ref.loc19_29: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.1e6]
  183. // CHECK:STDOUT: %.loc19_29: type = converted %U.ref.loc19_29, <error> [concrete = <error>]
  184. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc19_14.1 (%Self.as_type.3df) = value_param call_param0
  185. // CHECK:STDOUT: %.loc19_14.1: type = splice_block %.loc19_14.2 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type.3df)] {
  186. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self.ccd)]
  187. // CHECK:STDOUT: %Self.as_type.loc19_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type.3df)]
  188. // CHECK:STDOUT: %.loc19_14.2: type = converted %Self.ref, %Self.as_type.loc19_14.2 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type.3df)]
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc19_14.1 (%Self.as_type.3df) = bind_name self, %self.param
  191. // CHECK:STDOUT: %u.param: <error> = value_param call_param1
  192. // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
  193. // CHECK:STDOUT: %U.ref.loc19_23: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.1e6]
  194. // CHECK:STDOUT: %.loc19_23: type = converted %U.ref.loc19_23, <error> [concrete = <error>]
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT: %u: <error> = bind_name u, %u.param
  197. // CHECK:STDOUT: %return.param: ref <error> = out_param call_param2
  198. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1]
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: !members:
  203. // CHECK:STDOUT: .Self = %Self
  204. // CHECK:STDOUT: .U = @U.%assoc0
  205. // CHECK:STDOUT: .F = %assoc1
  206. // CHECK:STDOUT: witness = (%U, %F.decl)
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  210. // CHECK:STDOUT: assoc_const U:! type;
  211. // CHECK:STDOUT: }
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: impl @impl.8c7: %.loc22_7.2 as %.loc22_14 {
  214. // CHECK:STDOUT: %F.decl: %F.type.b97 = fn_decl @F.2 [concrete = constants.%F.747] {
  215. // CHECK:STDOUT: %self.patt: %empty_tuple.type = binding_pattern self
  216. // CHECK:STDOUT: %self.param_patt: %empty_tuple.type = value_param_pattern %self.patt, call_param0
  217. // CHECK:STDOUT: %u.patt: %empty_struct_type = binding_pattern u
  218. // CHECK:STDOUT: %u.param_patt: %empty_struct_type = value_param_pattern %u.patt, call_param1
  219. // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern
  220. // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, call_param2
  221. // CHECK:STDOUT: } {
  222. // CHECK:STDOUT: %.loc23_31.1: %empty_struct_type = struct_literal ()
  223. // CHECK:STDOUT: %.loc23_31.2: type = converted %.loc23_31.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  224. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  225. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.8c7.%.loc22_7.2 [concrete = constants.%empty_tuple.type]
  226. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  227. // CHECK:STDOUT: %u.param: %empty_struct_type = value_param call_param1
  228. // CHECK:STDOUT: %.loc23_24.1: type = splice_block %.loc23_24.3 [concrete = constants.%empty_struct_type] {
  229. // CHECK:STDOUT: %.loc23_24.2: %empty_struct_type = struct_literal ()
  230. // CHECK:STDOUT: %.loc23_24.3: type = converted %.loc23_24.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT: %u: %empty_struct_type = bind_name u, %u.param
  233. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param2
  234. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: !members:
  238. // CHECK:STDOUT: .F = %F.decl
  239. // CHECK:STDOUT: witness = file.%impl_witness.loc22
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT:
  242. // CHECK:STDOUT: impl @impl.f57: %C.ref.loc31_6 as %.loc31_13 {
  243. // CHECK:STDOUT: %F.decl: %F.type.69d = fn_decl @F.3 [concrete = constants.%F.451] {
  244. // CHECK:STDOUT: %self.patt: %C = binding_pattern self
  245. // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
  246. // CHECK:STDOUT: %u.patt: %C = binding_pattern u
  247. // CHECK:STDOUT: %u.param_patt: %C = value_param_pattern %u.patt, call_param1
  248. // CHECK:STDOUT: %return.patt: %C = return_slot_pattern
  249. // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, call_param2
  250. // CHECK:STDOUT: } {
  251. // CHECK:STDOUT: %C.ref.loc32_29: type = name_ref C, file.%C.decl [concrete = constants.%C]
  252. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  253. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.f57.%C.ref.loc31_6 [concrete = constants.%C]
  254. // CHECK:STDOUT: %self: %C = bind_name self, %self.param
  255. // CHECK:STDOUT: %u.param: %C = value_param call_param1
  256. // CHECK:STDOUT: %C.ref.loc32_23: type = name_ref C, file.%C.decl [concrete = constants.%C]
  257. // CHECK:STDOUT: %u: %C = bind_name u, %u.param
  258. // CHECK:STDOUT: %return.param: ref %C = out_param call_param2
  259. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT:
  262. // CHECK:STDOUT: !members:
  263. // CHECK:STDOUT: .C = <poisoned>
  264. // CHECK:STDOUT: .F = %F.decl
  265. // CHECK:STDOUT: witness = file.%impl_witness.loc31
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: class @C {
  269. // CHECK:STDOUT: %.loc28_10: %empty_struct_type = struct_literal ()
  270. // CHECK:STDOUT: %.loc28_11: type = converted %.loc28_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  271. // CHECK:STDOUT: adapt_decl %.loc28_11 [concrete]
  272. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  273. // CHECK:STDOUT: complete_type_witness = %complete_type
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: !members:
  276. // CHECK:STDOUT: .Self = constants.%C
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: generic fn @F.1(@J.%Self: %J.type) {
  280. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.ccd)]
  281. // CHECK:STDOUT: %Self.as_type.loc19_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type.3df)]
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self.as_type.loc19_14.1 (%Self.as_type.3df)](%u.param_patt: <error>) -> <error>;
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT:
  286. // CHECK:STDOUT: fn @F.2[%self.param_patt: %empty_tuple.type](%u.param_patt: %empty_struct_type) -> %empty_struct_type {
  287. // CHECK:STDOUT: !entry:
  288. // CHECK:STDOUT: %u.ref: %empty_struct_type = name_ref u, %u
  289. // CHECK:STDOUT: return %u.ref
  290. // CHECK:STDOUT: }
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: fn @F.3[%self.param_patt: %C](%u.param_patt: %C) -> %C {
  293. // CHECK:STDOUT: !entry:
  294. // CHECK:STDOUT: %self.ref: %C = name_ref self, %self
  295. // CHECK:STDOUT: return %self.ref
  296. // CHECK:STDOUT: }
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: specific @U(constants.%Self.ccd) {}
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: specific @F.1(constants.%Self.ccd) {
  301. // CHECK:STDOUT: %Self => constants.%Self.ccd
  302. // CHECK:STDOUT: %Self.as_type.loc19_14.1 => constants.%Self.as_type.3df
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: specific @U(constants.%J.facet.28c) {}
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: specific @F.1(constants.%J.facet.506) {
  308. // CHECK:STDOUT: %Self => constants.%J.facet.506
  309. // CHECK:STDOUT: %Self.as_type.loc19_14.1 => constants.%empty_tuple.type
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: specific @F.1(constants.%J.facet.e8d) {
  313. // CHECK:STDOUT: %Self => constants.%J.facet.e8d
  314. // CHECK:STDOUT: %Self.as_type.loc19_14.1 => constants.%C
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: --- use_non-type_in_function.carbon
  318. // CHECK:STDOUT:
  319. // CHECK:STDOUT: constants {
  320. // CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete]
  321. // CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic]
  322. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  323. // CHECK:STDOUT: %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
  324. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  325. // CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type %M.type [concrete]
  326. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete]
  327. // CHECK:STDOUT: %G.type.020: type = fn_type @G.1 [concrete]
  328. // CHECK:STDOUT: %G.91c: %G.type.020 = struct_value () [concrete]
  329. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, @M.%G.decl [concrete]
  330. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self]
  331. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  332. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  333. // CHECK:STDOUT: %M.facet.407: %M.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  334. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  335. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  336. // CHECK:STDOUT: %struct: %struct_type.b.347 = struct_value (%empty_struct) [concrete]
  337. // CHECK:STDOUT: %M_where.type: type = facet_type <@M where %impl.elem0 = %struct> [concrete]
  338. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (%struct, @impl.%G.decl) [concrete]
  339. // CHECK:STDOUT: %G.type.bf5: type = fn_type @G.2 [concrete]
  340. // CHECK:STDOUT: %G.44e: %G.type.bf5 = struct_value () [concrete]
  341. // CHECK:STDOUT: %M.facet.993: %M.type = facet_value %empty_tuple.type, (%impl_witness) [concrete]
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: imports {
  345. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  346. // CHECK:STDOUT: import Core//prelude
  347. // CHECK:STDOUT: import Core//prelude/...
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: file {
  352. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  353. // CHECK:STDOUT: .Core = imports.%Core
  354. // CHECK:STDOUT: .M = %M.decl
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT: %Core.import = import Core
  357. // CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {}
  358. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  359. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  360. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  361. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  362. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  363. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  364. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  365. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  366. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  367. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  368. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  369. // CHECK:STDOUT: %.loc8_32: %empty_struct_type = struct_literal ()
  370. // CHECK:STDOUT: %.loc8_33.1: %struct_type.b.347 = struct_literal (%.loc8_32)
  371. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  372. // CHECK:STDOUT: %.loc8_33.2: %empty_struct_type = converted %.loc8_32, %empty_struct [concrete = constants.%empty_struct]
  373. // CHECK:STDOUT: %struct: %struct_type.b.347 = struct_value (%.loc8_33.2) [concrete = constants.%struct]
  374. // CHECK:STDOUT: %.loc8_33.3: %struct_type.b.347 = converted %.loc8_33.1, %struct [concrete = constants.%struct]
  375. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [concrete = constants.%M_where.type] {
  376. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_33.3
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT: }
  379. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (constants.%struct, @impl.%G.decl) [concrete = constants.%impl_witness]
  380. // CHECK:STDOUT: }
  381. // CHECK:STDOUT:
  382. // CHECK:STDOUT: interface @M {
  383. // CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  384. // CHECK:STDOUT: %Z: %struct_type.b.347 = assoc_const_decl @Z [concrete] {
  385. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete = constants.%assoc0]
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT: %G.decl: %G.type.020 = fn_decl @G.1 [concrete = constants.%G.91c] {
  388. // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern
  389. // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, call_param0
  390. // CHECK:STDOUT: } {
  391. // CHECK:STDOUT: %.loc5_14.1: %empty_struct_type = struct_literal ()
  392. // CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  393. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
  394. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, %G.decl [concrete = constants.%assoc1]
  397. // CHECK:STDOUT:
  398. // CHECK:STDOUT: !members:
  399. // CHECK:STDOUT: .Self = %Self
  400. // CHECK:STDOUT: .Z = @Z.%assoc0
  401. // CHECK:STDOUT: .G = %assoc1
  402. // CHECK:STDOUT: witness = (%Z, %G.decl)
  403. // CHECK:STDOUT: }
  404. // CHECK:STDOUT:
  405. // CHECK:STDOUT: generic assoc_const @Z(@M.%Self: %M.type) {
  406. // CHECK:STDOUT: assoc_const Z:! %struct_type.b.347;
  407. // CHECK:STDOUT: }
  408. // CHECK:STDOUT:
  409. // CHECK:STDOUT: impl @impl: %.loc8_7.2 as %.loc8_14 {
  410. // CHECK:STDOUT: %G.decl: %G.type.bf5 = fn_decl @G.2 [concrete = constants.%G.44e] {
  411. // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern
  412. // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, call_param0
  413. // CHECK:STDOUT: } {
  414. // CHECK:STDOUT: %.loc9_14.1: %empty_struct_type = struct_literal ()
  415. // CHECK:STDOUT: %.loc9_14.2: type = converted %.loc9_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  416. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
  417. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  418. // CHECK:STDOUT: }
  419. // CHECK:STDOUT:
  420. // CHECK:STDOUT: !members:
  421. // CHECK:STDOUT: .G = %G.decl
  422. // CHECK:STDOUT: .M = <poisoned>
  423. // CHECK:STDOUT: witness = file.%impl_witness
  424. // CHECK:STDOUT: }
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: generic fn @G.1(@M.%Self: %M.type) {
  427. // CHECK:STDOUT: fn() -> %empty_struct_type;
  428. // CHECK:STDOUT: }
  429. // CHECK:STDOUT:
  430. // CHECK:STDOUT: fn @G.2() -> %empty_struct_type {
  431. // CHECK:STDOUT: !entry:
  432. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  433. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  434. // CHECK:STDOUT: %M.facet: %M.type = facet_value constants.%empty_tuple.type, (constants.%impl_witness) [concrete = constants.%M.facet.993]
  435. // CHECK:STDOUT: %.loc10_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.993]
  436. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  437. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc10_18 [concrete = constants.%empty_tuple.type]
  438. // CHECK:STDOUT: %.loc10_23: type = converted %.loc10_18, %as_type [concrete = constants.%empty_tuple.type]
  439. // CHECK:STDOUT: %as_wit.iface0: <witness> = facet_access_witness %.loc10_18, element0 [concrete = constants.%impl_witness]
  440. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access %as_wit.iface0, element0 [concrete = constants.%struct]
  441. // CHECK:STDOUT: %.loc10_25: %empty_struct_type = struct_access %impl.elem0, element0 [concrete = constants.%empty_struct]
  442. // CHECK:STDOUT: return %.loc10_25
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: specific @Z(constants.%Self) {}
  446. // CHECK:STDOUT:
  447. // CHECK:STDOUT: specific @G.1(constants.%Self) {}
  448. // CHECK:STDOUT:
  449. // CHECK:STDOUT: specific @Z(constants.%M.facet.407) {}
  450. // CHECK:STDOUT:
  451. // CHECK:STDOUT: specific @G.1(constants.%M.facet.993) {}
  452. // CHECK:STDOUT:
  453. // CHECK:STDOUT: specific @Z(constants.%M.facet.993) {}
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: --- self_as_uses_correct_rewrite_constraint.carbon
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: constants {
  458. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  459. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  460. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  461. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  462. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  463. // CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic]
  464. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  465. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  466. // CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete]
  467. // CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic]
  468. // CHECK:STDOUT: %struct_type.b.86f: type = struct_type {.b: type} [concrete]
  469. // CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type %M.type [concrete]
  470. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete]
  471. // CHECK:STDOUT: %G.type.020: type = fn_type @G.1 [concrete]
  472. // CHECK:STDOUT: %G.91c: %G.type.020 = struct_value () [concrete]
  473. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, @M.%G.decl [concrete]
  474. // CHECK:STDOUT: %C.7a7: type = class_type @C, @C(%empty_struct_type) [concrete]
  475. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self]
  476. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  477. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  478. // CHECK:STDOUT: %M.facet.407: %M.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  479. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  480. // CHECK:STDOUT: %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
  481. // CHECK:STDOUT: %struct.0f3: %struct_type.b.86f = struct_value (%empty_struct_type) [concrete]
  482. // CHECK:STDOUT: %M_where.type.132: type = facet_type <@M where %impl.elem0 = %struct.0f3> [concrete]
  483. // CHECK:STDOUT: %impl_witness.ae0: <witness> = impl_witness (%struct.0f3, @impl.9c5.%G.decl) [concrete]
  484. // CHECK:STDOUT: %G.type.160: type = fn_type @G.2 [concrete]
  485. // CHECK:STDOUT: %G.fc4: %G.type.160 = struct_value () [concrete]
  486. // CHECK:STDOUT: %M.facet.508: %M.type = facet_value %C.7a7, (%impl_witness.ae0) [concrete]
  487. // CHECK:STDOUT: %C.3a0: type = class_type @C, @C(%empty_tuple.type) [concrete]
  488. // CHECK:STDOUT: %struct_type.b.161: type = struct_type {.b: %empty_tuple.type} [concrete]
  489. // CHECK:STDOUT: %struct.c94: %struct_type.b.86f = struct_value (%empty_tuple.type) [concrete]
  490. // CHECK:STDOUT: %M_where.type.363: type = facet_type <@M where %impl.elem0 = %struct.c94> [concrete]
  491. // CHECK:STDOUT: %impl_witness.6b9: <witness> = impl_witness (%struct.c94, @impl.f46.%G.decl) [concrete]
  492. // CHECK:STDOUT: %G.type.18e: type = fn_type @G.3 [concrete]
  493. // CHECK:STDOUT: %G.066: %G.type.18e = struct_value () [concrete]
  494. // CHECK:STDOUT: %M.facet.a97: %M.type = facet_value %C.3a0, (%impl_witness.6b9) [concrete]
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: imports {
  498. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  499. // CHECK:STDOUT: import Core//prelude
  500. // CHECK:STDOUT: import Core//prelude/...
  501. // CHECK:STDOUT: }
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: file {
  505. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  506. // CHECK:STDOUT: .Core = imports.%Core
  507. // CHECK:STDOUT: .C = %C.decl
  508. // CHECK:STDOUT: .M = %M.decl
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT: %Core.import = import Core
  511. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  512. // CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)]
  513. // CHECK:STDOUT: } {
  514. // CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
  515. // CHECK:STDOUT: }
  516. // CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {}
  517. // CHECK:STDOUT: impl_decl @impl.9c5 [concrete] {} {
  518. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  519. // CHECK:STDOUT: %.loc11_9: %empty_struct_type = struct_literal ()
  520. // CHECK:STDOUT: %.loc11_10: type = converted %.loc11_9, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  521. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type) [concrete = constants.%C.7a7]
  522. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  523. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  524. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  525. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  526. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  527. // CHECK:STDOUT: %.loc11_23: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  528. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  529. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  530. // CHECK:STDOUT: %.loc11_35: %empty_struct_type = struct_literal ()
  531. // CHECK:STDOUT: %.loc11_36.1: %struct_type.b.347 = struct_literal (%.loc11_35)
  532. // CHECK:STDOUT: %.loc11_36.2: type = converted %.loc11_35, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  533. // CHECK:STDOUT: %struct: %struct_type.b.86f = struct_value (%.loc11_36.2) [concrete = constants.%struct.0f3]
  534. // CHECK:STDOUT: %.loc11_36.3: %struct_type.b.86f = converted %.loc11_36.1, %struct [concrete = constants.%struct.0f3]
  535. // CHECK:STDOUT: %.loc11_17: type = where_expr %.Self [concrete = constants.%M_where.type.132] {
  536. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc11_36.3
  537. // CHECK:STDOUT: }
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT: %impl_witness.loc11: <witness> = impl_witness (constants.%struct.0f3, @impl.9c5.%G.decl) [concrete = constants.%impl_witness.ae0]
  540. // CHECK:STDOUT: impl_decl @impl.f46 [concrete] {} {
  541. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  542. // CHECK:STDOUT: %.loc17_9: %empty_tuple.type = tuple_literal ()
  543. // CHECK:STDOUT: %.loc17_10: type = converted %.loc17_9, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  544. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_tuple.type) [concrete = constants.%C.3a0]
  545. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  546. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  547. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  548. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  549. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  550. // CHECK:STDOUT: %.loc17_23: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  551. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  552. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  553. // CHECK:STDOUT: %.loc17_35: %empty_tuple.type = tuple_literal ()
  554. // CHECK:STDOUT: %.loc17_36.1: %struct_type.b.161 = struct_literal (%.loc17_35)
  555. // CHECK:STDOUT: %.loc17_36.2: type = converted %.loc17_35, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  556. // CHECK:STDOUT: %struct: %struct_type.b.86f = struct_value (%.loc17_36.2) [concrete = constants.%struct.c94]
  557. // CHECK:STDOUT: %.loc17_36.3: %struct_type.b.86f = converted %.loc17_36.1, %struct [concrete = constants.%struct.c94]
  558. // CHECK:STDOUT: %.loc17_17: type = where_expr %.Self [concrete = constants.%M_where.type.363] {
  559. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc17_36.3
  560. // CHECK:STDOUT: }
  561. // CHECK:STDOUT: }
  562. // CHECK:STDOUT: %impl_witness.loc17: <witness> = impl_witness (constants.%struct.c94, @impl.f46.%G.decl) [concrete = constants.%impl_witness.6b9]
  563. // CHECK:STDOUT: }
  564. // CHECK:STDOUT:
  565. // CHECK:STDOUT: interface @M {
  566. // CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  567. // CHECK:STDOUT: %Z: %struct_type.b.86f = assoc_const_decl @Z [concrete] {
  568. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete = constants.%assoc0]
  569. // CHECK:STDOUT: }
  570. // CHECK:STDOUT: %G.decl: %G.type.020 = fn_decl @G.1 [concrete = constants.%G.91c] {
  571. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  572. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, call_param0
  573. // CHECK:STDOUT: } {
  574. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  575. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  576. // CHECK:STDOUT: }
  577. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, %G.decl [concrete = constants.%assoc1]
  578. // CHECK:STDOUT:
  579. // CHECK:STDOUT: !members:
  580. // CHECK:STDOUT: .Self = %Self
  581. // CHECK:STDOUT: .Z = @Z.%assoc0
  582. // CHECK:STDOUT: .G = %assoc1
  583. // CHECK:STDOUT: witness = (%Z, %G.decl)
  584. // CHECK:STDOUT: }
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: generic assoc_const @Z(@M.%Self: %M.type) {
  587. // CHECK:STDOUT: assoc_const Z:! %struct_type.b.86f;
  588. // CHECK:STDOUT: }
  589. // CHECK:STDOUT:
  590. // CHECK:STDOUT: impl @impl.9c5: %C as %.loc11_17 {
  591. // CHECK:STDOUT: %G.decl: %G.type.160 = fn_decl @G.2 [concrete = constants.%G.fc4] {
  592. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  593. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, call_param0
  594. // CHECK:STDOUT: } {
  595. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  596. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  597. // CHECK:STDOUT: }
  598. // CHECK:STDOUT:
  599. // CHECK:STDOUT: !members:
  600. // CHECK:STDOUT: .G = %G.decl
  601. // CHECK:STDOUT: .M = <poisoned>
  602. // CHECK:STDOUT: witness = file.%impl_witness.loc11
  603. // CHECK:STDOUT: }
  604. // CHECK:STDOUT:
  605. // CHECK:STDOUT: impl @impl.f46: %C as %.loc17_17 {
  606. // CHECK:STDOUT: %G.decl: %G.type.18e = fn_decl @G.3 [concrete = constants.%G.066] {
  607. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  608. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, call_param0
  609. // CHECK:STDOUT: } {
  610. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  611. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  612. // CHECK:STDOUT: }
  613. // CHECK:STDOUT:
  614. // CHECK:STDOUT: !members:
  615. // CHECK:STDOUT: .G = %G.decl
  616. // CHECK:STDOUT: .M = <poisoned>
  617. // CHECK:STDOUT: witness = file.%impl_witness.loc17
  618. // CHECK:STDOUT: }
  619. // CHECK:STDOUT:
  620. // CHECK:STDOUT: generic class @C(%T.loc4_9.1: type) {
  621. // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
  622. // CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)]
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: !definition:
  625. // CHECK:STDOUT:
  626. // CHECK:STDOUT: class {
  627. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  628. // CHECK:STDOUT: complete_type_witness = %complete_type
  629. // CHECK:STDOUT:
  630. // CHECK:STDOUT: !members:
  631. // CHECK:STDOUT: .Self = constants.%C.f2e
  632. // CHECK:STDOUT: }
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: generic fn @G.1(@M.%Self: %M.type) {
  636. // CHECK:STDOUT: fn() -> type;
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT:
  639. // CHECK:STDOUT: fn @G.2() -> type {
  640. // CHECK:STDOUT: !entry:
  641. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.9c5.%C [concrete = constants.%C.7a7]
  642. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  643. // CHECK:STDOUT: %M.facet: %M.type = facet_value constants.%C.7a7, (constants.%impl_witness.ae0) [concrete = constants.%M.facet.508]
  644. // CHECK:STDOUT: %.loc13_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.508]
  645. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  646. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc13_18 [concrete = constants.%C.7a7]
  647. // CHECK:STDOUT: %.loc13_23: type = converted %.loc13_18, %as_type [concrete = constants.%C.7a7]
  648. // CHECK:STDOUT: %as_wit.iface0: <witness> = facet_access_witness %.loc13_18, element0 [concrete = constants.%impl_witness.ae0]
  649. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access %as_wit.iface0, element0 [concrete = constants.%struct.0f3]
  650. // CHECK:STDOUT: %.loc13_25: type = struct_access %impl.elem0, element0 [concrete = constants.%empty_struct_type]
  651. // CHECK:STDOUT: return %.loc13_25
  652. // CHECK:STDOUT: }
  653. // CHECK:STDOUT:
  654. // CHECK:STDOUT: fn @G.3() -> type {
  655. // CHECK:STDOUT: !entry:
  656. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.f46.%C [concrete = constants.%C.3a0]
  657. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  658. // CHECK:STDOUT: %M.facet: %M.type = facet_value constants.%C.3a0, (constants.%impl_witness.6b9) [concrete = constants.%M.facet.a97]
  659. // CHECK:STDOUT: %.loc19_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.a97]
  660. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  661. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc19_18 [concrete = constants.%C.3a0]
  662. // CHECK:STDOUT: %.loc19_23: type = converted %.loc19_18, %as_type [concrete = constants.%C.3a0]
  663. // CHECK:STDOUT: %as_wit.iface0: <witness> = facet_access_witness %.loc19_18, element0 [concrete = constants.%impl_witness.6b9]
  664. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access %as_wit.iface0, element0 [concrete = constants.%struct.c94]
  665. // CHECK:STDOUT: %.loc19_25: type = struct_access %impl.elem0, element0 [concrete = constants.%empty_tuple.type]
  666. // CHECK:STDOUT: return %.loc19_25
  667. // CHECK:STDOUT: }
  668. // CHECK:STDOUT:
  669. // CHECK:STDOUT: specific @C(constants.%T) {
  670. // CHECK:STDOUT: %T.loc4_9.2 => constants.%T
  671. // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T
  672. // CHECK:STDOUT: }
  673. // CHECK:STDOUT:
  674. // CHECK:STDOUT: specific @Z(constants.%Self) {}
  675. // CHECK:STDOUT:
  676. // CHECK:STDOUT: specific @G.1(constants.%Self) {}
  677. // CHECK:STDOUT:
  678. // CHECK:STDOUT: specific @C(constants.%empty_struct_type) {
  679. // CHECK:STDOUT: %T.loc4_9.2 => constants.%empty_struct_type
  680. // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%empty_struct_type
  681. // CHECK:STDOUT: }
  682. // CHECK:STDOUT:
  683. // CHECK:STDOUT: specific @Z(constants.%M.facet.407) {}
  684. // CHECK:STDOUT:
  685. // CHECK:STDOUT: specific @G.1(constants.%M.facet.508) {}
  686. // CHECK:STDOUT:
  687. // CHECK:STDOUT: specific @Z(constants.%M.facet.508) {}
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: specific @C(constants.%empty_tuple.type) {
  690. // CHECK:STDOUT: %T.loc4_9.2 => constants.%empty_tuple.type
  691. // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%empty_tuple.type
  692. // CHECK:STDOUT: }
  693. // CHECK:STDOUT:
  694. // CHECK:STDOUT: specific @G.1(constants.%M.facet.a97) {}
  695. // CHECK:STDOUT:
  696. // CHECK:STDOUT: specific @Z(constants.%M.facet.a97) {}
  697. // CHECK:STDOUT:
  698. // CHECK:STDOUT: --- fail_todo_associated_int_in_array.carbon
  699. // CHECK:STDOUT:
  700. // CHECK:STDOUT: constants {
  701. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  702. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  703. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  704. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  705. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  706. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [concrete]
  707. // CHECK:STDOUT: %assoc0.73c: %I.assoc_type = assoc_entity element0, @I.%N [concrete]
  708. // CHECK:STDOUT: %Self.as_type.b70: type = facet_access_type %Self.826 [symbolic]
  709. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  710. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  711. // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
  712. // CHECK:STDOUT: %F.bc6: %F.type.cf0 = struct_value () [concrete]
  713. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%F.decl [concrete]
  714. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  715. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  716. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  717. // CHECK:STDOUT: %I.facet.d87: %I.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  718. // CHECK:STDOUT: %impl.elem0: %i32 = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  719. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  720. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  721. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  722. // CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.4f9(%int_32) [concrete]
  723. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
  724. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  725. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%impl_witness.d39) [concrete]
  726. // CHECK:STDOUT: %.be7: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
  727. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
  728. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
  729. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
  730. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  731. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %int_2.ef8> [concrete]
  732. // CHECK:STDOUT: %impl_witness.2c9: <witness> = impl_witness (%int_2.ef8, <error>) [concrete]
  733. // CHECK:STDOUT: %array_type: type = array_type %int_2.ecc, bool [concrete]
  734. // CHECK:STDOUT: %F.type.925: type = fn_type @F.2 [concrete]
  735. // CHECK:STDOUT: %F.2a6: %F.type.925 = struct_value () [concrete]
  736. // CHECK:STDOUT: %I.facet.3e8: %I.type = facet_value %empty_tuple.type, (%impl_witness.2c9) [concrete]
  737. // CHECK:STDOUT: %true: bool = bool_literal true [concrete]
  738. // CHECK:STDOUT: %false: bool = bool_literal false [concrete]
  739. // CHECK:STDOUT: %tuple.type: type = tuple_type (bool, bool) [concrete]
  740. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  741. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  742. // CHECK:STDOUT: %array: %array_type = tuple_value (%true, %false) [concrete]
  743. // CHECK:STDOUT: }
  744. // CHECK:STDOUT:
  745. // CHECK:STDOUT: imports {
  746. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  747. // CHECK:STDOUT: .Int = %Core.Int
  748. // CHECK:STDOUT: .Bool = %Core.Bool
  749. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  750. // CHECK:STDOUT: import Core//prelude
  751. // CHECK:STDOUT: import Core//prelude/...
  752. // CHECK:STDOUT: }
  753. // CHECK:STDOUT: }
  754. // CHECK:STDOUT:
  755. // CHECK:STDOUT: file {
  756. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  757. // CHECK:STDOUT: .Core = imports.%Core
  758. // CHECK:STDOUT: .I = %I.decl
  759. // CHECK:STDOUT: }
  760. // CHECK:STDOUT: %Core.import = import Core
  761. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  762. // CHECK:STDOUT: impl_decl @impl.dd2 [concrete] {} {
  763. // CHECK:STDOUT: %.loc15_7.1: %empty_tuple.type = tuple_literal ()
  764. // CHECK:STDOUT: %.loc15_7.2: type = converted %.loc15_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  765. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  766. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  767. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  768. // CHECK:STDOUT: %N.ref: %I.assoc_type = name_ref N, @N.%assoc0 [concrete = constants.%assoc0.73c]
  769. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  770. // CHECK:STDOUT: %.loc15_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  771. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  772. // CHECK:STDOUT: %impl.elem0.loc15_20: %i32 = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  773. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  774. // CHECK:STDOUT: %impl.elem0.loc15_25: %.be7 = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956]
  775. // CHECK:STDOUT: %bound_method.loc15_25.1: <bound method> = bound_method %int_2, %impl.elem0.loc15_25 [concrete = constants.%Convert.bound]
  776. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc15_25, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  777. // CHECK:STDOUT: %bound_method.loc15_25.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
  778. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_25.2(%int_2) [concrete = constants.%int_2.ef8]
  779. // CHECK:STDOUT: %.loc15_25.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8]
  780. // CHECK:STDOUT: %.loc15_25.2: %i32 = converted %int_2, %.loc15_25.1 [concrete = constants.%int_2.ef8]
  781. // CHECK:STDOUT: %.loc15_14: type = where_expr %.Self [concrete = constants.%I_where.type] {
  782. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc15_20, %.loc15_25.2
  783. // CHECK:STDOUT: }
  784. // CHECK:STDOUT: }
  785. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (constants.%int_2.ef8, <error>) [concrete = constants.%impl_witness.2c9]
  786. // CHECK:STDOUT: }
  787. // CHECK:STDOUT:
  788. // CHECK:STDOUT: interface @I {
  789. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  790. // CHECK:STDOUT: %N: %i32 = assoc_const_decl @N [concrete] {
  791. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%N [concrete = constants.%assoc0.73c]
  792. // CHECK:STDOUT: }
  793. // CHECK:STDOUT: %F.decl: %F.type.cf0 = fn_decl @F.1 [concrete = constants.%F.bc6] {
  794. // CHECK:STDOUT: %self.patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70) = binding_pattern self
  795. // CHECK:STDOUT: %self.param_patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70) = value_param_pattern %self.patt, call_param0
  796. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern
  797. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, call_param1
  798. // CHECK:STDOUT: } {
  799. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  800. // CHECK:STDOUT: %N.ref: %I.assoc_type = name_ref N, @N.%assoc0 [concrete = constants.%assoc0.73c]
  801. // CHECK:STDOUT: %.loc12_31.1: type = value_of_initializer %bool.make_type [concrete = bool]
  802. // CHECK:STDOUT: %.loc12_31.2: type = converted %bool.make_type, %.loc12_31.1 [concrete = bool]
  803. // CHECK:STDOUT: %.loc12_37: Core.IntLiteral = converted %N.ref, <error> [concrete = <error>]
  804. // CHECK:STDOUT: %array_type: type = array_type <error>, bool [concrete = <error>]
  805. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70) = value_param call_param0
  806. // CHECK:STDOUT: %.loc12_14.1: type = splice_block %.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.b70)] {
  807. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)]
  808. // CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.b70)]
  809. // CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.b70)]
  810. // CHECK:STDOUT: }
  811. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70) = bind_name self, %self.param
  812. // CHECK:STDOUT: %return.param: ref <error> = out_param call_param1
  813. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  814. // CHECK:STDOUT: }
  815. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1]
  816. // CHECK:STDOUT:
  817. // CHECK:STDOUT: !members:
  818. // CHECK:STDOUT: .Self = %Self
  819. // CHECK:STDOUT: .N = @N.%assoc0
  820. // CHECK:STDOUT: .F = %assoc1
  821. // CHECK:STDOUT: witness = (%N, %F.decl)
  822. // CHECK:STDOUT: }
  823. // CHECK:STDOUT:
  824. // CHECK:STDOUT: generic assoc_const @N(@I.%Self: %I.type) {
  825. // CHECK:STDOUT: assoc_const N:! %i32;
  826. // CHECK:STDOUT: }
  827. // CHECK:STDOUT:
  828. // CHECK:STDOUT: impl @impl.dd2: %.loc15_7.2 as %.loc15_14 {
  829. // CHECK:STDOUT: %F.decl: %F.type.925 = fn_decl @F.2 [concrete = constants.%F.2a6] {
  830. // CHECK:STDOUT: %self.patt: %empty_tuple.type = binding_pattern self
  831. // CHECK:STDOUT: %self.param_patt: %empty_tuple.type = value_param_pattern %self.patt, call_param0
  832. // CHECK:STDOUT: %return.patt: %array_type = return_slot_pattern
  833. // CHECK:STDOUT: %return.param_patt: %array_type = out_param_pattern %return.patt, call_param1
  834. // CHECK:STDOUT: } {
  835. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  836. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  837. // CHECK:STDOUT: %.loc16_31.1: type = value_of_initializer %bool.make_type [concrete = bool]
  838. // CHECK:STDOUT: %.loc16_31.2: type = converted %bool.make_type, %.loc16_31.1 [concrete = bool]
  839. // CHECK:STDOUT: %array_type: type = array_type %int_2, bool [concrete = constants.%array_type]
  840. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  841. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.dd2.%.loc15_7.2 [concrete = constants.%empty_tuple.type]
  842. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  843. // CHECK:STDOUT: %return.param: ref %array_type = out_param call_param1
  844. // CHECK:STDOUT: %return: ref %array_type = return_slot %return.param
  845. // CHECK:STDOUT: }
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: !members:
  848. // CHECK:STDOUT: .F = %F.decl
  849. // CHECK:STDOUT: witness = file.%impl_witness
  850. // CHECK:STDOUT: }
  851. // CHECK:STDOUT:
  852. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  853. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.826)]
  854. // CHECK:STDOUT: %Self.as_type.loc12_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.b70)]
  855. // CHECK:STDOUT:
  856. // CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70)]() -> <error>;
  857. // CHECK:STDOUT: }
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: fn @F.2[%self.param_patt: %empty_tuple.type]() -> %return.param_patt: %array_type {
  860. // CHECK:STDOUT: !entry:
  861. // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
  862. // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false]
  863. // CHECK:STDOUT: %.loc16_61.1: %tuple.type = tuple_literal (%true, %false)
  864. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  865. // CHECK:STDOUT: %.loc16_61.2: ref bool = array_index %return, %int_0
  866. // CHECK:STDOUT: %.loc16_61.3: init bool = initialize_from %true to %.loc16_61.2 [concrete = constants.%true]
  867. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  868. // CHECK:STDOUT: %.loc16_61.4: ref bool = array_index %return, %int_1
  869. // CHECK:STDOUT: %.loc16_61.5: init bool = initialize_from %false to %.loc16_61.4 [concrete = constants.%false]
  870. // CHECK:STDOUT: %.loc16_61.6: init %array_type = array_init (%.loc16_61.3, %.loc16_61.5) to %return [concrete = constants.%array]
  871. // CHECK:STDOUT: %.loc16_62: init %array_type = converted %.loc16_61.1, %.loc16_61.6 [concrete = constants.%array]
  872. // CHECK:STDOUT: return %.loc16_62 to %return
  873. // CHECK:STDOUT: }
  874. // CHECK:STDOUT:
  875. // CHECK:STDOUT: specific @N(constants.%Self.826) {}
  876. // CHECK:STDOUT:
  877. // CHECK:STDOUT: specific @F.1(constants.%Self.826) {
  878. // CHECK:STDOUT: %Self => constants.%Self.826
  879. // CHECK:STDOUT: %Self.as_type.loc12_14.1 => constants.%Self.as_type.b70
  880. // CHECK:STDOUT: }
  881. // CHECK:STDOUT:
  882. // CHECK:STDOUT: specific @N(constants.%I.facet.d87) {}
  883. // CHECK:STDOUT:
  884. // CHECK:STDOUT: specific @F.1(constants.%I.facet.3e8) {
  885. // CHECK:STDOUT: %Self => constants.%I.facet.3e8
  886. // CHECK:STDOUT: %Self.as_type.loc12_14.1 => constants.%empty_tuple.type
  887. // CHECK:STDOUT: }
  888. // CHECK:STDOUT: