generic.carbon 84 KB

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