import_self_specific.carbon 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=ignore
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_self_specific.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_self_specific.carbon
  13. // --- impl_def.carbon
  14. library "[[@TEST_NAME]]";
  15. // The I.Assoc will be a facet of type Y.
  16. interface Y {}
  17. impl forall [T:! type] T as Y {}
  18. // C takes a facet of type Z.
  19. interface Z {}
  20. impl forall [U:! type] U as Z {}
  21. class C(V:! Z) {
  22. adapt ();
  23. }
  24. interface I {
  25. let Assoc:! Y;
  26. // This is a generic function with a specific that contains a reference `Self`
  27. // in it (in the ImplWitnessAccess for `Self.Assoc`). The `Self.Assoc` is
  28. // converted from `Y` to `Z`, so it holds a FacetValue in the specific with a
  29. // witness for impl lookup of `Self.Assoc as Z`. This `Self` gets imported
  30. // when an `impl` implements it, and should not be introduced into that
  31. // `impl`'s generic eval block.
  32. fn F(c: C(Assoc));
  33. }
  34. // --- impl_use.carbon
  35. library "[[@TEST_NAME]]";
  36. import library "impl_def";
  37. class E {}
  38. class D(N:! E) {}
  39. // The eval block for this generic `impl` must not include any instructions
  40. // derived from the import of `I.F`.
  41. //
  42. // This impl will import each entry in the interface `I`'s witness table. In
  43. // particular, that includes `F` and the specific containing `Self.Assoc as Z`.
  44. // When it does so, the eval block of `F` forms a new local eval block for the
  45. // imported generic. And when the generic is evaluated against a newly
  46. // constructed local self specific, any instructions created in the process of
  47. // that evaluation (such as inside impl lookup deduction against the U in the
  48. // impl for Z) should not be inappropriately added to this impl's generic eval
  49. // block.
  50. impl forall [N:! E] D(N) as I where .Assoc = () {
  51. fn F(c: C(())) {}
  52. }
  53. // CHECK:STDOUT: --- impl_def.carbon
  54. // CHECK:STDOUT:
  55. // CHECK:STDOUT: constants {
  56. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  57. // CHECK:STDOUT: %Self.045: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  58. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  59. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  60. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  61. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  62. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table, @T.as.Y.impl(%T) [symbolic]
  63. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  64. // CHECK:STDOUT: %Self.1d7: %Z.type = bind_symbolic_name Self, 0 [symbolic]
  65. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  66. // CHECK:STDOUT: %Z.impl_witness.f19: <witness> = impl_witness file.%Z.impl_witness_table, @U.as.Z.impl(%U) [symbolic]
  67. // CHECK:STDOUT: %V: %Z.type = bind_symbolic_name V, 0 [symbolic]
  68. // CHECK:STDOUT: %pattern_type.4a0: type = pattern_type %Z.type [concrete]
  69. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  70. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  71. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  72. // CHECK:STDOUT: %C.fb9: type = class_type @C, @C(%V) [symbolic]
  73. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_tuple.type [concrete]
  74. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  75. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  76. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  77. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Assoc [concrete]
  78. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self.7ee, @I [symbolic]
  79. // CHECK:STDOUT: %impl.elem0: %Y.type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
  80. // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic]
  81. // CHECK:STDOUT: %Z.impl_witness.07f: <witness> = impl_witness file.%Z.impl_witness_table, @U.as.Z.impl(%as_type) [symbolic]
  82. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0, @Z [symbolic]
  83. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %as_type, (%Z.lookup_impl_witness) [symbolic]
  84. // CHECK:STDOUT: %C.cd7: type = class_type @C, @C(%Z.facet) [symbolic]
  85. // CHECK:STDOUT: %pattern_type.174: type = pattern_type %C.cd7 [symbolic]
  86. // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
  87. // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
  88. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%I.F.decl [concrete]
  89. // CHECK:STDOUT: }
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: file {
  92. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  93. // CHECK:STDOUT: .Y = %Y.decl
  94. // CHECK:STDOUT: .Z = %Z.decl
  95. // CHECK:STDOUT: .C = %C.decl
  96. // CHECK:STDOUT: .I = %I.decl
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT: %Y.decl: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
  99. // CHECK:STDOUT: impl_decl @T.as.Y.impl [concrete] {
  100. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  101. // CHECK:STDOUT: } {
  102. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_14.1 [symbolic = %T.loc5_14.2 (constants.%T)]
  103. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
  104. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  105. // CHECK:STDOUT: %T.loc5_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_14.2 (constants.%T)]
  106. // CHECK:STDOUT: }
  107. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @T.as.Y.impl [concrete]
  108. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness %Y.impl_witness_table, @T.as.Y.impl(constants.%T) [symbolic = @T.as.Y.impl.%Y.impl_witness (constants.%Y.impl_witness)]
  109. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  110. // CHECK:STDOUT: impl_decl @U.as.Z.impl [concrete] {
  111. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  112. // CHECK:STDOUT: } {
  113. // CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc9_14.1 [symbolic = %U.loc9_14.2 (constants.%U)]
  114. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  115. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  116. // CHECK:STDOUT: %U.loc9_14.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc9_14.2 (constants.%U)]
  117. // CHECK:STDOUT: }
  118. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @U.as.Z.impl [concrete]
  119. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness %Z.impl_witness_table, @U.as.Z.impl(constants.%U) [symbolic = @U.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.f19)]
  120. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  121. // CHECK:STDOUT: %V.patt: %pattern_type.4a0 = symbolic_binding_pattern V, 0 [concrete]
  122. // CHECK:STDOUT: } {
  123. // CHECK:STDOUT: %.loc11: type = splice_block %Z.ref [concrete = constants.%Z.type] {
  124. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  125. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  126. // CHECK:STDOUT: }
  127. // CHECK:STDOUT: %V.loc11_9.2: %Z.type = bind_symbolic_name V, 0 [symbolic = %V.loc11_9.1 (constants.%V)]
  128. // CHECK:STDOUT: }
  129. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  130. // CHECK:STDOUT: }
  131. // CHECK:STDOUT:
  132. // CHECK:STDOUT: interface @Y {
  133. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.045]
  134. // CHECK:STDOUT:
  135. // CHECK:STDOUT: !members:
  136. // CHECK:STDOUT: .Self = %Self
  137. // CHECK:STDOUT: witness = ()
  138. // CHECK:STDOUT: }
  139. // CHECK:STDOUT:
  140. // CHECK:STDOUT: interface @Z {
  141. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1d7]
  142. // CHECK:STDOUT:
  143. // CHECK:STDOUT: !members:
  144. // CHECK:STDOUT: .Self = %Self
  145. // CHECK:STDOUT: witness = ()
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: interface @I {
  149. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  150. // CHECK:STDOUT: %Assoc: %Y.type = assoc_const_decl @Assoc [concrete] {
  151. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Assoc [concrete = constants.%assoc0]
  152. // CHECK:STDOUT: }
  153. // CHECK:STDOUT: %I.F.decl: %I.F.type = fn_decl @I.F [concrete = constants.%I.F] {
  154. // CHECK:STDOUT: %c.patt: @I.F.%pattern_type (%pattern_type.174) = binding_pattern c [concrete]
  155. // CHECK:STDOUT: %c.param_patt: @I.F.%pattern_type (%pattern_type.174) = value_param_pattern %c.patt, call_param0 [concrete]
  156. // CHECK:STDOUT: } {
  157. // CHECK:STDOUT: %c.param: @I.F.%C.loc24_18.1 (%C.cd7) = value_param call_param0
  158. // CHECK:STDOUT: %.loc24_18.1: type = splice_block %C.loc24_18.2 [symbolic = %C.loc24_18.1 (constants.%C.cd7)] {
  159. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  160. // CHECK:STDOUT: %impl.elem0.loc24_13.2: %Y.type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_13.1 (constants.%impl.elem0)]
  161. // CHECK:STDOUT: %Assoc.ref: %Y.type = name_ref Assoc, %impl.elem0.loc24_13.2 [symbolic = %impl.elem0.loc24_13.1 (constants.%impl.elem0)]
  162. // CHECK:STDOUT: %Assoc.as_type: type = facet_access_type %Assoc.ref [symbolic = %as_type (constants.%as_type)]
  163. // CHECK:STDOUT: %Z.facet.loc24_18.2: %Z.type = facet_value %Assoc.as_type, (constants.%Z.lookup_impl_witness) [symbolic = %Z.facet.loc24_18.1 (constants.%Z.facet)]
  164. // CHECK:STDOUT: %.loc24_18.2: %Z.type = converted %Assoc.ref, %Z.facet.loc24_18.2 [symbolic = %Z.facet.loc24_18.1 (constants.%Z.facet)]
  165. // CHECK:STDOUT: %C.loc24_18.2: type = class_type @C, @C(constants.%Z.facet) [symbolic = %C.loc24_18.1 (constants.%C.cd7)]
  166. // CHECK:STDOUT: }
  167. // CHECK:STDOUT: %c: @I.F.%C.loc24_18.1 (%C.cd7) = bind_name c, %c.param
  168. // CHECK:STDOUT: }
  169. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %I.F.decl [concrete = constants.%assoc1]
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: !members:
  172. // CHECK:STDOUT: .Self = %Self
  173. // CHECK:STDOUT: .Y = <poisoned>
  174. // CHECK:STDOUT: .Assoc = @Assoc.%assoc0
  175. // CHECK:STDOUT: .C = <poisoned>
  176. // CHECK:STDOUT: .F = %assoc1
  177. // CHECK:STDOUT: witness = (%Assoc, %I.F.decl)
  178. // CHECK:STDOUT: }
  179. // CHECK:STDOUT:
  180. // CHECK:STDOUT: generic assoc_const @Assoc(@I.%Self: %I.type) {
  181. // CHECK:STDOUT: assoc_const Assoc:! %Y.type;
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT:
  184. // CHECK:STDOUT: generic impl @T.as.Y.impl(%T.loc5_14.1: type) {
  185. // CHECK:STDOUT: %T.loc5_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_14.2 (constants.%T)]
  186. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table, @T.as.Y.impl(%T.loc5_14.2) [symbolic = %Y.impl_witness (constants.%Y.impl_witness)]
  187. // CHECK:STDOUT:
  188. // CHECK:STDOUT: !definition:
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: impl: %T.ref as %Y.ref {
  191. // CHECK:STDOUT: !members:
  192. // CHECK:STDOUT: witness = file.%Y.impl_witness
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: generic impl @U.as.Z.impl(%U.loc9_14.1: type) {
  197. // CHECK:STDOUT: %U.loc9_14.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc9_14.2 (constants.%U)]
  198. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table, @U.as.Z.impl(%U.loc9_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.f19)]
  199. // CHECK:STDOUT:
  200. // CHECK:STDOUT: !definition:
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: impl: %U.ref as %Z.ref {
  203. // CHECK:STDOUT: !members:
  204. // CHECK:STDOUT: witness = file.%Z.impl_witness
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: generic class @C(%V.loc11_9.2: %Z.type) {
  209. // CHECK:STDOUT: %V.loc11_9.1: %Z.type = bind_symbolic_name V, 0 [symbolic = %V.loc11_9.1 (constants.%V)]
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: !definition:
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: class {
  214. // CHECK:STDOUT: %.loc12_10: %empty_tuple.type = tuple_literal ()
  215. // CHECK:STDOUT: %.loc12_11: type = converted %.loc12_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  216. // CHECK:STDOUT: adapt_decl %.loc12_11 [concrete]
  217. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_tuple.type [concrete = constants.%complete_type]
  218. // CHECK:STDOUT: complete_type_witness = %complete_type
  219. // CHECK:STDOUT:
  220. // CHECK:STDOUT: !members:
  221. // CHECK:STDOUT: .Self = constants.%C.fb9
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT:
  225. // CHECK:STDOUT: generic fn @I.F(@I.%Self: %I.type) {
  226. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  227. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
  228. // CHECK:STDOUT: %impl.elem0.loc24_13.1: %Y.type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_13.1 (constants.%impl.elem0)]
  229. // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.loc24_13.1 [symbolic = %as_type (constants.%as_type)]
  230. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.loc24_13.1, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
  231. // CHECK:STDOUT: %Z.facet.loc24_18.1: %Z.type = facet_value %as_type, (%Z.lookup_impl_witness) [symbolic = %Z.facet.loc24_18.1 (constants.%Z.facet)]
  232. // CHECK:STDOUT: %C.loc24_18.1: type = class_type @C, @C(%Z.facet.loc24_18.1) [symbolic = %C.loc24_18.1 (constants.%C.cd7)]
  233. // CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc24_18.1 [symbolic = %pattern_type (constants.%pattern_type.174)]
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: fn(%c.param: @I.F.%C.loc24_18.1 (%C.cd7));
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: specific @T.as.Y.impl(constants.%T) {
  239. // CHECK:STDOUT: %T.loc5_14.2 => constants.%T
  240. // CHECK:STDOUT: %Y.impl_witness => constants.%Y.impl_witness
  241. // CHECK:STDOUT: }
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: specific @U.as.Z.impl(constants.%U) {
  244. // CHECK:STDOUT: %U.loc9_14.2 => constants.%U
  245. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.f19
  246. // CHECK:STDOUT: }
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: specific @C(constants.%V) {
  249. // CHECK:STDOUT: %V.loc11_9.1 => constants.%V
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: specific @Assoc(constants.%Self.7ee) {}
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: specific @U.as.Z.impl(constants.%as_type) {
  255. // CHECK:STDOUT: %U.loc9_14.2 => constants.%as_type
  256. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.07f
  257. // CHECK:STDOUT:
  258. // CHECK:STDOUT: !definition:
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: specific @C(constants.%Z.facet) {
  262. // CHECK:STDOUT: %V.loc11_9.1 => constants.%Z.facet
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: specific @I.F(constants.%Self.7ee) {
  266. // CHECK:STDOUT: %Self => constants.%Self.7ee
  267. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness
  268. // CHECK:STDOUT: %impl.elem0.loc24_13.1 => constants.%impl.elem0
  269. // CHECK:STDOUT: %as_type => constants.%as_type
  270. // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness
  271. // CHECK:STDOUT: %Z.facet.loc24_18.1 => constants.%Z.facet
  272. // CHECK:STDOUT: %C.loc24_18.1 => constants.%C.cd7
  273. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.174
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: --- impl_use.carbon
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: constants {
  279. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  280. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  281. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  282. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  283. // CHECK:STDOUT: %.Self.659: %type = bind_symbolic_name .Self [symbolic_self]
  284. // CHECK:STDOUT: %N: %E = bind_symbolic_name N, 0 [symbolic]
  285. // CHECK:STDOUT: %pattern_type.a4a: type = pattern_type %E [concrete]
  286. // CHECK:STDOUT: %D.type: type = generic_class_type @D [concrete]
  287. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  288. // CHECK:STDOUT: %D.generic: %D.type = struct_value () [concrete]
  289. // CHECK:STDOUT: %D: type = class_type @D, @D(%N) [symbolic]
  290. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  291. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  292. // CHECK:STDOUT: %.Self.364: %I.type = bind_symbolic_name .Self [symbolic_self]
  293. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  294. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.1d8 [concrete]
  295. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.364 [symbolic_self]
  296. // CHECK:STDOUT: %I.lookup_impl_witness.f6d: <witness> = lookup_impl_witness %.Self.364, @I [symbolic_self]
  297. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  298. // CHECK:STDOUT: %impl.elem0.ba1: %Y.type = impl_witness_access %I.lookup_impl_witness.f6d, element0 [symbolic_self]
  299. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  300. // CHECK:STDOUT: %Y.impl_witness.0d0: <witness> = impl_witness imports.%Y.impl_witness_table, @T.as.Y.impl(%T) [symbolic]
  301. // CHECK:STDOUT: %Y.impl_witness.6f2: <witness> = impl_witness imports.%Y.impl_witness_table, @T.as.Y.impl(%empty_tuple.type) [concrete]
  302. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %empty_tuple.type, (%Y.impl_witness.6f2) [concrete]
  303. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0.ba1 = %Y.facet> [concrete]
  304. // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
  305. // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
  306. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  307. // CHECK:STDOUT: %I.lookup_impl_witness.dd3: <witness> = lookup_impl_witness %Self.7ee, @I [symbolic]
  308. // CHECK:STDOUT: %impl.elem0.8e8: %Y.type = impl_witness_access %I.lookup_impl_witness.dd3, element0 [symbolic]
  309. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.8e8, @Z [symbolic]
  310. // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.8e8 [symbolic]
  311. // CHECK:STDOUT: %Z.facet.ad7: %Z.type = facet_value %as_type, (%Z.lookup_impl_witness) [symbolic]
  312. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  313. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  314. // CHECK:STDOUT: %complete_type.782: <witness> = complete_type_witness %empty_tuple.type [concrete]
  315. // CHECK:STDOUT: %V: %Z.type = bind_symbolic_name V, 0 [symbolic]
  316. // CHECK:STDOUT: %C.cd7: type = class_type @C, @C(%Z.facet.ad7) [symbolic]
  317. // CHECK:STDOUT: %pattern_type.174: type = pattern_type %C.cd7 [symbolic]
  318. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  319. // CHECK:STDOUT: %Z.impl_witness.f19: <witness> = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%U) [symbolic]
  320. // CHECK:STDOUT: %Z.impl_witness.07f: <witness> = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%as_type) [symbolic]
  321. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table, @D.as.I.impl(%N) [symbolic]
  322. // CHECK:STDOUT: %Z.impl_witness.f6f: <witness> = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%empty_tuple.type) [concrete]
  323. // CHECK:STDOUT: %Z.facet.c2e: %Z.type = facet_value %empty_tuple.type, (%Z.impl_witness.f6f) [concrete]
  324. // CHECK:STDOUT: %C.e33: type = class_type @C, @C(%Z.facet.c2e) [concrete]
  325. // CHECK:STDOUT: %pattern_type.99b: type = pattern_type %C.e33 [concrete]
  326. // CHECK:STDOUT: %D.as.I.impl.F.type: type = fn_type @D.as.I.impl.F, @D.as.I.impl(%N) [symbolic]
  327. // CHECK:STDOUT: %D.as.I.impl.F: %D.as.I.impl.F.type = struct_value () [symbolic]
  328. // CHECK:STDOUT: %I.facet: %I.type = facet_value %D, (%I.impl_witness) [symbolic]
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT:
  331. // CHECK:STDOUT: imports {
  332. // CHECK:STDOUT: %Main.Y = import_ref Main//impl_def, Y, unloaded
  333. // CHECK:STDOUT: %Main.Z = import_ref Main//impl_def, Z, unloaded
  334. // CHECK:STDOUT: %Main.C: %C.type = import_ref Main//impl_def, C, loaded [concrete = constants.%C.generic]
  335. // CHECK:STDOUT: %Main.I: type = import_ref Main//impl_def, I, loaded [concrete = constants.%I.type]
  336. // CHECK:STDOUT: %Main.import_ref.8e7 = import_ref Main//impl_def, inst{{[0-9A-F]+}} [no loc], unloaded
  337. // CHECK:STDOUT: %Main.import_ref.9ff: %I.assoc_type = import_ref Main//impl_def, loc16_12, loaded [concrete = constants.%assoc0]
  338. // CHECK:STDOUT: %Main.import_ref.abf = import_ref Main//impl_def, loc24_20, unloaded
  339. // CHECK:STDOUT: %Main.Assoc: %Y.type = import_ref Main//impl_def, Assoc, loaded [concrete = %Assoc]
  340. // CHECK:STDOUT: %Main.F: %I.F.type = import_ref Main//impl_def, F, loaded [concrete = constants.%I.F]
  341. // CHECK:STDOUT: %Main.import_ref.1d8: %Y.type = import_ref Main//impl_def, loc16_12, loaded [concrete = %Assoc]
  342. // CHECK:STDOUT: %Main.import_ref.0f3 = import_ref Main//impl_def, inst{{[0-9A-F]+}} [no loc], unloaded
  343. // CHECK:STDOUT: %Assoc: %Y.type = assoc_const_decl @Assoc [concrete] {}
  344. // CHECK:STDOUT: %Main.import_ref.de261c.1: %I.type = import_ref Main//impl_def, inst{{[0-9A-F]+}} [no loc], loaded [symbolic = constants.%Self.7ee]
  345. // CHECK:STDOUT: %Main.import_ref.e7b: <witness> = import_ref Main//impl_def, loc5_31, loaded [symbolic = @T.as.Y.impl.%Y.impl_witness (constants.%Y.impl_witness.0d0)]
  346. // CHECK:STDOUT: %Main.import_ref.5ab3ec.1: type = import_ref Main//impl_def, loc5_14, loaded [symbolic = @T.as.Y.impl.%T (constants.%T)]
  347. // CHECK:STDOUT: %Main.import_ref.583: type = import_ref Main//impl_def, loc5_24, loaded [symbolic = @T.as.Y.impl.%T (constants.%T)]
  348. // CHECK:STDOUT: %Main.import_ref.0a1: type = import_ref Main//impl_def, loc5_29, loaded [concrete = constants.%Y.type]
  349. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @T.as.Y.impl [concrete]
  350. // CHECK:STDOUT: %Main.import_ref.362 = import_ref Main//impl_def, inst{{[0-9A-F]+}} [no loc], unloaded
  351. // CHECK:STDOUT: %Main.import_ref.e9e: %Z.type = import_ref Main//impl_def, loc11_9, loaded [symbolic = @C.%V (constants.%V)]
  352. // CHECK:STDOUT: %Main.import_ref.3fc: <witness> = import_ref Main//impl_def, loc13_1, loaded [concrete = constants.%complete_type.782]
  353. // CHECK:STDOUT: %Main.import_ref.384 = import_ref Main//impl_def, inst{{[0-9A-F]+}} [no loc], unloaded
  354. // CHECK:STDOUT: %Main.import_ref.de261c.2: %I.type = import_ref Main//impl_def, inst{{[0-9A-F]+}} [no loc], loaded [symbolic = constants.%Self.7ee]
  355. // CHECK:STDOUT: %Main.import_ref.36a: <witness> = import_ref Main//impl_def, loc9_31, loaded [symbolic = @U.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.f19)]
  356. // CHECK:STDOUT: %Main.import_ref.5ab3ec.2: type = import_ref Main//impl_def, loc9_14, loaded [symbolic = @U.as.Z.impl.%U (constants.%U)]
  357. // CHECK:STDOUT: %Main.import_ref.144: type = import_ref Main//impl_def, loc9_24, loaded [symbolic = @U.as.Z.impl.%U (constants.%U)]
  358. // CHECK:STDOUT: %Main.import_ref.df1: type = import_ref Main//impl_def, loc9_29, loaded [concrete = constants.%Z.type]
  359. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @U.as.Z.impl [concrete]
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: file {
  363. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  364. // CHECK:STDOUT: .Y = imports.%Main.Y
  365. // CHECK:STDOUT: .Z = imports.%Main.Z
  366. // CHECK:STDOUT: .C = imports.%Main.C
  367. // CHECK:STDOUT: .I = imports.%Main.I
  368. // CHECK:STDOUT: .E = %E.decl
  369. // CHECK:STDOUT: .D = %D.decl
  370. // CHECK:STDOUT: }
  371. // CHECK:STDOUT: %default.import = import <none>
  372. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  373. // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [concrete = constants.%D.generic] {
  374. // CHECK:STDOUT: %N.patt: %pattern_type.a4a = symbolic_binding_pattern N, 0 [concrete]
  375. // CHECK:STDOUT: } {
  376. // CHECK:STDOUT: %.loc7: type = splice_block %E.ref [concrete = constants.%E] {
  377. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.659]
  378. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E]
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT: %N.loc7_9.2: %E = bind_symbolic_name N, 0 [symbolic = %N.loc7_9.1 (constants.%N)]
  381. // CHECK:STDOUT: }
  382. // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {
  383. // CHECK:STDOUT: %N.patt: %pattern_type.a4a = symbolic_binding_pattern N, 0 [concrete]
  384. // CHECK:STDOUT: } {
  385. // CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [concrete = constants.%D.generic]
  386. // CHECK:STDOUT: %N.ref: %E = name_ref N, %N.loc20_14.2 [symbolic = %N.loc20_14.1 (constants.%N)]
  387. // CHECK:STDOUT: %D.loc20_24.2: type = class_type @D, @D(constants.%N) [symbolic = %D.loc20_24.1 (constants.%D)]
  388. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  389. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.364]
  390. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self.364]
  391. // CHECK:STDOUT: %Assoc.ref: %I.assoc_type = name_ref Assoc, imports.%Main.import_ref.9ff [concrete = constants.%assoc0]
  392. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  393. // CHECK:STDOUT: %.loc20_37: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  394. // CHECK:STDOUT: %impl.elem0: %Y.type = impl_witness_access constants.%I.lookup_impl_witness.f6d, element0 [symbolic_self = constants.%impl.elem0.ba1]
  395. // CHECK:STDOUT: %.loc20_47.1: %empty_tuple.type = tuple_literal ()
  396. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value constants.%empty_tuple.type, (constants.%Y.impl_witness.6f2) [concrete = constants.%Y.facet]
  397. // CHECK:STDOUT: %.loc20_47.2: %Y.type = converted %.loc20_47.1, %Y.facet [concrete = constants.%Y.facet]
  398. // CHECK:STDOUT: %.loc20_31: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  399. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  400. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc20_47.2
  401. // CHECK:STDOUT: }
  402. // CHECK:STDOUT: %.loc20_18: type = splice_block %E.ref [concrete = constants.%E] {
  403. // CHECK:STDOUT: %.Self.2: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.659]
  404. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E]
  405. // CHECK:STDOUT: }
  406. // CHECK:STDOUT: %N.loc20_14.2: %E = bind_symbolic_name N, 0 [symbolic = %N.loc20_14.1 (constants.%N)]
  407. // CHECK:STDOUT: }
  408. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @D.as.I.impl.%D.as.I.impl.F.decl), @D.as.I.impl [concrete]
  409. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table, @D.as.I.impl(constants.%N) [symbolic = @D.as.I.impl.%I.impl_witness (constants.%I.impl_witness)]
  410. // CHECK:STDOUT: %impl_witness_assoc_constant: %Y.type = impl_witness_assoc_constant constants.%Y.facet [concrete = constants.%Y.facet]
  411. // CHECK:STDOUT: }
  412. // CHECK:STDOUT:
  413. // CHECK:STDOUT: interface @I [from "impl_def.carbon"] {
  414. // CHECK:STDOUT: !members:
  415. // CHECK:STDOUT: .Self = imports.%Main.import_ref.8e7
  416. // CHECK:STDOUT: .Assoc = imports.%Main.import_ref.9ff
  417. // CHECK:STDOUT: .F = imports.%Main.import_ref.abf
  418. // CHECK:STDOUT: witness = (imports.%Main.Assoc, imports.%Main.F)
  419. // CHECK:STDOUT: }
  420. // CHECK:STDOUT:
  421. // CHECK:STDOUT: interface @Y [from "impl_def.carbon"] {
  422. // CHECK:STDOUT: !members:
  423. // CHECK:STDOUT: .Self = imports.%Main.import_ref.0f3
  424. // CHECK:STDOUT: witness = ()
  425. // CHECK:STDOUT: }
  426. // CHECK:STDOUT:
  427. // CHECK:STDOUT: interface @Z [from "impl_def.carbon"] {
  428. // CHECK:STDOUT: !members:
  429. // CHECK:STDOUT: .Self = imports.%Main.import_ref.362
  430. // CHECK:STDOUT: witness = ()
  431. // CHECK:STDOUT: }
  432. // CHECK:STDOUT:
  433. // CHECK:STDOUT: generic assoc_const @Assoc(imports.%Main.import_ref.de261c.1: %I.type) [from "impl_def.carbon"] {
  434. // CHECK:STDOUT: assoc_const Assoc:! %Y.type;
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: generic impl @T.as.Y.impl(imports.%Main.import_ref.5ab3ec.1: type) [from "impl_def.carbon"] {
  438. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  439. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness imports.%Y.impl_witness_table, @T.as.Y.impl(%T) [symbolic = %Y.impl_witness (constants.%Y.impl_witness.0d0)]
  440. // CHECK:STDOUT:
  441. // CHECK:STDOUT: !definition:
  442. // CHECK:STDOUT:
  443. // CHECK:STDOUT: impl: imports.%Main.import_ref.583 as imports.%Main.import_ref.0a1 {
  444. // CHECK:STDOUT: !members:
  445. // CHECK:STDOUT: witness = imports.%Main.import_ref.e7b
  446. // CHECK:STDOUT: }
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT:
  449. // CHECK:STDOUT: generic impl @U.as.Z.impl(imports.%Main.import_ref.5ab3ec.2: type) [from "impl_def.carbon"] {
  450. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  451. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%U) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.f19)]
  452. // CHECK:STDOUT:
  453. // CHECK:STDOUT: !definition:
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: impl: imports.%Main.import_ref.144 as imports.%Main.import_ref.df1 {
  456. // CHECK:STDOUT: !members:
  457. // CHECK:STDOUT: witness = imports.%Main.import_ref.36a
  458. // CHECK:STDOUT: }
  459. // CHECK:STDOUT: }
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: generic impl @D.as.I.impl(%N.loc20_14.2: %E) {
  462. // CHECK:STDOUT: %N.loc20_14.1: %E = bind_symbolic_name N, 0 [symbolic = %N.loc20_14.1 (constants.%N)]
  463. // CHECK:STDOUT: %D.loc20_24.1: type = class_type @D, @D(%N.loc20_14.1) [symbolic = %D.loc20_24.1 (constants.%D)]
  464. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table, @D.as.I.impl(%N.loc20_14.1) [symbolic = %I.impl_witness (constants.%I.impl_witness)]
  465. // CHECK:STDOUT:
  466. // CHECK:STDOUT: !definition:
  467. // CHECK:STDOUT: %D.as.I.impl.F.type: type = fn_type @D.as.I.impl.F, @D.as.I.impl(%N.loc20_14.1) [symbolic = %D.as.I.impl.F.type (constants.%D.as.I.impl.F.type)]
  468. // CHECK:STDOUT: %D.as.I.impl.F: @D.as.I.impl.%D.as.I.impl.F.type (%D.as.I.impl.F.type) = struct_value () [symbolic = %D.as.I.impl.F (constants.%D.as.I.impl.F)]
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: impl: %D.loc20_24.2 as %.loc20_31 {
  471. // CHECK:STDOUT: %D.as.I.impl.F.decl: @D.as.I.impl.%D.as.I.impl.F.type (%D.as.I.impl.F.type) = fn_decl @D.as.I.impl.F [symbolic = @D.as.I.impl.%D.as.I.impl.F (constants.%D.as.I.impl.F)] {
  472. // CHECK:STDOUT: %c.patt: %pattern_type.99b = binding_pattern c [concrete]
  473. // CHECK:STDOUT: %c.param_patt: %pattern_type.99b = value_param_pattern %c.patt, call_param0 [concrete]
  474. // CHECK:STDOUT: } {
  475. // CHECK:STDOUT: %c.param: %C.e33 = value_param call_param0
  476. // CHECK:STDOUT: %.loc21_15.1: type = splice_block %C [concrete = constants.%C.e33] {
  477. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [concrete = constants.%C.generic]
  478. // CHECK:STDOUT: %.loc21_14: %empty_tuple.type = tuple_literal ()
  479. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value constants.%empty_tuple.type, (constants.%Z.impl_witness.f6f) [concrete = constants.%Z.facet.c2e]
  480. // CHECK:STDOUT: %.loc21_15.2: %Z.type = converted %.loc21_14, %Z.facet [concrete = constants.%Z.facet.c2e]
  481. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%Z.facet.c2e) [concrete = constants.%C.e33]
  482. // CHECK:STDOUT: }
  483. // CHECK:STDOUT: %c: %C.e33 = bind_name c, %c.param
  484. // CHECK:STDOUT: }
  485. // CHECK:STDOUT:
  486. // CHECK:STDOUT: !members:
  487. // CHECK:STDOUT: .C = <poisoned>
  488. // CHECK:STDOUT: .F = %D.as.I.impl.F.decl
  489. // CHECK:STDOUT: witness = file.%I.impl_witness
  490. // CHECK:STDOUT: }
  491. // CHECK:STDOUT: }
  492. // CHECK:STDOUT:
  493. // CHECK:STDOUT: class @E {
  494. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  495. // CHECK:STDOUT: complete_type_witness = %complete_type
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: !members:
  498. // CHECK:STDOUT: .Self = constants.%E
  499. // CHECK:STDOUT: }
  500. // CHECK:STDOUT:
  501. // CHECK:STDOUT: generic class @D(%N.loc7_9.2: %E) {
  502. // CHECK:STDOUT: %N.loc7_9.1: %E = bind_symbolic_name N, 0 [symbolic = %N.loc7_9.1 (constants.%N)]
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: !definition:
  505. // CHECK:STDOUT:
  506. // CHECK:STDOUT: class {
  507. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  508. // CHECK:STDOUT: complete_type_witness = %complete_type
  509. // CHECK:STDOUT:
  510. // CHECK:STDOUT: !members:
  511. // CHECK:STDOUT: .Self = constants.%D
  512. // CHECK:STDOUT: }
  513. // CHECK:STDOUT: }
  514. // CHECK:STDOUT:
  515. // CHECK:STDOUT: generic class @C(imports.%Main.import_ref.e9e: %Z.type) [from "impl_def.carbon"] {
  516. // CHECK:STDOUT: %V: %Z.type = bind_symbolic_name V, 0 [symbolic = %V (constants.%V)]
  517. // CHECK:STDOUT:
  518. // CHECK:STDOUT: !definition:
  519. // CHECK:STDOUT:
  520. // CHECK:STDOUT: class {
  521. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.3fc
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: !members:
  524. // CHECK:STDOUT: .Self = imports.%Main.import_ref.384
  525. // CHECK:STDOUT: }
  526. // CHECK:STDOUT: }
  527. // CHECK:STDOUT:
  528. // CHECK:STDOUT: generic fn @I.F(imports.%Main.import_ref.de261c.2: %I.type) [from "impl_def.carbon"] {
  529. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  530. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness.dd3)]
  531. // CHECK:STDOUT: %impl.elem0: %Y.type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0 (constants.%impl.elem0.8e8)]
  532. // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic = %as_type (constants.%as_type)]
  533. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
  534. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %as_type, (%Z.lookup_impl_witness) [symbolic = %Z.facet (constants.%Z.facet.ad7)]
  535. // CHECK:STDOUT: %C: type = class_type @C, @C(%Z.facet) [symbolic = %C (constants.%C.cd7)]
  536. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [symbolic = %pattern_type (constants.%pattern_type.174)]
  537. // CHECK:STDOUT:
  538. // CHECK:STDOUT: fn;
  539. // CHECK:STDOUT: }
  540. // CHECK:STDOUT:
  541. // CHECK:STDOUT: generic fn @D.as.I.impl.F(@D.as.I.impl.%N.loc20_14.2: %E) {
  542. // CHECK:STDOUT: !definition:
  543. // CHECK:STDOUT:
  544. // CHECK:STDOUT: fn(%c.param: %C.e33) {
  545. // CHECK:STDOUT: !entry:
  546. // CHECK:STDOUT: return
  547. // CHECK:STDOUT: }
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT:
  550. // CHECK:STDOUT: specific @D(constants.%N) {
  551. // CHECK:STDOUT: %N.loc7_9.1 => constants.%N
  552. // CHECK:STDOUT: }
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: specific @Assoc(constants.%Self.7ee) {}
  555. // CHECK:STDOUT:
  556. // CHECK:STDOUT: specific @Assoc(constants.%.Self.364) {}
  557. // CHECK:STDOUT:
  558. // CHECK:STDOUT: specific @T.as.Y.impl(constants.%T) {
  559. // CHECK:STDOUT: %T => constants.%T
  560. // CHECK:STDOUT: %Y.impl_witness => constants.%Y.impl_witness.0d0
  561. // CHECK:STDOUT: }
  562. // CHECK:STDOUT:
  563. // CHECK:STDOUT: specific @T.as.Y.impl(constants.%empty_tuple.type) {
  564. // CHECK:STDOUT: %T => constants.%empty_tuple.type
  565. // CHECK:STDOUT: %Y.impl_witness => constants.%Y.impl_witness.6f2
  566. // CHECK:STDOUT:
  567. // CHECK:STDOUT: !definition:
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: specific @D.as.I.impl(constants.%N) {
  571. // CHECK:STDOUT: %N.loc20_14.1 => constants.%N
  572. // CHECK:STDOUT: %D.loc20_24.1 => constants.%D
  573. // CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness
  574. // CHECK:STDOUT:
  575. // CHECK:STDOUT: !definition:
  576. // CHECK:STDOUT: %D.as.I.impl.F.type => constants.%D.as.I.impl.F.type
  577. // CHECK:STDOUT: %D.as.I.impl.F => constants.%D.as.I.impl.F
  578. // CHECK:STDOUT: }
  579. // CHECK:STDOUT:
  580. // CHECK:STDOUT: specific @C(constants.%V) {
  581. // CHECK:STDOUT: %V => constants.%V
  582. // CHECK:STDOUT: }
  583. // CHECK:STDOUT:
  584. // CHECK:STDOUT: specific @C(constants.%Z.facet.ad7) {
  585. // CHECK:STDOUT: %V => constants.%Z.facet.ad7
  586. // CHECK:STDOUT: }
  587. // CHECK:STDOUT:
  588. // CHECK:STDOUT: specific @I.F(constants.%Self.7ee) {
  589. // CHECK:STDOUT: %Self => constants.%Self.7ee
  590. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness.dd3
  591. // CHECK:STDOUT: %impl.elem0 => constants.%impl.elem0.8e8
  592. // CHECK:STDOUT: %as_type => constants.%as_type
  593. // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness
  594. // CHECK:STDOUT: %Z.facet => constants.%Z.facet.ad7
  595. // CHECK:STDOUT: %C => constants.%C.cd7
  596. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.174
  597. // CHECK:STDOUT: }
  598. // CHECK:STDOUT:
  599. // CHECK:STDOUT: specific @U.as.Z.impl(constants.%U) {
  600. // CHECK:STDOUT: %U => constants.%U
  601. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.f19
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT:
  604. // CHECK:STDOUT: specific @U.as.Z.impl(constants.%as_type) {
  605. // CHECK:STDOUT: %U => constants.%as_type
  606. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.07f
  607. // CHECK:STDOUT:
  608. // CHECK:STDOUT: !definition:
  609. // CHECK:STDOUT: }
  610. // CHECK:STDOUT:
  611. // CHECK:STDOUT: specific @U.as.Z.impl(constants.%empty_tuple.type) {
  612. // CHECK:STDOUT: %U => constants.%empty_tuple.type
  613. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.f6f
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: !definition:
  616. // CHECK:STDOUT: }
  617. // CHECK:STDOUT:
  618. // CHECK:STDOUT: specific @C(constants.%Z.facet.c2e) {
  619. // CHECK:STDOUT: %V => constants.%Z.facet.c2e
  620. // CHECK:STDOUT:
  621. // CHECK:STDOUT: !definition:
  622. // CHECK:STDOUT: }
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: specific @D.as.I.impl.F(constants.%N) {}
  625. // CHECK:STDOUT:
  626. // CHECK:STDOUT: specific @I.F(constants.%I.facet) {
  627. // CHECK:STDOUT: %Self => constants.%I.facet
  628. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.impl_witness
  629. // CHECK:STDOUT: %impl.elem0 => constants.%Y.facet
  630. // CHECK:STDOUT: %as_type => constants.%empty_tuple.type
  631. // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.impl_witness.f6f
  632. // CHECK:STDOUT: %Z.facet => constants.%Z.facet.c2e
  633. // CHECK:STDOUT: %C => constants.%C.e33
  634. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.99b
  635. // CHECK:STDOUT: }
  636. // CHECK:STDOUT: