generic.carbon 100 KB

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