convert_interface.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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: %empty_tuple.type: type = tuple_type () [concrete]
  28. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [concrete]
  29. // CHECK:STDOUT: %F.type: type = fn_type @F [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, (%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: %impl_witness: <witness> = impl_witness () [concrete = constants.%impl_witness]
  58. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  59. // CHECK:STDOUT: %e.patt: %Eats.type = binding_pattern e
  60. // CHECK:STDOUT: %e.param_patt: %Eats.type = value_param_pattern %e.patt, call_param0
  61. // CHECK:STDOUT: } {
  62. // CHECK:STDOUT: %e.param: %Eats.type = value_param call_param0
  63. // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type]
  64. // CHECK:STDOUT: %e: %Eats.type = bind_name e, %e.param
  65. // CHECK:STDOUT: }
  66. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
  67. // CHECK:STDOUT: }
  68. // CHECK:STDOUT:
  69. // CHECK:STDOUT: interface @Eats {
  70. // CHECK:STDOUT: %Self: %Eats.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1b5]
  71. // CHECK:STDOUT:
  72. // CHECK:STDOUT: !members:
  73. // CHECK:STDOUT: .Self = %Self
  74. // CHECK:STDOUT: witness = ()
  75. // CHECK:STDOUT: }
  76. // CHECK:STDOUT:
  77. // CHECK:STDOUT: interface @Animal {
  78. // CHECK:STDOUT: %Self: %Animal.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.fd4]
  79. // CHECK:STDOUT:
  80. // CHECK:STDOUT: !members:
  81. // CHECK:STDOUT: .Self = %Self
  82. // CHECK:STDOUT: witness = ()
  83. // CHECK:STDOUT: }
  84. // CHECK:STDOUT:
  85. // CHECK:STDOUT: impl @impl: %Animal.ref as %Eats.ref {
  86. // CHECK:STDOUT: !members:
  87. // CHECK:STDOUT: witness = file.%impl_witness
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT:
  90. // CHECK:STDOUT: fn @F(%e.param_patt: %Eats.type) {
  91. // CHECK:STDOUT: !entry:
  92. // CHECK:STDOUT: return
  93. // CHECK:STDOUT: }
  94. // CHECK:STDOUT:
  95. // CHECK:STDOUT: fn @G() {
  96. // CHECK:STDOUT: !entry:
  97. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  98. // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type]
  99. // CHECK:STDOUT: %Eats.facet: %Eats.type = facet_value constants.%Animal.type, (constants.%impl_witness) [concrete = constants.%Eats.facet]
  100. // CHECK:STDOUT: %.loc22: %Eats.type = converted %Animal.ref, %Eats.facet [concrete = constants.%Eats.facet]
  101. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc22)
  102. // CHECK:STDOUT: return
  103. // CHECK:STDOUT: }
  104. // CHECK:STDOUT:
  105. // CHECK:STDOUT: --- toolchain/testing/min_prelude/convert.carbon
  106. // CHECK:STDOUT:
  107. // CHECK:STDOUT: constants {
  108. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  109. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  110. // CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete]
  111. // CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete]
  112. // CHECK:STDOUT: %As.type.8ba: type = facet_type <@As, @As(%Dest)> [symbolic]
  113. // CHECK:STDOUT: %Self.b4e: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic]
  114. // CHECK:STDOUT: %Self.as_type.7f0: type = facet_access_type %Self.b4e [symbolic]
  115. // CHECK:STDOUT: %Convert.type.ad1: type = fn_type @Convert.1, @As(%Dest) [symbolic]
  116. // CHECK:STDOUT: %Convert.0ed: %Convert.type.ad1 = struct_value () [symbolic]
  117. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type %As.type.8ba [symbolic]
  118. // CHECK:STDOUT: %assoc0.ac5: %As.assoc_type = assoc_entity element0, @As.%Convert.decl [symbolic]
  119. // CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete]
  120. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete]
  121. // CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  122. // CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic]
  123. // CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic]
  124. // CHECK:STDOUT: %Convert.type.4cf: type = fn_type @Convert.2, @ImplicitAs(%Dest) [symbolic]
  125. // CHECK:STDOUT: %Convert.147: %Convert.type.4cf = struct_value () [symbolic]
  126. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type %ImplicitAs.type.07f [symbolic]
  127. // CHECK:STDOUT: %assoc0.a50: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic]
  128. // CHECK:STDOUT: }
  129. // CHECK:STDOUT:
  130. // CHECK:STDOUT: file {
  131. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  132. // CHECK:STDOUT: .As = %As.decl
  133. // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
  134. // CHECK:STDOUT: }
  135. // CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] {
  136. // CHECK:STDOUT: %Dest.patt.loc8_14.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc8_14.2 (constants.%Dest.patt)]
  137. // CHECK:STDOUT: } {
  138. // CHECK:STDOUT: %Dest.loc8_14.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc8_14.2 (constants.%Dest)]
  139. // CHECK:STDOUT: }
  140. // CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] {
  141. // CHECK:STDOUT: %Dest.patt.loc12_22.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc12_22.2 (constants.%Dest.patt)]
  142. // CHECK:STDOUT: } {
  143. // CHECK:STDOUT: %Dest.loc12_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc12_22.2 (constants.%Dest)]
  144. // CHECK:STDOUT: }
  145. // CHECK:STDOUT: }
  146. // CHECK:STDOUT:
  147. // CHECK:STDOUT: generic interface @As(%Dest.loc8_14.1: type) {
  148. // CHECK:STDOUT: %Dest.loc8_14.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc8_14.2 (constants.%Dest)]
  149. // CHECK:STDOUT: %Dest.patt.loc8_14.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc8_14.2 (constants.%Dest.patt)]
  150. // CHECK:STDOUT:
  151. // CHECK:STDOUT: !definition:
  152. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest.loc8_14.2)> [symbolic = %As.type (constants.%As.type.8ba)]
  153. // CHECK:STDOUT: %Self.2: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)]
  154. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest.loc8_14.2) [symbolic = %Convert.type (constants.%Convert.type.ad1)]
  155. // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.ad1) = struct_value () [symbolic = %Convert (constants.%Convert.0ed)]
  156. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As.%As.type (%As.type.8ba) [symbolic = %As.assoc_type (constants.%As.assoc_type)]
  157. // 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.ac5)]
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: interface {
  160. // CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)]
  161. // CHECK:STDOUT: %Convert.decl: @As.%Convert.type (%Convert.type.ad1) = fn_decl @Convert.1 [symbolic = @As.%Convert (constants.%Convert.0ed)] {
  162. // CHECK:STDOUT: %self.patt: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = binding_pattern self
  163. // CHECK:STDOUT: %self.param_patt: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = value_param_pattern %self.patt, call_param0
  164. // CHECK:STDOUT: %return.patt: @Convert.1.%Dest (%Dest) = return_slot_pattern
  165. // CHECK:STDOUT: %return.param_patt: @Convert.1.%Dest (%Dest) = out_param_pattern %return.patt, call_param1
  166. // CHECK:STDOUT: } {
  167. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @As.%Dest.loc8_14.1 [symbolic = %Dest (constants.%Dest)]
  168. // CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = value_param call_param0
  169. // CHECK:STDOUT: %.loc9_20.1: type = splice_block %.loc9_20.3 [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type.7f0)] {
  170. // 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)]
  171. // CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.8ba) = name_ref Self, %.loc9_20.2 [symbolic = %Self (constants.%Self.b4e)]
  172. // 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)]
  173. // 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)]
  174. // CHECK:STDOUT: }
  175. // CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = bind_name self, %self.param
  176. // CHECK:STDOUT: %return.param: ref @Convert.1.%Dest (%Dest) = out_param call_param1
  177. // CHECK:STDOUT: %return: ref @Convert.1.%Dest (%Dest) = return_slot %return.param
  178. // CHECK:STDOUT: }
  179. // 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.ac5)]
  180. // CHECK:STDOUT:
  181. // CHECK:STDOUT: !members:
  182. // CHECK:STDOUT: .Self = %Self.1
  183. // CHECK:STDOUT: .Dest = <poisoned>
  184. // CHECK:STDOUT: .Convert = %assoc0.loc9_35.1
  185. // CHECK:STDOUT: witness = (%Convert.decl)
  186. // CHECK:STDOUT: }
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT:
  189. // CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc12_22.1: type) {
  190. // CHECK:STDOUT: %Dest.loc12_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc12_22.2 (constants.%Dest)]
  191. // CHECK:STDOUT: %Dest.patt.loc12_22.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc12_22.2 (constants.%Dest.patt)]
  192. // CHECK:STDOUT:
  193. // CHECK:STDOUT: !definition:
  194. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc12_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  195. // CHECK:STDOUT: %Self.2: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
  196. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%Dest.loc12_22.2) [symbolic = %Convert.type (constants.%Convert.type.4cf)]
  197. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.4cf) = struct_value () [symbolic = %Convert (constants.%Convert.147)]
  198. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)]
  199. // 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.a50)]
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: interface {
  202. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
  203. // CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.4cf) = fn_decl @Convert.2 [symbolic = @ImplicitAs.%Convert (constants.%Convert.147)] {
  204. // CHECK:STDOUT: %self.patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = binding_pattern self
  205. // CHECK:STDOUT: %self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0
  206. // CHECK:STDOUT: %return.patt: @Convert.2.%Dest (%Dest) = return_slot_pattern
  207. // CHECK:STDOUT: %return.param_patt: @Convert.2.%Dest (%Dest) = out_param_pattern %return.patt, call_param1
  208. // CHECK:STDOUT: } {
  209. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc12_22.1 [symbolic = %Dest (constants.%Dest)]
  210. // CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param call_param0
  211. // CHECK:STDOUT: %.loc14_20.1: type = splice_block %.loc14_20.3 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] {
  212. // 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)]
  213. // CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc14_20.2 [symbolic = %Self (constants.%Self.0f3)]
  214. // 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)]
  215. // 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)]
  216. // CHECK:STDOUT: }
  217. // CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = bind_name self, %self.param
  218. // CHECK:STDOUT: %return.param: ref @Convert.2.%Dest (%Dest) = out_param call_param1
  219. // CHECK:STDOUT: %return: ref @Convert.2.%Dest (%Dest) = return_slot %return.param
  220. // CHECK:STDOUT: }
  221. // 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.a50)]
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: !members:
  224. // CHECK:STDOUT: .Self = %Self.1
  225. // CHECK:STDOUT: .Dest = <poisoned>
  226. // CHECK:STDOUT: .Convert = %assoc0.loc14_35.1
  227. // CHECK:STDOUT: witness = (%Convert.decl)
  228. // CHECK:STDOUT: }
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: generic fn @Convert.1(@As.%Dest.loc8_14.1: type, @As.%Self.1: @As.%As.type (%As.type.8ba)) {
  232. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  233. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.8ba)]
  234. // CHECK:STDOUT: %Self: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b4e)]
  235. // 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)]
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0)]() -> @Convert.1.%Dest (%Dest);
  238. // CHECK:STDOUT: }
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: generic fn @Convert.2(@ImplicitAs.%Dest.loc12_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) {
  241. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  242. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  243. // CHECK:STDOUT: %Self: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)]
  244. // 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)]
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419)]() -> @Convert.2.%Dest (%Dest);
  247. // CHECK:STDOUT: }
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: specific @As(constants.%Dest) {
  250. // CHECK:STDOUT: %Dest.loc8_14.2 => constants.%Dest
  251. // CHECK:STDOUT: %Dest.patt.loc8_14.2 => constants.%Dest
  252. // CHECK:STDOUT: }
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.b4e) {
  255. // CHECK:STDOUT: %Dest => constants.%Dest
  256. // CHECK:STDOUT: %As.type => constants.%As.type.8ba
  257. // CHECK:STDOUT: %Self => constants.%Self.b4e
  258. // CHECK:STDOUT: %Self.as_type.loc9_20.1 => constants.%Self.as_type.7f0
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: specific @As(@Convert.1.%Dest) {}
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: specific @As(%Dest.loc8_14.2) {}
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  266. // CHECK:STDOUT: %Dest.loc12_22.2 => constants.%Dest
  267. // CHECK:STDOUT: %Dest.patt.loc12_22.2 => constants.%Dest
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: specific @Convert.2(constants.%Dest, constants.%Self.0f3) {
  271. // CHECK:STDOUT: %Dest => constants.%Dest
  272. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f
  273. // CHECK:STDOUT: %Self => constants.%Self.0f3
  274. // CHECK:STDOUT: %Self.as_type.loc14_20.1 => constants.%Self.as_type.419
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%Dest) {}
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: specific @ImplicitAs(%Dest.loc12_22.2) {}
  280. // CHECK:STDOUT: