convert_interface.carbon 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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/min_prelude/convert.carbon
  6. // EXTRA-ARGS: --custom-core
  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/facet/min_prelude/convert_interface.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/min_prelude/convert_interface.carbon
  13. interface Eats {}
  14. interface Animal {}
  15. // TODO: This may be rejected in the future.
  16. // https://github.com/carbon-language/carbon-lang/issues/4853
  17. impl Animal as Eats {}
  18. fn F(e: Eats) {}
  19. fn G() { F(Animal); }
  20. // CHECK:STDOUT: --- convert_interface.carbon
  21. // CHECK:STDOUT:
  22. // CHECK:STDOUT: constants {
  23. // CHECK:STDOUT: %Eats.type: type = facet_type <@Eats> [concrete]
  24. // CHECK:STDOUT: %Self.1b5: %Eats.type = bind_symbolic_name Self, 0 [symbolic]
  25. // CHECK:STDOUT: %Animal.type: type = facet_type <@Animal> [concrete]
  26. // CHECK:STDOUT: %Self.fd4: %Animal.type = bind_symbolic_name Self, 0 [symbolic]
  27. // CHECK:STDOUT: %Eats.impl_witness: <witness> = impl_witness file.%Eats.impl_witness_table [concrete]
  28. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  29. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  30. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  31. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  32. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  33. // CHECK:STDOUT: %Eats.facet: %Eats.type = facet_value %Animal.type, (%Eats.impl_witness) [concrete]
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT:
  36. // CHECK:STDOUT: imports {
  37. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  38. // CHECK:STDOUT: import Core//prelude
  39. // CHECK:STDOUT: }
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT:
  42. // CHECK:STDOUT: file {
  43. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  44. // CHECK:STDOUT: .Core = imports.%Core
  45. // CHECK:STDOUT: .Eats = %Eats.decl
  46. // CHECK:STDOUT: .Animal = %Animal.decl
  47. // CHECK:STDOUT: .F = %F.decl
  48. // CHECK:STDOUT: .G = %G.decl
  49. // CHECK:STDOUT: }
  50. // CHECK:STDOUT: %Core.import = import Core
  51. // CHECK:STDOUT: %Eats.decl: type = interface_decl @Eats [concrete = constants.%Eats.type] {} {}
  52. // CHECK:STDOUT: %Animal.decl: type = interface_decl @Animal [concrete = constants.%Animal.type] {} {}
  53. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  54. // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type]
  55. // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type]
  56. // CHECK:STDOUT: }
  57. // CHECK:STDOUT: %Eats.impl_witness_table = impl_witness_table (), @impl [concrete]
  58. // CHECK:STDOUT: %Eats.impl_witness: <witness> = impl_witness %Eats.impl_witness_table [concrete = constants.%Eats.impl_witness]
  59. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  60. // CHECK:STDOUT: %e.patt: %Eats.type = binding_pattern e
  61. // CHECK:STDOUT: %e.param_patt: %Eats.type = value_param_pattern %e.patt, call_param0
  62. // CHECK:STDOUT: } {
  63. // CHECK:STDOUT: %e.param: %Eats.type = value_param call_param0
  64. // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type]
  65. // CHECK:STDOUT: %e: %Eats.type = bind_name e, %e.param
  66. // CHECK:STDOUT: }
  67. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
  68. // CHECK:STDOUT: }
  69. // CHECK:STDOUT:
  70. // CHECK:STDOUT: interface @Eats {
  71. // CHECK:STDOUT: %Self: %Eats.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1b5]
  72. // CHECK:STDOUT:
  73. // CHECK:STDOUT: !members:
  74. // CHECK:STDOUT: .Self = %Self
  75. // CHECK:STDOUT: witness = ()
  76. // CHECK:STDOUT: }
  77. // CHECK:STDOUT:
  78. // CHECK:STDOUT: interface @Animal {
  79. // CHECK:STDOUT: %Self: %Animal.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.fd4]
  80. // CHECK:STDOUT:
  81. // CHECK:STDOUT: !members:
  82. // CHECK:STDOUT: .Self = %Self
  83. // CHECK:STDOUT: witness = ()
  84. // CHECK:STDOUT: }
  85. // CHECK:STDOUT:
  86. // CHECK:STDOUT: impl @impl: %Animal.ref as %Eats.ref {
  87. // CHECK:STDOUT: !members:
  88. // CHECK:STDOUT: witness = file.%Eats.impl_witness
  89. // CHECK:STDOUT: }
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: fn @F(%e.param: %Eats.type) {
  92. // CHECK:STDOUT: !entry:
  93. // CHECK:STDOUT: return
  94. // CHECK:STDOUT: }
  95. // CHECK:STDOUT:
  96. // CHECK:STDOUT: fn @G() {
  97. // CHECK:STDOUT: !entry:
  98. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  99. // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type]
  100. // CHECK:STDOUT: %Eats.facet: %Eats.type = facet_value constants.%Animal.type, (constants.%Eats.impl_witness) [concrete = constants.%Eats.facet]
  101. // CHECK:STDOUT: %.loc22: %Eats.type = converted %Animal.ref, %Eats.facet [concrete = constants.%Eats.facet]
  102. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc22)
  103. // CHECK:STDOUT: return
  104. // CHECK:STDOUT: }
  105. // CHECK:STDOUT:
  106. // CHECK:STDOUT: --- include_files/convert.carbon
  107. // CHECK:STDOUT:
  108. // CHECK:STDOUT: constants {
  109. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  110. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  111. // CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete]
  112. // CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete]
  113. // CHECK:STDOUT: %As.type.8ba: type = facet_type <@As, @As(%Dest)> [symbolic]
  114. // CHECK:STDOUT: %Self.b4e: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic]
  115. // CHECK:STDOUT: %Self.as_type.7f0: type = facet_access_type %Self.b4e [symbolic]
  116. // CHECK:STDOUT: %Convert.type.ad1: type = fn_type @Convert.1, @As(%Dest) [symbolic]
  117. // CHECK:STDOUT: %Convert.0ed: %Convert.type.ad1 = struct_value () [symbolic]
  118. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As, @As(%Dest) [symbolic]
  119. // CHECK:STDOUT: %assoc0.1d5: %As.assoc_type = assoc_entity element0, @As.%Convert.decl [symbolic]
  120. // CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete]
  121. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete]
  122. // CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  123. // CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic]
  124. // CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic]
  125. // CHECK:STDOUT: %Convert.type.4cf: type = fn_type @Convert.2, @ImplicitAs(%Dest) [symbolic]
  126. // CHECK:STDOUT: %Convert.147: %Convert.type.4cf = struct_value () [symbolic]
  127. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  128. // CHECK:STDOUT: %assoc0.8f8: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic]
  129. // CHECK:STDOUT: }
  130. // CHECK:STDOUT:
  131. // CHECK:STDOUT: file {
  132. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  133. // CHECK:STDOUT: .As = %As.decl
  134. // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] {
  137. // CHECK:STDOUT: %Dest.patt.loc8_14.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc8_14.2 (constants.%Dest.patt)]
  138. // CHECK:STDOUT: } {
  139. // CHECK:STDOUT: %Dest.loc8_14.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc8_14.2 (constants.%Dest)]
  140. // CHECK:STDOUT: }
  141. // CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] {
  142. // CHECK:STDOUT: %Dest.patt.loc12_22.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc12_22.2 (constants.%Dest.patt)]
  143. // CHECK:STDOUT: } {
  144. // CHECK:STDOUT: %Dest.loc12_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc12_22.2 (constants.%Dest)]
  145. // CHECK:STDOUT: }
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: generic interface @As(%Dest.loc8_14.1: type) {
  149. // CHECK:STDOUT: %Dest.loc8_14.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc8_14.2 (constants.%Dest)]
  150. // CHECK:STDOUT: %Dest.patt.loc8_14.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc8_14.2 (constants.%Dest.patt)]
  151. // CHECK:STDOUT:
  152. // CHECK:STDOUT: !definition:
  153. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest.loc8_14.2)> [symbolic = %As.type (constants.%As.type.8ba)]
  154. // CHECK:STDOUT: %Self.2: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)]
  155. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest.loc8_14.2) [symbolic = %Convert.type (constants.%Convert.type.ad1)]
  156. // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.ad1) = struct_value () [symbolic = %Convert (constants.%Convert.0ed)]
  157. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As, @As(%Dest.loc8_14.2) [symbolic = %As.assoc_type (constants.%As.assoc_type)]
  158. // CHECK:STDOUT: %assoc0.loc9_35.2: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc9_35.2 (constants.%assoc0.1d5)]
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: interface {
  161. // CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)]
  162. // CHECK:STDOUT: %Convert.decl: @As.%Convert.type (%Convert.type.ad1) = fn_decl @Convert.1 [symbolic = @As.%Convert (constants.%Convert.0ed)] {
  163. // CHECK:STDOUT: %self.patt: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = binding_pattern self
  164. // CHECK:STDOUT: %self.param_patt: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = value_param_pattern %self.patt, call_param0
  165. // CHECK:STDOUT: %return.patt: @Convert.1.%Dest (%Dest) = return_slot_pattern
  166. // CHECK:STDOUT: %return.param_patt: @Convert.1.%Dest (%Dest) = out_param_pattern %return.patt, call_param1
  167. // CHECK:STDOUT: } {
  168. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @As.%Dest.loc8_14.1 [symbolic = %Dest (constants.%Dest)]
  169. // CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = value_param call_param0
  170. // CHECK:STDOUT: %.loc9_20.1: type = splice_block %.loc9_20.3 [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type.7f0)] {
  171. // CHECK:STDOUT: %.loc9_20.2: @Convert.1.%As.type (%As.type.8ba) = specific_constant @As.%Self.1, @As(constants.%Dest) [symbolic = %Self (constants.%Self.b4e)]
  172. // CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.8ba) = name_ref Self, %.loc9_20.2 [symbolic = %Self (constants.%Self.b4e)]
  173. // CHECK:STDOUT: %Self.as_type.loc9_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type.7f0)]
  174. // CHECK:STDOUT: %.loc9_20.3: type = converted %Self.ref, %Self.as_type.loc9_20.2 [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type.7f0)]
  175. // CHECK:STDOUT: }
  176. // CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = bind_name self, %self.param
  177. // CHECK:STDOUT: %return.param: ref @Convert.1.%Dest (%Dest) = out_param call_param1
  178. // CHECK:STDOUT: %return: ref @Convert.1.%Dest (%Dest) = return_slot %return.param
  179. // CHECK:STDOUT: }
  180. // CHECK:STDOUT: %assoc0.loc9_35.1: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc9_35.2 (constants.%assoc0.1d5)]
  181. // CHECK:STDOUT:
  182. // CHECK:STDOUT: !members:
  183. // CHECK:STDOUT: .Self = %Self.1
  184. // CHECK:STDOUT: .Dest = <poisoned>
  185. // CHECK:STDOUT: .Convert = %assoc0.loc9_35.1
  186. // CHECK:STDOUT: witness = (%Convert.decl)
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT: }
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc12_22.1: type) {
  191. // CHECK:STDOUT: %Dest.loc12_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc12_22.2 (constants.%Dest)]
  192. // CHECK:STDOUT: %Dest.patt.loc12_22.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc12_22.2 (constants.%Dest.patt)]
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: !definition:
  195. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc12_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  196. // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
  197. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%Dest.loc12_22.2) [symbolic = %Convert.type (constants.%Convert.type.4cf)]
  198. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.4cf) = struct_value () [symbolic = %Convert (constants.%Convert.147)]
  199. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest.loc12_22.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)]
  200. // CHECK:STDOUT: %assoc0.loc14_35.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.8f8)]
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: interface {
  203. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
  204. // CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.4cf) = fn_decl @Convert.2 [symbolic = @ImplicitAs.%Convert (constants.%Convert.147)] {
  205. // CHECK:STDOUT: %self.patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = binding_pattern self
  206. // CHECK:STDOUT: %self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0
  207. // CHECK:STDOUT: %return.patt: @Convert.2.%Dest (%Dest) = return_slot_pattern
  208. // CHECK:STDOUT: %return.param_patt: @Convert.2.%Dest (%Dest) = out_param_pattern %return.patt, call_param1
  209. // CHECK:STDOUT: } {
  210. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc12_22.1 [symbolic = %Dest (constants.%Dest)]
  211. // CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param call_param0
  212. // CHECK:STDOUT: %.loc14_20.1: type = splice_block %.loc14_20.3 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] {
  213. // CHECK:STDOUT: %.loc14_20.2: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self.0f3)]
  214. // CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc14_20.2 [symbolic = %Self (constants.%Self.0f3)]
  215. // CHECK:STDOUT: %Self.as_type.loc14_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)]
  216. // CHECK:STDOUT: %.loc14_20.3: type = converted %Self.ref, %Self.as_type.loc14_20.2 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)]
  217. // CHECK:STDOUT: }
  218. // CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = bind_name self, %self.param
  219. // CHECK:STDOUT: %return.param: ref @Convert.2.%Dest (%Dest) = out_param call_param1
  220. // CHECK:STDOUT: %return: ref @Convert.2.%Dest (%Dest) = return_slot %return.param
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT: %assoc0.loc14_35.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.8f8)]
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: !members:
  225. // CHECK:STDOUT: .Self = %Self.1
  226. // CHECK:STDOUT: .Dest = <poisoned>
  227. // CHECK:STDOUT: .Convert = %assoc0.loc14_35.1
  228. // CHECK:STDOUT: witness = (%Convert.decl)
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT: }
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: generic fn @Convert.1(@As.%Dest.loc8_14.1: type, @As.%Self.1: @As.%As.type (%As.type.8ba)) {
  233. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  234. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.8ba)]
  235. // CHECK:STDOUT: %Self: @Convert.1.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b4e)]
  236. // CHECK:STDOUT: %Self.as_type.loc9_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type.7f0)]
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: fn(%self.param: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0)) -> @Convert.1.%Dest (%Dest);
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: generic fn @Convert.2(@ImplicitAs.%Dest.loc12_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) {
  242. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  243. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  244. // CHECK:STDOUT: %Self: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)]
  245. // CHECK:STDOUT: %Self.as_type.loc14_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)]
  246. // CHECK:STDOUT:
  247. // CHECK:STDOUT: fn(%self.param: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419)) -> @Convert.2.%Dest (%Dest);
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: specific @As(constants.%Dest) {
  251. // CHECK:STDOUT: %Dest.loc8_14.2 => constants.%Dest
  252. // CHECK:STDOUT: %Dest.patt.loc8_14.2 => constants.%Dest.patt
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.b4e) {
  256. // CHECK:STDOUT: %Dest => constants.%Dest
  257. // CHECK:STDOUT: %As.type => constants.%As.type.8ba
  258. // CHECK:STDOUT: %Self => constants.%Self.b4e
  259. // CHECK:STDOUT: %Self.as_type.loc9_20.1 => constants.%Self.as_type.7f0
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT:
  262. // CHECK:STDOUT: specific @As(@Convert.1.%Dest) {}
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: specific @As(%Dest.loc8_14.2) {}
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  267. // CHECK:STDOUT: %Dest.loc12_22.2 => constants.%Dest
  268. // CHECK:STDOUT: %Dest.patt.loc12_22.2 => constants.%Dest.patt
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT:
  271. // CHECK:STDOUT: specific @Convert.2(constants.%Dest, constants.%Self.0f3) {
  272. // CHECK:STDOUT: %Dest => constants.%Dest
  273. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f
  274. // CHECK:STDOUT: %Self => constants.%Self.0f3
  275. // CHECK:STDOUT: %Self.as_type.loc14_20.1 => constants.%Self.as_type.419
  276. // CHECK:STDOUT: }
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%Dest) {}
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: specific @ImplicitAs(%Dest.loc12_22.2) {}
  281. // CHECK:STDOUT: