generic.carbon 102 KB

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