require_import.carbon 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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, unused 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.as_type.190: type = facet_access_type %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: %Z.WithSelf.F.type.091: type = fn_type @Z.WithSelf.F, @Z.WithSelf(%T, %Self.984) [symbolic]
  57. // CHECK:STDOUT: %Z.WithSelf.F.073: %Z.WithSelf.F.type.091 = struct_value () [symbolic]
  58. // CHECK:STDOUT: %Z.type.67cf45.1: type = facet_type <@Z, @Z(%Self.as_type.190)> [symbolic]
  59. // CHECK:STDOUT: %Self.9e6a89.1: %Z.type.67cf45.1 = symbolic_binding Self, 1 [symbolic]
  60. // CHECK:STDOUT: %require_complete.5aca91.1: <witness> = require_complete_type %Z.type.67cf45.1 [symbolic]
  61. // CHECK:STDOUT: %pattern_type.9a5: type = pattern_type %X.type [concrete]
  62. // CHECK:STDOUT: %A: %X.type = symbolic_binding A, 0 [symbolic]
  63. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  64. // CHECK:STDOUT: %Self.d4d: %Y.type = symbolic_binding Self, 0 [symbolic]
  65. // CHECK:STDOUT: %Self.as_type.c59: type = facet_access_type %Self.d4d [symbolic]
  66. // CHECK:STDOUT: %Z.type.4c1: type = facet_type <@Z, @Z(%Self.as_type.c59)> [symbolic]
  67. // CHECK:STDOUT: %Self.334: %Z.type.4c1 = symbolic_binding Self, 1 [symbolic]
  68. // CHECK:STDOUT: %pattern_type.95b: type = pattern_type %Y.type [concrete]
  69. // CHECK:STDOUT: %B: %Y.type = symbolic_binding B, 1 [symbolic]
  70. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  71. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  72. // CHECK:STDOUT: %A.as_type: type = facet_access_type %A [symbolic]
  73. // CHECK:STDOUT: %Z.type.67cf45.2: type = facet_type <@Z, @Z(%A.as_type)> [symbolic]
  74. // CHECK:STDOUT: %require_complete.5aca91.2: <witness> = require_complete_type %Z.type.67cf45.2 [symbolic]
  75. // CHECK:STDOUT: %Self.9e6a89.2: %Z.type.67cf45.2 = symbolic_binding Self, 1 [symbolic]
  76. // CHECK:STDOUT: %Z.WithSelf.F.type.c44: type = fn_type @Z.WithSelf.F, @Z.WithSelf(%A.as_type, %Self.984) [symbolic]
  77. // CHECK:STDOUT: %Z.WithSelf.F.e33: %Z.WithSelf.F.type.c44 = struct_value () [symbolic]
  78. // CHECK:STDOUT: %Z.assoc_type.221: type = assoc_entity_type @Z, @Z(%A.as_type) [symbolic]
  79. // CHECK:STDOUT: %assoc0.b43: %Z.assoc_type.221 = assoc_entity element0, imports.%Main.import_ref.7b4 [symbolic]
  80. // CHECK:STDOUT: %Z.WithSelf.F.type.f05: type = fn_type @Z.WithSelf.F, @Z.WithSelf(%A.as_type, %A) [symbolic]
  81. // CHECK:STDOUT: %Z.WithSelf.F.364: %Z.WithSelf.F.type.f05 = struct_value () [symbolic]
  82. // CHECK:STDOUT: %assoc0.20d: %Z.assoc_type.0bf = assoc_entity element0, imports.%Main.import_ref.47b [symbolic]
  83. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %A, @Z, @Z(%A.as_type) [symbolic]
  84. // CHECK:STDOUT: %Z.facet: %Z.type.67cf45.2 = facet_value %A.as_type, (%Z.lookup_impl_witness) [symbolic]
  85. // CHECK:STDOUT: %Z.WithSelf.F.type.0d8: type = fn_type @Z.WithSelf.F, @Z.WithSelf(%A.as_type, %Z.facet) [symbolic]
  86. // CHECK:STDOUT: %Z.WithSelf.F.3cc: %Z.WithSelf.F.type.0d8 = struct_value () [symbolic]
  87. // CHECK:STDOUT: %.cfd: type = fn_type_with_self_type %Z.WithSelf.F.type.0d8, %Z.facet [symbolic]
  88. // CHECK:STDOUT: %impl.elem0: %.cfd = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic]
  89. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @Z.WithSelf.F(%A.as_type, %Z.facet) [symbolic]
  90. // CHECK:STDOUT: }
  91. // CHECK:STDOUT:
  92. // CHECK:STDOUT: imports {
  93. // CHECK:STDOUT: %Main.Z = import_ref Main//a, Z, unloaded
  94. // CHECK:STDOUT: %Main.Y: type = import_ref Main//a, Y, loaded [concrete = constants.%Y.type]
  95. // CHECK:STDOUT: %Main.X: type = import_ref Main//a, X, loaded [concrete = constants.%X.type]
  96. // CHECK:STDOUT: %Main.import_ref.4a8: type = import_ref Main//a, loc12_31, loaded [symbolic = @X.WithSelf.%Z.type (constants.%Z.type.67cf45.1)]
  97. // CHECK:STDOUT: %Main.import_ref.f56: @Z.WithSelf.%Z.assoc_type (%Z.assoc_type.0bf) = import_ref Main//a, loc4_9, loaded [symbolic = @Z.WithSelf.%assoc0 (constants.%assoc0.20d)]
  98. // CHECK:STDOUT: %Main.F = import_ref Main//a, F, unloaded
  99. // CHECK:STDOUT: %Main.import_ref.7b4: @Z.WithSelf.%Z.WithSelf.F.type (%Z.WithSelf.F.type.091) = import_ref Main//a, loc4_9, loaded [symbolic = @Z.WithSelf.%Z.WithSelf.F (constants.%Z.WithSelf.F.073)]
  100. // CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//a, loc3_14, loaded [symbolic = @Z.%T (constants.%T)]
  101. // CHECK:STDOUT: %Main.import_ref.1dc578.2: @Z.%Z.type (%Z.type.0ed) = import_ref Main//a, loc3_23, loaded [symbolic = @Z.%Self (constants.%Self.984)]
  102. // CHECK:STDOUT: %Main.import_ref.145 = import_ref Main//a, loc3_23, unloaded
  103. // CHECK:STDOUT: %Main.import_ref.b3bc94.3: type = import_ref Main//a, loc3_14, loaded [symbolic = @Z.%T (constants.%T)]
  104. // CHECK:STDOUT: %Main.import_ref.67f: type = import_ref Main//a, loc12_18, loaded [symbolic = @X.WithSelf.Self.as_type.impls.Z.type.require.%Self.as_type (constants.%Self.as_type.190)]
  105. // CHECK:STDOUT: %Main.import_ref.12d: type = import_ref Main//a, loc12_30, loaded [symbolic = @X.WithSelf.Self.as_type.impls.Z.type.require.%Z.type (constants.%Z.type.67cf45.1)]
  106. // CHECK:STDOUT: %Main.import_ref.e33cd1.2: %X.type = import_ref Main//a, loc11_14, loaded [symbolic = constants.%Self.f45]
  107. // CHECK:STDOUT: %Main.import_ref.65b = import_ref Main//a, loc11_14, unloaded
  108. // CHECK:STDOUT: %Main.import_ref.030 = import_ref Main//a, loc8_31, unloaded
  109. // CHECK:STDOUT: %Main.import_ref.7bb: type = import_ref Main//a, loc8_18, loaded [symbolic = @Y.WithSelf.Self.as_type.impls.Z.type.require.%Self.as_type (constants.%Self.as_type.c59)]
  110. // CHECK:STDOUT: %Main.import_ref.e14: type = import_ref Main//a, loc8_30, loaded [symbolic = @Y.WithSelf.Self.as_type.impls.Z.type.require.%Z.type (constants.%Z.type.4c1)]
  111. // CHECK:STDOUT: %Main.import_ref.8c73c0.2: %Y.type = import_ref Main//a, loc7_13, loaded [symbolic = constants.%Self.d4d]
  112. // CHECK:STDOUT: %Main.import_ref.3e2 = import_ref Main//a, loc7_13, unloaded
  113. // CHECK:STDOUT: %Main.import_ref.47b = import_ref Main//a, loc4_9, unloaded
  114. // CHECK:STDOUT: }
  115. // CHECK:STDOUT:
  116. // CHECK:STDOUT: file {
  117. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  118. // CHECK:STDOUT: .Z = imports.%Main.Z
  119. // CHECK:STDOUT: .Y = imports.%Main.Y
  120. // CHECK:STDOUT: .X = imports.%Main.X
  121. // CHECK:STDOUT: .F = %F.decl
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT: %default.import.loc2_17.1 = import <none>
  124. // CHECK:STDOUT: %default.import.loc2_17.2 = import <none>
  125. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  126. // CHECK:STDOUT: %A.patt: %pattern_type.9a5 = symbolic_binding_pattern A, 0 [concrete]
  127. // CHECK:STDOUT: %B.patt: %pattern_type.95b = symbolic_binding_pattern B, 1 [concrete]
  128. // CHECK:STDOUT: } {
  129. // CHECK:STDOUT: %.loc4_10: type = splice_block %X.ref [concrete = constants.%X.type] {
  130. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  131. // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Main.X [concrete = constants.%X.type]
  132. // CHECK:STDOUT: }
  133. // CHECK:STDOUT: %A.loc4_7.2: %X.type = symbolic_binding A, 0 [symbolic = %A.loc4_7.1 (constants.%A)]
  134. // CHECK:STDOUT: %.loc4_24: type = splice_block %Y.ref [concrete = constants.%Y.type] {
  135. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  136. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%Main.Y [concrete = constants.%Y.type]
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT: %B.loc4_21.2: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_21.1 (constants.%B)]
  139. // CHECK:STDOUT: }
  140. // CHECK:STDOUT: }
  141. // CHECK:STDOUT:
  142. // CHECK:STDOUT: generic interface @Z(imports.%Main.import_ref.b3bc94.3: type) [from "a.carbon"] {
  143. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
  144. // CHECK:STDOUT:
  145. // CHECK:STDOUT: !definition:
  146. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%T)> [symbolic = %Z.type (constants.%Z.type.0ed)]
  147. // CHECK:STDOUT: %Self: @Z.%Z.type (%Z.type.0ed) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.984)]
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: interface {
  150. // CHECK:STDOUT: !members:
  151. // CHECK:STDOUT: .Self = imports.%Main.import_ref.145
  152. // CHECK:STDOUT: .F = imports.%Main.import_ref.f56
  153. // CHECK:STDOUT: witness = (imports.%Main.F)
  154. // CHECK:STDOUT:
  155. // CHECK:STDOUT: !requires:
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: interface @Y [from "a.carbon"] {
  160. // CHECK:STDOUT: !members:
  161. // CHECK:STDOUT: .Self = imports.%Main.import_ref.3e2
  162. // CHECK:STDOUT: extend imports.%Main.import_ref.030
  163. // CHECK:STDOUT: witness = ()
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: !requires:
  166. // CHECK:STDOUT: @Y.WithSelf.Self.as_type.impls.Z.type.require {
  167. // CHECK:STDOUT: require imports.%Main.import_ref.7bb impls imports.%Main.import_ref.e14
  168. // CHECK:STDOUT: }
  169. // CHECK:STDOUT: }
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: constraint @X [from "a.carbon"] {
  172. // CHECK:STDOUT: !members:
  173. // CHECK:STDOUT: .Self = imports.%Main.import_ref.65b
  174. // CHECK:STDOUT: .F = <poisoned>
  175. // CHECK:STDOUT: extend imports.%Main.import_ref.4a8
  176. // CHECK:STDOUT:
  177. // CHECK:STDOUT: !requires:
  178. // CHECK:STDOUT: @X.WithSelf.Self.as_type.impls.Z.type.require {
  179. // CHECK:STDOUT: require imports.%Main.import_ref.67f impls imports.%Main.import_ref.12d
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: generic require @X.WithSelf.Self.as_type.impls.Z.type.require(imports.%Main.import_ref.e33cd1.2: %X.type) [from "a.carbon"] {
  184. // CHECK:STDOUT: %Self: %X.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.f45)]
  185. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.190)]
  186. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%Self.as_type)> [symbolic = %Z.type (constants.%Z.type.67cf45.1)]
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT:
  189. // CHECK:STDOUT: generic require @Y.WithSelf.Self.as_type.impls.Z.type.require(imports.%Main.import_ref.8c73c0.2: %Y.type) [from "a.carbon"] {
  190. // CHECK:STDOUT: %Self: %Y.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.d4d)]
  191. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.c59)]
  192. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%Self.as_type)> [symbolic = %Z.type (constants.%Z.type.4c1)]
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT:
  195. // CHECK:STDOUT: generic fn @Z.WithSelf.F(imports.%Main.import_ref.b3bc94.2: type, imports.%Main.import_ref.1dc578.2: @Z.%Z.type (%Z.type.0ed)) [from "a.carbon"] {
  196. // CHECK:STDOUT: fn;
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: generic fn @F(%A.loc4_7.2: %X.type, %B.loc4_21.2: %Y.type) {
  200. // CHECK:STDOUT: %A.loc4_7.1: %X.type = symbolic_binding A, 0 [symbolic = %A.loc4_7.1 (constants.%A)]
  201. // CHECK:STDOUT: %B.loc4_21.1: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_21.1 (constants.%B)]
  202. // CHECK:STDOUT:
  203. // CHECK:STDOUT: !definition:
  204. // CHECK:STDOUT: %A.as_type.loc5_4.2: type = facet_access_type %A.loc4_7.1 [symbolic = %A.as_type.loc5_4.2 (constants.%A.as_type)]
  205. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%A.as_type.loc5_4.2)> [symbolic = %Z.type (constants.%Z.type.67cf45.2)]
  206. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Z.type [symbolic = %require_complete (constants.%require_complete.5aca91.2)]
  207. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z, @Z(%A.as_type.loc5_4.2) [symbolic = %Z.assoc_type (constants.%Z.assoc_type.221)]
  208. // CHECK:STDOUT: %assoc0: @F.%Z.assoc_type (%Z.assoc_type.221) = assoc_entity element0, imports.%Main.import_ref.7b4 [symbolic = %assoc0 (constants.%assoc0.b43)]
  209. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %A.loc4_7.1, @Z, @Z(%A.as_type.loc5_4.2) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
  210. // CHECK:STDOUT: %Z.facet: @F.%Z.type (%Z.type.67cf45.2) = facet_value %A.as_type.loc5_4.2, (%Z.lookup_impl_witness) [symbolic = %Z.facet (constants.%Z.facet)]
  211. // CHECK:STDOUT: %Z.WithSelf.F.type: type = fn_type @Z.WithSelf.F, @Z.WithSelf(%A.as_type.loc5_4.2, %Z.facet) [symbolic = %Z.WithSelf.F.type (constants.%Z.WithSelf.F.type.0d8)]
  212. // CHECK:STDOUT: %.loc5_4.3: type = fn_type_with_self_type %Z.WithSelf.F.type, %Z.facet [symbolic = %.loc5_4.3 (constants.%.cfd)]
  213. // CHECK:STDOUT: %impl.elem0.loc5_4.2: @F.%.loc5_4.3 (%.cfd) = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_4.2 (constants.%impl.elem0)]
  214. // CHECK:STDOUT: %specific_impl_fn.loc5_4.2: <specific function> = specific_impl_function %impl.elem0.loc5_4.2, @Z.WithSelf.F(%A.as_type.loc5_4.2, %Z.facet) [symbolic = %specific_impl_fn.loc5_4.2 (constants.%specific_impl_fn)]
  215. // CHECK:STDOUT:
  216. // CHECK:STDOUT: fn() {
  217. // CHECK:STDOUT: !entry:
  218. // CHECK:STDOUT: %A.ref: %X.type = name_ref A, %A.loc4_7.2 [symbolic = %A.loc4_7.1 (constants.%A)]
  219. // CHECK:STDOUT: %A.as_type.loc5_4.1: type = facet_access_type %A.ref [symbolic = %A.as_type.loc5_4.2 (constants.%A.as_type)]
  220. // CHECK:STDOUT: %.loc5_4.1: type = converted %A.ref, %A.as_type.loc5_4.1 [symbolic = %A.as_type.loc5_4.2 (constants.%A.as_type)]
  221. // CHECK:STDOUT: %.loc5_4.2: @F.%Z.assoc_type (%Z.assoc_type.221) = specific_constant imports.%Main.import_ref.f56, @Z.WithSelf(constants.%A.as_type, constants.%A) [symbolic = %assoc0 (constants.%assoc0.b43)]
  222. // CHECK:STDOUT: %F.ref: @F.%Z.assoc_type (%Z.assoc_type.221) = name_ref F, %.loc5_4.2 [symbolic = %assoc0 (constants.%assoc0.b43)]
  223. // CHECK:STDOUT: %impl.elem0.loc5_4.1: @F.%.loc5_4.3 (%.cfd) = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_4.2 (constants.%impl.elem0)]
  224. // CHECK:STDOUT: %specific_impl_fn.loc5_4.1: <specific function> = specific_impl_function %impl.elem0.loc5_4.1, @Z.WithSelf.F(constants.%A.as_type, constants.%Z.facet) [symbolic = %specific_impl_fn.loc5_4.2 (constants.%specific_impl_fn)]
  225. // CHECK:STDOUT: %Z.WithSelf.F.call: init %empty_tuple.type = call %specific_impl_fn.loc5_4.1()
  226. // CHECK:STDOUT: return
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT: }
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: specific @Z(constants.%T) {
  231. // CHECK:STDOUT: %T => constants.%T
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: specific @Z.WithSelf(constants.%T, constants.%Self.984) {}
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: specific @Z.WithSelf.F(constants.%T, constants.%Self.984) {}
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: specific @Z(constants.%Self.as_type.190) {
  239. // CHECK:STDOUT: %T => constants.%Self.as_type.190
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: !definition:
  242. // CHECK:STDOUT: %Z.type => constants.%Z.type.67cf45.1
  243. // CHECK:STDOUT: %Self => constants.%Self.9e6a89.1
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: specific @X.WithSelf(constants.%Self.f45) {
  247. // CHECK:STDOUT: !definition:
  248. // CHECK:STDOUT: %Self => constants.%Self.f45
  249. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.190
  250. // CHECK:STDOUT: %Z.type => constants.%Z.type.67cf45.1
  251. // CHECK:STDOUT: %require_complete => constants.%require_complete.5aca91.1
  252. // CHECK:STDOUT: }
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: specific @X.WithSelf.Self.as_type.impls.Z.type.require(constants.%Self.f45) {
  255. // CHECK:STDOUT: %Self => constants.%Self.f45
  256. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.190
  257. // CHECK:STDOUT: %Z.type => constants.%Z.type.67cf45.1
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: specific @Z(constants.%Self.as_type.c59) {
  261. // CHECK:STDOUT: %T => constants.%Self.as_type.c59
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: !definition:
  264. // CHECK:STDOUT: %Z.type => constants.%Z.type.4c1
  265. // CHECK:STDOUT: %Self => constants.%Self.334
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: specific @Y.WithSelf(constants.%Self.d4d) {}
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: specific @Y.WithSelf.Self.as_type.impls.Z.type.require(constants.%Self.d4d) {
  271. // CHECK:STDOUT: %Self => constants.%Self.d4d
  272. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.c59
  273. // CHECK:STDOUT: %Z.type => constants.%Z.type.4c1
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: specific @F(constants.%A, constants.%B) {
  277. // CHECK:STDOUT: %A.loc4_7.1 => constants.%A
  278. // CHECK:STDOUT: %B.loc4_21.1 => constants.%B
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: specific @X.WithSelf(constants.%A) {
  282. // CHECK:STDOUT: !definition:
  283. // CHECK:STDOUT: %Self => constants.%A
  284. // CHECK:STDOUT: %Self.as_type => constants.%A.as_type
  285. // CHECK:STDOUT: %Z.type => constants.%Z.type.67cf45.2
  286. // CHECK:STDOUT: %require_complete => constants.%require_complete.5aca91.2
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: specific @Z(constants.%A.as_type) {
  290. // CHECK:STDOUT: %T => constants.%A.as_type
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: !definition:
  293. // CHECK:STDOUT: %Z.type => constants.%Z.type.67cf45.2
  294. // CHECK:STDOUT: %Self => constants.%Self.9e6a89.2
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT:
  297. // CHECK:STDOUT: specific @Z.WithSelf(constants.%A.as_type, constants.%Self.984) {
  298. // CHECK:STDOUT: !definition:
  299. // CHECK:STDOUT: %T => constants.%A.as_type
  300. // CHECK:STDOUT: %Z.type => constants.%Z.type.67cf45.2
  301. // CHECK:STDOUT: %Self => constants.%Self.984
  302. // CHECK:STDOUT: %Z.WithSelf.F.type => constants.%Z.WithSelf.F.type.c44
  303. // CHECK:STDOUT: %Z.WithSelf.F => constants.%Z.WithSelf.F.e33
  304. // CHECK:STDOUT: %Z.assoc_type => constants.%Z.assoc_type.221
  305. // CHECK:STDOUT: %assoc0 => constants.%assoc0.b43
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT:
  308. // CHECK:STDOUT: specific @Z.WithSelf(constants.%A.as_type, constants.%A) {
  309. // CHECK:STDOUT: !definition:
  310. // CHECK:STDOUT: %T => constants.%A.as_type
  311. // CHECK:STDOUT: %Z.type => constants.%Z.type.67cf45.2
  312. // CHECK:STDOUT: %Self => constants.%A
  313. // CHECK:STDOUT: %Z.WithSelf.F.type => constants.%Z.WithSelf.F.type.f05
  314. // CHECK:STDOUT: %Z.WithSelf.F => constants.%Z.WithSelf.F.364
  315. // CHECK:STDOUT: %Z.assoc_type => constants.%Z.assoc_type.221
  316. // CHECK:STDOUT: %assoc0 => constants.%assoc0.b43
  317. // CHECK:STDOUT: }
  318. // CHECK:STDOUT:
  319. // CHECK:STDOUT: specific @X.WithSelf.Self.as_type.impls.Z.type.require(constants.%A) {
  320. // CHECK:STDOUT: %Self => constants.%A
  321. // CHECK:STDOUT: %Self.as_type => constants.%A.as_type
  322. // CHECK:STDOUT: %Z.type => constants.%Z.type.67cf45.2
  323. // CHECK:STDOUT: }
  324. // CHECK:STDOUT:
  325. // CHECK:STDOUT: specific @Z.WithSelf(constants.%A.as_type, constants.%Z.facet) {
  326. // CHECK:STDOUT: !definition:
  327. // CHECK:STDOUT: %T => constants.%A.as_type
  328. // CHECK:STDOUT: %Z.type => constants.%Z.type.67cf45.2
  329. // CHECK:STDOUT: %Self => constants.%Z.facet
  330. // CHECK:STDOUT: %Z.WithSelf.F.type => constants.%Z.WithSelf.F.type.0d8
  331. // CHECK:STDOUT: %Z.WithSelf.F => constants.%Z.WithSelf.F.3cc
  332. // CHECK:STDOUT: %Z.assoc_type => constants.%Z.assoc_type.221
  333. // CHECK:STDOUT: %assoc0 => constants.%assoc0.b43
  334. // CHECK:STDOUT: }
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: specific @Z.WithSelf.F(constants.%A.as_type, constants.%Z.facet) {}
  337. // CHECK:STDOUT: