binding_pattern.carbon 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  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/deduce/min_prelude/binding_pattern.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/deduce/min_prelude/binding_pattern.carbon
  13. // --- fail_incompatible_deduce.carbon
  14. library "[[@TEST_NAME]]";
  15. class C(T:! type) {
  16. fn Create(value: T) {}
  17. }
  18. fn F(U:! type, V:! type) {
  19. // CHECK:STDERR: fail_incompatible_deduce.carbon:[[@LINE+10]]:15: error: cannot implicitly convert expression of type `{}` to `V` [ConversionFailure]
  20. // CHECK:STDERR: C(V).Create({});
  21. // CHECK:STDERR: ^~
  22. // CHECK:STDERR: fail_incompatible_deduce.carbon:[[@LINE+7]]:15: note: type `{}` does not implement interface `Core.ImplicitAs(V)` [MissingImplInMemberAccessNote]
  23. // CHECK:STDERR: C(V).Create({});
  24. // CHECK:STDERR: ^~
  25. // CHECK:STDERR: fail_incompatible_deduce.carbon:[[@LINE-10]]:13: note: initializing function parameter [InCallToFunctionParam]
  26. // CHECK:STDERR: fn Create(value: T) {}
  27. // CHECK:STDERR: ^~~~~~~~
  28. // CHECK:STDERR:
  29. C(V).Create({});
  30. }
  31. // --- fail_todo_compatible_deduce.carbon
  32. library "[[@TEST_NAME]]";
  33. class C(T:! type) {
  34. fn Create(value: T) {}
  35. }
  36. // TODO: This `where` should be sufficient to say that `{} as V` works.
  37. fn F(U:! type, V:! type where {} impls Core.ImplicitAs(.Self)) {
  38. // CHECK:STDERR: fail_todo_compatible_deduce.carbon:[[@LINE+10]]:15: error: cannot implicitly convert expression of type `{}` to `V` [ConversionFailure]
  39. // CHECK:STDERR: C(V).Create({});
  40. // CHECK:STDERR: ^~
  41. // CHECK:STDERR: fail_todo_compatible_deduce.carbon:[[@LINE+7]]:15: note: type `{}` does not implement interface `Core.ImplicitAs(V)` [MissingImplInMemberAccessNote]
  42. // CHECK:STDERR: C(V).Create({});
  43. // CHECK:STDERR: ^~
  44. // CHECK:STDERR: fail_todo_compatible_deduce.carbon:[[@LINE-11]]:13: note: initializing function parameter [InCallToFunctionParam]
  45. // CHECK:STDERR: fn Create(value: T) {}
  46. // CHECK:STDERR: ^~~~~~~~
  47. // CHECK:STDERR:
  48. C(V).Create({});
  49. }
  50. // CHECK:STDOUT: --- fail_incompatible_deduce.carbon
  51. // CHECK:STDOUT:
  52. // CHECK:STDOUT: constants {
  53. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  54. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  55. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  56. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  57. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  58. // CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic]
  59. // CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T [symbolic]
  60. // CHECK:STDOUT: %Create.type.f31: type = fn_type @Create, @C(%T) [symbolic]
  61. // CHECK:STDOUT: %Create.cc8: %Create.type.f31 = struct_value () [symbolic]
  62. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  63. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  64. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  65. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  66. // CHECK:STDOUT: %V: type = bind_symbolic_name V, 1 [symbolic]
  67. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  68. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  69. // CHECK:STDOUT: %C.5e5: type = class_type @C, @C(%V) [symbolic]
  70. // CHECK:STDOUT: %Create.type.beb: type = fn_type @Create, @C(%V) [symbolic]
  71. // CHECK:STDOUT: %Create.dca: %Create.type.beb = struct_value () [symbolic]
  72. // CHECK:STDOUT: %require_complete.d93: <witness> = require_complete_type %C.5e5 [symbolic]
  73. // CHECK:STDOUT: %pattern_type.a32: type = pattern_type %V [symbolic]
  74. // CHECK:STDOUT: %Create.specific_fn: <specific function> = specific_function %Create.dca, @Create(%V) [symbolic]
  75. // CHECK:STDOUT: %require_complete.b54: <witness> = require_complete_type %V [symbolic]
  76. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  77. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  78. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  79. // CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  80. // CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic]
  81. // CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
  82. // CHECK:STDOUT: %Convert.42e: %Convert.type.275 = struct_value () [symbolic]
  83. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.519 [symbolic]
  84. // CHECK:STDOUT: %pattern_type.f3e: type = pattern_type %Self.as_type [symbolic]
  85. // CHECK:STDOUT: %pattern_type.7dcd0a.2: type = pattern_type %Dest [symbolic]
  86. // CHECK:STDOUT: %ImplicitAs.assoc_type.ca0: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  87. // CHECK:STDOUT: %assoc0.9f5: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic]
  88. // CHECK:STDOUT: %ImplicitAs.type.d88: type = facet_type <@ImplicitAs, @ImplicitAs(%V)> [symbolic]
  89. // CHECK:STDOUT: %Self.533: %ImplicitAs.type.d88 = bind_symbolic_name Self, 1 [symbolic]
  90. // CHECK:STDOUT: %Convert.type.5a5: type = fn_type @Convert, @ImplicitAs(%V) [symbolic]
  91. // CHECK:STDOUT: %Convert.f21: %Convert.type.5a5 = struct_value () [symbolic]
  92. // CHECK:STDOUT: %ImplicitAs.assoc_type.5fe: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%V) [symbolic]
  93. // CHECK:STDOUT: %assoc0.a0b: %ImplicitAs.assoc_type.5fe = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic]
  94. // CHECK:STDOUT: %require_complete.6c8: <witness> = require_complete_type %ImplicitAs.type.d88 [symbolic]
  95. // CHECK:STDOUT: %assoc0.dc0: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.207 [symbolic]
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT:
  98. // CHECK:STDOUT: imports {
  99. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  100. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  101. // CHECK:STDOUT: import Core//prelude
  102. // CHECK:STDOUT: }
  103. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  104. // CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc12_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
  105. // CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//prelude, inst69 [no loc], unloaded
  106. // CHECK:STDOUT: %Core.import_ref.492: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.dc0)]
  107. // CHECK:STDOUT: %Core.Convert = import_ref Core//prelude, Convert, unloaded
  108. // CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc12_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
  109. // CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//prelude, inst69 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)]
  110. // CHECK:STDOUT: %Core.import_ref.1c7: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)]
  111. // CHECK:STDOUT: %Core.import_ref.207 = import_ref Core//prelude, loc14_35, unloaded
  112. // CHECK:STDOUT: }
  113. // CHECK:STDOUT:
  114. // CHECK:STDOUT: file {
  115. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  116. // CHECK:STDOUT: .Core = imports.%Core
  117. // CHECK:STDOUT: .C = %C.decl
  118. // CHECK:STDOUT: .F = %F.decl
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT: %Core.import = import Core
  121. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  122. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  123. // CHECK:STDOUT: } {
  124. // CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
  125. // CHECK:STDOUT: }
  126. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  127. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  128. // CHECK:STDOUT: %V.patt: %pattern_type.98f = symbolic_binding_pattern V, 1 [concrete]
  129. // CHECK:STDOUT: } {
  130. // CHECK:STDOUT: %U.loc8_6.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc8_6.2 (constants.%U)]
  131. // CHECK:STDOUT: %V.loc8_16.1: type = bind_symbolic_name V, 1 [symbolic = %V.loc8_16.2 (constants.%V)]
  132. // CHECK:STDOUT: }
  133. // CHECK:STDOUT: }
  134. // CHECK:STDOUT:
  135. // CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.1: type) [from "include_files/convert.carbon"] {
  136. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  137. // CHECK:STDOUT:
  138. // CHECK:STDOUT: !definition:
  139. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
  140. // CHECK:STDOUT: %Self: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
  141. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.275)]
  142. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = struct_value () [symbolic = %Convert (constants.%Convert.42e)]
  143. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.ca0)]
  144. // CHECK:STDOUT: %assoc0: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic = %assoc0 (constants.%assoc0.9f5)]
  145. // CHECK:STDOUT:
  146. // CHECK:STDOUT: interface {
  147. // CHECK:STDOUT: !members:
  148. // CHECK:STDOUT: .Self = imports.%Core.import_ref.ff5
  149. // CHECK:STDOUT: .Convert = imports.%Core.import_ref.492
  150. // CHECK:STDOUT: witness = (imports.%Core.Convert)
  151. // CHECK:STDOUT: }
  152. // CHECK:STDOUT: }
  153. // CHECK:STDOUT:
  154. // CHECK:STDOUT: generic class @C(%T.loc4_9.1: type) {
  155. // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
  156. // CHECK:STDOUT:
  157. // CHECK:STDOUT: !definition:
  158. // CHECK:STDOUT: %Create.type: type = fn_type @Create, @C(%T.loc4_9.2) [symbolic = %Create.type (constants.%Create.type.f31)]
  159. // CHECK:STDOUT: %Create: @C.%Create.type (%Create.type.f31) = struct_value () [symbolic = %Create (constants.%Create.cc8)]
  160. // CHECK:STDOUT:
  161. // CHECK:STDOUT: class {
  162. // CHECK:STDOUT: %Create.decl: @C.%Create.type (%Create.type.f31) = fn_decl @Create [symbolic = @C.%Create (constants.%Create.cc8)] {
  163. // CHECK:STDOUT: %value.patt: @Create.%pattern_type (%pattern_type.7dcd0a.1) = binding_pattern value [concrete]
  164. // CHECK:STDOUT: %value.param_patt: @Create.%pattern_type (%pattern_type.7dcd0a.1) = value_param_pattern %value.patt, call_param0 [concrete]
  165. // CHECK:STDOUT: } {
  166. // CHECK:STDOUT: %value.param: @Create.%T (%T) = value_param call_param0
  167. // CHECK:STDOUT: %T.ref: type = name_ref T, @C.%T.loc4_9.1 [symbolic = %T (constants.%T)]
  168. // CHECK:STDOUT: %value: @Create.%T (%T) = bind_name value, %value.param
  169. // CHECK:STDOUT: }
  170. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  171. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  172. // CHECK:STDOUT: complete_type_witness = %complete_type
  173. // CHECK:STDOUT:
  174. // CHECK:STDOUT: !members:
  175. // CHECK:STDOUT: .Self = constants.%C.f2e
  176. // CHECK:STDOUT: .T = <poisoned>
  177. // CHECK:STDOUT: .Create = %Create.decl
  178. // CHECK:STDOUT: }
  179. // CHECK:STDOUT: }
  180. // CHECK:STDOUT:
  181. // CHECK:STDOUT: generic fn @Create(@C.%T.loc4_9.1: type) {
  182. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  183. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dcd0a.1)]
  184. // CHECK:STDOUT:
  185. // CHECK:STDOUT: !definition:
  186. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  187. // CHECK:STDOUT:
  188. // CHECK:STDOUT: fn(%value.param: @Create.%T (%T)) {
  189. // CHECK:STDOUT: !entry:
  190. // CHECK:STDOUT: return
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT: }
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: generic fn @F(%U.loc8_6.1: type, %V.loc8_16.1: type) {
  195. // CHECK:STDOUT: %U.loc8_6.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc8_6.2 (constants.%U)]
  196. // CHECK:STDOUT: %V.loc8_16.2: type = bind_symbolic_name V, 1 [symbolic = %V.loc8_16.2 (constants.%V)]
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: !definition:
  199. // CHECK:STDOUT: %C.loc19_6.2: type = class_type @C, @C(%V.loc8_16.2) [symbolic = %C.loc19_6.2 (constants.%C.5e5)]
  200. // CHECK:STDOUT: %require_complete.loc19_7: <witness> = require_complete_type %C.loc19_6.2 [symbolic = %require_complete.loc19_7 (constants.%require_complete.d93)]
  201. // CHECK:STDOUT: %Create.type: type = fn_type @Create, @C(%V.loc8_16.2) [symbolic = %Create.type (constants.%Create.type.beb)]
  202. // CHECK:STDOUT: %Create: @F.%Create.type (%Create.type.beb) = struct_value () [symbolic = %Create (constants.%Create.dca)]
  203. // CHECK:STDOUT: %Create.specific_fn.loc19_7.2: <specific function> = specific_function %Create, @Create(%V.loc8_16.2) [symbolic = %Create.specific_fn.loc19_7.2 (constants.%Create.specific_fn)]
  204. // CHECK:STDOUT: %require_complete.loc19_16.1: <witness> = require_complete_type %V.loc8_16.2 [symbolic = %require_complete.loc19_16.1 (constants.%require_complete.b54)]
  205. // CHECK:STDOUT: %ImplicitAs.type.loc19_16.2: type = facet_type <@ImplicitAs, @ImplicitAs(%V.loc8_16.2)> [symbolic = %ImplicitAs.type.loc19_16.2 (constants.%ImplicitAs.type.d88)]
  206. // CHECK:STDOUT: %require_complete.loc19_16.2: <witness> = require_complete_type %ImplicitAs.type.loc19_16.2 [symbolic = %require_complete.loc19_16.2 (constants.%require_complete.6c8)]
  207. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%V.loc8_16.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.5fe)]
  208. // CHECK:STDOUT: %assoc0: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.5fe) = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic = %assoc0 (constants.%assoc0.a0b)]
  209. // CHECK:STDOUT:
  210. // CHECK:STDOUT: fn() {
  211. // CHECK:STDOUT: !entry:
  212. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  213. // CHECK:STDOUT: %V.ref: type = name_ref V, %V.loc8_16.1 [symbolic = %V.loc8_16.2 (constants.%V)]
  214. // CHECK:STDOUT: %C.loc19_6.1: type = class_type @C, @C(constants.%V) [symbolic = %C.loc19_6.2 (constants.%C.5e5)]
  215. // CHECK:STDOUT: %.loc19_7: @F.%Create.type (%Create.type.beb) = specific_constant @C.%Create.decl, @C(constants.%V) [symbolic = %Create (constants.%Create.dca)]
  216. // CHECK:STDOUT: %Create.ref: @F.%Create.type (%Create.type.beb) = name_ref Create, %.loc19_7 [symbolic = %Create (constants.%Create.dca)]
  217. // CHECK:STDOUT: %.loc19_16.1: %empty_struct_type = struct_literal ()
  218. // CHECK:STDOUT: %Create.specific_fn.loc19_7.1: <specific function> = specific_function %Create.ref, @Create(constants.%V) [symbolic = %Create.specific_fn.loc19_7.2 (constants.%Create.specific_fn)]
  219. // CHECK:STDOUT: %ImplicitAs.type.loc19_16.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%V)> [symbolic = %ImplicitAs.type.loc19_16.2 (constants.%ImplicitAs.type.d88)]
  220. // CHECK:STDOUT: %.loc19_16.2: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.5fe) = specific_constant imports.%Core.import_ref.492, @ImplicitAs(constants.%V) [symbolic = %assoc0 (constants.%assoc0.a0b)]
  221. // CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.5fe) = name_ref Convert, %.loc19_16.2 [symbolic = %assoc0 (constants.%assoc0.a0b)]
  222. // CHECK:STDOUT: %.loc19_16.3: @F.%V.loc8_16.2 (%V) = converted %.loc19_16.1, <error> [concrete = <error>]
  223. // CHECK:STDOUT: %Create.call: init %empty_tuple.type = call %Create.specific_fn.loc19_7.1(<error>)
  224. // CHECK:STDOUT: return
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "include_files/convert.carbon"] {
  229. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  230. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
  231. // CHECK:STDOUT: %Self: @Convert.%ImplicitAs.type (%ImplicitAs.type.d62) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
  232. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  233. // CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.f3e)]
  234. // CHECK:STDOUT: %pattern_type.2: type = pattern_type %Dest [symbolic = %pattern_type.2 (constants.%pattern_type.7dcd0a.2)]
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: fn;
  237. // CHECK:STDOUT: }
  238. // CHECK:STDOUT:
  239. // CHECK:STDOUT: specific @C(constants.%T) {
  240. // CHECK:STDOUT: %T.loc4_9.2 => constants.%T
  241. // CHECK:STDOUT:
  242. // CHECK:STDOUT: !definition:
  243. // CHECK:STDOUT: %Create.type => constants.%Create.type.f31
  244. // CHECK:STDOUT: %Create => constants.%Create.cc8
  245. // CHECK:STDOUT: }
  246. // CHECK:STDOUT:
  247. // CHECK:STDOUT: specific @Create(constants.%T) {
  248. // CHECK:STDOUT: %T => constants.%T
  249. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dcd0a.1
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: specific @F(constants.%U, constants.%V) {
  253. // CHECK:STDOUT: %U.loc8_6.2 => constants.%U
  254. // CHECK:STDOUT: %V.loc8_16.2 => constants.%V
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: specific @C(constants.%V) {
  258. // CHECK:STDOUT: %T.loc4_9.2 => constants.%V
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: !definition:
  261. // CHECK:STDOUT: %Create.type => constants.%Create.type.beb
  262. // CHECK:STDOUT: %Create => constants.%Create.dca
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: specific @Create(constants.%V) {
  266. // CHECK:STDOUT: %T => constants.%V
  267. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a32
  268. // CHECK:STDOUT:
  269. // CHECK:STDOUT: !definition:
  270. // CHECK:STDOUT: %require_complete => constants.%require_complete.b54
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT:
  273. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  274. // CHECK:STDOUT: %Dest => constants.%Dest
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.519) {
  278. // CHECK:STDOUT: %Dest => constants.%Dest
  279. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d62
  280. // CHECK:STDOUT: %Self => constants.%Self.519
  281. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  282. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.f3e
  283. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.7dcd0a.2
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT:
  286. // CHECK:STDOUT: specific @ImplicitAs(constants.%V) {
  287. // CHECK:STDOUT: %Dest => constants.%V
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: !definition:
  290. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d88
  291. // CHECK:STDOUT: %Self => constants.%Self.533
  292. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5a5
  293. // CHECK:STDOUT: %Convert => constants.%Convert.f21
  294. // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.5fe
  295. // CHECK:STDOUT: %assoc0 => constants.%assoc0.a0b
  296. // CHECK:STDOUT: }
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: --- fail_todo_compatible_deduce.carbon
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: constants {
  301. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  302. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  303. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  304. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  305. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  306. // CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic]
  307. // CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T [symbolic]
  308. // CHECK:STDOUT: %Create.type.f31: type = fn_type @Create, @C(%T) [symbolic]
  309. // CHECK:STDOUT: %Create.cc8: %Create.type.f31 = struct_value () [symbolic]
  310. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  311. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  312. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  313. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  314. // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self]
  315. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  316. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  317. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  318. // CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  319. // CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic]
  320. // CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
  321. // CHECK:STDOUT: %Convert.42e: %Convert.type.275 = struct_value () [symbolic]
  322. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.519 [symbolic]
  323. // CHECK:STDOUT: %pattern_type.f3e: type = pattern_type %Self.as_type [symbolic]
  324. // CHECK:STDOUT: %pattern_type.7dcd0a.2: type = pattern_type %Dest [symbolic]
  325. // CHECK:STDOUT: %ImplicitAs.assoc_type.ca0: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  326. // CHECK:STDOUT: %assoc0.9f5: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic]
  327. // CHECK:STDOUT: %ImplicitAs.type.aba: type = facet_type <@ImplicitAs, @ImplicitAs(%.Self)> [symbolic_self]
  328. // CHECK:STDOUT: %type_where: type = facet_type <type where TODO> [concrete]
  329. // CHECK:STDOUT: %V: %type_where = bind_symbolic_name V, 1 [symbolic]
  330. // CHECK:STDOUT: %pattern_type.344: type = pattern_type %type_where [concrete]
  331. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  332. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  333. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic]
  334. // CHECK:STDOUT: %C.cd6: type = class_type @C, @C(%V.as_type) [symbolic]
  335. // CHECK:STDOUT: %Create.type.ff1: type = fn_type @Create, @C(%V.as_type) [symbolic]
  336. // CHECK:STDOUT: %Create.96b: %Create.type.ff1 = struct_value () [symbolic]
  337. // CHECK:STDOUT: %require_complete.558: <witness> = require_complete_type %C.cd6 [symbolic]
  338. // CHECK:STDOUT: %pattern_type.6e0: type = pattern_type %V.as_type [symbolic]
  339. // CHECK:STDOUT: %Create.specific_fn: <specific function> = specific_function %Create.96b, @Create(%V.as_type) [symbolic]
  340. // CHECK:STDOUT: %require_complete.0b5: <witness> = require_complete_type %V.as_type [symbolic]
  341. // CHECK:STDOUT: %ImplicitAs.type.113: type = facet_type <@ImplicitAs, @ImplicitAs(%V.as_type)> [symbolic]
  342. // CHECK:STDOUT: %Self.8ea: %ImplicitAs.type.113 = bind_symbolic_name Self, 1 [symbolic]
  343. // CHECK:STDOUT: %Convert.type.ec0: type = fn_type @Convert, @ImplicitAs(%V.as_type) [symbolic]
  344. // CHECK:STDOUT: %Convert.b52: %Convert.type.ec0 = struct_value () [symbolic]
  345. // CHECK:STDOUT: %ImplicitAs.assoc_type.83a: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%V.as_type) [symbolic]
  346. // CHECK:STDOUT: %assoc0.5dc: %ImplicitAs.assoc_type.83a = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic]
  347. // CHECK:STDOUT: %require_complete.9fe: <witness> = require_complete_type %ImplicitAs.type.113 [symbolic]
  348. // CHECK:STDOUT: %assoc0.dc0: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.207 [symbolic]
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: imports {
  352. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  353. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  354. // CHECK:STDOUT: import Core//prelude
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  357. // CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc12_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
  358. // CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//prelude, inst69 [no loc], unloaded
  359. // CHECK:STDOUT: %Core.import_ref.492: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.dc0)]
  360. // CHECK:STDOUT: %Core.Convert = import_ref Core//prelude, Convert, unloaded
  361. // CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc12_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
  362. // CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//prelude, inst69 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)]
  363. // CHECK:STDOUT: %Core.import_ref.1c7: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)]
  364. // CHECK:STDOUT: %Core.import_ref.207 = import_ref Core//prelude, loc14_35, unloaded
  365. // CHECK:STDOUT: }
  366. // CHECK:STDOUT:
  367. // CHECK:STDOUT: file {
  368. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  369. // CHECK:STDOUT: .Core = imports.%Core
  370. // CHECK:STDOUT: .C = %C.decl
  371. // CHECK:STDOUT: .F = %F.decl
  372. // CHECK:STDOUT: }
  373. // CHECK:STDOUT: %Core.import = import Core
  374. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  375. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  376. // CHECK:STDOUT: } {
  377. // CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
  378. // CHECK:STDOUT: }
  379. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  380. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  381. // CHECK:STDOUT: %V.patt: %pattern_type.344 = symbolic_binding_pattern V, 1 [concrete]
  382. // CHECK:STDOUT: } {
  383. // CHECK:STDOUT: %U.loc9_6.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc9_6.2 (constants.%U)]
  384. // CHECK:STDOUT: %.loc9_25.1: type = splice_block %.loc9_25.2 [concrete = constants.%type_where] {
  385. // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  386. // CHECK:STDOUT: %.loc9_32.1: %empty_struct_type = struct_literal ()
  387. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  388. // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.cc7 = name_ref ImplicitAs, imports.%Core.ImplicitAs [concrete = constants.%ImplicitAs.generic]
  389. // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  390. // CHECK:STDOUT: %ImplicitAs.type.loc9: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%.Self)> [symbolic_self = constants.%ImplicitAs.type.aba]
  391. // CHECK:STDOUT: %.loc9_32.2: type = converted %.loc9_32.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  392. // CHECK:STDOUT: %.loc9_25.2: type = where_expr %.Self [concrete = constants.%type_where] {
  393. // CHECK:STDOUT: requirement_impls %.loc9_32.2, %ImplicitAs.type.loc9
  394. // CHECK:STDOUT: }
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT: %V.loc9_16.1: %type_where = bind_symbolic_name V, 1 [symbolic = %V.loc9_16.2 (constants.%V)]
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT: }
  399. // CHECK:STDOUT:
  400. // CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.1: type) [from "include_files/convert.carbon"] {
  401. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  402. // CHECK:STDOUT:
  403. // CHECK:STDOUT: !definition:
  404. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
  405. // CHECK:STDOUT: %Self: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
  406. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.275)]
  407. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = struct_value () [symbolic = %Convert (constants.%Convert.42e)]
  408. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.ca0)]
  409. // CHECK:STDOUT: %assoc0: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic = %assoc0 (constants.%assoc0.9f5)]
  410. // CHECK:STDOUT:
  411. // CHECK:STDOUT: interface {
  412. // CHECK:STDOUT: !members:
  413. // CHECK:STDOUT: .Self = imports.%Core.import_ref.ff5
  414. // CHECK:STDOUT: .Convert = imports.%Core.import_ref.492
  415. // CHECK:STDOUT: witness = (imports.%Core.Convert)
  416. // CHECK:STDOUT: }
  417. // CHECK:STDOUT: }
  418. // CHECK:STDOUT:
  419. // CHECK:STDOUT: generic class @C(%T.loc4_9.1: type) {
  420. // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: !definition:
  423. // CHECK:STDOUT: %Create.type: type = fn_type @Create, @C(%T.loc4_9.2) [symbolic = %Create.type (constants.%Create.type.f31)]
  424. // CHECK:STDOUT: %Create: @C.%Create.type (%Create.type.f31) = struct_value () [symbolic = %Create (constants.%Create.cc8)]
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: class {
  427. // CHECK:STDOUT: %Create.decl: @C.%Create.type (%Create.type.f31) = fn_decl @Create [symbolic = @C.%Create (constants.%Create.cc8)] {
  428. // CHECK:STDOUT: %value.patt: @Create.%pattern_type (%pattern_type.7dcd0a.1) = binding_pattern value [concrete]
  429. // CHECK:STDOUT: %value.param_patt: @Create.%pattern_type (%pattern_type.7dcd0a.1) = value_param_pattern %value.patt, call_param0 [concrete]
  430. // CHECK:STDOUT: } {
  431. // CHECK:STDOUT: %value.param: @Create.%T (%T) = value_param call_param0
  432. // CHECK:STDOUT: %T.ref: type = name_ref T, @C.%T.loc4_9.1 [symbolic = %T (constants.%T)]
  433. // CHECK:STDOUT: %value: @Create.%T (%T) = bind_name value, %value.param
  434. // CHECK:STDOUT: }
  435. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  436. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  437. // CHECK:STDOUT: complete_type_witness = %complete_type
  438. // CHECK:STDOUT:
  439. // CHECK:STDOUT: !members:
  440. // CHECK:STDOUT: .Self = constants.%C.f2e
  441. // CHECK:STDOUT: .T = <poisoned>
  442. // CHECK:STDOUT: .Create = %Create.decl
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: generic fn @Create(@C.%T.loc4_9.1: type) {
  447. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  448. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dcd0a.1)]
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: !definition:
  451. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  452. // CHECK:STDOUT:
  453. // CHECK:STDOUT: fn(%value.param: @Create.%T (%T)) {
  454. // CHECK:STDOUT: !entry:
  455. // CHECK:STDOUT: return
  456. // CHECK:STDOUT: }
  457. // CHECK:STDOUT: }
  458. // CHECK:STDOUT:
  459. // CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "include_files/convert.carbon"] {
  460. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  461. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
  462. // CHECK:STDOUT: %Self: @Convert.%ImplicitAs.type (%ImplicitAs.type.d62) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
  463. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  464. // CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.f3e)]
  465. // CHECK:STDOUT: %pattern_type.2: type = pattern_type %Dest [symbolic = %pattern_type.2 (constants.%pattern_type.7dcd0a.2)]
  466. // CHECK:STDOUT:
  467. // CHECK:STDOUT: fn;
  468. // CHECK:STDOUT: }
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: generic fn @F(%U.loc9_6.1: type, %V.loc9_16.1: %type_where) {
  471. // CHECK:STDOUT: %U.loc9_6.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc9_6.2 (constants.%U)]
  472. // CHECK:STDOUT: %V.loc9_16.2: %type_where = bind_symbolic_name V, 1 [symbolic = %V.loc9_16.2 (constants.%V)]
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: !definition:
  475. // CHECK:STDOUT: %V.as_type.loc20_6.2: type = facet_access_type %V.loc9_16.2 [symbolic = %V.as_type.loc20_6.2 (constants.%V.as_type)]
  476. // CHECK:STDOUT: %C.loc20_6.2: type = class_type @C, @C(%V.as_type.loc20_6.2) [symbolic = %C.loc20_6.2 (constants.%C.cd6)]
  477. // CHECK:STDOUT: %require_complete.loc20_7: <witness> = require_complete_type %C.loc20_6.2 [symbolic = %require_complete.loc20_7 (constants.%require_complete.558)]
  478. // CHECK:STDOUT: %Create.type: type = fn_type @Create, @C(%V.as_type.loc20_6.2) [symbolic = %Create.type (constants.%Create.type.ff1)]
  479. // CHECK:STDOUT: %Create: @F.%Create.type (%Create.type.ff1) = struct_value () [symbolic = %Create (constants.%Create.96b)]
  480. // CHECK:STDOUT: %Create.specific_fn.loc20_7.2: <specific function> = specific_function %Create, @Create(%V.as_type.loc20_6.2) [symbolic = %Create.specific_fn.loc20_7.2 (constants.%Create.specific_fn)]
  481. // CHECK:STDOUT: %require_complete.loc20_16.1: <witness> = require_complete_type %V.as_type.loc20_6.2 [symbolic = %require_complete.loc20_16.1 (constants.%require_complete.0b5)]
  482. // CHECK:STDOUT: %ImplicitAs.type.loc20_16.2: type = facet_type <@ImplicitAs, @ImplicitAs(%V.as_type.loc20_6.2)> [symbolic = %ImplicitAs.type.loc20_16.2 (constants.%ImplicitAs.type.113)]
  483. // CHECK:STDOUT: %require_complete.loc20_16.2: <witness> = require_complete_type %ImplicitAs.type.loc20_16.2 [symbolic = %require_complete.loc20_16.2 (constants.%require_complete.9fe)]
  484. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%V.as_type.loc20_6.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.83a)]
  485. // CHECK:STDOUT: %assoc0: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.83a) = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic = %assoc0 (constants.%assoc0.5dc)]
  486. // CHECK:STDOUT:
  487. // CHECK:STDOUT: fn() {
  488. // CHECK:STDOUT: !entry:
  489. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  490. // CHECK:STDOUT: %V.ref: %type_where = name_ref V, %V.loc9_16.1 [symbolic = %V.loc9_16.2 (constants.%V)]
  491. // CHECK:STDOUT: %V.as_type.loc20_6.1: type = facet_access_type %V.ref [symbolic = %V.as_type.loc20_6.2 (constants.%V.as_type)]
  492. // CHECK:STDOUT: %.loc20_6: type = converted %V.ref, %V.as_type.loc20_6.1 [symbolic = %V.as_type.loc20_6.2 (constants.%V.as_type)]
  493. // CHECK:STDOUT: %C.loc20_6.1: type = class_type @C, @C(constants.%V.as_type) [symbolic = %C.loc20_6.2 (constants.%C.cd6)]
  494. // CHECK:STDOUT: %.loc20_7: @F.%Create.type (%Create.type.ff1) = specific_constant @C.%Create.decl, @C(constants.%V.as_type) [symbolic = %Create (constants.%Create.96b)]
  495. // CHECK:STDOUT: %Create.ref: @F.%Create.type (%Create.type.ff1) = name_ref Create, %.loc20_7 [symbolic = %Create (constants.%Create.96b)]
  496. // CHECK:STDOUT: %.loc20_16.1: %empty_struct_type = struct_literal ()
  497. // CHECK:STDOUT: %Create.specific_fn.loc20_7.1: <specific function> = specific_function %Create.ref, @Create(constants.%V.as_type) [symbolic = %Create.specific_fn.loc20_7.2 (constants.%Create.specific_fn)]
  498. // CHECK:STDOUT: %ImplicitAs.type.loc20_16.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%V.as_type)> [symbolic = %ImplicitAs.type.loc20_16.2 (constants.%ImplicitAs.type.113)]
  499. // CHECK:STDOUT: %.loc20_16.2: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.83a) = specific_constant imports.%Core.import_ref.492, @ImplicitAs(constants.%V.as_type) [symbolic = %assoc0 (constants.%assoc0.5dc)]
  500. // CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.83a) = name_ref Convert, %.loc20_16.2 [symbolic = %assoc0 (constants.%assoc0.5dc)]
  501. // CHECK:STDOUT: %.loc20_16.3: @F.%V.as_type.loc20_6.2 (%V.as_type) = converted %.loc20_16.1, <error> [concrete = <error>]
  502. // CHECK:STDOUT: %Create.call: init %empty_tuple.type = call %Create.specific_fn.loc20_7.1(<error>)
  503. // CHECK:STDOUT: return
  504. // CHECK:STDOUT: }
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT:
  507. // CHECK:STDOUT: specific @C(constants.%T) {
  508. // CHECK:STDOUT: %T.loc4_9.2 => constants.%T
  509. // CHECK:STDOUT:
  510. // CHECK:STDOUT: !definition:
  511. // CHECK:STDOUT: %Create.type => constants.%Create.type.f31
  512. // CHECK:STDOUT: %Create => constants.%Create.cc8
  513. // CHECK:STDOUT: }
  514. // CHECK:STDOUT:
  515. // CHECK:STDOUT: specific @Create(constants.%T) {
  516. // CHECK:STDOUT: %T => constants.%T
  517. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dcd0a.1
  518. // CHECK:STDOUT: }
  519. // CHECK:STDOUT:
  520. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  521. // CHECK:STDOUT: %Dest => constants.%Dest
  522. // CHECK:STDOUT: }
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.519) {
  525. // CHECK:STDOUT: %Dest => constants.%Dest
  526. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d62
  527. // CHECK:STDOUT: %Self => constants.%Self.519
  528. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  529. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.f3e
  530. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.7dcd0a.2
  531. // CHECK:STDOUT: }
  532. // CHECK:STDOUT:
  533. // CHECK:STDOUT: specific @ImplicitAs(constants.%.Self) {
  534. // CHECK:STDOUT: %Dest => constants.%.Self
  535. // CHECK:STDOUT: }
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: specific @F(constants.%U, constants.%V) {
  538. // CHECK:STDOUT: %U.loc9_6.2 => constants.%U
  539. // CHECK:STDOUT: %V.loc9_16.2 => constants.%V
  540. // CHECK:STDOUT: }
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: specific @C(constants.%V.as_type) {
  543. // CHECK:STDOUT: %T.loc4_9.2 => constants.%V.as_type
  544. // CHECK:STDOUT:
  545. // CHECK:STDOUT: !definition:
  546. // CHECK:STDOUT: %Create.type => constants.%Create.type.ff1
  547. // CHECK:STDOUT: %Create => constants.%Create.96b
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT:
  550. // CHECK:STDOUT: specific @Create(constants.%V.as_type) {
  551. // CHECK:STDOUT: %T => constants.%V.as_type
  552. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6e0
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: !definition:
  555. // CHECK:STDOUT: %require_complete => constants.%require_complete.0b5
  556. // CHECK:STDOUT: }
  557. // CHECK:STDOUT:
  558. // CHECK:STDOUT: specific @ImplicitAs(constants.%V.as_type) {
  559. // CHECK:STDOUT: %Dest => constants.%V.as_type
  560. // CHECK:STDOUT:
  561. // CHECK:STDOUT: !definition:
  562. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.113
  563. // CHECK:STDOUT: %Self => constants.%Self.8ea
  564. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.ec0
  565. // CHECK:STDOUT: %Convert => constants.%Convert.b52
  566. // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.83a
  567. // CHECK:STDOUT: %assoc0 => constants.%assoc0.5dc
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: --- include_files/convert.carbon
  571. // CHECK:STDOUT:
  572. // CHECK:STDOUT: constants {
  573. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  574. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  575. // CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete]
  576. // CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete]
  577. // CHECK:STDOUT: %As.type.8ba: type = facet_type <@As, @As(%Dest)> [symbolic]
  578. // CHECK:STDOUT: %Self.b4e: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic]
  579. // CHECK:STDOUT: %Self.as_type.7f0: type = facet_access_type %Self.b4e [symbolic]
  580. // CHECK:STDOUT: %pattern_type.947: type = pattern_type %Self.as_type.7f0 [symbolic]
  581. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %Dest [symbolic]
  582. // CHECK:STDOUT: %Convert.type.ad1: type = fn_type @Convert.1, @As(%Dest) [symbolic]
  583. // CHECK:STDOUT: %Convert.0ed: %Convert.type.ad1 = struct_value () [symbolic]
  584. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As, @As(%Dest) [symbolic]
  585. // CHECK:STDOUT: %assoc0.1d5: %As.assoc_type = assoc_entity element0, @As.%Convert.decl [symbolic]
  586. // CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete]
  587. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete]
  588. // CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  589. // CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic]
  590. // CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic]
  591. // CHECK:STDOUT: %pattern_type.a93: type = pattern_type %Self.as_type.419 [symbolic]
  592. // CHECK:STDOUT: %Convert.type.4cf: type = fn_type @Convert.2, @ImplicitAs(%Dest) [symbolic]
  593. // CHECK:STDOUT: %Convert.147: %Convert.type.4cf = struct_value () [symbolic]
  594. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  595. // CHECK:STDOUT: %assoc0.8f8: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic]
  596. // CHECK:STDOUT: }
  597. // CHECK:STDOUT:
  598. // CHECK:STDOUT: file {
  599. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  600. // CHECK:STDOUT: .As = %As.decl
  601. // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] {
  604. // CHECK:STDOUT: %Dest.patt: %pattern_type.98f = symbolic_binding_pattern Dest, 0 [concrete]
  605. // CHECK:STDOUT: } {
  606. // CHECK:STDOUT: %Dest.loc8_14.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc8_14.2 (constants.%Dest)]
  607. // CHECK:STDOUT: }
  608. // CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] {
  609. // CHECK:STDOUT: %Dest.patt: %pattern_type.98f = symbolic_binding_pattern Dest, 0 [concrete]
  610. // CHECK:STDOUT: } {
  611. // CHECK:STDOUT: %Dest.loc12_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc12_22.2 (constants.%Dest)]
  612. // CHECK:STDOUT: }
  613. // CHECK:STDOUT: }
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: generic interface @As(%Dest.loc8_14.1: type) {
  616. // CHECK:STDOUT: %Dest.loc8_14.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc8_14.2 (constants.%Dest)]
  617. // CHECK:STDOUT:
  618. // CHECK:STDOUT: !definition:
  619. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest.loc8_14.2)> [symbolic = %As.type (constants.%As.type.8ba)]
  620. // CHECK:STDOUT: %Self.2: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)]
  621. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest.loc8_14.2) [symbolic = %Convert.type (constants.%Convert.type.ad1)]
  622. // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.ad1) = struct_value () [symbolic = %Convert (constants.%Convert.0ed)]
  623. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As, @As(%Dest.loc8_14.2) [symbolic = %As.assoc_type (constants.%As.assoc_type)]
  624. // 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)]
  625. // CHECK:STDOUT:
  626. // CHECK:STDOUT: interface {
  627. // CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)]
  628. // CHECK:STDOUT: %Convert.decl: @As.%Convert.type (%Convert.type.ad1) = fn_decl @Convert.1 [symbolic = @As.%Convert (constants.%Convert.0ed)] {
  629. // CHECK:STDOUT: %self.patt: @Convert.1.%pattern_type.loc9_14 (%pattern_type.947) = binding_pattern self [concrete]
  630. // CHECK:STDOUT: %self.param_patt: @Convert.1.%pattern_type.loc9_14 (%pattern_type.947) = value_param_pattern %self.patt, call_param0 [concrete]
  631. // CHECK:STDOUT: %return.patt: @Convert.1.%pattern_type.loc9_28 (%pattern_type.7dc) = return_slot_pattern [concrete]
  632. // CHECK:STDOUT: %return.param_patt: @Convert.1.%pattern_type.loc9_28 (%pattern_type.7dc) = out_param_pattern %return.patt, call_param1 [concrete]
  633. // CHECK:STDOUT: } {
  634. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @As.%Dest.loc8_14.1 [symbolic = %Dest (constants.%Dest)]
  635. // CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = value_param call_param0
  636. // CHECK:STDOUT: %.loc9_20.1: type = splice_block %.loc9_20.3 [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type.7f0)] {
  637. // 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)]
  638. // CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.8ba) = name_ref Self, %.loc9_20.2 [symbolic = %Self (constants.%Self.b4e)]
  639. // 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)]
  640. // 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)]
  641. // CHECK:STDOUT: }
  642. // CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0) = bind_name self, %self.param
  643. // CHECK:STDOUT: %return.param: ref @Convert.1.%Dest (%Dest) = out_param call_param1
  644. // CHECK:STDOUT: %return: ref @Convert.1.%Dest (%Dest) = return_slot %return.param
  645. // CHECK:STDOUT: }
  646. // 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)]
  647. // CHECK:STDOUT:
  648. // CHECK:STDOUT: !members:
  649. // CHECK:STDOUT: .Self = %Self.1
  650. // CHECK:STDOUT: .Dest = <poisoned>
  651. // CHECK:STDOUT: .Convert = %assoc0.loc9_35.1
  652. // CHECK:STDOUT: witness = (%Convert.decl)
  653. // CHECK:STDOUT: }
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT:
  656. // CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc12_22.1: type) {
  657. // CHECK:STDOUT: %Dest.loc12_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc12_22.2 (constants.%Dest)]
  658. // CHECK:STDOUT:
  659. // CHECK:STDOUT: !definition:
  660. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc12_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  661. // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
  662. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%Dest.loc12_22.2) [symbolic = %Convert.type (constants.%Convert.type.4cf)]
  663. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.4cf) = struct_value () [symbolic = %Convert (constants.%Convert.147)]
  664. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest.loc12_22.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)]
  665. // 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)]
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: interface {
  668. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
  669. // CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.4cf) = fn_decl @Convert.2 [symbolic = @ImplicitAs.%Convert (constants.%Convert.147)] {
  670. // CHECK:STDOUT: %self.patt: @Convert.2.%pattern_type.loc14_14 (%pattern_type.a93) = binding_pattern self [concrete]
  671. // CHECK:STDOUT: %self.param_patt: @Convert.2.%pattern_type.loc14_14 (%pattern_type.a93) = value_param_pattern %self.patt, call_param0 [concrete]
  672. // CHECK:STDOUT: %return.patt: @Convert.2.%pattern_type.loc14_28 (%pattern_type.7dc) = return_slot_pattern [concrete]
  673. // CHECK:STDOUT: %return.param_patt: @Convert.2.%pattern_type.loc14_28 (%pattern_type.7dc) = out_param_pattern %return.patt, call_param1 [concrete]
  674. // CHECK:STDOUT: } {
  675. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc12_22.1 [symbolic = %Dest (constants.%Dest)]
  676. // CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param call_param0
  677. // CHECK:STDOUT: %.loc14_20.1: type = splice_block %.loc14_20.3 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] {
  678. // 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)]
  679. // CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc14_20.2 [symbolic = %Self (constants.%Self.0f3)]
  680. // 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)]
  681. // 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)]
  682. // CHECK:STDOUT: }
  683. // CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = bind_name self, %self.param
  684. // CHECK:STDOUT: %return.param: ref @Convert.2.%Dest (%Dest) = out_param call_param1
  685. // CHECK:STDOUT: %return: ref @Convert.2.%Dest (%Dest) = return_slot %return.param
  686. // CHECK:STDOUT: }
  687. // 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)]
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: !members:
  690. // CHECK:STDOUT: .Self = %Self.1
  691. // CHECK:STDOUT: .Dest = <poisoned>
  692. // CHECK:STDOUT: .Convert = %assoc0.loc14_35.1
  693. // CHECK:STDOUT: witness = (%Convert.decl)
  694. // CHECK:STDOUT: }
  695. // CHECK:STDOUT: }
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: generic fn @Convert.1(@As.%Dest.loc8_14.1: type, @As.%Self.1: @As.%As.type (%As.type.8ba)) {
  698. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  699. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.8ba)]
  700. // CHECK:STDOUT: %Self: @Convert.1.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b4e)]
  701. // 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)]
  702. // CHECK:STDOUT: %pattern_type.loc9_14: type = pattern_type %Self.as_type.loc9_20.1 [symbolic = %pattern_type.loc9_14 (constants.%pattern_type.947)]
  703. // CHECK:STDOUT: %pattern_type.loc9_28: type = pattern_type %Dest [symbolic = %pattern_type.loc9_28 (constants.%pattern_type.7dc)]
  704. // CHECK:STDOUT:
  705. // CHECK:STDOUT: fn(%self.param: @Convert.1.%Self.as_type.loc9_20.1 (%Self.as_type.7f0)) -> @Convert.1.%Dest (%Dest);
  706. // CHECK:STDOUT: }
  707. // CHECK:STDOUT:
  708. // CHECK:STDOUT: generic fn @Convert.2(@ImplicitAs.%Dest.loc12_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) {
  709. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  710. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  711. // CHECK:STDOUT: %Self: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)]
  712. // 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)]
  713. // CHECK:STDOUT: %pattern_type.loc14_14: type = pattern_type %Self.as_type.loc14_20.1 [symbolic = %pattern_type.loc14_14 (constants.%pattern_type.a93)]
  714. // CHECK:STDOUT: %pattern_type.loc14_28: type = pattern_type %Dest [symbolic = %pattern_type.loc14_28 (constants.%pattern_type.7dc)]
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: fn(%self.param: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419)) -> @Convert.2.%Dest (%Dest);
  717. // CHECK:STDOUT: }
  718. // CHECK:STDOUT:
  719. // CHECK:STDOUT: specific @As(constants.%Dest) {
  720. // CHECK:STDOUT: %Dest.loc8_14.2 => constants.%Dest
  721. // CHECK:STDOUT: }
  722. // CHECK:STDOUT:
  723. // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.b4e) {
  724. // CHECK:STDOUT: %Dest => constants.%Dest
  725. // CHECK:STDOUT: %As.type => constants.%As.type.8ba
  726. // CHECK:STDOUT: %Self => constants.%Self.b4e
  727. // CHECK:STDOUT: %Self.as_type.loc9_20.1 => constants.%Self.as_type.7f0
  728. // CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.947
  729. // CHECK:STDOUT: %pattern_type.loc9_28 => constants.%pattern_type.7dc
  730. // CHECK:STDOUT: }
  731. // CHECK:STDOUT:
  732. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  733. // CHECK:STDOUT: %Dest.loc12_22.2 => constants.%Dest
  734. // CHECK:STDOUT: }
  735. // CHECK:STDOUT:
  736. // CHECK:STDOUT: specific @Convert.2(constants.%Dest, constants.%Self.0f3) {
  737. // CHECK:STDOUT: %Dest => constants.%Dest
  738. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f
  739. // CHECK:STDOUT: %Self => constants.%Self.0f3
  740. // CHECK:STDOUT: %Self.as_type.loc14_20.1 => constants.%Self.as_type.419
  741. // CHECK:STDOUT: %pattern_type.loc14_14 => constants.%pattern_type.a93
  742. // CHECK:STDOUT: %pattern_type.loc14_28 => constants.%pattern_type.7dc
  743. // CHECK:STDOUT: }
  744. // CHECK:STDOUT: