generic.carbon 83 KB

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