generic.carbon 81 KB

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