generic.carbon 105 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/generic.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/generic.carbon
  14. // --- deduced_type.carbon
  15. library "[[@TEST_NAME]]";
  16. interface HasF {
  17. fn F[self: Self]();
  18. }
  19. impl forall [T:! type] T as HasF {
  20. fn F[self: Self]() {}
  21. }
  22. fn G(x: {}) {
  23. x.(HasF.F)();
  24. }
  25. // --- deduced_type_subst.carbon
  26. library "[[@TEST_NAME]]";
  27. interface HasF {
  28. fn F[self: Self]() -> Self;
  29. }
  30. impl forall [T:! type] T* as HasF {
  31. fn F[self: Self]() -> T* { return self; }
  32. }
  33. fn G(x: {}*) -> {}* {
  34. return x.(HasF.F)();
  35. }
  36. // --- deduced_type_argument.carbon
  37. library "[[@TEST_NAME]]";
  38. interface HasF {
  39. fn F[self: Self]();
  40. }
  41. class C(T:! type) {}
  42. impl forall [T:! type] C(T) as HasF {
  43. fn F[self: Self]() {}
  44. }
  45. fn G(x: C({})) {
  46. x.(HasF.F)();
  47. }
  48. // --- deduced_interface_argument.carbon
  49. library "[[@TEST_NAME]]";
  50. interface HasF(T:! type) {
  51. fn F[self: Self]();
  52. }
  53. impl forall [T:! type] {} as HasF(T) {
  54. fn F[self: Self]() {}
  55. }
  56. fn G(x: {}) {
  57. x.(HasF({}).F)();
  58. }
  59. // --- fail_incomplete_deduction.carbon
  60. library "[[@TEST_NAME]]";
  61. interface HasF {
  62. fn F[self: Self]();
  63. }
  64. // CHECK:STDERR: fail_incomplete_deduction.carbon:[[@LINE+4]]:13: error: `impl` with unused generic binding [ImplUnusedBinding]
  65. // CHECK:STDERR: impl forall [T:! type, U:! type] T as HasF {
  66. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  67. // CHECK:STDERR:
  68. impl forall [T:! type, U:! type] T as HasF {
  69. fn F[self: Self]() {}
  70. }
  71. fn G(x: {}) {
  72. // CHECK:STDERR: fail_incomplete_deduction.carbon:[[@LINE+4]]:3: error: cannot access member of interface `HasF` in type `{}` that does not implement that interface [MissingImplInMemberAccess]
  73. // CHECK:STDERR: x.(HasF.F)();
  74. // CHECK:STDERR: ^~~~~~~~~~
  75. // CHECK:STDERR:
  76. x.(HasF.F)();
  77. }
  78. // --- fail_inconsistent_deduction.carbon
  79. library "[[@TEST_NAME]]";
  80. interface HasF(T:! type) {
  81. fn F[self: Self]();
  82. }
  83. impl forall [T:! type] T as HasF(T) {
  84. fn F[self: Self]() {}
  85. }
  86. class A {}
  87. class B {}
  88. fn G(x: A) {
  89. // TODO: It'd be nice to include a note here saying that deduction failed because
  90. // we deduced two different values for `T`.
  91. // CHECK:STDERR: fail_inconsistent_deduction.carbon:[[@LINE+4]]:3: error: cannot access member of interface `HasF(B)` in type `A` that does not implement that interface [MissingImplInMemberAccess]
  92. // CHECK:STDERR: x.(HasF(B).F)();
  93. // CHECK:STDERR: ^~~~~~~~~~~~~
  94. // CHECK:STDERR:
  95. x.(HasF(B).F)();
  96. }
  97. // CHECK:STDOUT: --- deduced_type.carbon
  98. // CHECK:STDOUT:
  99. // CHECK:STDOUT: constants {
  100. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  101. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  102. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  103. // CHECK:STDOUT: %pattern_type.85b: type = pattern_type %Self.as_type [symbolic]
  104. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete]
  105. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  106. // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete]
  107. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete]
  108. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, @HasF.%HasF.F.decl [concrete]
  109. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  110. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  111. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  112. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  113. // CHECK:STDOUT: %HasF.impl_witness.ebd: <witness> = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T) [symbolic]
  114. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  115. // CHECK:STDOUT: %T.as.HasF.impl.F.type.a16: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T) [symbolic]
  116. // CHECK:STDOUT: %T.as.HasF.impl.F.66e: %T.as.HasF.impl.F.type.a16 = struct_value () [symbolic]
  117. // CHECK:STDOUT: %HasF.facet.804: %HasF.type = facet_value %T, (%HasF.impl_witness.ebd) [symbolic]
  118. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
  119. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  120. // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
  121. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  122. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  123. // CHECK:STDOUT: %HasF.impl_witness.401: <witness> = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%empty_struct_type) [concrete]
  124. // CHECK:STDOUT: %T.as.HasF.impl.F.type.4de: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%empty_struct_type) [concrete]
  125. // CHECK:STDOUT: %T.as.HasF.impl.F.00f: %T.as.HasF.impl.F.type.4de = struct_value () [concrete]
  126. // CHECK:STDOUT: %HasF.facet.4bd: %HasF.type = facet_value %empty_struct_type, (%HasF.impl_witness.401) [concrete]
  127. // CHECK:STDOUT: %.adb: type = fn_type_with_self_type %HasF.F.type, %HasF.facet.4bd [concrete]
  128. // CHECK:STDOUT: %T.as.HasF.impl.F.specific_fn: <specific function> = specific_function %T.as.HasF.impl.F.00f, @T.as.HasF.impl.F(%empty_struct_type) [concrete]
  129. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  130. // CHECK:STDOUT: }
  131. // CHECK:STDOUT:
  132. // CHECK:STDOUT: imports {
  133. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  134. // CHECK:STDOUT: import Core//prelude
  135. // CHECK:STDOUT: import Core//prelude/...
  136. // CHECK:STDOUT: }
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT:
  139. // CHECK:STDOUT: file {
  140. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  141. // CHECK:STDOUT: .Core = imports.%Core
  142. // CHECK:STDOUT: .HasF = %HasF.decl
  143. // CHECK:STDOUT: .G = %G.decl
  144. // CHECK:STDOUT: }
  145. // CHECK:STDOUT: %Core.import = import Core
  146. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [concrete = constants.%HasF.type] {} {}
  147. // CHECK:STDOUT: impl_decl @T.as.HasF.impl [concrete] {
  148. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  149. // CHECK:STDOUT: } {
  150. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T)]
  151. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type]
  152. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  153. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)]
  154. // CHECK:STDOUT: }
  155. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@T.as.HasF.impl.%T.as.HasF.impl.F.decl), @T.as.HasF.impl [concrete]
  156. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T) [symbolic = @T.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.ebd)]
  157. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  158. // CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
  159. // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete]
  160. // CHECK:STDOUT: } {
  161. // CHECK:STDOUT: %x.param: %empty_struct_type = value_param call_param0
  162. // CHECK:STDOUT: %.loc12_10.1: type = splice_block %.loc12_10.3 [concrete = constants.%empty_struct_type] {
  163. // CHECK:STDOUT: %.loc12_10.2: %empty_struct_type = struct_literal ()
  164. // CHECK:STDOUT: %.loc12_10.3: type = converted %.loc12_10.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT: }
  169. // CHECK:STDOUT:
  170. // CHECK:STDOUT: interface @HasF {
  171. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  172. // CHECK:STDOUT: %HasF.F.decl: %HasF.F.type = fn_decl @HasF.F [concrete = constants.%HasF.F] {
  173. // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.85b) = binding_pattern self [concrete]
  174. // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = value_param_pattern %self.patt, call_param0 [concrete]
  175. // CHECK:STDOUT: } {
  176. // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0
  177. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] {
  178. // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)]
  179. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  180. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.F.decl [concrete = constants.%assoc0]
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: !members:
  187. // CHECK:STDOUT: .Self = %Self
  188. // CHECK:STDOUT: .F = %assoc0
  189. // CHECK:STDOUT: witness = (%HasF.F.decl)
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT:
  192. // CHECK:STDOUT: generic impl @T.as.HasF.impl(%T.loc8_14.2: type) {
  193. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)]
  194. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.ebd)]
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: !definition:
  197. // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %T.as.HasF.impl.F.type (constants.%T.as.HasF.impl.F.type.a16)]
  198. // CHECK:STDOUT: %T.as.HasF.impl.F: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type.a16) = struct_value () [symbolic = %T.as.HasF.impl.F (constants.%T.as.HasF.impl.F.66e)]
  199. // CHECK:STDOUT:
  200. // CHECK:STDOUT: impl: %T.ref as %HasF.ref {
  201. // CHECK:STDOUT: %T.as.HasF.impl.F.decl: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type.a16) = fn_decl @T.as.HasF.impl.F [symbolic = @T.as.HasF.impl.%T.as.HasF.impl.F (constants.%T.as.HasF.impl.F.66e)] {
  202. // CHECK:STDOUT: %self.patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = binding_pattern self [concrete]
  203. // CHECK:STDOUT: %self.param_patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = value_param_pattern %self.patt, call_param0 [concrete]
  204. // CHECK:STDOUT: } {
  205. // CHECK:STDOUT: %self.param: @T.as.HasF.impl.F.%T (%T) = value_param call_param0
  206. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @T.as.HasF.impl.%T.ref [symbolic = %T (constants.%T)]
  207. // CHECK:STDOUT: %self: @T.as.HasF.impl.F.%T (%T) = bind_name self, %self.param
  208. // CHECK:STDOUT: }
  209. // CHECK:STDOUT:
  210. // CHECK:STDOUT: !members:
  211. // CHECK:STDOUT: .F = %T.as.HasF.impl.F.decl
  212. // CHECK:STDOUT: witness = file.%HasF.impl_witness
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT: }
  215. // CHECK:STDOUT:
  216. // CHECK:STDOUT: generic fn @HasF.F(@HasF.%Self: %HasF.type) {
  217. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  218. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  219. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.85b)]
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type));
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: generic fn @T.as.HasF.impl.F(@T.as.HasF.impl.%T.loc8_14.2: type) {
  225. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  226. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: !definition:
  229. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete)]
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: fn(%self.param: @T.as.HasF.impl.F.%T (%T)) {
  232. // CHECK:STDOUT: !entry:
  233. // CHECK:STDOUT: return
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: fn @G(%x.param: %empty_struct_type) {
  238. // CHECK:STDOUT: !entry:
  239. // CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x
  240. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type]
  241. // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0]
  242. // CHECK:STDOUT: %impl.elem0: %.adb = impl_witness_access constants.%HasF.impl_witness.401, element0 [concrete = constants.%T.as.HasF.impl.F.00f]
  243. // CHECK:STDOUT: %bound_method.loc13_4: <bound method> = bound_method %x.ref, %impl.elem0
  244. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @T.as.HasF.impl.F(constants.%empty_struct_type) [concrete = constants.%T.as.HasF.impl.F.specific_fn]
  245. // CHECK:STDOUT: %bound_method.loc13_14: <bound method> = bound_method %x.ref, %specific_fn
  246. // CHECK:STDOUT: %T.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method.loc13_14(%x.ref)
  247. // CHECK:STDOUT: return
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: specific @HasF.F(constants.%Self) {
  251. // CHECK:STDOUT: %Self => constants.%Self
  252. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type
  253. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.85b
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%T) {
  257. // CHECK:STDOUT: %T.loc8_14.1 => constants.%T
  258. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.ebd
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: !definition:
  261. // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type.a16
  262. // CHECK:STDOUT: %T.as.HasF.impl.F => constants.%T.as.HasF.impl.F.66e
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: specific @T.as.HasF.impl.F(constants.%T) {
  266. // CHECK:STDOUT: %T => constants.%T
  267. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: specific @HasF.F(constants.%HasF.facet.804) {
  271. // CHECK:STDOUT: %Self => constants.%HasF.facet.804
  272. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T
  273. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%empty_struct_type) {
  277. // CHECK:STDOUT: %T.loc8_14.1 => constants.%empty_struct_type
  278. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.401
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: !definition:
  281. // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type.4de
  282. // CHECK:STDOUT: %T.as.HasF.impl.F => constants.%T.as.HasF.impl.F.00f
  283. // CHECK:STDOUT: }
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: specific @T.as.HasF.impl.F(constants.%empty_struct_type) {
  286. // CHECK:STDOUT: %T => constants.%empty_struct_type
  287. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a96
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: !definition:
  290. // CHECK:STDOUT: %require_complete => constants.%complete_type
  291. // CHECK:STDOUT: }
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: --- deduced_type_subst.carbon
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: constants {
  296. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  297. // CHECK:STDOUT: %Self.cb9: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  298. // CHECK:STDOUT: %Self.as_type.45c: type = facet_access_type %Self.cb9 [symbolic]
  299. // CHECK:STDOUT: %pattern_type.85b: type = pattern_type %Self.as_type.45c [symbolic]
  300. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete]
  301. // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete]
  302. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete]
  303. // CHECK:STDOUT: %assoc0.97a: %HasF.assoc_type = assoc_entity element0, @HasF.%HasF.F.decl [concrete]
  304. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  305. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  306. // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
  307. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  308. // CHECK:STDOUT: %ptr.79f: type = ptr_type %T.8b3 [symbolic]
  309. // CHECK:STDOUT: %HasF.impl_witness.0e0: <witness> = impl_witness file.%HasF.impl_witness_table, @ptr.as.HasF.impl(%T.8b3) [symbolic]
  310. // CHECK:STDOUT: %pattern_type.afe: type = pattern_type %ptr.79f [symbolic]
  311. // CHECK:STDOUT: %ptr.as.HasF.impl.F.type.aaa: type = fn_type @ptr.as.HasF.impl.F, @ptr.as.HasF.impl(%T.8b3) [symbolic]
  312. // CHECK:STDOUT: %ptr.as.HasF.impl.F.b35: %ptr.as.HasF.impl.F.type.aaa = struct_value () [symbolic]
  313. // CHECK:STDOUT: %HasF.facet.040: %HasF.type = facet_value %ptr.79f, (%HasF.impl_witness.0e0) [symbolic]
  314. // CHECK:STDOUT: %require_complete.6e5: <witness> = require_complete_type %ptr.79f [symbolic]
  315. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  316. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  317. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.31f: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic]
  318. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.8a8: %ptr.as.Copy.impl.Op.type.31f = struct_value () [symbolic]
  319. // CHECK:STDOUT: %Copy.lookup_impl_witness.cb2: <witness> = lookup_impl_witness %ptr.79f, @Copy [symbolic]
  320. // CHECK:STDOUT: %Copy.facet.2d1: %Copy.type = facet_value %ptr.79f, (%Copy.lookup_impl_witness.cb2) [symbolic]
  321. // CHECK:STDOUT: %.1cc: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.2d1 [symbolic]
  322. // CHECK:STDOUT: %impl.elem0.751: %.1cc = impl_witness_access %Copy.lookup_impl_witness.cb2, element0 [symbolic]
  323. // CHECK:STDOUT: %specific_impl_fn.f44: <specific function> = specific_impl_function %impl.elem0.751, @Copy.Op(%Copy.facet.2d1) [symbolic]
  324. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  325. // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete]
  326. // CHECK:STDOUT: %pattern_type.1cc: type = pattern_type %ptr.c28 [concrete]
  327. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  328. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  329. // CHECK:STDOUT: %HasF.impl_witness.589: <witness> = impl_witness file.%HasF.impl_witness_table, @ptr.as.HasF.impl(%empty_struct_type) [concrete]
  330. // CHECK:STDOUT: %ptr.as.HasF.impl.F.type.fcd: type = fn_type @ptr.as.HasF.impl.F, @ptr.as.HasF.impl(%empty_struct_type) [concrete]
  331. // CHECK:STDOUT: %ptr.as.HasF.impl.F.407: %ptr.as.HasF.impl.F.type.fcd = struct_value () [concrete]
  332. // CHECK:STDOUT: %HasF.facet.157: %HasF.type = facet_value %ptr.c28, (%HasF.impl_witness.589) [concrete]
  333. // CHECK:STDOUT: %.2b4: type = fn_type_with_self_type %HasF.F.type, %HasF.facet.157 [concrete]
  334. // CHECK:STDOUT: %ptr.as.HasF.impl.F.specific_fn: <specific function> = specific_function %ptr.as.HasF.impl.F.407, @ptr.as.HasF.impl.F(%empty_struct_type) [concrete]
  335. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %ptr.c28 [concrete]
  336. // CHECK:STDOUT: %Copy.impl_witness.d27: <witness> = impl_witness imports.%Copy.impl_witness_table.53c, @ptr.as.Copy.impl(%empty_struct_type) [concrete]
  337. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.800: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%empty_struct_type) [concrete]
  338. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.e07: %ptr.as.Copy.impl.Op.type.800 = struct_value () [concrete]
  339. // CHECK:STDOUT: %Copy.facet.0b7: %Copy.type = facet_value %ptr.c28, (%Copy.impl_witness.d27) [concrete]
  340. // CHECK:STDOUT: %.edf: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.0b7 [concrete]
  341. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %ptr.as.Copy.impl.Op.e07, @ptr.as.Copy.impl.Op(%empty_struct_type) [concrete]
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: imports {
  345. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  346. // CHECK:STDOUT: .Copy = %Core.Copy
  347. // CHECK:STDOUT: import Core//prelude
  348. // CHECK:STDOUT: import Core//prelude/...
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  351. // CHECK:STDOUT: %Core.import_ref.0e4: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.31f) = import_ref Core//prelude/parts/copy, loc36_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.8a8)]
  352. // CHECK:STDOUT: %Copy.impl_witness_table.53c = impl_witness_table (%Core.import_ref.0e4), @ptr.as.Copy.impl [concrete]
  353. // CHECK:STDOUT: }
  354. // CHECK:STDOUT:
  355. // CHECK:STDOUT: file {
  356. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  357. // CHECK:STDOUT: .Core = imports.%Core
  358. // CHECK:STDOUT: .HasF = %HasF.decl
  359. // CHECK:STDOUT: .G = %G.decl
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT: %Core.import = import Core
  362. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [concrete = constants.%HasF.type] {} {}
  363. // CHECK:STDOUT: impl_decl @ptr.as.HasF.impl [concrete] {
  364. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  365. // CHECK:STDOUT: } {
  366. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T.8b3)]
  367. // CHECK:STDOUT: %ptr.loc8_25.2: type = ptr_type %T.ref [symbolic = %ptr.loc8_25.1 (constants.%ptr.79f)]
  368. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type]
  369. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  370. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T.8b3)]
  371. // CHECK:STDOUT: }
  372. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@ptr.as.HasF.impl.%ptr.as.HasF.impl.F.decl), @ptr.as.HasF.impl [concrete]
  373. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness %HasF.impl_witness_table, @ptr.as.HasF.impl(constants.%T.8b3) [symbolic = @ptr.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.0e0)]
  374. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  375. // CHECK:STDOUT: %x.patt: %pattern_type.1cc = binding_pattern x [concrete]
  376. // CHECK:STDOUT: %x.param_patt: %pattern_type.1cc = value_param_pattern %x.patt, call_param0 [concrete]
  377. // CHECK:STDOUT: %return.patt: %pattern_type.1cc = return_slot_pattern [concrete]
  378. // CHECK:STDOUT: %return.param_patt: %pattern_type.1cc = out_param_pattern %return.patt, call_param1 [concrete]
  379. // CHECK:STDOUT: } {
  380. // CHECK:STDOUT: %.loc12_18: %empty_struct_type = struct_literal ()
  381. // CHECK:STDOUT: %.loc12_19: type = converted %.loc12_18, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  382. // CHECK:STDOUT: %ptr.loc12_19: type = ptr_type %.loc12_19 [concrete = constants.%ptr.c28]
  383. // CHECK:STDOUT: %x.param: %ptr.c28 = value_param call_param0
  384. // CHECK:STDOUT: %.loc12_11.1: type = splice_block %ptr.loc12_11 [concrete = constants.%ptr.c28] {
  385. // CHECK:STDOUT: %.loc12_10: %empty_struct_type = struct_literal ()
  386. // CHECK:STDOUT: %.loc12_11.2: type = converted %.loc12_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  387. // CHECK:STDOUT: %ptr.loc12_11: type = ptr_type %.loc12_11.2 [concrete = constants.%ptr.c28]
  388. // CHECK:STDOUT: }
  389. // CHECK:STDOUT: %x: %ptr.c28 = bind_name x, %x.param
  390. // CHECK:STDOUT: %return.param: ref %ptr.c28 = out_param call_param1
  391. // CHECK:STDOUT: %return: ref %ptr.c28 = return_slot %return.param
  392. // CHECK:STDOUT: }
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT:
  395. // CHECK:STDOUT: interface @HasF {
  396. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.cb9]
  397. // CHECK:STDOUT: %HasF.F.decl: %HasF.F.type = fn_decl @HasF.F [concrete = constants.%HasF.F] {
  398. // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.85b) = binding_pattern self [concrete]
  399. // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = value_param_pattern %self.patt, call_param0 [concrete]
  400. // CHECK:STDOUT: %return.patt: @HasF.F.%pattern_type (%pattern_type.85b) = return_slot_pattern [concrete]
  401. // CHECK:STDOUT: %return.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = out_param_pattern %return.patt, call_param1 [concrete]
  402. // CHECK:STDOUT: } {
  403. // CHECK:STDOUT: %Self.ref.loc5_25: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.cb9)]
  404. // CHECK:STDOUT: %Self.as_type.loc5_25: type = facet_access_type %Self.ref.loc5_25 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)]
  405. // CHECK:STDOUT: %.loc5_25: type = converted %Self.ref.loc5_25, %Self.as_type.loc5_25 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)]
  406. // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = value_param call_param0
  407. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] {
  408. // CHECK:STDOUT: %Self.ref.loc5_14: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.cb9)]
  409. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref.loc5_14 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)]
  410. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref.loc5_14, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)]
  411. // CHECK:STDOUT: }
  412. // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = bind_name self, %self.param
  413. // CHECK:STDOUT: %return.param: ref @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = out_param call_param1
  414. // CHECK:STDOUT: %return: ref @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = return_slot %return.param
  415. // CHECK:STDOUT: }
  416. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.F.decl [concrete = constants.%assoc0.97a]
  417. // CHECK:STDOUT:
  418. // CHECK:STDOUT: !members:
  419. // CHECK:STDOUT: .Self = %Self
  420. // CHECK:STDOUT: .F = %assoc0
  421. // CHECK:STDOUT: witness = (%HasF.F.decl)
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT:
  424. // CHECK:STDOUT: generic impl @ptr.as.HasF.impl(%T.loc8_14.2: type) {
  425. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T.8b3)]
  426. // CHECK:STDOUT: %ptr.loc8_25.1: type = ptr_type %T.loc8_14.1 [symbolic = %ptr.loc8_25.1 (constants.%ptr.79f)]
  427. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table, @ptr.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.0e0)]
  428. // CHECK:STDOUT:
  429. // CHECK:STDOUT: !definition:
  430. // CHECK:STDOUT: %ptr.as.HasF.impl.F.type: type = fn_type @ptr.as.HasF.impl.F, @ptr.as.HasF.impl(%T.loc8_14.1) [symbolic = %ptr.as.HasF.impl.F.type (constants.%ptr.as.HasF.impl.F.type.aaa)]
  431. // CHECK:STDOUT: %ptr.as.HasF.impl.F: @ptr.as.HasF.impl.%ptr.as.HasF.impl.F.type (%ptr.as.HasF.impl.F.type.aaa) = struct_value () [symbolic = %ptr.as.HasF.impl.F (constants.%ptr.as.HasF.impl.F.b35)]
  432. // CHECK:STDOUT:
  433. // CHECK:STDOUT: impl: %ptr.loc8_25.2 as %HasF.ref {
  434. // CHECK:STDOUT: %ptr.as.HasF.impl.F.decl: @ptr.as.HasF.impl.%ptr.as.HasF.impl.F.type (%ptr.as.HasF.impl.F.type.aaa) = fn_decl @ptr.as.HasF.impl.F [symbolic = @ptr.as.HasF.impl.%ptr.as.HasF.impl.F (constants.%ptr.as.HasF.impl.F.b35)] {
  435. // CHECK:STDOUT: %self.patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.afe) = binding_pattern self [concrete]
  436. // CHECK:STDOUT: %self.param_patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.afe) = value_param_pattern %self.patt, call_param0 [concrete]
  437. // CHECK:STDOUT: %return.patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.afe) = return_slot_pattern [concrete]
  438. // CHECK:STDOUT: %return.param_patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.afe) = out_param_pattern %return.patt, call_param1 [concrete]
  439. // CHECK:STDOUT: } {
  440. // CHECK:STDOUT: %T.ref: type = name_ref T, @ptr.as.HasF.impl.%T.loc8_14.2 [symbolic = %T (constants.%T.8b3)]
  441. // CHECK:STDOUT: %ptr.loc9_26: type = ptr_type %T.ref [symbolic = %ptr.loc9_14 (constants.%ptr.79f)]
  442. // CHECK:STDOUT: %self.param: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = value_param call_param0
  443. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @ptr.as.HasF.impl.%ptr.loc8_25.2 [symbolic = %ptr.loc9_14 (constants.%ptr.79f)]
  444. // CHECK:STDOUT: %self: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = bind_name self, %self.param
  445. // CHECK:STDOUT: %return.param: ref @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = out_param call_param1
  446. // CHECK:STDOUT: %return: ref @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = return_slot %return.param
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT:
  449. // CHECK:STDOUT: !members:
  450. // CHECK:STDOUT: .T = <poisoned>
  451. // CHECK:STDOUT: .F = %ptr.as.HasF.impl.F.decl
  452. // CHECK:STDOUT: witness = file.%HasF.impl_witness
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT: }
  455. // CHECK:STDOUT:
  456. // CHECK:STDOUT: generic fn @HasF.F(@HasF.%Self: %HasF.type) {
  457. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.cb9)]
  458. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)]
  459. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.85b)]
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c)) -> @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c);
  462. // CHECK:STDOUT: }
  463. // CHECK:STDOUT:
  464. // CHECK:STDOUT: generic fn @ptr.as.HasF.impl.F(@ptr.as.HasF.impl.%T.loc8_14.2: type) {
  465. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
  466. // CHECK:STDOUT: %ptr.loc9_14: type = ptr_type %T [symbolic = %ptr.loc9_14 (constants.%ptr.79f)]
  467. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc9_14 [symbolic = %pattern_type (constants.%pattern_type.afe)]
  468. // CHECK:STDOUT:
  469. // CHECK:STDOUT: !definition:
  470. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc9_14 [symbolic = %require_complete (constants.%require_complete.6e5)]
  471. // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %ptr.loc9_14, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.cb2)]
  472. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc9_14, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.2d1)]
  473. // CHECK:STDOUT: %.loc9_37.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc9_37.2 (constants.%.1cc)]
  474. // CHECK:STDOUT: %impl.elem0.loc9_37.2: @ptr.as.HasF.impl.F.%.loc9_37.2 (%.1cc) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.751)]
  475. // CHECK:STDOUT: %specific_impl_fn.loc9_37.2: <specific function> = specific_impl_function %impl.elem0.loc9_37.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc9_37.2 (constants.%specific_impl_fn.f44)]
  476. // CHECK:STDOUT:
  477. // CHECK:STDOUT: fn(%self.param: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f)) -> @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) {
  478. // CHECK:STDOUT: !entry:
  479. // CHECK:STDOUT: %self.ref: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = name_ref self, %self
  480. // CHECK:STDOUT: %impl.elem0.loc9_37.1: @ptr.as.HasF.impl.F.%.loc9_37.2 (%.1cc) = impl_witness_access constants.%Copy.lookup_impl_witness.cb2, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.751)]
  481. // CHECK:STDOUT: %bound_method.loc9_37.1: <bound method> = bound_method %self.ref, %impl.elem0.loc9_37.1
  482. // CHECK:STDOUT: %specific_impl_fn.loc9_37.1: <specific function> = specific_impl_function %impl.elem0.loc9_37.1, @Copy.Op(constants.%Copy.facet.2d1) [symbolic = %specific_impl_fn.loc9_37.2 (constants.%specific_impl_fn.f44)]
  483. // CHECK:STDOUT: %bound_method.loc9_37.2: <bound method> = bound_method %self.ref, %specific_impl_fn.loc9_37.1
  484. // CHECK:STDOUT: %.loc9_37.1: init @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = call %bound_method.loc9_37.2(%self.ref)
  485. // CHECK:STDOUT: return %.loc9_37.1 to %return
  486. // CHECK:STDOUT: }
  487. // CHECK:STDOUT: }
  488. // CHECK:STDOUT:
  489. // CHECK:STDOUT: fn @G(%x.param: %ptr.c28) -> %ptr.c28 {
  490. // CHECK:STDOUT: !entry:
  491. // CHECK:STDOUT: %x.ref: %ptr.c28 = name_ref x, %x
  492. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type]
  493. // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0.97a]
  494. // CHECK:STDOUT: %impl.elem0: %.2b4 = impl_witness_access constants.%HasF.impl_witness.589, element0 [concrete = constants.%ptr.as.HasF.impl.F.407]
  495. // CHECK:STDOUT: %bound_method.loc13_11: <bound method> = bound_method %x.ref, %impl.elem0
  496. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @ptr.as.HasF.impl.F(constants.%empty_struct_type) [concrete = constants.%ptr.as.HasF.impl.F.specific_fn]
  497. // CHECK:STDOUT: %bound_method.loc13_21: <bound method> = bound_method %x.ref, %specific_fn
  498. // CHECK:STDOUT: %ptr.as.HasF.impl.F.call: init %ptr.c28 = call %bound_method.loc13_21(%x.ref)
  499. // CHECK:STDOUT: return %ptr.as.HasF.impl.F.call to %return
  500. // CHECK:STDOUT: }
  501. // CHECK:STDOUT:
  502. // CHECK:STDOUT: specific @HasF.F(constants.%Self.cb9) {
  503. // CHECK:STDOUT: %Self => constants.%Self.cb9
  504. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.45c
  505. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.85b
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT:
  508. // CHECK:STDOUT: specific @ptr.as.HasF.impl(constants.%T.8b3) {
  509. // CHECK:STDOUT: %T.loc8_14.1 => constants.%T.8b3
  510. // CHECK:STDOUT: %ptr.loc8_25.1 => constants.%ptr.79f
  511. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.0e0
  512. // CHECK:STDOUT:
  513. // CHECK:STDOUT: !definition:
  514. // CHECK:STDOUT: %ptr.as.HasF.impl.F.type => constants.%ptr.as.HasF.impl.F.type.aaa
  515. // CHECK:STDOUT: %ptr.as.HasF.impl.F => constants.%ptr.as.HasF.impl.F.b35
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT:
  518. // CHECK:STDOUT: specific @ptr.as.HasF.impl.F(constants.%T.8b3) {
  519. // CHECK:STDOUT: %T => constants.%T.8b3
  520. // CHECK:STDOUT: %ptr.loc9_14 => constants.%ptr.79f
  521. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe
  522. // CHECK:STDOUT: }
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: specific @HasF.F(constants.%HasF.facet.040) {
  525. // CHECK:STDOUT: %Self => constants.%HasF.facet.040
  526. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%ptr.79f
  527. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: specific @ptr.as.HasF.impl(constants.%empty_struct_type) {
  531. // CHECK:STDOUT: %T.loc8_14.1 => constants.%empty_struct_type
  532. // CHECK:STDOUT: %ptr.loc8_25.1 => constants.%ptr.c28
  533. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.589
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: !definition:
  536. // CHECK:STDOUT: %ptr.as.HasF.impl.F.type => constants.%ptr.as.HasF.impl.F.type.fcd
  537. // CHECK:STDOUT: %ptr.as.HasF.impl.F => constants.%ptr.as.HasF.impl.F.407
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT:
  540. // CHECK:STDOUT: specific @ptr.as.HasF.impl.F(constants.%empty_struct_type) {
  541. // CHECK:STDOUT: %T => constants.%empty_struct_type
  542. // CHECK:STDOUT: %ptr.loc9_14 => constants.%ptr.c28
  543. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1cc
  544. // CHECK:STDOUT:
  545. // CHECK:STDOUT: !definition:
  546. // CHECK:STDOUT: %require_complete => constants.%complete_type
  547. // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.d27
  548. // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.0b7
  549. // CHECK:STDOUT: %.loc9_37.2 => constants.%.edf
  550. // CHECK:STDOUT: %impl.elem0.loc9_37.2 => constants.%ptr.as.Copy.impl.Op.e07
  551. // CHECK:STDOUT: %specific_impl_fn.loc9_37.2 => constants.%ptr.as.Copy.impl.Op.specific_fn
  552. // CHECK:STDOUT: }
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: --- deduced_type_argument.carbon
  555. // CHECK:STDOUT:
  556. // CHECK:STDOUT: constants {
  557. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  558. // CHECK:STDOUT: %Self.cb9: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  559. // CHECK:STDOUT: %Self.as_type.45c: type = facet_access_type %Self.cb9 [symbolic]
  560. // CHECK:STDOUT: %pattern_type.85b: type = pattern_type %Self.as_type.45c [symbolic]
  561. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete]
  562. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  563. // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete]
  564. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete]
  565. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, @HasF.%HasF.F.decl [concrete]
  566. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  567. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  568. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  569. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  570. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  571. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  572. // CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic]
  573. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  574. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  575. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic]
  576. // CHECK:STDOUT: %ptr.7d2: type = ptr_type %C.f2e [symbolic]
  577. // CHECK:STDOUT: %pattern_type.1d2: type = pattern_type %ptr.7d2 [symbolic]
  578. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%T) [symbolic]
  579. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [symbolic]
  580. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  581. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  582. // CHECK:STDOUT: %HasF.impl_witness.e3c: <witness> = impl_witness file.%HasF.impl_witness_table, @C.as.HasF.impl(%T) [symbolic]
  583. // CHECK:STDOUT: %pattern_type.e5e: type = pattern_type %C.f2e [symbolic]
  584. // CHECK:STDOUT: %C.as.HasF.impl.F.type.3fd: type = fn_type @C.as.HasF.impl.F, @C.as.HasF.impl(%T) [symbolic]
  585. // CHECK:STDOUT: %C.as.HasF.impl.F.e8c: %C.as.HasF.impl.F.type.3fd = struct_value () [symbolic]
  586. // CHECK:STDOUT: %HasF.facet.469: %HasF.type = facet_value %C.f2e, (%HasF.impl_witness.e3c) [symbolic]
  587. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.f2e [symbolic]
  588. // CHECK:STDOUT: %C.7a7: type = class_type @C, @C(%empty_struct_type) [concrete]
  589. // CHECK:STDOUT: %pattern_type.99a: type = pattern_type %C.7a7 [concrete]
  590. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  591. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  592. // CHECK:STDOUT: %HasF.impl_witness.148: <witness> = impl_witness file.%HasF.impl_witness_table, @C.as.HasF.impl(%empty_struct_type) [concrete]
  593. // CHECK:STDOUT: %C.as.HasF.impl.F.type.6e7: type = fn_type @C.as.HasF.impl.F, @C.as.HasF.impl(%empty_struct_type) [concrete]
  594. // CHECK:STDOUT: %C.as.HasF.impl.F.410: %C.as.HasF.impl.F.type.6e7 = struct_value () [concrete]
  595. // CHECK:STDOUT: %HasF.facet.6ff: %HasF.type = facet_value %C.7a7, (%HasF.impl_witness.148) [concrete]
  596. // CHECK:STDOUT: %.b29: type = fn_type_with_self_type %HasF.F.type, %HasF.facet.6ff [concrete]
  597. // CHECK:STDOUT: %C.as.HasF.impl.F.specific_fn: <specific function> = specific_function %C.as.HasF.impl.F.410, @C.as.HasF.impl.F(%empty_struct_type) [concrete]
  598. // CHECK:STDOUT: }
  599. // CHECK:STDOUT:
  600. // CHECK:STDOUT: imports {
  601. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  602. // CHECK:STDOUT: .Destroy = %Core.Destroy
  603. // CHECK:STDOUT: import Core//prelude
  604. // CHECK:STDOUT: import Core//prelude/...
  605. // CHECK:STDOUT: }
  606. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  607. // CHECK:STDOUT: }
  608. // CHECK:STDOUT:
  609. // CHECK:STDOUT: file {
  610. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  611. // CHECK:STDOUT: .Core = imports.%Core
  612. // CHECK:STDOUT: .HasF = %HasF.decl
  613. // CHECK:STDOUT: .C = %C.decl
  614. // CHECK:STDOUT: .G = %G.decl
  615. // CHECK:STDOUT: }
  616. // CHECK:STDOUT: %Core.import = import Core
  617. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [concrete = constants.%HasF.type] {} {}
  618. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  619. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  620. // CHECK:STDOUT: } {
  621. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  622. // CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.1 (constants.%T)]
  623. // CHECK:STDOUT: }
  624. // CHECK:STDOUT: impl_decl @C.as.HasF.impl [concrete] {
  625. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  626. // CHECK:STDOUT: } {
  627. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  628. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc10_14.2 [symbolic = %T.loc10_14.1 (constants.%T)]
  629. // CHECK:STDOUT: %C.loc10_27.2: type = class_type @C, @C(constants.%T) [symbolic = %C.loc10_27.1 (constants.%C.f2e)]
  630. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type]
  631. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  632. // CHECK:STDOUT: %T.loc10_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.1 (constants.%T)]
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@C.as.HasF.impl.%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete]
  635. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness %HasF.impl_witness_table, @C.as.HasF.impl(constants.%T) [symbolic = @C.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.e3c)]
  636. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  637. // CHECK:STDOUT: %x.patt: %pattern_type.99a = binding_pattern x [concrete]
  638. // CHECK:STDOUT: %x.param_patt: %pattern_type.99a = value_param_pattern %x.patt, call_param0 [concrete]
  639. // CHECK:STDOUT: } {
  640. // CHECK:STDOUT: %x.param: %C.7a7 = value_param call_param0
  641. // CHECK:STDOUT: %.loc14_13.1: type = splice_block %C [concrete = constants.%C.7a7] {
  642. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  643. // CHECK:STDOUT: %.loc14_12: %empty_struct_type = struct_literal ()
  644. // CHECK:STDOUT: %.loc14_13.2: type = converted %.loc14_12, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  645. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type) [concrete = constants.%C.7a7]
  646. // CHECK:STDOUT: }
  647. // CHECK:STDOUT: %x: %C.7a7 = bind_name x, %x.param
  648. // CHECK:STDOUT: }
  649. // CHECK:STDOUT: }
  650. // CHECK:STDOUT:
  651. // CHECK:STDOUT: interface @HasF {
  652. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.cb9]
  653. // CHECK:STDOUT: %HasF.F.decl: %HasF.F.type = fn_decl @HasF.F [concrete = constants.%HasF.F] {
  654. // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.85b) = binding_pattern self [concrete]
  655. // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = value_param_pattern %self.patt, call_param0 [concrete]
  656. // CHECK:STDOUT: } {
  657. // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = value_param call_param0
  658. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] {
  659. // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.cb9)]
  660. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)]
  661. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)]
  662. // CHECK:STDOUT: }
  663. // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = bind_name self, %self.param
  664. // CHECK:STDOUT: }
  665. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.F.decl [concrete = constants.%assoc0]
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: !members:
  668. // CHECK:STDOUT: .Self = %Self
  669. // CHECK:STDOUT: .F = %assoc0
  670. // CHECK:STDOUT: witness = (%HasF.F.decl)
  671. // CHECK:STDOUT: }
  672. // CHECK:STDOUT:
  673. // CHECK:STDOUT: generic impl @C.as.Destroy.impl(@C.%T.loc8_9.2: type) {
  674. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  675. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)]
  676. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness)]
  677. // CHECK:STDOUT:
  678. // CHECK:STDOUT: !definition:
  679. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%T) [symbolic = %C.as.Destroy.impl.Op.type (constants.%C.as.Destroy.impl.Op.type)]
  680. // CHECK:STDOUT: %C.as.Destroy.impl.Op: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = struct_value () [symbolic = %C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)]
  681. // CHECK:STDOUT:
  682. // CHECK:STDOUT: impl: @C.%Self.ref as constants.%Destroy.type {
  683. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = fn_decl @C.as.Destroy.impl.Op [symbolic = @C.as.Destroy.impl.%C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)] {
  684. // CHECK:STDOUT: %self.patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.1d2) = binding_pattern self [concrete]
  685. // CHECK:STDOUT: %self.param_patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.1d2) = value_param_pattern %self.patt, call_param0 [concrete]
  686. // CHECK:STDOUT: %.loc8_19.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  687. // CHECK:STDOUT: } {
  688. // CHECK:STDOUT: %self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2) = value_param call_param0
  689. // CHECK:STDOUT: %.loc8_19.2: type = splice_block %Self.ref [symbolic = %C (constants.%C.f2e)] {
  690. // CHECK:STDOUT: %.loc8_19.3: type = specific_constant constants.%C.f2e, @C(constants.%T) [symbolic = %C (constants.%C.f2e)]
  691. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc8_19.3 [symbolic = %C (constants.%C.f2e)]
  692. // CHECK:STDOUT: }
  693. // CHECK:STDOUT: %self: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2) = bind_name self, %self.param
  694. // CHECK:STDOUT: }
  695. // CHECK:STDOUT:
  696. // CHECK:STDOUT: !members:
  697. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  698. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  699. // CHECK:STDOUT: }
  700. // CHECK:STDOUT: }
  701. // CHECK:STDOUT:
  702. // CHECK:STDOUT: generic impl @C.as.HasF.impl(%T.loc10_14.2: type) {
  703. // CHECK:STDOUT: %T.loc10_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.1 (constants.%T)]
  704. // CHECK:STDOUT: %C.loc10_27.1: type = class_type @C, @C(%T.loc10_14.1) [symbolic = %C.loc10_27.1 (constants.%C.f2e)]
  705. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table, @C.as.HasF.impl(%T.loc10_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.e3c)]
  706. // CHECK:STDOUT:
  707. // CHECK:STDOUT: !definition:
  708. // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F, @C.as.HasF.impl(%T.loc10_14.1) [symbolic = %C.as.HasF.impl.F.type (constants.%C.as.HasF.impl.F.type.3fd)]
  709. // CHECK:STDOUT: %C.as.HasF.impl.F: @C.as.HasF.impl.%C.as.HasF.impl.F.type (%C.as.HasF.impl.F.type.3fd) = struct_value () [symbolic = %C.as.HasF.impl.F (constants.%C.as.HasF.impl.F.e8c)]
  710. // CHECK:STDOUT:
  711. // CHECK:STDOUT: impl: %C.loc10_27.2 as %HasF.ref {
  712. // CHECK:STDOUT: %C.as.HasF.impl.F.decl: @C.as.HasF.impl.%C.as.HasF.impl.F.type (%C.as.HasF.impl.F.type.3fd) = fn_decl @C.as.HasF.impl.F [symbolic = @C.as.HasF.impl.%C.as.HasF.impl.F (constants.%C.as.HasF.impl.F.e8c)] {
  713. // CHECK:STDOUT: %self.patt: @C.as.HasF.impl.F.%pattern_type (%pattern_type.e5e) = binding_pattern self [concrete]
  714. // CHECK:STDOUT: %self.param_patt: @C.as.HasF.impl.F.%pattern_type (%pattern_type.e5e) = value_param_pattern %self.patt, call_param0 [concrete]
  715. // CHECK:STDOUT: } {
  716. // CHECK:STDOUT: %self.param: @C.as.HasF.impl.F.%C (%C.f2e) = value_param call_param0
  717. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.HasF.impl.%C.loc10_27.2 [symbolic = %C (constants.%C.f2e)]
  718. // CHECK:STDOUT: %self: @C.as.HasF.impl.F.%C (%C.f2e) = bind_name self, %self.param
  719. // CHECK:STDOUT: }
  720. // CHECK:STDOUT:
  721. // CHECK:STDOUT: !members:
  722. // CHECK:STDOUT: .F = %C.as.HasF.impl.F.decl
  723. // CHECK:STDOUT: witness = file.%HasF.impl_witness
  724. // CHECK:STDOUT: }
  725. // CHECK:STDOUT: }
  726. // CHECK:STDOUT:
  727. // CHECK:STDOUT: generic class @C(%T.loc8_9.2: type) {
  728. // CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.1 (constants.%T)]
  729. // CHECK:STDOUT:
  730. // CHECK:STDOUT: !definition:
  731. // CHECK:STDOUT:
  732. // CHECK:STDOUT: class {
  733. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C.f2e [symbolic = @C.as.Destroy.impl.%C (constants.%C.f2e)]
  734. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  735. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  736. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table, @C.as.Destroy.impl(constants.%T) [symbolic = @C.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness)]
  737. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  738. // CHECK:STDOUT: complete_type_witness = %complete_type
  739. // CHECK:STDOUT:
  740. // CHECK:STDOUT: !members:
  741. // CHECK:STDOUT: .Self = constants.%C.f2e
  742. // CHECK:STDOUT: }
  743. // CHECK:STDOUT: }
  744. // CHECK:STDOUT:
  745. // CHECK:STDOUT: generic fn @HasF.F(@HasF.%Self: %HasF.type) {
  746. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.cb9)]
  747. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)]
  748. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.85b)]
  749. // CHECK:STDOUT:
  750. // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c));
  751. // CHECK:STDOUT: }
  752. // CHECK:STDOUT:
  753. // CHECK:STDOUT: generic fn @C.as.Destroy.impl.Op(@C.%T.loc8_9.2: type) {
  754. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  755. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)]
  756. // CHECK:STDOUT: %ptr: type = ptr_type %C [symbolic = %ptr (constants.%ptr.7d2)]
  757. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.1d2)]
  758. // CHECK:STDOUT:
  759. // CHECK:STDOUT: !definition:
  760. // CHECK:STDOUT:
  761. // CHECK:STDOUT: fn(%self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2)) = "no_op";
  762. // CHECK:STDOUT: }
  763. // CHECK:STDOUT:
  764. // CHECK:STDOUT: generic fn @C.as.HasF.impl.F(@C.as.HasF.impl.%T.loc10_14.2: type) {
  765. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  766. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)]
  767. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [symbolic = %pattern_type (constants.%pattern_type.e5e)]
  768. // CHECK:STDOUT:
  769. // CHECK:STDOUT: !definition:
  770. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C [symbolic = %require_complete (constants.%require_complete)]
  771. // CHECK:STDOUT:
  772. // CHECK:STDOUT: fn(%self.param: @C.as.HasF.impl.F.%C (%C.f2e)) {
  773. // CHECK:STDOUT: !entry:
  774. // CHECK:STDOUT: return
  775. // CHECK:STDOUT: }
  776. // CHECK:STDOUT: }
  777. // CHECK:STDOUT:
  778. // CHECK:STDOUT: fn @G(%x.param: %C.7a7) {
  779. // CHECK:STDOUT: !entry:
  780. // CHECK:STDOUT: %x.ref: %C.7a7 = name_ref x, %x
  781. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type]
  782. // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0]
  783. // CHECK:STDOUT: %impl.elem0: %.b29 = impl_witness_access constants.%HasF.impl_witness.148, element0 [concrete = constants.%C.as.HasF.impl.F.410]
  784. // CHECK:STDOUT: %bound_method.loc15_4: <bound method> = bound_method %x.ref, %impl.elem0
  785. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @C.as.HasF.impl.F(constants.%empty_struct_type) [concrete = constants.%C.as.HasF.impl.F.specific_fn]
  786. // CHECK:STDOUT: %bound_method.loc15_14: <bound method> = bound_method %x.ref, %specific_fn
  787. // CHECK:STDOUT: %C.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method.loc15_14(%x.ref)
  788. // CHECK:STDOUT: return
  789. // CHECK:STDOUT: }
  790. // CHECK:STDOUT:
  791. // CHECK:STDOUT: specific @HasF.F(constants.%Self.cb9) {
  792. // CHECK:STDOUT: %Self => constants.%Self.cb9
  793. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.45c
  794. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.85b
  795. // CHECK:STDOUT: }
  796. // CHECK:STDOUT:
  797. // CHECK:STDOUT: specific @C(constants.%T) {
  798. // CHECK:STDOUT: %T.loc8_9.1 => constants.%T
  799. // CHECK:STDOUT:
  800. // CHECK:STDOUT: !definition:
  801. // CHECK:STDOUT: }
  802. // CHECK:STDOUT:
  803. // CHECK:STDOUT: specific @C.as.Destroy.impl(constants.%T) {
  804. // CHECK:STDOUT: %T => constants.%T
  805. // CHECK:STDOUT: %C => constants.%C.f2e
  806. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness
  807. // CHECK:STDOUT: }
  808. // CHECK:STDOUT:
  809. // CHECK:STDOUT: specific @C.as.Destroy.impl.Op(constants.%T) {
  810. // CHECK:STDOUT: %T => constants.%T
  811. // CHECK:STDOUT: %C => constants.%C.f2e
  812. // CHECK:STDOUT: %ptr => constants.%ptr.7d2
  813. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1d2
  814. // CHECK:STDOUT: }
  815. // CHECK:STDOUT:
  816. // CHECK:STDOUT: specific @C.as.HasF.impl(constants.%T) {
  817. // CHECK:STDOUT: %T.loc10_14.1 => constants.%T
  818. // CHECK:STDOUT: %C.loc10_27.1 => constants.%C.f2e
  819. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.e3c
  820. // CHECK:STDOUT:
  821. // CHECK:STDOUT: !definition:
  822. // CHECK:STDOUT: %C.as.HasF.impl.F.type => constants.%C.as.HasF.impl.F.type.3fd
  823. // CHECK:STDOUT: %C.as.HasF.impl.F => constants.%C.as.HasF.impl.F.e8c
  824. // CHECK:STDOUT: }
  825. // CHECK:STDOUT:
  826. // CHECK:STDOUT: specific @C.as.HasF.impl.F(constants.%T) {
  827. // CHECK:STDOUT: %T => constants.%T
  828. // CHECK:STDOUT: %C => constants.%C.f2e
  829. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e5e
  830. // CHECK:STDOUT: }
  831. // CHECK:STDOUT:
  832. // CHECK:STDOUT: specific @HasF.F(constants.%HasF.facet.469) {
  833. // CHECK:STDOUT: %Self => constants.%HasF.facet.469
  834. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%C.f2e
  835. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e5e
  836. // CHECK:STDOUT: }
  837. // CHECK:STDOUT:
  838. // CHECK:STDOUT: specific @C(constants.%empty_struct_type) {
  839. // CHECK:STDOUT: %T.loc8_9.1 => constants.%empty_struct_type
  840. // CHECK:STDOUT:
  841. // CHECK:STDOUT: !definition:
  842. // CHECK:STDOUT: }
  843. // CHECK:STDOUT:
  844. // CHECK:STDOUT: specific @C.as.HasF.impl(constants.%empty_struct_type) {
  845. // CHECK:STDOUT: %T.loc10_14.1 => constants.%empty_struct_type
  846. // CHECK:STDOUT: %C.loc10_27.1 => constants.%C.7a7
  847. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.148
  848. // CHECK:STDOUT:
  849. // CHECK:STDOUT: !definition:
  850. // CHECK:STDOUT: %C.as.HasF.impl.F.type => constants.%C.as.HasF.impl.F.type.6e7
  851. // CHECK:STDOUT: %C.as.HasF.impl.F => constants.%C.as.HasF.impl.F.410
  852. // CHECK:STDOUT: }
  853. // CHECK:STDOUT:
  854. // CHECK:STDOUT: specific @C.as.HasF.impl.F(constants.%empty_struct_type) {
  855. // CHECK:STDOUT: %T => constants.%empty_struct_type
  856. // CHECK:STDOUT: %C => constants.%C.7a7
  857. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.99a
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: !definition:
  860. // CHECK:STDOUT: %require_complete => constants.%complete_type
  861. // CHECK:STDOUT: }
  862. // CHECK:STDOUT:
  863. // CHECK:STDOUT: --- deduced_interface_argument.carbon
  864. // CHECK:STDOUT:
  865. // CHECK:STDOUT: constants {
  866. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  867. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  868. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  869. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  870. // CHECK:STDOUT: %HasF.type.fe3: type = generic_interface_type @HasF [concrete]
  871. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  872. // CHECK:STDOUT: %HasF.generic: %HasF.type.fe3 = struct_value () [concrete]
  873. // CHECK:STDOUT: %HasF.type.9f4: type = facet_type <@HasF, @HasF(%T)> [symbolic]
  874. // CHECK:STDOUT: %Self.0b6: %HasF.type.9f4 = bind_symbolic_name Self, 1 [symbolic]
  875. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.0b6 [symbolic]
  876. // CHECK:STDOUT: %pattern_type.f60: type = pattern_type %Self.as_type [symbolic]
  877. // CHECK:STDOUT: %HasF.F.type.46c: type = fn_type @HasF.F, @HasF(%T) [symbolic]
  878. // CHECK:STDOUT: %HasF.F.823: %HasF.F.type.46c = struct_value () [symbolic]
  879. // CHECK:STDOUT: %HasF.assoc_type.dd8: type = assoc_entity_type @HasF, @HasF(%T) [symbolic]
  880. // CHECK:STDOUT: %assoc0.d31: %HasF.assoc_type.dd8 = assoc_entity element0, @HasF.%HasF.F.decl [symbolic]
  881. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  882. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %HasF.type.9f4 [symbolic]
  883. // CHECK:STDOUT: %HasF.impl_witness.b0b: <witness> = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%T) [symbolic]
  884. // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
  885. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type.364: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%T) [symbolic]
  886. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.6bf: %empty_struct_type.as.HasF.impl.F.type.364 = struct_value () [symbolic]
  887. // CHECK:STDOUT: %HasF.facet.e17: %HasF.type.9f4 = facet_value %empty_struct_type, (%HasF.impl_witness.b0b) [symbolic]
  888. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  889. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  890. // CHECK:STDOUT: %HasF.type.48b: type = facet_type <@HasF, @HasF(%empty_struct_type)> [concrete]
  891. // CHECK:STDOUT: %Self.f65: %HasF.type.48b = bind_symbolic_name Self, 1 [symbolic]
  892. // CHECK:STDOUT: %HasF.F.type.b0b: type = fn_type @HasF.F, @HasF(%empty_struct_type) [concrete]
  893. // CHECK:STDOUT: %HasF.F.418: %HasF.F.type.b0b = struct_value () [concrete]
  894. // CHECK:STDOUT: %HasF.assoc_type.9e4: type = assoc_entity_type @HasF, @HasF(%empty_struct_type) [concrete]
  895. // CHECK:STDOUT: %assoc0.f76: %HasF.assoc_type.9e4 = assoc_entity element0, @HasF.%HasF.F.decl [concrete]
  896. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %HasF.type.48b [concrete]
  897. // CHECK:STDOUT: %HasF.impl_witness.430: <witness> = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%empty_struct_type) [concrete]
  898. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type.9bd: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%empty_struct_type) [concrete]
  899. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.8ab: %empty_struct_type.as.HasF.impl.F.type.9bd = struct_value () [concrete]
  900. // CHECK:STDOUT: %HasF.facet.b88: %HasF.type.48b = facet_value %empty_struct_type, (%HasF.impl_witness.430) [concrete]
  901. // CHECK:STDOUT: %.0b8: type = fn_type_with_self_type %HasF.F.type.b0b, %HasF.facet.b88 [concrete]
  902. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.specific_fn: <specific function> = specific_function %empty_struct_type.as.HasF.impl.F.8ab, @empty_struct_type.as.HasF.impl.F(%empty_struct_type) [concrete]
  903. // CHECK:STDOUT: }
  904. // CHECK:STDOUT:
  905. // CHECK:STDOUT: imports {
  906. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  907. // CHECK:STDOUT: import Core//prelude
  908. // CHECK:STDOUT: import Core//prelude/...
  909. // CHECK:STDOUT: }
  910. // CHECK:STDOUT: }
  911. // CHECK:STDOUT:
  912. // CHECK:STDOUT: file {
  913. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  914. // CHECK:STDOUT: .Core = imports.%Core
  915. // CHECK:STDOUT: .HasF = %HasF.decl
  916. // CHECK:STDOUT: .G = %G.decl
  917. // CHECK:STDOUT: }
  918. // CHECK:STDOUT: %Core.import = import Core
  919. // CHECK:STDOUT: %HasF.decl: %HasF.type.fe3 = interface_decl @HasF [concrete = constants.%HasF.generic] {
  920. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  921. // CHECK:STDOUT: } {
  922. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  923. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  924. // CHECK:STDOUT: }
  925. // CHECK:STDOUT: impl_decl @empty_struct_type.as.HasF.impl [concrete] {
  926. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  927. // CHECK:STDOUT: } {
  928. // CHECK:STDOUT: %.loc8_25.1: %empty_struct_type = struct_literal ()
  929. // CHECK:STDOUT: %.loc8_25.2: type = converted %.loc8_25.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  930. // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic]
  931. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T)]
  932. // CHECK:STDOUT: %HasF.type.loc8_36.2: type = facet_type <@HasF, @HasF(constants.%T)> [symbolic = %HasF.type.loc8_36.1 (constants.%HasF.type.9f4)]
  933. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  934. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)]
  935. // CHECK:STDOUT: }
  936. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F.decl), @empty_struct_type.as.HasF.impl [concrete]
  937. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness %HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(constants.%T) [symbolic = @empty_struct_type.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.b0b)]
  938. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  939. // CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
  940. // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete]
  941. // CHECK:STDOUT: } {
  942. // CHECK:STDOUT: %x.param: %empty_struct_type = value_param call_param0
  943. // CHECK:STDOUT: %.loc12_10.1: type = splice_block %.loc12_10.3 [concrete = constants.%empty_struct_type] {
  944. // CHECK:STDOUT: %.loc12_10.2: %empty_struct_type = struct_literal ()
  945. // CHECK:STDOUT: %.loc12_10.3: type = converted %.loc12_10.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  946. // CHECK:STDOUT: }
  947. // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param
  948. // CHECK:STDOUT: }
  949. // CHECK:STDOUT: }
  950. // CHECK:STDOUT:
  951. // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.2: type) {
  952. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  953. // CHECK:STDOUT:
  954. // CHECK:STDOUT: !definition:
  955. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T.loc4_16.1)> [symbolic = %HasF.type (constants.%HasF.type.9f4)]
  956. // CHECK:STDOUT: %Self.2: @HasF.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0b6)]
  957. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F, @HasF(%T.loc4_16.1) [symbolic = %HasF.F.type (constants.%HasF.F.type.46c)]
  958. // CHECK:STDOUT: %HasF.F: @HasF.%HasF.F.type (%HasF.F.type.46c) = struct_value () [symbolic = %HasF.F (constants.%HasF.F.823)]
  959. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF, @HasF(%T.loc4_16.1) [symbolic = %HasF.assoc_type (constants.%HasF.assoc_type.dd8)]
  960. // CHECK:STDOUT: %assoc0.loc5_21.2: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %HasF.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.d31)]
  961. // CHECK:STDOUT:
  962. // CHECK:STDOUT: interface {
  963. // CHECK:STDOUT: %Self.1: @HasF.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0b6)]
  964. // CHECK:STDOUT: %HasF.F.decl: @HasF.%HasF.F.type (%HasF.F.type.46c) = fn_decl @HasF.F [symbolic = @HasF.%HasF.F (constants.%HasF.F.823)] {
  965. // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.f60) = binding_pattern self [concrete]
  966. // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.f60) = value_param_pattern %self.patt, call_param0 [concrete]
  967. // CHECK:STDOUT: } {
  968. // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0
  969. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.3 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] {
  970. // CHECK:STDOUT: %.loc5_14.2: @HasF.F.%HasF.type (%HasF.type.9f4) = specific_constant @HasF.%Self.1, @HasF(constants.%T) [symbolic = %Self (constants.%Self.0b6)]
  971. // CHECK:STDOUT: %Self.ref: @HasF.F.%HasF.type (%HasF.type.9f4) = name_ref Self, %.loc5_14.2 [symbolic = %Self (constants.%Self.0b6)]
  972. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  973. // CHECK:STDOUT: %.loc5_14.3: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  974. // CHECK:STDOUT: }
  975. // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param
  976. // CHECK:STDOUT: }
  977. // CHECK:STDOUT: %assoc0.loc5_21.1: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %HasF.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.d31)]
  978. // CHECK:STDOUT:
  979. // CHECK:STDOUT: !members:
  980. // CHECK:STDOUT: .Self = %Self.1
  981. // CHECK:STDOUT: .F = %assoc0.loc5_21.1
  982. // CHECK:STDOUT: witness = (%HasF.F.decl)
  983. // CHECK:STDOUT: }
  984. // CHECK:STDOUT: }
  985. // CHECK:STDOUT:
  986. // CHECK:STDOUT: generic impl @empty_struct_type.as.HasF.impl(%T.loc8_14.2: type) {
  987. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)]
  988. // CHECK:STDOUT: %HasF.type.loc8_36.1: type = facet_type <@HasF, @HasF(%T.loc8_14.1)> [symbolic = %HasF.type.loc8_36.1 (constants.%HasF.type.9f4)]
  989. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %HasF.type.loc8_36.1 [symbolic = %require_complete (constants.%require_complete)]
  990. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.b0b)]
  991. // CHECK:STDOUT:
  992. // CHECK:STDOUT: !definition:
  993. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%T.loc8_14.1) [symbolic = %empty_struct_type.as.HasF.impl.F.type (constants.%empty_struct_type.as.HasF.impl.F.type.364)]
  994. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F: @empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F.type (%empty_struct_type.as.HasF.impl.F.type.364) = struct_value () [symbolic = %empty_struct_type.as.HasF.impl.F (constants.%empty_struct_type.as.HasF.impl.F.6bf)]
  995. // CHECK:STDOUT:
  996. // CHECK:STDOUT: impl: %.loc8_25.2 as %HasF.type.loc8_36.2 {
  997. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.decl: @empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F.type (%empty_struct_type.as.HasF.impl.F.type.364) = fn_decl @empty_struct_type.as.HasF.impl.F [symbolic = @empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F (constants.%empty_struct_type.as.HasF.impl.F.6bf)] {
  998. // CHECK:STDOUT: %self.patt: %pattern_type.a96 = binding_pattern self [concrete]
  999. // CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = value_param_pattern %self.patt, call_param0 [concrete]
  1000. // CHECK:STDOUT: } {
  1001. // CHECK:STDOUT: %self.param: %empty_struct_type = value_param call_param0
  1002. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_struct_type.as.HasF.impl.%.loc8_25.2 [concrete = constants.%empty_struct_type]
  1003. // CHECK:STDOUT: %self: %empty_struct_type = bind_name self, %self.param
  1004. // CHECK:STDOUT: }
  1005. // CHECK:STDOUT:
  1006. // CHECK:STDOUT: !members:
  1007. // CHECK:STDOUT: .F = %empty_struct_type.as.HasF.impl.F.decl
  1008. // CHECK:STDOUT: witness = file.%HasF.impl_witness
  1009. // CHECK:STDOUT: }
  1010. // CHECK:STDOUT: }
  1011. // CHECK:STDOUT:
  1012. // CHECK:STDOUT: generic fn @HasF.F(@HasF.%T.loc4_16.2: type, @HasF.%Self.1: @HasF.%HasF.type (%HasF.type.9f4)) {
  1013. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1014. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T)> [symbolic = %HasF.type (constants.%HasF.type.9f4)]
  1015. // CHECK:STDOUT: %Self: @HasF.F.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0b6)]
  1016. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  1017. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.f60)]
  1018. // CHECK:STDOUT:
  1019. // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type));
  1020. // CHECK:STDOUT: }
  1021. // CHECK:STDOUT:
  1022. // CHECK:STDOUT: generic fn @empty_struct_type.as.HasF.impl.F(@empty_struct_type.as.HasF.impl.%T.loc8_14.2: type) {
  1023. // CHECK:STDOUT: !definition:
  1024. // CHECK:STDOUT:
  1025. // CHECK:STDOUT: fn(%self.param: %empty_struct_type) {
  1026. // CHECK:STDOUT: !entry:
  1027. // CHECK:STDOUT: return
  1028. // CHECK:STDOUT: }
  1029. // CHECK:STDOUT: }
  1030. // CHECK:STDOUT:
  1031. // CHECK:STDOUT: fn @G(%x.param: %empty_struct_type) {
  1032. // CHECK:STDOUT: !entry:
  1033. // CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x
  1034. // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic]
  1035. // CHECK:STDOUT: %.loc13_12: %empty_struct_type = struct_literal ()
  1036. // CHECK:STDOUT: %.loc13_13: type = converted %.loc13_12, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1037. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%empty_struct_type)> [concrete = constants.%HasF.type.48b]
  1038. // CHECK:STDOUT: %.loc13_14: %HasF.assoc_type.9e4 = specific_constant @HasF.%assoc0.loc5_21.1, @HasF(constants.%empty_struct_type) [concrete = constants.%assoc0.f76]
  1039. // CHECK:STDOUT: %F.ref: %HasF.assoc_type.9e4 = name_ref F, %.loc13_14 [concrete = constants.%assoc0.f76]
  1040. // CHECK:STDOUT: %impl.elem0: %.0b8 = impl_witness_access constants.%HasF.impl_witness.430, element0 [concrete = constants.%empty_struct_type.as.HasF.impl.F.8ab]
  1041. // CHECK:STDOUT: %bound_method.loc13_4: <bound method> = bound_method %x.ref, %impl.elem0
  1042. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @empty_struct_type.as.HasF.impl.F(constants.%empty_struct_type) [concrete = constants.%empty_struct_type.as.HasF.impl.F.specific_fn]
  1043. // CHECK:STDOUT: %bound_method.loc13_18: <bound method> = bound_method %x.ref, %specific_fn
  1044. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method.loc13_18(%x.ref)
  1045. // CHECK:STDOUT: return
  1046. // CHECK:STDOUT: }
  1047. // CHECK:STDOUT:
  1048. // CHECK:STDOUT: specific @HasF(constants.%T) {
  1049. // CHECK:STDOUT: %T.loc4_16.1 => constants.%T
  1050. // CHECK:STDOUT:
  1051. // CHECK:STDOUT: !definition:
  1052. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4
  1053. // CHECK:STDOUT: %Self.2 => constants.%Self.0b6
  1054. // CHECK:STDOUT: %HasF.F.type => constants.%HasF.F.type.46c
  1055. // CHECK:STDOUT: %HasF.F => constants.%HasF.F.823
  1056. // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.dd8
  1057. // CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.d31
  1058. // CHECK:STDOUT: }
  1059. // CHECK:STDOUT:
  1060. // CHECK:STDOUT: specific @HasF.F(constants.%T, constants.%Self.0b6) {
  1061. // CHECK:STDOUT: %T => constants.%T
  1062. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4
  1063. // CHECK:STDOUT: %Self => constants.%Self.0b6
  1064. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type
  1065. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f60
  1066. // CHECK:STDOUT: }
  1067. // CHECK:STDOUT:
  1068. // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl(constants.%T) {
  1069. // CHECK:STDOUT: %T.loc8_14.1 => constants.%T
  1070. // CHECK:STDOUT: %HasF.type.loc8_36.1 => constants.%HasF.type.9f4
  1071. // CHECK:STDOUT: %require_complete => constants.%require_complete
  1072. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.b0b
  1073. // CHECK:STDOUT:
  1074. // CHECK:STDOUT: !definition:
  1075. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type => constants.%empty_struct_type.as.HasF.impl.F.type.364
  1076. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F => constants.%empty_struct_type.as.HasF.impl.F.6bf
  1077. // CHECK:STDOUT: }
  1078. // CHECK:STDOUT:
  1079. // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl.F(constants.%T) {}
  1080. // CHECK:STDOUT:
  1081. // CHECK:STDOUT: specific @HasF.F(constants.%T, constants.%HasF.facet.e17) {
  1082. // CHECK:STDOUT: %T => constants.%T
  1083. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4
  1084. // CHECK:STDOUT: %Self => constants.%HasF.facet.e17
  1085. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_struct_type
  1086. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a96
  1087. // CHECK:STDOUT: }
  1088. // CHECK:STDOUT:
  1089. // CHECK:STDOUT: specific @HasF(constants.%empty_struct_type) {
  1090. // CHECK:STDOUT: %T.loc4_16.1 => constants.%empty_struct_type
  1091. // CHECK:STDOUT:
  1092. // CHECK:STDOUT: !definition:
  1093. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.48b
  1094. // CHECK:STDOUT: %Self.2 => constants.%Self.f65
  1095. // CHECK:STDOUT: %HasF.F.type => constants.%HasF.F.type.b0b
  1096. // CHECK:STDOUT: %HasF.F => constants.%HasF.F.418
  1097. // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.9e4
  1098. // CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.f76
  1099. // CHECK:STDOUT: }
  1100. // CHECK:STDOUT:
  1101. // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl(constants.%empty_struct_type) {
  1102. // CHECK:STDOUT: %T.loc8_14.1 => constants.%empty_struct_type
  1103. // CHECK:STDOUT: %HasF.type.loc8_36.1 => constants.%HasF.type.48b
  1104. // CHECK:STDOUT: %require_complete => constants.%complete_type
  1105. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.430
  1106. // CHECK:STDOUT:
  1107. // CHECK:STDOUT: !definition:
  1108. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type => constants.%empty_struct_type.as.HasF.impl.F.type.9bd
  1109. // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F => constants.%empty_struct_type.as.HasF.impl.F.8ab
  1110. // CHECK:STDOUT: }
  1111. // CHECK:STDOUT:
  1112. // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl.F(constants.%empty_struct_type) {
  1113. // CHECK:STDOUT: !definition:
  1114. // CHECK:STDOUT: }
  1115. // CHECK:STDOUT:
  1116. // CHECK:STDOUT: --- fail_incomplete_deduction.carbon
  1117. // CHECK:STDOUT:
  1118. // CHECK:STDOUT: constants {
  1119. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  1120. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  1121. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1122. // CHECK:STDOUT: %pattern_type.85b: type = pattern_type %Self.as_type [symbolic]
  1123. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete]
  1124. // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete]
  1125. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete]
  1126. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, @HasF.%HasF.F.decl [concrete]
  1127. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1128. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  1129. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1130. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1131. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic]
  1132. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T, %U) [symbolic]
  1133. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1134. // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T, %U) [symbolic]
  1135. // CHECK:STDOUT: %T.as.HasF.impl.F: %T.as.HasF.impl.F.type = struct_value () [symbolic]
  1136. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
  1137. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1138. // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
  1139. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1140. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1141. // CHECK:STDOUT: }
  1142. // CHECK:STDOUT:
  1143. // CHECK:STDOUT: imports {
  1144. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1145. // CHECK:STDOUT: import Core//prelude
  1146. // CHECK:STDOUT: import Core//prelude/...
  1147. // CHECK:STDOUT: }
  1148. // CHECK:STDOUT: }
  1149. // CHECK:STDOUT:
  1150. // CHECK:STDOUT: file {
  1151. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1152. // CHECK:STDOUT: .Core = imports.%Core
  1153. // CHECK:STDOUT: .HasF = %HasF.decl
  1154. // CHECK:STDOUT: .G = %G.decl
  1155. // CHECK:STDOUT: }
  1156. // CHECK:STDOUT: %Core.import = import Core
  1157. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [concrete = constants.%HasF.type] {} {}
  1158. // CHECK:STDOUT: impl_decl @T.as.HasF.impl [concrete] {
  1159. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1160. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 1 [concrete]
  1161. // CHECK:STDOUT: } {
  1162. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_14.2 [symbolic = %T.loc12_14.1 (constants.%T)]
  1163. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type]
  1164. // CHECK:STDOUT: %.Self.1: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1165. // CHECK:STDOUT: %T.loc12_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.1 (constants.%T)]
  1166. // CHECK:STDOUT: %.Self.2: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1167. // CHECK:STDOUT: %U.loc12_24.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc12_24.1 (constants.%U)]
  1168. // CHECK:STDOUT: }
  1169. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (<error>), @T.as.HasF.impl [concrete]
  1170. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T, constants.%U) [symbolic = @T.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness)]
  1171. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  1172. // CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
  1173. // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete]
  1174. // CHECK:STDOUT: } {
  1175. // CHECK:STDOUT: %x.param: %empty_struct_type = value_param call_param0
  1176. // CHECK:STDOUT: %.loc16_10.1: type = splice_block %.loc16_10.3 [concrete = constants.%empty_struct_type] {
  1177. // CHECK:STDOUT: %.loc16_10.2: %empty_struct_type = struct_literal ()
  1178. // CHECK:STDOUT: %.loc16_10.3: type = converted %.loc16_10.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1179. // CHECK:STDOUT: }
  1180. // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param
  1181. // CHECK:STDOUT: }
  1182. // CHECK:STDOUT: }
  1183. // CHECK:STDOUT:
  1184. // CHECK:STDOUT: interface @HasF {
  1185. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1186. // CHECK:STDOUT: %HasF.F.decl: %HasF.F.type = fn_decl @HasF.F [concrete = constants.%HasF.F] {
  1187. // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.85b) = binding_pattern self [concrete]
  1188. // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = value_param_pattern %self.patt, call_param0 [concrete]
  1189. // CHECK:STDOUT: } {
  1190. // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0
  1191. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] {
  1192. // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)]
  1193. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  1194. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  1195. // CHECK:STDOUT: }
  1196. // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param
  1197. // CHECK:STDOUT: }
  1198. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.F.decl [concrete = constants.%assoc0]
  1199. // CHECK:STDOUT:
  1200. // CHECK:STDOUT: !members:
  1201. // CHECK:STDOUT: .Self = %Self
  1202. // CHECK:STDOUT: .F = %assoc0
  1203. // CHECK:STDOUT: witness = (%HasF.F.decl)
  1204. // CHECK:STDOUT: }
  1205. // CHECK:STDOUT:
  1206. // CHECK:STDOUT: generic impl @T.as.HasF.impl(%T.loc12_14.2: type, %U.loc12_24.2: type) {
  1207. // CHECK:STDOUT: %T.loc12_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.1 (constants.%T)]
  1208. // CHECK:STDOUT: %U.loc12_24.1: type = bind_symbolic_name U, 1 [symbolic = %U.loc12_24.1 (constants.%U)]
  1209. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T.loc12_14.1, %U.loc12_24.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness)]
  1210. // CHECK:STDOUT:
  1211. // CHECK:STDOUT: !definition:
  1212. // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T.loc12_14.1, %U.loc12_24.1) [symbolic = %T.as.HasF.impl.F.type (constants.%T.as.HasF.impl.F.type)]
  1213. // CHECK:STDOUT: %T.as.HasF.impl.F: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type) = struct_value () [symbolic = %T.as.HasF.impl.F (constants.%T.as.HasF.impl.F)]
  1214. // CHECK:STDOUT:
  1215. // CHECK:STDOUT: impl: %T.ref as %HasF.ref {
  1216. // CHECK:STDOUT: %T.as.HasF.impl.F.decl: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type) = fn_decl @T.as.HasF.impl.F [symbolic = @T.as.HasF.impl.%T.as.HasF.impl.F (constants.%T.as.HasF.impl.F)] {
  1217. // CHECK:STDOUT: %self.patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = binding_pattern self [concrete]
  1218. // CHECK:STDOUT: %self.param_patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = value_param_pattern %self.patt, call_param0 [concrete]
  1219. // CHECK:STDOUT: } {
  1220. // CHECK:STDOUT: %self.param: @T.as.HasF.impl.F.%T (%T) = value_param call_param0
  1221. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @T.as.HasF.impl.%T.ref [symbolic = %T (constants.%T)]
  1222. // CHECK:STDOUT: %self: @T.as.HasF.impl.F.%T (%T) = bind_name self, %self.param
  1223. // CHECK:STDOUT: }
  1224. // CHECK:STDOUT:
  1225. // CHECK:STDOUT: !members:
  1226. // CHECK:STDOUT: .F = %T.as.HasF.impl.F.decl
  1227. // CHECK:STDOUT: witness = <error>
  1228. // CHECK:STDOUT: }
  1229. // CHECK:STDOUT: }
  1230. // CHECK:STDOUT:
  1231. // CHECK:STDOUT: generic fn @HasF.F(@HasF.%Self: %HasF.type) {
  1232. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1233. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  1234. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.85b)]
  1235. // CHECK:STDOUT:
  1236. // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type));
  1237. // CHECK:STDOUT: }
  1238. // CHECK:STDOUT:
  1239. // CHECK:STDOUT: generic fn @T.as.HasF.impl.F(@T.as.HasF.impl.%T.loc12_14.2: type, @T.as.HasF.impl.%U.loc12_24.2: type) {
  1240. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1241. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1242. // CHECK:STDOUT:
  1243. // CHECK:STDOUT: !definition:
  1244. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete)]
  1245. // CHECK:STDOUT:
  1246. // CHECK:STDOUT: fn(%self.param: @T.as.HasF.impl.F.%T (%T)) {
  1247. // CHECK:STDOUT: !entry:
  1248. // CHECK:STDOUT: return
  1249. // CHECK:STDOUT: }
  1250. // CHECK:STDOUT: }
  1251. // CHECK:STDOUT:
  1252. // CHECK:STDOUT: fn @G(%x.param: %empty_struct_type) {
  1253. // CHECK:STDOUT: !entry:
  1254. // CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x
  1255. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type]
  1256. // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0]
  1257. // CHECK:STDOUT: return
  1258. // CHECK:STDOUT: }
  1259. // CHECK:STDOUT:
  1260. // CHECK:STDOUT: specific @HasF.F(constants.%Self) {
  1261. // CHECK:STDOUT: %Self => constants.%Self
  1262. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type
  1263. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.85b
  1264. // CHECK:STDOUT: }
  1265. // CHECK:STDOUT:
  1266. // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%T, constants.%U) {
  1267. // CHECK:STDOUT: %T.loc12_14.1 => constants.%T
  1268. // CHECK:STDOUT: %U.loc12_24.1 => constants.%U
  1269. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness
  1270. // CHECK:STDOUT:
  1271. // CHECK:STDOUT: !definition:
  1272. // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type
  1273. // CHECK:STDOUT: %T.as.HasF.impl.F => constants.%T.as.HasF.impl.F
  1274. // CHECK:STDOUT: }
  1275. // CHECK:STDOUT:
  1276. // CHECK:STDOUT: specific @T.as.HasF.impl.F(constants.%T, constants.%U) {
  1277. // CHECK:STDOUT: %T => constants.%T
  1278. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1279. // CHECK:STDOUT: }
  1280. // CHECK:STDOUT:
  1281. // CHECK:STDOUT: --- fail_inconsistent_deduction.carbon
  1282. // CHECK:STDOUT:
  1283. // CHECK:STDOUT: constants {
  1284. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1285. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  1286. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1287. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1288. // CHECK:STDOUT: %HasF.type.fe3: type = generic_interface_type @HasF [concrete]
  1289. // CHECK:STDOUT: %HasF.generic: %HasF.type.fe3 = struct_value () [concrete]
  1290. // CHECK:STDOUT: %HasF.type.9f4: type = facet_type <@HasF, @HasF(%T)> [symbolic]
  1291. // CHECK:STDOUT: %Self.0b6: %HasF.type.9f4 = bind_symbolic_name Self, 1 [symbolic]
  1292. // CHECK:STDOUT: %Self.as_type.b0c: type = facet_access_type %Self.0b6 [symbolic]
  1293. // CHECK:STDOUT: %pattern_type.f60: type = pattern_type %Self.as_type.b0c [symbolic]
  1294. // CHECK:STDOUT: %HasF.F.type.46c: type = fn_type @HasF.F, @HasF(%T) [symbolic]
  1295. // CHECK:STDOUT: %HasF.F.823: %HasF.F.type.46c = struct_value () [symbolic]
  1296. // CHECK:STDOUT: %HasF.assoc_type.dd8: type = assoc_entity_type @HasF, @HasF(%T) [symbolic]
  1297. // CHECK:STDOUT: %assoc0.d31: %HasF.assoc_type.dd8 = assoc_entity element0, @HasF.%HasF.F.decl [symbolic]
  1298. // CHECK:STDOUT: %require_complete.c26: <witness> = require_complete_type %HasF.type.9f4 [symbolic]
  1299. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T) [symbolic]
  1300. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1301. // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T) [symbolic]
  1302. // CHECK:STDOUT: %T.as.HasF.impl.F: %T.as.HasF.impl.F.type = struct_value () [symbolic]
  1303. // CHECK:STDOUT: %HasF.facet: %HasF.type.9f4 = facet_value %T, (%HasF.impl_witness) [symbolic]
  1304. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  1305. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  1306. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1307. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1308. // CHECK:STDOUT: %Destroy.impl_witness.ca8: <witness> = impl_witness @A.%Destroy.impl_witness_table [concrete]
  1309. // CHECK:STDOUT: %ptr.6db: type = ptr_type %A [concrete]
  1310. // CHECK:STDOUT: %pattern_type.5f8: type = pattern_type %ptr.6db [concrete]
  1311. // CHECK:STDOUT: %A.as.Destroy.impl.Op.type: type = fn_type @A.as.Destroy.impl.Op [concrete]
  1312. // CHECK:STDOUT: %A.as.Destroy.impl.Op: %A.as.Destroy.impl.Op.type = struct_value () [concrete]
  1313. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1314. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1315. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  1316. // CHECK:STDOUT: %Destroy.impl_witness.041: <witness> = impl_witness @B.%Destroy.impl_witness_table [concrete]
  1317. // CHECK:STDOUT: %ptr.e79: type = ptr_type %B [concrete]
  1318. // CHECK:STDOUT: %pattern_type.960: type = pattern_type %ptr.e79 [concrete]
  1319. // CHECK:STDOUT: %B.as.Destroy.impl.Op.type: type = fn_type @B.as.Destroy.impl.Op [concrete]
  1320. // CHECK:STDOUT: %B.as.Destroy.impl.Op: %B.as.Destroy.impl.Op.type = struct_value () [concrete]
  1321. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  1322. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1323. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1324. // CHECK:STDOUT: %HasF.type.296: type = facet_type <@HasF, @HasF(%B)> [concrete]
  1325. // CHECK:STDOUT: %Self.f60: %HasF.type.296 = bind_symbolic_name Self, 1 [symbolic]
  1326. // CHECK:STDOUT: %HasF.F.type.1c6: type = fn_type @HasF.F, @HasF(%B) [concrete]
  1327. // CHECK:STDOUT: %HasF.F.7cf: %HasF.F.type.1c6 = struct_value () [concrete]
  1328. // CHECK:STDOUT: %HasF.assoc_type.1af: type = assoc_entity_type @HasF, @HasF(%B) [concrete]
  1329. // CHECK:STDOUT: %assoc0.402: %HasF.assoc_type.1af = assoc_entity element0, @HasF.%HasF.F.decl [concrete]
  1330. // CHECK:STDOUT: }
  1331. // CHECK:STDOUT:
  1332. // CHECK:STDOUT: imports {
  1333. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1334. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1335. // CHECK:STDOUT: import Core//prelude
  1336. // CHECK:STDOUT: import Core//prelude/...
  1337. // CHECK:STDOUT: }
  1338. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1339. // CHECK:STDOUT: }
  1340. // CHECK:STDOUT:
  1341. // CHECK:STDOUT: file {
  1342. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1343. // CHECK:STDOUT: .Core = imports.%Core
  1344. // CHECK:STDOUT: .HasF = %HasF.decl
  1345. // CHECK:STDOUT: .A = %A.decl
  1346. // CHECK:STDOUT: .B = %B.decl
  1347. // CHECK:STDOUT: .G = %G.decl
  1348. // CHECK:STDOUT: }
  1349. // CHECK:STDOUT: %Core.import = import Core
  1350. // CHECK:STDOUT: %HasF.decl: %HasF.type.fe3 = interface_decl @HasF [concrete = constants.%HasF.generic] {
  1351. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1352. // CHECK:STDOUT: } {
  1353. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1354. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  1355. // CHECK:STDOUT: }
  1356. // CHECK:STDOUT: impl_decl @T.as.HasF.impl [concrete] {
  1357. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1358. // CHECK:STDOUT: } {
  1359. // CHECK:STDOUT: %T.ref.loc8_24: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T)]
  1360. // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic]
  1361. // CHECK:STDOUT: %T.ref.loc8_34: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T)]
  1362. // CHECK:STDOUT: %HasF.type.loc8_35.2: type = facet_type <@HasF, @HasF(constants.%T)> [symbolic = %HasF.type.loc8_35.1 (constants.%HasF.type.9f4)]
  1363. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1364. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)]
  1365. // CHECK:STDOUT: }
  1366. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@T.as.HasF.impl.%T.as.HasF.impl.F.decl), @T.as.HasF.impl [concrete]
  1367. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T) [symbolic = @T.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness)]
  1368. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  1369. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  1370. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  1371. // CHECK:STDOUT: %x.patt: %pattern_type.c10 = binding_pattern x [concrete]
  1372. // CHECK:STDOUT: %x.param_patt: %pattern_type.c10 = value_param_pattern %x.patt, call_param0 [concrete]
  1373. // CHECK:STDOUT: } {
  1374. // CHECK:STDOUT: %x.param: %A = value_param call_param0
  1375. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  1376. // CHECK:STDOUT: %x: %A = bind_name x, %x.param
  1377. // CHECK:STDOUT: }
  1378. // CHECK:STDOUT: }
  1379. // CHECK:STDOUT:
  1380. // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.2: type) {
  1381. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  1382. // CHECK:STDOUT:
  1383. // CHECK:STDOUT: !definition:
  1384. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T.loc4_16.1)> [symbolic = %HasF.type (constants.%HasF.type.9f4)]
  1385. // CHECK:STDOUT: %Self.2: @HasF.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0b6)]
  1386. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F, @HasF(%T.loc4_16.1) [symbolic = %HasF.F.type (constants.%HasF.F.type.46c)]
  1387. // CHECK:STDOUT: %HasF.F: @HasF.%HasF.F.type (%HasF.F.type.46c) = struct_value () [symbolic = %HasF.F (constants.%HasF.F.823)]
  1388. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF, @HasF(%T.loc4_16.1) [symbolic = %HasF.assoc_type (constants.%HasF.assoc_type.dd8)]
  1389. // CHECK:STDOUT: %assoc0.loc5_21.2: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %HasF.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.d31)]
  1390. // CHECK:STDOUT:
  1391. // CHECK:STDOUT: interface {
  1392. // CHECK:STDOUT: %Self.1: @HasF.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0b6)]
  1393. // CHECK:STDOUT: %HasF.F.decl: @HasF.%HasF.F.type (%HasF.F.type.46c) = fn_decl @HasF.F [symbolic = @HasF.%HasF.F (constants.%HasF.F.823)] {
  1394. // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.f60) = binding_pattern self [concrete]
  1395. // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.f60) = value_param_pattern %self.patt, call_param0 [concrete]
  1396. // CHECK:STDOUT: } {
  1397. // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.b0c) = value_param call_param0
  1398. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.3 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b0c)] {
  1399. // CHECK:STDOUT: %.loc5_14.2: @HasF.F.%HasF.type (%HasF.type.9f4) = specific_constant @HasF.%Self.1, @HasF(constants.%T) [symbolic = %Self (constants.%Self.0b6)]
  1400. // CHECK:STDOUT: %Self.ref: @HasF.F.%HasF.type (%HasF.type.9f4) = name_ref Self, %.loc5_14.2 [symbolic = %Self (constants.%Self.0b6)]
  1401. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b0c)]
  1402. // CHECK:STDOUT: %.loc5_14.3: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b0c)]
  1403. // CHECK:STDOUT: }
  1404. // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.b0c) = bind_name self, %self.param
  1405. // CHECK:STDOUT: }
  1406. // CHECK:STDOUT: %assoc0.loc5_21.1: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %HasF.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.d31)]
  1407. // CHECK:STDOUT:
  1408. // CHECK:STDOUT: !members:
  1409. // CHECK:STDOUT: .Self = %Self.1
  1410. // CHECK:STDOUT: .F = %assoc0.loc5_21.1
  1411. // CHECK:STDOUT: witness = (%HasF.F.decl)
  1412. // CHECK:STDOUT: }
  1413. // CHECK:STDOUT: }
  1414. // CHECK:STDOUT:
  1415. // CHECK:STDOUT: generic impl @T.as.HasF.impl(%T.loc8_14.2: type) {
  1416. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)]
  1417. // CHECK:STDOUT: %HasF.type.loc8_35.1: type = facet_type <@HasF, @HasF(%T.loc8_14.1)> [symbolic = %HasF.type.loc8_35.1 (constants.%HasF.type.9f4)]
  1418. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %HasF.type.loc8_35.1 [symbolic = %require_complete (constants.%require_complete.c26)]
  1419. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness)]
  1420. // CHECK:STDOUT:
  1421. // CHECK:STDOUT: !definition:
  1422. // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %T.as.HasF.impl.F.type (constants.%T.as.HasF.impl.F.type)]
  1423. // CHECK:STDOUT: %T.as.HasF.impl.F: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type) = struct_value () [symbolic = %T.as.HasF.impl.F (constants.%T.as.HasF.impl.F)]
  1424. // CHECK:STDOUT:
  1425. // CHECK:STDOUT: impl: %T.ref.loc8_24 as %HasF.type.loc8_35.2 {
  1426. // CHECK:STDOUT: %T.as.HasF.impl.F.decl: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type) = fn_decl @T.as.HasF.impl.F [symbolic = @T.as.HasF.impl.%T.as.HasF.impl.F (constants.%T.as.HasF.impl.F)] {
  1427. // CHECK:STDOUT: %self.patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = binding_pattern self [concrete]
  1428. // CHECK:STDOUT: %self.param_patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = value_param_pattern %self.patt, call_param0 [concrete]
  1429. // CHECK:STDOUT: } {
  1430. // CHECK:STDOUT: %self.param: @T.as.HasF.impl.F.%T (%T) = value_param call_param0
  1431. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @T.as.HasF.impl.%T.ref.loc8_24 [symbolic = %T (constants.%T)]
  1432. // CHECK:STDOUT: %self: @T.as.HasF.impl.F.%T (%T) = bind_name self, %self.param
  1433. // CHECK:STDOUT: }
  1434. // CHECK:STDOUT:
  1435. // CHECK:STDOUT: !members:
  1436. // CHECK:STDOUT: .F = %T.as.HasF.impl.F.decl
  1437. // CHECK:STDOUT: witness = file.%HasF.impl_witness
  1438. // CHECK:STDOUT: }
  1439. // CHECK:STDOUT: }
  1440. // CHECK:STDOUT:
  1441. // CHECK:STDOUT: impl @A.as.Destroy.impl: @A.%Self.ref as constants.%Destroy.type {
  1442. // CHECK:STDOUT: %A.as.Destroy.impl.Op.decl: %A.as.Destroy.impl.Op.type = fn_decl @A.as.Destroy.impl.Op [concrete = constants.%A.as.Destroy.impl.Op] {
  1443. // CHECK:STDOUT: %self.patt: %pattern_type.5f8 = binding_pattern self [concrete]
  1444. // CHECK:STDOUT: %self.param_patt: %pattern_type.5f8 = value_param_pattern %self.patt, call_param0 [concrete]
  1445. // CHECK:STDOUT: %.loc12: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1446. // CHECK:STDOUT: } {
  1447. // CHECK:STDOUT: %self.param: %ptr.6db = value_param call_param0
  1448. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%A [concrete = constants.%A]
  1449. // CHECK:STDOUT: %self: %ptr.6db = bind_name self, %self.param
  1450. // CHECK:STDOUT: }
  1451. // CHECK:STDOUT:
  1452. // CHECK:STDOUT: !members:
  1453. // CHECK:STDOUT: .Op = %A.as.Destroy.impl.Op.decl
  1454. // CHECK:STDOUT: witness = @A.%Destroy.impl_witness
  1455. // CHECK:STDOUT: }
  1456. // CHECK:STDOUT:
  1457. // CHECK:STDOUT: impl @B.as.Destroy.impl: @B.%Self.ref as constants.%Destroy.type {
  1458. // CHECK:STDOUT: %B.as.Destroy.impl.Op.decl: %B.as.Destroy.impl.Op.type = fn_decl @B.as.Destroy.impl.Op [concrete = constants.%B.as.Destroy.impl.Op] {
  1459. // CHECK:STDOUT: %self.patt: %pattern_type.960 = binding_pattern self [concrete]
  1460. // CHECK:STDOUT: %self.param_patt: %pattern_type.960 = value_param_pattern %self.patt, call_param0 [concrete]
  1461. // CHECK:STDOUT: %.loc13: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1462. // CHECK:STDOUT: } {
  1463. // CHECK:STDOUT: %self.param: %ptr.e79 = value_param call_param0
  1464. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [concrete = constants.%B]
  1465. // CHECK:STDOUT: %self: %ptr.e79 = bind_name self, %self.param
  1466. // CHECK:STDOUT: }
  1467. // CHECK:STDOUT:
  1468. // CHECK:STDOUT: !members:
  1469. // CHECK:STDOUT: .Op = %B.as.Destroy.impl.Op.decl
  1470. // CHECK:STDOUT: witness = @B.%Destroy.impl_witness
  1471. // CHECK:STDOUT: }
  1472. // CHECK:STDOUT:
  1473. // CHECK:STDOUT: class @A {
  1474. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%A [concrete = constants.%A]
  1475. // CHECK:STDOUT: impl_decl @A.as.Destroy.impl [concrete] {} {}
  1476. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@A.as.Destroy.impl.%A.as.Destroy.impl.Op.decl), @A.as.Destroy.impl [concrete]
  1477. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.ca8]
  1478. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1479. // CHECK:STDOUT: complete_type_witness = %complete_type
  1480. // CHECK:STDOUT:
  1481. // CHECK:STDOUT: !members:
  1482. // CHECK:STDOUT: .Self = constants.%A
  1483. // CHECK:STDOUT: }
  1484. // CHECK:STDOUT:
  1485. // CHECK:STDOUT: class @B {
  1486. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [concrete = constants.%B]
  1487. // CHECK:STDOUT: impl_decl @B.as.Destroy.impl [concrete] {} {}
  1488. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@B.as.Destroy.impl.%B.as.Destroy.impl.Op.decl), @B.as.Destroy.impl [concrete]
  1489. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.041]
  1490. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1491. // CHECK:STDOUT: complete_type_witness = %complete_type
  1492. // CHECK:STDOUT:
  1493. // CHECK:STDOUT: !members:
  1494. // CHECK:STDOUT: .Self = constants.%B
  1495. // CHECK:STDOUT: }
  1496. // CHECK:STDOUT:
  1497. // CHECK:STDOUT: generic fn @HasF.F(@HasF.%T.loc4_16.2: type, @HasF.%Self.1: @HasF.%HasF.type (%HasF.type.9f4)) {
  1498. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1499. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T)> [symbolic = %HasF.type (constants.%HasF.type.9f4)]
  1500. // CHECK:STDOUT: %Self: @HasF.F.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0b6)]
  1501. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b0c)]
  1502. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.f60)]
  1503. // CHECK:STDOUT:
  1504. // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.b0c));
  1505. // CHECK:STDOUT: }
  1506. // CHECK:STDOUT:
  1507. // CHECK:STDOUT: generic fn @T.as.HasF.impl.F(@T.as.HasF.impl.%T.loc8_14.2: type) {
  1508. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1509. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1510. // CHECK:STDOUT:
  1511. // CHECK:STDOUT: !definition:
  1512. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  1513. // CHECK:STDOUT:
  1514. // CHECK:STDOUT: fn(%self.param: @T.as.HasF.impl.F.%T (%T)) {
  1515. // CHECK:STDOUT: !entry:
  1516. // CHECK:STDOUT: return
  1517. // CHECK:STDOUT: }
  1518. // CHECK:STDOUT: }
  1519. // CHECK:STDOUT:
  1520. // CHECK:STDOUT: fn @A.as.Destroy.impl.Op(%self.param: %ptr.6db) = "no_op";
  1521. // CHECK:STDOUT:
  1522. // CHECK:STDOUT: fn @B.as.Destroy.impl.Op(%self.param: %ptr.e79) = "no_op";
  1523. // CHECK:STDOUT:
  1524. // CHECK:STDOUT: fn @G(%x.param: %A) {
  1525. // CHECK:STDOUT: !entry:
  1526. // CHECK:STDOUT: %x.ref: %A = name_ref x, %x
  1527. // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic]
  1528. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  1529. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%B)> [concrete = constants.%HasF.type.296]
  1530. // CHECK:STDOUT: %.loc22: %HasF.assoc_type.1af = specific_constant @HasF.%assoc0.loc5_21.1, @HasF(constants.%B) [concrete = constants.%assoc0.402]
  1531. // CHECK:STDOUT: %F.ref: %HasF.assoc_type.1af = name_ref F, %.loc22 [concrete = constants.%assoc0.402]
  1532. // CHECK:STDOUT: return
  1533. // CHECK:STDOUT: }
  1534. // CHECK:STDOUT:
  1535. // CHECK:STDOUT: specific @HasF(constants.%T) {
  1536. // CHECK:STDOUT: %T.loc4_16.1 => constants.%T
  1537. // CHECK:STDOUT:
  1538. // CHECK:STDOUT: !definition:
  1539. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4
  1540. // CHECK:STDOUT: %Self.2 => constants.%Self.0b6
  1541. // CHECK:STDOUT: %HasF.F.type => constants.%HasF.F.type.46c
  1542. // CHECK:STDOUT: %HasF.F => constants.%HasF.F.823
  1543. // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.dd8
  1544. // CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.d31
  1545. // CHECK:STDOUT: }
  1546. // CHECK:STDOUT:
  1547. // CHECK:STDOUT: specific @HasF.F(constants.%T, constants.%Self.0b6) {
  1548. // CHECK:STDOUT: %T => constants.%T
  1549. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4
  1550. // CHECK:STDOUT: %Self => constants.%Self.0b6
  1551. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.b0c
  1552. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f60
  1553. // CHECK:STDOUT: }
  1554. // CHECK:STDOUT:
  1555. // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%T) {
  1556. // CHECK:STDOUT: %T.loc8_14.1 => constants.%T
  1557. // CHECK:STDOUT: %HasF.type.loc8_35.1 => constants.%HasF.type.9f4
  1558. // CHECK:STDOUT: %require_complete => constants.%require_complete.c26
  1559. // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness
  1560. // CHECK:STDOUT:
  1561. // CHECK:STDOUT: !definition:
  1562. // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type
  1563. // CHECK:STDOUT: %T.as.HasF.impl.F => constants.%T.as.HasF.impl.F
  1564. // CHECK:STDOUT: }
  1565. // CHECK:STDOUT:
  1566. // CHECK:STDOUT: specific @T.as.HasF.impl.F(constants.%T) {
  1567. // CHECK:STDOUT: %T => constants.%T
  1568. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1569. // CHECK:STDOUT: }
  1570. // CHECK:STDOUT:
  1571. // CHECK:STDOUT: specific @HasF.F(constants.%T, constants.%HasF.facet) {
  1572. // CHECK:STDOUT: %T => constants.%T
  1573. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4
  1574. // CHECK:STDOUT: %Self => constants.%HasF.facet
  1575. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T
  1576. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1577. // CHECK:STDOUT: }
  1578. // CHECK:STDOUT:
  1579. // CHECK:STDOUT: specific @HasF(constants.%B) {
  1580. // CHECK:STDOUT: %T.loc4_16.1 => constants.%B
  1581. // CHECK:STDOUT:
  1582. // CHECK:STDOUT: !definition:
  1583. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.296
  1584. // CHECK:STDOUT: %Self.2 => constants.%Self.f60
  1585. // CHECK:STDOUT: %HasF.F.type => constants.%HasF.F.type.1c6
  1586. // CHECK:STDOUT: %HasF.F => constants.%HasF.F.7cf
  1587. // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.1af
  1588. // CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.402
  1589. // CHECK:STDOUT: }
  1590. // CHECK:STDOUT: