require_import.carbon 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/require_import.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/require_import.carbon
  12. // --- a.carbon
  13. library "[[@TEST_NAME]]";
  14. interface Z(T:! type) {
  15. fn F();
  16. }
  17. interface Y {
  18. extend require impls Z(Self);
  19. }
  20. constraint X {
  21. extend require impls Z(Self);
  22. }
  23. // --- a.impl.carbon
  24. //@include-in-dumps
  25. impl library "[[@TEST_NAME]]";
  26. fn F(A:! X, B:! Y) {
  27. A.F();
  28. }
  29. // --- fail_todo_symbolic_facet_interface_requires_interface.carbon
  30. library "[[@TEST_NAME]]";
  31. import library "a";
  32. fn F(B:! Y) {
  33. // TODO: We find the name F, but then fail to do impl lookup for `F` in `B:!
  34. // Y` since the identified facet type doesn't include Z. We need to be able to
  35. // find a symbolic facet from the require decl in Y during impl lookup.
  36. //
  37. // CHECK:STDERR: fail_todo_symbolic_facet_interface_requires_interface.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Z(B)` in type `B` that does not implement that interface [MissingImplInMemberAccess]
  38. // CHECK:STDERR: B.F();
  39. // CHECK:STDERR: ^~~
  40. // CHECK:STDERR:
  41. B.F();
  42. }
  43. // CHECK:STDOUT: --- a.impl.carbon
  44. // CHECK:STDOUT:
  45. // CHECK:STDOUT: constants {
  46. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  47. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  48. // CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
  49. // CHECK:STDOUT: %Self.f45: %X.type = symbolic_binding Self, 0 [symbolic]
  50. // CHECK:STDOUT: %Self.binding.as_type.f60: type = symbolic_binding_type Self, 0, %Self.f45 [symbolic]
  51. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  52. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  53. // CHECK:STDOUT: %Z.type.0ed: type = facet_type <@Z, @Z(%T)> [symbolic]
  54. // CHECK:STDOUT: %Self.984: %Z.type.0ed = symbolic_binding Self, 1 [symbolic]
  55. // CHECK:STDOUT: %Z.assoc_type.0bf: type = assoc_entity_type @Z, @Z(%T) [symbolic]
  56. // CHECK:STDOUT: %assoc0.f88: %Z.assoc_type.0bf = assoc_entity element0, imports.%Main.import_ref.f14 [symbolic]
  57. // CHECK:STDOUT: %Z.F.type.6cb: type = fn_type @Z.F, @Z(%T) [symbolic]
  58. // CHECK:STDOUT: %Z.F.6cc: %Z.F.type.6cb = struct_value () [symbolic]
  59. // CHECK:STDOUT: %Z.type.9f3244.1: type = facet_type <@Z, @Z(%Self.binding.as_type.f60)> [symbolic]
  60. // CHECK:STDOUT: %Z.assoc_type.449133.1: type = assoc_entity_type @Z, @Z(%Self.binding.as_type.f60) [symbolic]
  61. // CHECK:STDOUT: %assoc0.179: %Z.assoc_type.449133.1 = assoc_entity element0, imports.%Main.import_ref.5847cb.1 [symbolic]
  62. // CHECK:STDOUT: %Z.F.type.0ab8e8.1: type = fn_type @Z.F, @Z(%Self.binding.as_type.f60) [symbolic]
  63. // CHECK:STDOUT: %Z.F.d97fe5.1: %Z.F.type.0ab8e8.1 = struct_value () [symbolic]
  64. // CHECK:STDOUT: %Self.fcd60c.1: %Z.type.9f3244.1 = symbolic_binding Self, 1 [symbolic]
  65. // CHECK:STDOUT: %A: %X.type = symbolic_binding A, 0 [symbolic]
  66. // CHECK:STDOUT: %pattern_type.9a5: type = pattern_type %X.type [concrete]
  67. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  68. // CHECK:STDOUT: %Self.d4d: %Y.type = symbolic_binding Self, 0 [symbolic]
  69. // CHECK:STDOUT: %Self.binding.as_type.63e: type = symbolic_binding_type Self, 0, %Self.d4d [symbolic]
  70. // CHECK:STDOUT: %Z.type.d16: type = facet_type <@Z, @Z(%Self.binding.as_type.63e)> [symbolic]
  71. // CHECK:STDOUT: %Z.assoc_type.df3: type = assoc_entity_type @Z, @Z(%Self.binding.as_type.63e) [symbolic]
  72. // CHECK:STDOUT: %assoc0.e61: %Z.assoc_type.df3 = assoc_entity element0, imports.%Main.import_ref.5847cb.2 [symbolic]
  73. // CHECK:STDOUT: %Z.F.type.388: type = fn_type @Z.F, @Z(%Self.binding.as_type.63e) [symbolic]
  74. // CHECK:STDOUT: %Z.F.791: %Z.F.type.388 = struct_value () [symbolic]
  75. // CHECK:STDOUT: %Self.890: %Z.type.d16 = symbolic_binding Self, 1 [symbolic]
  76. // CHECK:STDOUT: %B: %Y.type = symbolic_binding B, 1 [symbolic]
  77. // CHECK:STDOUT: %pattern_type.95b: type = pattern_type %Y.type [concrete]
  78. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  79. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  80. // CHECK:STDOUT: %A.binding.as_type: type = symbolic_binding_type A, 0, %A [symbolic]
  81. // CHECK:STDOUT: %Z.type.9f3244.2: type = facet_type <@Z, @Z(%A.binding.as_type)> [symbolic]
  82. // CHECK:STDOUT: %Self.fcd60c.2: %Z.type.9f3244.2 = symbolic_binding Self, 1 [symbolic]
  83. // CHECK:STDOUT: %Z.F.type.0ab8e8.2: type = fn_type @Z.F, @Z(%A.binding.as_type) [symbolic]
  84. // CHECK:STDOUT: %Z.F.d97fe5.2: %Z.F.type.0ab8e8.2 = struct_value () [symbolic]
  85. // CHECK:STDOUT: %Z.assoc_type.449133.2: type = assoc_entity_type @Z, @Z(%A.binding.as_type) [symbolic]
  86. // CHECK:STDOUT: %assoc0.f48: %Z.assoc_type.449133.2 = assoc_entity element0, imports.%Main.import_ref.f14 [symbolic]
  87. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Z.type.9f3244.2 [symbolic]
  88. // CHECK:STDOUT: %assoc0.d5a: %Z.assoc_type.0bf = assoc_entity element0, imports.%Main.import_ref.5847cb.3 [symbolic]
  89. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %A, @Z, @Z(%A.binding.as_type) [symbolic]
  90. // CHECK:STDOUT: %Z.facet: %Z.type.9f3244.2 = facet_value %A.binding.as_type, (%Z.lookup_impl_witness) [symbolic]
  91. // CHECK:STDOUT: %.168: type = fn_type_with_self_type %Z.F.type.0ab8e8.2, %Z.facet [symbolic]
  92. // CHECK:STDOUT: %impl.elem0: %.168 = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic]
  93. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @Z.F(%A.binding.as_type, %Z.facet) [symbolic]
  94. // CHECK:STDOUT: }
  95. // CHECK:STDOUT:
  96. // CHECK:STDOUT: imports {
  97. // CHECK:STDOUT: %Main.Z = import_ref Main//a, Z, unloaded
  98. // CHECK:STDOUT: %Main.Y: type = import_ref Main//a, Y, loaded [concrete = constants.%Y.type]
  99. // CHECK:STDOUT: %Main.X: type = import_ref Main//a, X, loaded [concrete = constants.%X.type]
  100. // CHECK:STDOUT: %Main.import_ref.145 = import_ref Main//a, loc3_23, unloaded
  101. // CHECK:STDOUT: %Main.import_ref.f4a: @Z.%Z.assoc_type (%Z.assoc_type.0bf) = import_ref Main//a, loc4_9, loaded [symbolic = @Z.%assoc0 (constants.%assoc0.d5a)]
  102. // CHECK:STDOUT: %Main.F = import_ref Main//a, F, unloaded
  103. // CHECK:STDOUT: %Main.import_ref.b3bc94.1: type = import_ref Main//a, loc3_13, loaded [symbolic = @Z.%T (constants.%T)]
  104. // CHECK:STDOUT: %Main.import_ref.f14: @Z.%Z.F.type (%Z.F.type.6cb) = import_ref Main//a, loc4_9, loaded [symbolic = @Z.%Z.F (constants.%Z.F.6cc)]
  105. // CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//a, loc3_13, loaded [symbolic = @Z.%T (constants.%T)]
  106. // CHECK:STDOUT: %Main.import_ref.1dc: @Z.%Z.type (%Z.type.0ed) = import_ref Main//a, loc3_23, loaded [symbolic = @Z.%Self (constants.%Self.984)]
  107. // CHECK:STDOUT: %Main.import_ref.5847cb.1 = import_ref Main//a, loc4_9, unloaded
  108. // CHECK:STDOUT: %Main.import_ref.67f: type = import_ref Main//a, loc12_18, loaded [symbolic = @X.Self.binding.as_type.impls.Z.type.require.%Self.binding.as_type (constants.%Self.binding.as_type.f60)]
  109. // CHECK:STDOUT: %Main.import_ref.8d6: type = import_ref Main//a, loc12_30, loaded [symbolic = @X.Self.binding.as_type.impls.Z.type.require.%Z.type (constants.%Z.type.9f3244.1)]
  110. // CHECK:STDOUT: %Main.import_ref.e33cd1.1: %X.type = import_ref Main//a, loc11_14, loaded [symbolic = constants.%Self.f45]
  111. // CHECK:STDOUT: %Main.import_ref.65b = import_ref Main//a, loc11_14, unloaded
  112. // CHECK:STDOUT: %Main.import_ref.f88: type = import_ref Main//a, loc12_31, loaded [symbolic = constants.%Z.type.9f3244.1]
  113. // CHECK:STDOUT: %Main.import_ref.5847cb.2 = import_ref Main//a, loc4_9, unloaded
  114. // CHECK:STDOUT: %Main.import_ref.7bb: type = import_ref Main//a, loc8_18, loaded [symbolic = @Y.Self.binding.as_type.impls.Z.type.require.%Self.binding.as_type (constants.%Self.binding.as_type.63e)]
  115. // CHECK:STDOUT: %Main.import_ref.5ab: type = import_ref Main//a, loc8_30, loaded [symbolic = @Y.Self.binding.as_type.impls.Z.type.require.%Z.type (constants.%Z.type.d16)]
  116. // CHECK:STDOUT: %Main.import_ref.8c7: %Y.type = import_ref Main//a, loc7_13, loaded [symbolic = constants.%Self.d4d]
  117. // CHECK:STDOUT: %Main.import_ref.3e2c97.1 = import_ref Main//a, loc7_13, unloaded
  118. // CHECK:STDOUT: %Main.import_ref.80a = import_ref Main//a, loc8_31, unloaded
  119. // CHECK:STDOUT: %Main.import_ref.5847cb.3 = import_ref Main//a, loc4_9, unloaded
  120. // CHECK:STDOUT: }
  121. // CHECK:STDOUT:
  122. // CHECK:STDOUT: file {
  123. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  124. // CHECK:STDOUT: .Z = imports.%Main.Z
  125. // CHECK:STDOUT: .Y = imports.%Main.Y
  126. // CHECK:STDOUT: .X = imports.%Main.X
  127. // CHECK:STDOUT: .F = %F.decl
  128. // CHECK:STDOUT: }
  129. // CHECK:STDOUT: %default.import.loc2_17.1 = import <none>
  130. // CHECK:STDOUT: %default.import.loc2_17.2 = import <none>
  131. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  132. // CHECK:STDOUT: %A.patt: %pattern_type.9a5 = symbolic_binding_pattern A, 0 [concrete]
  133. // CHECK:STDOUT: %B.patt: %pattern_type.95b = symbolic_binding_pattern B, 1 [concrete]
  134. // CHECK:STDOUT: } {
  135. // CHECK:STDOUT: %.loc4_10: type = splice_block %X.ref [concrete = constants.%X.type] {
  136. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  137. // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Main.X [concrete = constants.%X.type]
  138. // CHECK:STDOUT: }
  139. // CHECK:STDOUT: %A.loc4_6.2: %X.type = symbolic_binding A, 0 [symbolic = %A.loc4_6.1 (constants.%A)]
  140. // CHECK:STDOUT: %.loc4_17: type = splice_block %Y.ref [concrete = constants.%Y.type] {
  141. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  142. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%Main.Y [concrete = constants.%Y.type]
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT: %B.loc4_13.2: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_13.1 (constants.%B)]
  145. // CHECK:STDOUT: }
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: generic interface @Z(imports.%Main.import_ref.b3bc94.1: type) [from "a.carbon"] {
  149. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
  150. // CHECK:STDOUT:
  151. // CHECK:STDOUT: !definition:
  152. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%T)> [symbolic = %Z.type (constants.%Z.type.0ed)]
  153. // CHECK:STDOUT: %Self: @Z.%Z.type (%Z.type.0ed) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.984)]
  154. // CHECK:STDOUT: %Z.F.type: type = fn_type @Z.F, @Z(%T) [symbolic = %Z.F.type (constants.%Z.F.type.6cb)]
  155. // CHECK:STDOUT: %Z.F: @Z.%Z.F.type (%Z.F.type.6cb) = struct_value () [symbolic = %Z.F (constants.%Z.F.6cc)]
  156. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z, @Z(%T) [symbolic = %Z.assoc_type (constants.%Z.assoc_type.0bf)]
  157. // CHECK:STDOUT: %assoc0: @Z.%Z.assoc_type (%Z.assoc_type.0bf) = assoc_entity element0, imports.%Main.import_ref.f14 [symbolic = %assoc0 (constants.%assoc0.f88)]
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: interface {
  160. // CHECK:STDOUT: !members:
  161. // CHECK:STDOUT: .Self = imports.%Main.import_ref.145
  162. // CHECK:STDOUT: .F = imports.%Main.import_ref.f4a
  163. // CHECK:STDOUT: witness = (imports.%Main.F)
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: !requires:
  166. // CHECK:STDOUT: }
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: interface @Y [from "a.carbon"] {
  170. // CHECK:STDOUT: !members:
  171. // CHECK:STDOUT: .Self = imports.%Main.import_ref.3e2c97.1
  172. // CHECK:STDOUT: extend imports.%Main.import_ref.80a
  173. // CHECK:STDOUT: witness = ()
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: !requires:
  176. // CHECK:STDOUT: @Y.Self.binding.as_type.impls.Z.type.require {
  177. // CHECK:STDOUT: require imports.%Main.import_ref.7bb impls imports.%Main.import_ref.5ab
  178. // CHECK:STDOUT: }
  179. // CHECK:STDOUT: }
  180. // CHECK:STDOUT:
  181. // CHECK:STDOUT: constraint @X [from "a.carbon"] {
  182. // CHECK:STDOUT: !members:
  183. // CHECK:STDOUT: .Self = imports.%Main.import_ref.65b
  184. // CHECK:STDOUT: .F = <poisoned>
  185. // CHECK:STDOUT: extend imports.%Main.import_ref.f88
  186. // CHECK:STDOUT:
  187. // CHECK:STDOUT: !requires:
  188. // CHECK:STDOUT: @X.Self.binding.as_type.impls.Z.type.require {
  189. // CHECK:STDOUT: require imports.%Main.import_ref.67f impls imports.%Main.import_ref.8d6
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT:
  193. // CHECK:STDOUT: generic require @X.Self.binding.as_type.impls.Z.type.require(imports.%Main.import_ref.e33cd1.1: %X.type) [from "a.carbon"] {
  194. // CHECK:STDOUT: %Self: %X.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.f45)]
  195. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.f60)]
  196. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%Self.binding.as_type)> [symbolic = %Z.type (constants.%Z.type.9f3244.1)]
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: generic require @Y.Self.binding.as_type.impls.Z.type.require(imports.%Main.import_ref.8c7: %Y.type) [from "a.carbon"] {
  200. // CHECK:STDOUT: %Self: %Y.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.d4d)]
  201. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.63e)]
  202. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%Self.binding.as_type)> [symbolic = %Z.type (constants.%Z.type.d16)]
  203. // CHECK:STDOUT: }
  204. // CHECK:STDOUT:
  205. // CHECK:STDOUT: generic fn @Z.F(imports.%Main.import_ref.b3bc94.2: type, imports.%Main.import_ref.1dc: @Z.%Z.type (%Z.type.0ed)) [from "a.carbon"] {
  206. // CHECK:STDOUT: fn;
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: generic fn @F(%A.loc4_6.2: %X.type, %B.loc4_13.2: %Y.type) {
  210. // CHECK:STDOUT: %A.loc4_6.1: %X.type = symbolic_binding A, 0 [symbolic = %A.loc4_6.1 (constants.%A)]
  211. // CHECK:STDOUT: %B.loc4_13.1: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_13.1 (constants.%B)]
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: !definition:
  214. // CHECK:STDOUT: %A.binding.as_type: type = symbolic_binding_type A, 0, %A.loc4_6.1 [symbolic = %A.binding.as_type (constants.%A.binding.as_type)]
  215. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%A.binding.as_type)> [symbolic = %Z.type (constants.%Z.type.9f3244.2)]
  216. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Z.type [symbolic = %require_complete (constants.%require_complete)]
  217. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z, @Z(%A.binding.as_type) [symbolic = %Z.assoc_type (constants.%Z.assoc_type.449133.2)]
  218. // CHECK:STDOUT: %assoc0: @F.%Z.assoc_type (%Z.assoc_type.449133.2) = assoc_entity element0, imports.%Main.import_ref.f14 [symbolic = %assoc0 (constants.%assoc0.f48)]
  219. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %A.loc4_6.1, @Z, @Z(%A.binding.as_type) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
  220. // CHECK:STDOUT: %Z.F.type: type = fn_type @Z.F, @Z(%A.binding.as_type) [symbolic = %Z.F.type (constants.%Z.F.type.0ab8e8.2)]
  221. // CHECK:STDOUT: %Z.facet: @F.%Z.type (%Z.type.9f3244.2) = facet_value %A.binding.as_type, (%Z.lookup_impl_witness) [symbolic = %Z.facet (constants.%Z.facet)]
  222. // CHECK:STDOUT: %.loc5_4.3: type = fn_type_with_self_type %Z.F.type, %Z.facet [symbolic = %.loc5_4.3 (constants.%.168)]
  223. // CHECK:STDOUT: %impl.elem0.loc5_4.2: @F.%.loc5_4.3 (%.168) = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_4.2 (constants.%impl.elem0)]
  224. // CHECK:STDOUT: %specific_impl_fn.loc5_4.2: <specific function> = specific_impl_function %impl.elem0.loc5_4.2, @Z.F(%A.binding.as_type, %Z.facet) [symbolic = %specific_impl_fn.loc5_4.2 (constants.%specific_impl_fn)]
  225. // CHECK:STDOUT:
  226. // CHECK:STDOUT: fn() {
  227. // CHECK:STDOUT: !entry:
  228. // CHECK:STDOUT: %A.ref: %X.type = name_ref A, %A.loc4_6.2 [symbolic = %A.loc4_6.1 (constants.%A)]
  229. // CHECK:STDOUT: %A.as_type: type = facet_access_type %A.ref [symbolic = %A.binding.as_type (constants.%A.binding.as_type)]
  230. // CHECK:STDOUT: %.loc5_4.1: type = converted %A.ref, %A.as_type [symbolic = %A.binding.as_type (constants.%A.binding.as_type)]
  231. // CHECK:STDOUT: %.loc5_4.2: @F.%Z.assoc_type (%Z.assoc_type.449133.2) = specific_constant imports.%Main.import_ref.f4a, @Z(constants.%A.binding.as_type) [symbolic = %assoc0 (constants.%assoc0.f48)]
  232. // CHECK:STDOUT: %F.ref: @F.%Z.assoc_type (%Z.assoc_type.449133.2) = name_ref F, %.loc5_4.2 [symbolic = %assoc0 (constants.%assoc0.f48)]
  233. // CHECK:STDOUT: %impl.elem0.loc5_4.1: @F.%.loc5_4.3 (%.168) = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_4.2 (constants.%impl.elem0)]
  234. // CHECK:STDOUT: %specific_impl_fn.loc5_4.1: <specific function> = specific_impl_function %impl.elem0.loc5_4.1, @Z.F(constants.%A.binding.as_type, constants.%Z.facet) [symbolic = %specific_impl_fn.loc5_4.2 (constants.%specific_impl_fn)]
  235. // CHECK:STDOUT: %Z.F.call: init %empty_tuple.type = call %specific_impl_fn.loc5_4.1()
  236. // CHECK:STDOUT: return
  237. // CHECK:STDOUT: }
  238. // CHECK:STDOUT: }
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: specific @Z(constants.%T) {
  241. // CHECK:STDOUT: %T => constants.%T
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: specific @Z.F(constants.%T, constants.%Self.984) {}
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: specific @Z(constants.%Self.binding.as_type.f60) {
  247. // CHECK:STDOUT: %T => constants.%Self.binding.as_type.f60
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: !definition:
  250. // CHECK:STDOUT: %Z.type => constants.%Z.type.9f3244.1
  251. // CHECK:STDOUT: %Self => constants.%Self.fcd60c.1
  252. // CHECK:STDOUT: %Z.F.type => constants.%Z.F.type.0ab8e8.1
  253. // CHECK:STDOUT: %Z.F => constants.%Z.F.d97fe5.1
  254. // CHECK:STDOUT: %Z.assoc_type => constants.%Z.assoc_type.449133.1
  255. // CHECK:STDOUT: %assoc0 => constants.%assoc0.179
  256. // CHECK:STDOUT: }
  257. // CHECK:STDOUT:
  258. // CHECK:STDOUT: specific @X.Self.binding.as_type.impls.Z.type.require(constants.%Self.f45) {
  259. // CHECK:STDOUT: %Self => constants.%Self.f45
  260. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.f60
  261. // CHECK:STDOUT: %Z.type => constants.%Z.type.9f3244.1
  262. // CHECK:STDOUT: }
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: specific @Z(constants.%Self.binding.as_type.63e) {
  265. // CHECK:STDOUT: %T => constants.%Self.binding.as_type.63e
  266. // CHECK:STDOUT:
  267. // CHECK:STDOUT: !definition:
  268. // CHECK:STDOUT: %Z.type => constants.%Z.type.d16
  269. // CHECK:STDOUT: %Self => constants.%Self.890
  270. // CHECK:STDOUT: %Z.F.type => constants.%Z.F.type.388
  271. // CHECK:STDOUT: %Z.F => constants.%Z.F.791
  272. // CHECK:STDOUT: %Z.assoc_type => constants.%Z.assoc_type.df3
  273. // CHECK:STDOUT: %assoc0 => constants.%assoc0.e61
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: specific @Y.Self.binding.as_type.impls.Z.type.require(constants.%Self.d4d) {
  277. // CHECK:STDOUT: %Self => constants.%Self.d4d
  278. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.63e
  279. // CHECK:STDOUT: %Z.type => constants.%Z.type.d16
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: specific @F(constants.%A, constants.%B) {
  283. // CHECK:STDOUT: %A.loc4_6.1 => constants.%A
  284. // CHECK:STDOUT: %B.loc4_13.1 => constants.%B
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: specific @Z(constants.%A.binding.as_type) {
  288. // CHECK:STDOUT: %T => constants.%A.binding.as_type
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: !definition:
  291. // CHECK:STDOUT: %Z.type => constants.%Z.type.9f3244.2
  292. // CHECK:STDOUT: %Self => constants.%Self.fcd60c.2
  293. // CHECK:STDOUT: %Z.F.type => constants.%Z.F.type.0ab8e8.2
  294. // CHECK:STDOUT: %Z.F => constants.%Z.F.d97fe5.2
  295. // CHECK:STDOUT: %Z.assoc_type => constants.%Z.assoc_type.449133.2
  296. // CHECK:STDOUT: %assoc0 => constants.%assoc0.f48
  297. // CHECK:STDOUT: }
  298. // CHECK:STDOUT:
  299. // CHECK:STDOUT: specific @X.Self.binding.as_type.impls.Z.type.require(constants.%A) {
  300. // CHECK:STDOUT: %Self => constants.%A
  301. // CHECK:STDOUT: %Self.binding.as_type => constants.%A.binding.as_type
  302. // CHECK:STDOUT: %Z.type => constants.%Z.type.9f3244.2
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: specific @Z.F(constants.%A.binding.as_type, constants.%Z.facet) {}
  306. // CHECK:STDOUT: