import.carbon 221 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408
  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/import.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/import.carbon
  14. // --- package_a.carbon
  15. package PackageA;
  16. interface HasF {
  17. fn F[self: Self]();
  18. }
  19. class C {}
  20. // Same library as the class and interface.
  21. impl C as HasF {
  22. fn F[self: Self]() {}
  23. }
  24. // --- package_b.carbon
  25. package PackageB;
  26. import PackageA;
  27. interface HasG {
  28. fn G[self: Self]();
  29. }
  30. class D {}
  31. // Same library as the interface.
  32. impl PackageA.C as HasG {
  33. fn G[self: Self]() {}
  34. }
  35. // Same library as the class.
  36. impl D as PackageA.HasF {
  37. fn F[self: Self]() {}
  38. }
  39. // Same library as the class and interface.
  40. impl D as HasG {
  41. fn G[self: Self]() {}
  42. }
  43. // --- use_cf.carbon
  44. library "[[@TEST_NAME]]";
  45. import PackageA;
  46. fn TestCF(c: PackageA.C) {
  47. c.(PackageA.HasF.F)();
  48. }
  49. // --- use_df.carbon
  50. library "[[@TEST_NAME]]";
  51. import PackageA;
  52. import PackageB;
  53. fn TestDF(d: PackageB.D) {
  54. d.(PackageA.HasF.F)();
  55. }
  56. // --- use_cg.carbon
  57. library "[[@TEST_NAME]]";
  58. import PackageA;
  59. import PackageB;
  60. fn TestCG(c: PackageA.C) {
  61. c.(PackageB.HasG.G)();
  62. }
  63. // --- use_dg.carbon
  64. library "[[@TEST_NAME]]";
  65. import PackageB;
  66. fn TestDG(d: PackageB.D) {
  67. d.(PackageB.HasG.G)();
  68. }
  69. // --- associated_interface.carbon
  70. package PackageAssociatedInterface;
  71. interface Z {
  72. fn H[self: Self]();
  73. }
  74. impl () as Z {
  75. fn H[self: Self]() {}
  76. }
  77. // --- import_associated_interface.carbon
  78. package PackageImportAssociatedInterface;
  79. import PackageAssociatedInterface;
  80. fn J() {
  81. ().(PackageAssociatedInterface.Z.H)();
  82. }
  83. // --- has_param.carbon
  84. package PackageHasParam;
  85. class AnyParam[T:! type](X:! T) {}
  86. interface Y {
  87. fn K[self: Self]() {}
  88. }
  89. // --- has_generic_interface.carbon
  90. package PackageGenericInterface;
  91. import PackageHasParam;
  92. interface GenericInterface(U:! type) {}
  93. impl PackageHasParam.AnyParam(GenericInterface) as PackageHasParam.Y {
  94. fn K[self: Self]() {}
  95. }
  96. fn L() {
  97. var obj: PackageHasParam.AnyParam(GenericInterface) = {};
  98. obj.(PackageHasParam.Y.K)();
  99. }
  100. // --- use_generic_interface_as_param.carbon
  101. library "[[@TEST_NAME]]";
  102. import PackageHasParam;
  103. import PackageGenericInterface;
  104. fn M() {
  105. var obj: PackageHasParam.AnyParam(
  106. PackageGenericInterface.GenericInterface) = {};
  107. obj.(PackageHasParam.Y.K)();
  108. }
  109. // --- has_generic_class.carbon
  110. package PackageGenericClass;
  111. import PackageHasParam;
  112. class GenericClass(U:! type) {}
  113. impl PackageHasParam.AnyParam(GenericClass) as PackageHasParam.Y {
  114. fn K[self: Self]() {}
  115. }
  116. fn L() {
  117. var obj: PackageHasParam.AnyParam(GenericClass) = {};
  118. obj.(PackageHasParam.Y.K)();
  119. }
  120. // --- use_generic_class_as_param.carbon
  121. library "[[@TEST_NAME]]";
  122. import PackageHasParam;
  123. import PackageGenericClass;
  124. fn M() {
  125. var obj: PackageHasParam.AnyParam(PackageGenericClass.GenericClass) = {};
  126. obj.(PackageHasParam.Y.K)();
  127. }
  128. // --- has_extra_interfaces.carbon
  129. package HasExtraInterfaces;
  130. interface Extra1 {}
  131. interface Extra2 {}
  132. interface Extra3 {}
  133. interface Extra4 {}
  134. interface Extra5 {}
  135. interface Extra6 {}
  136. interface Extra7 {}
  137. interface Extra8 {}
  138. class C(T:! type) {}
  139. interface I { fn F[self: Self](); }
  140. impl C((Extra1, Extra2, Extra3, Extra4, Extra5, Extra6, Extra7, Extra8)) as I {
  141. fn F[self: Self]() {}
  142. }
  143. // --- fail_use_has_extra_interfaces.carbon
  144. package UseHasExtraInterfaces;
  145. import HasExtraInterfaces;
  146. fn Test(c: HasExtraInterfaces.C(type)) {
  147. // This triggers the import of a bunch more interfaces, which reallocates the
  148. // interface ValueStore. Ensure that doesn't result in a use-after-free crash.
  149. // CHECK:STDERR: fail_use_has_extra_interfaces.carbon:[[@LINE+4]]:3: error: cannot access member of interface `HasExtraInterfaces.I` in type `HasExtraInterfaces.C(type)` that does not implement that interface [MissingImplInMemberAccess]
  150. // CHECK:STDERR: c.(HasExtraInterfaces.I.F)();
  151. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  152. // CHECK:STDERR:
  153. c.(HasExtraInterfaces.I.F)();
  154. }
  155. // CHECK:STDOUT: --- package_a.carbon
  156. // CHECK:STDOUT:
  157. // CHECK:STDOUT: constants {
  158. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  159. // CHECK:STDOUT: %Self.cb9: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  160. // CHECK:STDOUT: %Self.as_type.45c: type = facet_access_type %Self.cb9 [symbolic]
  161. // CHECK:STDOUT: %pattern_type.85b: type = pattern_type %Self.as_type.45c [symbolic]
  162. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete]
  163. // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete]
  164. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete]
  165. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, @HasF.%HasF.F.decl [concrete]
  166. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  167. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  168. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  169. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  170. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  171. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  172. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  173. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  174. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  175. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  176. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table [concrete]
  177. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  178. // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F [concrete]
  179. // CHECK:STDOUT: %C.as.HasF.impl.F: %C.as.HasF.impl.F.type = struct_value () [concrete]
  180. // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, (%HasF.impl_witness) [concrete]
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: imports {
  184. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  185. // CHECK:STDOUT: .Destroy = %Core.Destroy
  186. // CHECK:STDOUT: import Core//prelude
  187. // CHECK:STDOUT: import Core//prelude/...
  188. // CHECK:STDOUT: }
  189. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT:
  192. // CHECK:STDOUT: file {
  193. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  194. // CHECK:STDOUT: .Core = imports.%Core
  195. // CHECK:STDOUT: .HasF = %HasF.decl
  196. // CHECK:STDOUT: .C = %C.decl
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT: %Core.import = import Core
  199. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [concrete = constants.%HasF.type] {} {}
  200. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  201. // CHECK:STDOUT: impl_decl @C.as.HasF.impl [concrete] {} {
  202. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  203. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type]
  204. // CHECK:STDOUT: }
  205. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@C.as.HasF.impl.%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete]
  206. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness]
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: interface @HasF {
  210. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.cb9]
  211. // CHECK:STDOUT: %HasF.F.decl: %HasF.F.type = fn_decl @HasF.F [concrete = constants.%HasF.F] {
  212. // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.85b) = binding_pattern self [concrete]
  213. // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = value_param_pattern %self.patt, call_param0 [concrete]
  214. // CHECK:STDOUT: } {
  215. // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = value_param call_param0
  216. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] {
  217. // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.cb9)]
  218. // 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.45c)]
  219. // 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.45c)]
  220. // CHECK:STDOUT: }
  221. // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = bind_name self, %self.param
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.F.decl [concrete = constants.%assoc0]
  224. // CHECK:STDOUT:
  225. // CHECK:STDOUT: !members:
  226. // CHECK:STDOUT: .Self = %Self
  227. // CHECK:STDOUT: .F = %assoc0
  228. // CHECK:STDOUT: witness = (%HasF.F.decl)
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type {
  232. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  233. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  234. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  235. // CHECK:STDOUT: %.loc8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  236. // CHECK:STDOUT: } {
  237. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  238. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  239. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT:
  242. // CHECK:STDOUT: !members:
  243. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  244. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  245. // CHECK:STDOUT: }
  246. // CHECK:STDOUT:
  247. // CHECK:STDOUT: impl @C.as.HasF.impl: %C.ref as %HasF.ref {
  248. // CHECK:STDOUT: %C.as.HasF.impl.F.decl: %C.as.HasF.impl.F.type = fn_decl @C.as.HasF.impl.F [concrete = constants.%C.as.HasF.impl.F] {
  249. // CHECK:STDOUT: %self.patt: %pattern_type.c48 = binding_pattern self [concrete]
  250. // CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete]
  251. // CHECK:STDOUT: } {
  252. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  253. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.HasF.impl.%C.ref [concrete = constants.%C]
  254. // CHECK:STDOUT: %self: %C = bind_name self, %self.param
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: !members:
  258. // CHECK:STDOUT: .F = %C.as.HasF.impl.F.decl
  259. // CHECK:STDOUT: witness = file.%HasF.impl_witness
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT:
  262. // CHECK:STDOUT: class @C {
  263. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  264. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  265. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  266. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness]
  267. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  268. // CHECK:STDOUT: complete_type_witness = %complete_type
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: !members:
  271. // CHECK:STDOUT: .Self = constants.%C
  272. // CHECK:STDOUT: }
  273. // CHECK:STDOUT:
  274. // CHECK:STDOUT: generic fn @HasF.F(@HasF.%Self: %HasF.type) {
  275. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.cb9)]
  276. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)]
  277. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.85b)]
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c));
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: fn @C.as.HasF.impl.F(%self.param: %C) {
  285. // CHECK:STDOUT: !entry:
  286. // CHECK:STDOUT: return
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: specific @HasF.F(constants.%Self.cb9) {
  290. // CHECK:STDOUT: %Self => constants.%Self.cb9
  291. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.45c
  292. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.85b
  293. // CHECK:STDOUT: }
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: specific @HasF.F(constants.%HasF.facet) {
  296. // CHECK:STDOUT: %Self => constants.%HasF.facet
  297. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%C
  298. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c48
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: --- package_b.carbon
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: constants {
  304. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [concrete]
  305. // CHECK:STDOUT: %Self.4d5: %HasG.type = bind_symbolic_name Self, 0 [symbolic]
  306. // CHECK:STDOUT: %Self.as_type.5b9: type = facet_access_type %Self.4d5 [symbolic]
  307. // CHECK:STDOUT: %pattern_type.511: type = pattern_type %Self.as_type.5b9 [symbolic]
  308. // CHECK:STDOUT: %HasG.G.type: type = fn_type @HasG.G [concrete]
  309. // CHECK:STDOUT: %HasG.G: %HasG.G.type = struct_value () [concrete]
  310. // CHECK:STDOUT: %HasG.assoc_type: type = assoc_entity_type @HasG [concrete]
  311. // CHECK:STDOUT: %assoc0: %HasG.assoc_type = assoc_entity element0, @HasG.%HasG.G.decl [concrete]
  312. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  313. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  314. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  315. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @D.%Destroy.impl_witness_table [concrete]
  316. // CHECK:STDOUT: %ptr.19c: type = ptr_type %D [concrete]
  317. // CHECK:STDOUT: %pattern_type.a94: type = pattern_type %ptr.19c [concrete]
  318. // CHECK:STDOUT: %D.as.Destroy.impl.Op.type: type = fn_type @D.as.Destroy.impl.Op [concrete]
  319. // CHECK:STDOUT: %D.as.Destroy.impl.Op: %D.as.Destroy.impl.Op.type = struct_value () [concrete]
  320. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  321. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  322. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  323. // CHECK:STDOUT: %HasG.impl_witness.c63: <witness> = impl_witness file.%HasG.impl_witness_table.loc13 [concrete]
  324. // CHECK:STDOUT: %pattern_type.8e5: type = pattern_type %C [concrete]
  325. // CHECK:STDOUT: %C.as.HasG.impl.G.type: type = fn_type @C.as.HasG.impl.G [concrete]
  326. // CHECK:STDOUT: %C.as.HasG.impl.G: %C.as.HasG.impl.G.type = struct_value () [concrete]
  327. // CHECK:STDOUT: %HasG.facet.a10: %HasG.type = facet_value %C, (%HasG.impl_witness.c63) [concrete]
  328. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  329. // CHECK:STDOUT: %Self.d86: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  330. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete]
  331. // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete]
  332. // CHECK:STDOUT: %Self.as_type.a8f: type = facet_access_type %Self.d86 [symbolic]
  333. // CHECK:STDOUT: %pattern_type.fcd: type = pattern_type %Self.as_type.a8f [symbolic]
  334. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness file.%HasF.impl_witness_table [concrete]
  335. // CHECK:STDOUT: %pattern_type.510: type = pattern_type %D [concrete]
  336. // CHECK:STDOUT: %D.as.HasF.impl.F.type: type = fn_type @D.as.HasF.impl.F [concrete]
  337. // CHECK:STDOUT: %D.as.HasF.impl.F: %D.as.HasF.impl.F.type = struct_value () [concrete]
  338. // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %D, (%HasF.impl_witness) [concrete]
  339. // CHECK:STDOUT: %HasG.impl_witness.c28: <witness> = impl_witness file.%HasG.impl_witness_table.loc23 [concrete]
  340. // CHECK:STDOUT: %D.as.HasG.impl.G.type: type = fn_type @D.as.HasG.impl.G [concrete]
  341. // CHECK:STDOUT: %D.as.HasG.impl.G: %D.as.HasG.impl.G.type = struct_value () [concrete]
  342. // CHECK:STDOUT: %HasG.facet.6ec: %HasG.type = facet_value %D, (%HasG.impl_witness.c28) [concrete]
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT:
  345. // CHECK:STDOUT: imports {
  346. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  347. // CHECK:STDOUT: .Destroy = %Core.Destroy
  348. // CHECK:STDOUT: import Core//prelude
  349. // CHECK:STDOUT: import Core//prelude/...
  350. // CHECK:STDOUT: }
  351. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [concrete] {
  352. // CHECK:STDOUT: .C = %PackageA.C
  353. // CHECK:STDOUT: .HasF = %PackageA.HasF
  354. // CHECK:STDOUT: import PackageA//default
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  357. // CHECK:STDOUT: %PackageA.C: type = import_ref PackageA//default, C, loaded [concrete = constants.%C]
  358. // CHECK:STDOUT: %PackageA.import_ref.8f2: <witness> = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type]
  359. // CHECK:STDOUT: %PackageA.import_ref.2c4 = import_ref PackageA//default, inst43 [no loc], unloaded
  360. // CHECK:STDOUT: %PackageA.HasF: type = import_ref PackageA//default, HasF, loaded [concrete = constants.%HasF.type]
  361. // CHECK:STDOUT: %PackageA.import_ref.848 = import_ref PackageA//default, inst19 [no loc], unloaded
  362. // CHECK:STDOUT: %PackageA.import_ref.c63 = import_ref PackageA//default, loc5_21, unloaded
  363. // CHECK:STDOUT: %PackageA.F: %HasF.F.type = import_ref PackageA//default, F, loaded [concrete = constants.%HasF.F]
  364. // CHECK:STDOUT: %PackageA.import_ref.0b6: %HasF.type = import_ref PackageA//default, inst19 [no loc], loaded [symbolic = constants.%Self.d86]
  365. // CHECK:STDOUT: }
  366. // CHECK:STDOUT:
  367. // CHECK:STDOUT: file {
  368. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  369. // CHECK:STDOUT: .Core = imports.%Core
  370. // CHECK:STDOUT: .PackageA = imports.%PackageA
  371. // CHECK:STDOUT: .HasG = %HasG.decl
  372. // CHECK:STDOUT: .D = %D.decl
  373. // CHECK:STDOUT: }
  374. // CHECK:STDOUT: %Core.import = import Core
  375. // CHECK:STDOUT: %PackageA.import = import PackageA
  376. // CHECK:STDOUT: %HasG.decl: type = interface_decl @HasG [concrete = constants.%HasG.type] {} {}
  377. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  378. // CHECK:STDOUT: impl_decl @C.as.HasG.impl [concrete] {} {
  379. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  380. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%PackageA.C [concrete = constants.%C]
  381. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [concrete = constants.%HasG.type]
  382. // CHECK:STDOUT: }
  383. // CHECK:STDOUT: %HasG.impl_witness_table.loc13 = impl_witness_table (@C.as.HasG.impl.%C.as.HasG.impl.G.decl), @C.as.HasG.impl [concrete]
  384. // CHECK:STDOUT: %HasG.impl_witness.loc13: <witness> = impl_witness %HasG.impl_witness_table.loc13 [concrete = constants.%HasG.impl_witness.c63]
  385. // CHECK:STDOUT: impl_decl @D.as.HasF.impl [concrete] {} {
  386. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  387. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  388. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%PackageA.HasF [concrete = constants.%HasF.type]
  389. // CHECK:STDOUT: }
  390. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@D.as.HasF.impl.%D.as.HasF.impl.F.decl), @D.as.HasF.impl [concrete]
  391. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness]
  392. // CHECK:STDOUT: impl_decl @D.as.HasG.impl [concrete] {} {
  393. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  394. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [concrete = constants.%HasG.type]
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT: %HasG.impl_witness_table.loc23 = impl_witness_table (@D.as.HasG.impl.%D.as.HasG.impl.G.decl), @D.as.HasG.impl [concrete]
  397. // CHECK:STDOUT: %HasG.impl_witness.loc23: <witness> = impl_witness %HasG.impl_witness_table.loc23 [concrete = constants.%HasG.impl_witness.c28]
  398. // CHECK:STDOUT: }
  399. // CHECK:STDOUT:
  400. // CHECK:STDOUT: interface @HasG {
  401. // CHECK:STDOUT: %Self: %HasG.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.4d5]
  402. // CHECK:STDOUT: %HasG.G.decl: %HasG.G.type = fn_decl @HasG.G [concrete = constants.%HasG.G] {
  403. // CHECK:STDOUT: %self.patt: @HasG.G.%pattern_type (%pattern_type.511) = binding_pattern self [concrete]
  404. // CHECK:STDOUT: %self.param_patt: @HasG.G.%pattern_type (%pattern_type.511) = value_param_pattern %self.patt, call_param0 [concrete]
  405. // CHECK:STDOUT: } {
  406. // CHECK:STDOUT: %self.param: @HasG.G.%Self.as_type.loc7_14.1 (%Self.as_type.5b9) = value_param call_param0
  407. // CHECK:STDOUT: %.loc7_14.1: type = splice_block %.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.5b9)] {
  408. // CHECK:STDOUT: %Self.ref: %HasG.type = name_ref Self, @HasG.%Self [symbolic = %Self (constants.%Self.4d5)]
  409. // CHECK:STDOUT: %Self.as_type.loc7_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.5b9)]
  410. // CHECK:STDOUT: %.loc7_14.2: type = converted %Self.ref, %Self.as_type.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.5b9)]
  411. // CHECK:STDOUT: }
  412. // CHECK:STDOUT: %self: @HasG.G.%Self.as_type.loc7_14.1 (%Self.as_type.5b9) = bind_name self, %self.param
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT: %assoc0: %HasG.assoc_type = assoc_entity element0, %HasG.G.decl [concrete = constants.%assoc0]
  415. // CHECK:STDOUT:
  416. // CHECK:STDOUT: !members:
  417. // CHECK:STDOUT: .Self = %Self
  418. // CHECK:STDOUT: .G = %assoc0
  419. // CHECK:STDOUT: witness = (%HasG.G.decl)
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  423. // CHECK:STDOUT: !members:
  424. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.848
  425. // CHECK:STDOUT: .F = imports.%PackageA.import_ref.c63
  426. // CHECK:STDOUT: witness = (imports.%PackageA.F)
  427. // CHECK:STDOUT: }
  428. // CHECK:STDOUT:
  429. // CHECK:STDOUT: impl @D.as.Destroy.impl: @D.%Self.ref as constants.%Destroy.type {
  430. // CHECK:STDOUT: %D.as.Destroy.impl.Op.decl: %D.as.Destroy.impl.Op.type = fn_decl @D.as.Destroy.impl.Op [concrete = constants.%D.as.Destroy.impl.Op] {
  431. // CHECK:STDOUT: %self.patt: %pattern_type.a94 = binding_pattern self [concrete]
  432. // CHECK:STDOUT: %self.param_patt: %pattern_type.a94 = value_param_pattern %self.patt, call_param0 [concrete]
  433. // CHECK:STDOUT: %.loc10: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  434. // CHECK:STDOUT: } {
  435. // CHECK:STDOUT: %self.param: %ptr.19c = value_param call_param0
  436. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
  437. // CHECK:STDOUT: %self: %ptr.19c = bind_name self, %self.param
  438. // CHECK:STDOUT: }
  439. // CHECK:STDOUT:
  440. // CHECK:STDOUT: !members:
  441. // CHECK:STDOUT: .Op = %D.as.Destroy.impl.Op.decl
  442. // CHECK:STDOUT: witness = @D.%Destroy.impl_witness
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: impl @C.as.HasG.impl: %C.ref as %HasG.ref {
  446. // CHECK:STDOUT: %C.as.HasG.impl.G.decl: %C.as.HasG.impl.G.type = fn_decl @C.as.HasG.impl.G [concrete = constants.%C.as.HasG.impl.G] {
  447. // CHECK:STDOUT: %self.patt: %pattern_type.8e5 = binding_pattern self [concrete]
  448. // CHECK:STDOUT: %self.param_patt: %pattern_type.8e5 = value_param_pattern %self.patt, call_param0 [concrete]
  449. // CHECK:STDOUT: } {
  450. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  451. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.HasG.impl.%C.ref [concrete = constants.%C]
  452. // CHECK:STDOUT: %self: %C = bind_name self, %self.param
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: !members:
  456. // CHECK:STDOUT: .G = %C.as.HasG.impl.G.decl
  457. // CHECK:STDOUT: witness = file.%HasG.impl_witness.loc13
  458. // CHECK:STDOUT: }
  459. // CHECK:STDOUT:
  460. // CHECK:STDOUT: impl @D.as.HasF.impl: %D.ref as %HasF.ref {
  461. // CHECK:STDOUT: %D.as.HasF.impl.F.decl: %D.as.HasF.impl.F.type = fn_decl @D.as.HasF.impl.F [concrete = constants.%D.as.HasF.impl.F] {
  462. // CHECK:STDOUT: %self.patt: %pattern_type.510 = binding_pattern self [concrete]
  463. // CHECK:STDOUT: %self.param_patt: %pattern_type.510 = value_param_pattern %self.patt, call_param0 [concrete]
  464. // CHECK:STDOUT: } {
  465. // CHECK:STDOUT: %self.param: %D = value_param call_param0
  466. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @D.as.HasF.impl.%D.ref [concrete = constants.%D]
  467. // CHECK:STDOUT: %self: %D = bind_name self, %self.param
  468. // CHECK:STDOUT: }
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: !members:
  471. // CHECK:STDOUT: .F = %D.as.HasF.impl.F.decl
  472. // CHECK:STDOUT: witness = file.%HasF.impl_witness
  473. // CHECK:STDOUT: }
  474. // CHECK:STDOUT:
  475. // CHECK:STDOUT: impl @D.as.HasG.impl: %D.ref as %HasG.ref {
  476. // CHECK:STDOUT: %D.as.HasG.impl.G.decl: %D.as.HasG.impl.G.type = fn_decl @D.as.HasG.impl.G [concrete = constants.%D.as.HasG.impl.G] {
  477. // CHECK:STDOUT: %self.patt: %pattern_type.510 = binding_pattern self [concrete]
  478. // CHECK:STDOUT: %self.param_patt: %pattern_type.510 = value_param_pattern %self.patt, call_param0 [concrete]
  479. // CHECK:STDOUT: } {
  480. // CHECK:STDOUT: %self.param: %D = value_param call_param0
  481. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @D.as.HasG.impl.%D.ref [concrete = constants.%D]
  482. // CHECK:STDOUT: %self: %D = bind_name self, %self.param
  483. // CHECK:STDOUT: }
  484. // CHECK:STDOUT:
  485. // CHECK:STDOUT: !members:
  486. // CHECK:STDOUT: .G = %D.as.HasG.impl.G.decl
  487. // CHECK:STDOUT: witness = file.%HasG.impl_witness.loc23
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: class @D {
  491. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
  492. // CHECK:STDOUT: impl_decl @D.as.Destroy.impl [concrete] {} {}
  493. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@D.as.Destroy.impl.%D.as.Destroy.impl.Op.decl), @D.as.Destroy.impl [concrete]
  494. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness]
  495. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  496. // CHECK:STDOUT: complete_type_witness = %complete_type
  497. // CHECK:STDOUT:
  498. // CHECK:STDOUT: !members:
  499. // CHECK:STDOUT: .Self = constants.%D
  500. // CHECK:STDOUT: }
  501. // CHECK:STDOUT:
  502. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  503. // CHECK:STDOUT: complete_type_witness = imports.%PackageA.import_ref.8f2
  504. // CHECK:STDOUT:
  505. // CHECK:STDOUT: !members:
  506. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.2c4
  507. // CHECK:STDOUT: }
  508. // CHECK:STDOUT:
  509. // CHECK:STDOUT: generic fn @HasG.G(@HasG.%Self: %HasG.type) {
  510. // CHECK:STDOUT: %Self: %HasG.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.4d5)]
  511. // CHECK:STDOUT: %Self.as_type.loc7_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.5b9)]
  512. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc7_14.1 [symbolic = %pattern_type (constants.%pattern_type.511)]
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: fn(%self.param: @HasG.G.%Self.as_type.loc7_14.1 (%Self.as_type.5b9));
  515. // CHECK:STDOUT: }
  516. // CHECK:STDOUT:
  517. // CHECK:STDOUT: fn @D.as.Destroy.impl.Op(%self.param: %ptr.19c) = "no_op";
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: fn @C.as.HasG.impl.G(%self.param: %C) {
  520. // CHECK:STDOUT: !entry:
  521. // CHECK:STDOUT: return
  522. // CHECK:STDOUT: }
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: generic fn @HasF.F(imports.%PackageA.import_ref.0b6: %HasF.type) [from "package_a.carbon"] {
  525. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.d86)]
  526. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.a8f)]
  527. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.fcd)]
  528. // CHECK:STDOUT:
  529. // CHECK:STDOUT: fn;
  530. // CHECK:STDOUT: }
  531. // CHECK:STDOUT:
  532. // CHECK:STDOUT: fn @D.as.HasF.impl.F(%self.param: %D) {
  533. // CHECK:STDOUT: !entry:
  534. // CHECK:STDOUT: return
  535. // CHECK:STDOUT: }
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: fn @D.as.HasG.impl.G(%self.param: %D) {
  538. // CHECK:STDOUT: !entry:
  539. // CHECK:STDOUT: return
  540. // CHECK:STDOUT: }
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: specific @HasG.G(constants.%Self.4d5) {
  543. // CHECK:STDOUT: %Self => constants.%Self.4d5
  544. // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%Self.as_type.5b9
  545. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.511
  546. // CHECK:STDOUT: }
  547. // CHECK:STDOUT:
  548. // CHECK:STDOUT: specific @HasG.G(constants.%HasG.facet.a10) {
  549. // CHECK:STDOUT: %Self => constants.%HasG.facet.a10
  550. // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%C
  551. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.8e5
  552. // CHECK:STDOUT: }
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: specific @HasF.F(constants.%Self.d86) {
  555. // CHECK:STDOUT: %Self => constants.%Self.d86
  556. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.a8f
  557. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fcd
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT:
  560. // CHECK:STDOUT: specific @HasF.F(constants.%HasF.facet) {
  561. // CHECK:STDOUT: %Self => constants.%HasF.facet
  562. // CHECK:STDOUT: %Self.as_type => constants.%D
  563. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.510
  564. // CHECK:STDOUT: }
  565. // CHECK:STDOUT:
  566. // CHECK:STDOUT: specific @HasG.G(constants.%HasG.facet.6ec) {
  567. // CHECK:STDOUT: %Self => constants.%HasG.facet.6ec
  568. // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%D
  569. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.510
  570. // CHECK:STDOUT: }
  571. // CHECK:STDOUT:
  572. // CHECK:STDOUT: --- use_cf.carbon
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: constants {
  575. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  576. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  577. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  578. // CHECK:STDOUT: %pattern_type.8e5: type = pattern_type %C [concrete]
  579. // CHECK:STDOUT: %TestCF.type: type = fn_type @TestCF [concrete]
  580. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  581. // CHECK:STDOUT: %TestCF: %TestCF.type = struct_value () [concrete]
  582. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  583. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  584. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete]
  585. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, imports.%PackageA.import_ref.ab2 [concrete]
  586. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete]
  587. // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete]
  588. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  589. // CHECK:STDOUT: %pattern_type.fcd: type = pattern_type %Self.as_type [symbolic]
  590. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness imports.%HasF.impl_witness_table [concrete]
  591. // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, (%HasF.impl_witness) [concrete]
  592. // CHECK:STDOUT: %.3f2: type = fn_type_with_self_type %HasF.F.type, %HasF.facet [concrete]
  593. // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F [concrete]
  594. // CHECK:STDOUT: %C.as.HasF.impl.F: %C.as.HasF.impl.F.type = struct_value () [concrete]
  595. // CHECK:STDOUT: }
  596. // CHECK:STDOUT:
  597. // CHECK:STDOUT: imports {
  598. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  599. // CHECK:STDOUT: import Core//prelude
  600. // CHECK:STDOUT: import Core//prelude/...
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [concrete] {
  603. // CHECK:STDOUT: .C = %PackageA.C
  604. // CHECK:STDOUT: .HasF = %PackageA.HasF
  605. // CHECK:STDOUT: import PackageA//default
  606. // CHECK:STDOUT: }
  607. // CHECK:STDOUT: %PackageA.C: type = import_ref PackageA//default, C, loaded [concrete = constants.%C]
  608. // CHECK:STDOUT: %PackageA.import_ref.8f2: <witness> = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type]
  609. // CHECK:STDOUT: %PackageA.import_ref.2c4 = import_ref PackageA//default, inst43 [no loc], unloaded
  610. // CHECK:STDOUT: %PackageA.HasF: type = import_ref PackageA//default, HasF, loaded [concrete = constants.%HasF.type]
  611. // CHECK:STDOUT: %PackageA.import_ref.848 = import_ref PackageA//default, inst19 [no loc], unloaded
  612. // CHECK:STDOUT: %PackageA.import_ref.b36: %HasF.assoc_type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%assoc0]
  613. // CHECK:STDOUT: %PackageA.F = import_ref PackageA//default, F, unloaded
  614. // CHECK:STDOUT: %PackageA.import_ref.ab2: %HasF.F.type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%HasF.F]
  615. // CHECK:STDOUT: %PackageA.import_ref.0b6: %HasF.type = import_ref PackageA//default, inst19 [no loc], loaded [symbolic = constants.%Self]
  616. // CHECK:STDOUT: %PackageA.import_ref.a12: <witness> = import_ref PackageA//default, loc11_16, loaded [concrete = constants.%HasF.impl_witness]
  617. // CHECK:STDOUT: %PackageA.import_ref.29a: type = import_ref PackageA//default, loc11_6, loaded [concrete = constants.%C]
  618. // CHECK:STDOUT: %PackageA.import_ref.e8c: type = import_ref PackageA//default, loc11_11, loaded [concrete = constants.%HasF.type]
  619. // CHECK:STDOUT: %PackageA.import_ref.68f: %C.as.HasF.impl.F.type = import_ref PackageA//default, loc12_22, loaded [concrete = constants.%C.as.HasF.impl.F]
  620. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageA.import_ref.68f), @C.as.HasF.impl [concrete]
  621. // CHECK:STDOUT: }
  622. // CHECK:STDOUT:
  623. // CHECK:STDOUT: file {
  624. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  625. // CHECK:STDOUT: .Core = imports.%Core
  626. // CHECK:STDOUT: .PackageA = imports.%PackageA
  627. // CHECK:STDOUT: .TestCF = %TestCF.decl
  628. // CHECK:STDOUT: }
  629. // CHECK:STDOUT: %Core.import = import Core
  630. // CHECK:STDOUT: %PackageA.import = import PackageA
  631. // CHECK:STDOUT: %TestCF.decl: %TestCF.type = fn_decl @TestCF [concrete = constants.%TestCF] {
  632. // CHECK:STDOUT: %c.patt: %pattern_type.8e5 = binding_pattern c [concrete]
  633. // CHECK:STDOUT: %c.param_patt: %pattern_type.8e5 = value_param_pattern %c.patt, call_param0 [concrete]
  634. // CHECK:STDOUT: } {
  635. // CHECK:STDOUT: %c.param: %C = value_param call_param0
  636. // CHECK:STDOUT: %.loc6: type = splice_block %C.ref [concrete = constants.%C] {
  637. // CHECK:STDOUT: %PackageA.ref.loc6: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  638. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%PackageA.C [concrete = constants.%C]
  639. // CHECK:STDOUT: }
  640. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  641. // CHECK:STDOUT: }
  642. // CHECK:STDOUT: }
  643. // CHECK:STDOUT:
  644. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  645. // CHECK:STDOUT: !members:
  646. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.848
  647. // CHECK:STDOUT: .F = imports.%PackageA.import_ref.b36
  648. // CHECK:STDOUT: witness = (imports.%PackageA.F)
  649. // CHECK:STDOUT: }
  650. // CHECK:STDOUT:
  651. // CHECK:STDOUT: impl @C.as.HasF.impl: imports.%PackageA.import_ref.29a as imports.%PackageA.import_ref.e8c [from "package_a.carbon"] {
  652. // CHECK:STDOUT: !members:
  653. // CHECK:STDOUT: witness = imports.%PackageA.import_ref.a12
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT:
  656. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  657. // CHECK:STDOUT: complete_type_witness = imports.%PackageA.import_ref.8f2
  658. // CHECK:STDOUT:
  659. // CHECK:STDOUT: !members:
  660. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.2c4
  661. // CHECK:STDOUT: }
  662. // CHECK:STDOUT:
  663. // CHECK:STDOUT: fn @TestCF(%c.param: %C) {
  664. // CHECK:STDOUT: !entry:
  665. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  666. // CHECK:STDOUT: %PackageA.ref.loc7: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  667. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%PackageA.HasF [concrete = constants.%HasF.type]
  668. // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, imports.%PackageA.import_ref.b36 [concrete = constants.%assoc0]
  669. // CHECK:STDOUT: %impl.elem0: %.3f2 = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F]
  670. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.ref, %impl.elem0
  671. // CHECK:STDOUT: %C.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method(%c.ref)
  672. // CHECK:STDOUT: return
  673. // CHECK:STDOUT: }
  674. // CHECK:STDOUT:
  675. // CHECK:STDOUT: generic fn @HasF.F(imports.%PackageA.import_ref.0b6: %HasF.type) [from "package_a.carbon"] {
  676. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  677. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  678. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.fcd)]
  679. // CHECK:STDOUT:
  680. // CHECK:STDOUT: fn;
  681. // CHECK:STDOUT: }
  682. // CHECK:STDOUT:
  683. // CHECK:STDOUT: fn @C.as.HasF.impl.F [from "package_a.carbon"];
  684. // CHECK:STDOUT:
  685. // CHECK:STDOUT: specific @HasF.F(constants.%Self) {
  686. // CHECK:STDOUT: %Self => constants.%Self
  687. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  688. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fcd
  689. // CHECK:STDOUT: }
  690. // CHECK:STDOUT:
  691. // CHECK:STDOUT: --- use_df.carbon
  692. // CHECK:STDOUT:
  693. // CHECK:STDOUT: constants {
  694. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  695. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  696. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  697. // CHECK:STDOUT: %pattern_type.f09: type = pattern_type %D [concrete]
  698. // CHECK:STDOUT: %TestDF.type: type = fn_type @TestDF [concrete]
  699. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  700. // CHECK:STDOUT: %TestDF: %TestDF.type = struct_value () [concrete]
  701. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  702. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  703. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete]
  704. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, imports.%PackageA.import_ref.ab2 [concrete]
  705. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete]
  706. // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete]
  707. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  708. // CHECK:STDOUT: %pattern_type.fcd: type = pattern_type %Self.as_type [symbolic]
  709. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  710. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness imports.%HasF.impl_witness_table [concrete]
  711. // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %D, (%HasF.impl_witness) [concrete]
  712. // CHECK:STDOUT: %.321: type = fn_type_with_self_type %HasF.F.type, %HasF.facet [concrete]
  713. // CHECK:STDOUT: %D.as.HasF.impl.F.type: type = fn_type @D.as.HasF.impl.F [concrete]
  714. // CHECK:STDOUT: %D.as.HasF.impl.F: %D.as.HasF.impl.F.type = struct_value () [concrete]
  715. // CHECK:STDOUT: }
  716. // CHECK:STDOUT:
  717. // CHECK:STDOUT: imports {
  718. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  719. // CHECK:STDOUT: import Core//prelude
  720. // CHECK:STDOUT: import Core//prelude/...
  721. // CHECK:STDOUT: }
  722. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [concrete] {
  723. // CHECK:STDOUT: .HasF = %PackageA.HasF
  724. // CHECK:STDOUT: import PackageA//default
  725. // CHECK:STDOUT: }
  726. // CHECK:STDOUT: %PackageB: <namespace> = namespace file.%PackageB.import, [concrete] {
  727. // CHECK:STDOUT: .D = %PackageB.D
  728. // CHECK:STDOUT: import PackageB//default
  729. // CHECK:STDOUT: }
  730. // CHECK:STDOUT: %PackageB.D: type = import_ref PackageB//default, D, loaded [concrete = constants.%D]
  731. // CHECK:STDOUT: %PackageB.import_ref.8f2: <witness> = import_ref PackageB//default, loc10_10, loaded [concrete = constants.%complete_type]
  732. // CHECK:STDOUT: %PackageB.import_ref.cab = import_ref PackageB//default, inst45 [no loc], unloaded
  733. // CHECK:STDOUT: %PackageA.HasF: type = import_ref PackageA//default, HasF, loaded [concrete = constants.%HasF.type]
  734. // CHECK:STDOUT: %PackageA.import_ref.848 = import_ref PackageA//default, inst19 [no loc], unloaded
  735. // CHECK:STDOUT: %PackageA.import_ref.b36: %HasF.assoc_type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%assoc0]
  736. // CHECK:STDOUT: %PackageA.F = import_ref PackageA//default, F, unloaded
  737. // CHECK:STDOUT: %PackageA.import_ref.ab2: %HasF.F.type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%HasF.F]
  738. // CHECK:STDOUT: %PackageA.import_ref.0b6: %HasF.type = import_ref PackageA//default, inst19 [no loc], loaded [symbolic = constants.%Self]
  739. // CHECK:STDOUT: %PackageA.import_ref.54d = import_ref PackageA//default, loc11_16, unloaded
  740. // CHECK:STDOUT: %PackageA.import_ref.8f2: <witness> = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type]
  741. // CHECK:STDOUT: %PackageA.import_ref.2c4 = import_ref PackageA//default, inst43 [no loc], unloaded
  742. // CHECK:STDOUT: %PackageA.import_ref.29a: type = import_ref PackageA//default, loc11_6, loaded [concrete = constants.%C]
  743. // CHECK:STDOUT: %PackageA.import_ref.e8c: type = import_ref PackageA//default, loc11_11, loaded [concrete = constants.%HasF.type]
  744. // CHECK:STDOUT: %PackageB.import_ref.5e6: <witness> = import_ref PackageB//default, loc18_25, loaded [concrete = constants.%HasF.impl_witness]
  745. // CHECK:STDOUT: %PackageB.import_ref.aa9: type = import_ref PackageB//default, loc18_6, loaded [concrete = constants.%D]
  746. // CHECK:STDOUT: %PackageB.import_ref.831: type = import_ref PackageB//default, loc18_19, loaded [concrete = constants.%HasF.type]
  747. // CHECK:STDOUT: %PackageB.import_ref.9f3: %D.as.HasF.impl.F.type = import_ref PackageB//default, loc19_22, loaded [concrete = constants.%D.as.HasF.impl.F]
  748. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageB.import_ref.9f3), @D.as.HasF.impl [concrete]
  749. // CHECK:STDOUT: }
  750. // CHECK:STDOUT:
  751. // CHECK:STDOUT: file {
  752. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  753. // CHECK:STDOUT: .Core = imports.%Core
  754. // CHECK:STDOUT: .PackageA = imports.%PackageA
  755. // CHECK:STDOUT: .PackageB = imports.%PackageB
  756. // CHECK:STDOUT: .TestDF = %TestDF.decl
  757. // CHECK:STDOUT: }
  758. // CHECK:STDOUT: %Core.import = import Core
  759. // CHECK:STDOUT: %PackageA.import = import PackageA
  760. // CHECK:STDOUT: %PackageB.import = import PackageB
  761. // CHECK:STDOUT: %TestDF.decl: %TestDF.type = fn_decl @TestDF [concrete = constants.%TestDF] {
  762. // CHECK:STDOUT: %d.patt: %pattern_type.f09 = binding_pattern d [concrete]
  763. // CHECK:STDOUT: %d.param_patt: %pattern_type.f09 = value_param_pattern %d.patt, call_param0 [concrete]
  764. // CHECK:STDOUT: } {
  765. // CHECK:STDOUT: %d.param: %D = value_param call_param0
  766. // CHECK:STDOUT: %.loc7: type = splice_block %D.ref [concrete = constants.%D] {
  767. // CHECK:STDOUT: %PackageB.ref: <namespace> = name_ref PackageB, imports.%PackageB [concrete = imports.%PackageB]
  768. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%PackageB.D [concrete = constants.%D]
  769. // CHECK:STDOUT: }
  770. // CHECK:STDOUT: %d: %D = bind_name d, %d.param
  771. // CHECK:STDOUT: }
  772. // CHECK:STDOUT: }
  773. // CHECK:STDOUT:
  774. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  775. // CHECK:STDOUT: !members:
  776. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.848
  777. // CHECK:STDOUT: .F = imports.%PackageA.import_ref.b36
  778. // CHECK:STDOUT: witness = (imports.%PackageA.F)
  779. // CHECK:STDOUT: }
  780. // CHECK:STDOUT:
  781. // CHECK:STDOUT: impl @C.as.HasF.impl: imports.%PackageA.import_ref.29a as imports.%PackageA.import_ref.e8c [from "package_a.carbon"] {
  782. // CHECK:STDOUT: !members:
  783. // CHECK:STDOUT: witness = imports.%PackageA.import_ref.54d
  784. // CHECK:STDOUT: }
  785. // CHECK:STDOUT:
  786. // CHECK:STDOUT: impl @D.as.HasF.impl: imports.%PackageB.import_ref.aa9 as imports.%PackageB.import_ref.831 [from "package_b.carbon"] {
  787. // CHECK:STDOUT: !members:
  788. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.5e6
  789. // CHECK:STDOUT: }
  790. // CHECK:STDOUT:
  791. // CHECK:STDOUT: class @D [from "package_b.carbon"] {
  792. // CHECK:STDOUT: complete_type_witness = imports.%PackageB.import_ref.8f2
  793. // CHECK:STDOUT:
  794. // CHECK:STDOUT: !members:
  795. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.cab
  796. // CHECK:STDOUT: }
  797. // CHECK:STDOUT:
  798. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  799. // CHECK:STDOUT: complete_type_witness = imports.%PackageA.import_ref.8f2
  800. // CHECK:STDOUT:
  801. // CHECK:STDOUT: !members:
  802. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.2c4
  803. // CHECK:STDOUT: }
  804. // CHECK:STDOUT:
  805. // CHECK:STDOUT: fn @TestDF(%d.param: %D) {
  806. // CHECK:STDOUT: !entry:
  807. // CHECK:STDOUT: %d.ref: %D = name_ref d, %d
  808. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  809. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%PackageA.HasF [concrete = constants.%HasF.type]
  810. // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, imports.%PackageA.import_ref.b36 [concrete = constants.%assoc0]
  811. // CHECK:STDOUT: %impl.elem0: %.321 = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%D.as.HasF.impl.F]
  812. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %d.ref, %impl.elem0
  813. // CHECK:STDOUT: %D.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method(%d.ref)
  814. // CHECK:STDOUT: return
  815. // CHECK:STDOUT: }
  816. // CHECK:STDOUT:
  817. // CHECK:STDOUT: generic fn @HasF.F(imports.%PackageA.import_ref.0b6: %HasF.type) [from "package_a.carbon"] {
  818. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  819. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  820. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.fcd)]
  821. // CHECK:STDOUT:
  822. // CHECK:STDOUT: fn;
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT:
  825. // CHECK:STDOUT: fn @D.as.HasF.impl.F [from "package_b.carbon"];
  826. // CHECK:STDOUT:
  827. // CHECK:STDOUT: specific @HasF.F(constants.%Self) {
  828. // CHECK:STDOUT: %Self => constants.%Self
  829. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  830. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fcd
  831. // CHECK:STDOUT: }
  832. // CHECK:STDOUT:
  833. // CHECK:STDOUT: --- use_cg.carbon
  834. // CHECK:STDOUT:
  835. // CHECK:STDOUT: constants {
  836. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  837. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  838. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  839. // CHECK:STDOUT: %pattern_type.8e5: type = pattern_type %C [concrete]
  840. // CHECK:STDOUT: %TestCG.type: type = fn_type @TestCG [concrete]
  841. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  842. // CHECK:STDOUT: %TestCG: %TestCG.type = struct_value () [concrete]
  843. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [concrete]
  844. // CHECK:STDOUT: %Self: %HasG.type = bind_symbolic_name Self, 0 [symbolic]
  845. // CHECK:STDOUT: %HasG.assoc_type: type = assoc_entity_type @HasG [concrete]
  846. // CHECK:STDOUT: %assoc0: %HasG.assoc_type = assoc_entity element0, imports.%PackageB.import_ref.70a [concrete]
  847. // CHECK:STDOUT: %HasG.G.type: type = fn_type @HasG.G [concrete]
  848. // CHECK:STDOUT: %HasG.G: %HasG.G.type = struct_value () [concrete]
  849. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  850. // CHECK:STDOUT: %pattern_type.bf4: type = pattern_type %Self.as_type [symbolic]
  851. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  852. // CHECK:STDOUT: %HasG.impl_witness: <witness> = impl_witness imports.%HasG.impl_witness_table [concrete]
  853. // CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %C, (%HasG.impl_witness) [concrete]
  854. // CHECK:STDOUT: %.f91: type = fn_type_with_self_type %HasG.G.type, %HasG.facet [concrete]
  855. // CHECK:STDOUT: %C.as.HasG.impl.G.type: type = fn_type @C.as.HasG.impl.G [concrete]
  856. // CHECK:STDOUT: %C.as.HasG.impl.G: %C.as.HasG.impl.G.type = struct_value () [concrete]
  857. // CHECK:STDOUT: }
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: imports {
  860. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  861. // CHECK:STDOUT: import Core//prelude
  862. // CHECK:STDOUT: import Core//prelude/...
  863. // CHECK:STDOUT: }
  864. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [concrete] {
  865. // CHECK:STDOUT: .C = %PackageA.C
  866. // CHECK:STDOUT: import PackageA//default
  867. // CHECK:STDOUT: }
  868. // CHECK:STDOUT: %PackageB: <namespace> = namespace file.%PackageB.import, [concrete] {
  869. // CHECK:STDOUT: .HasG = %PackageB.HasG
  870. // CHECK:STDOUT: import PackageB//default
  871. // CHECK:STDOUT: }
  872. // CHECK:STDOUT: %PackageA.C: type = import_ref PackageA//default, C, loaded [concrete = constants.%C]
  873. // CHECK:STDOUT: %PackageA.import_ref.8f2: <witness> = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type]
  874. // CHECK:STDOUT: %PackageA.import_ref.2c4 = import_ref PackageA//default, inst43 [no loc], unloaded
  875. // CHECK:STDOUT: %PackageB.HasG: type = import_ref PackageB//default, HasG, loaded [concrete = constants.%HasG.type]
  876. // CHECK:STDOUT: %PackageB.import_ref.c0d = import_ref PackageB//default, inst21 [no loc], unloaded
  877. // CHECK:STDOUT: %PackageB.import_ref.6c2: %HasG.assoc_type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%assoc0]
  878. // CHECK:STDOUT: %PackageB.G = import_ref PackageB//default, G, unloaded
  879. // CHECK:STDOUT: %PackageB.import_ref.70a: %HasG.G.type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%HasG.G]
  880. // CHECK:STDOUT: %PackageB.import_ref.4b1: %HasG.type = import_ref PackageB//default, inst21 [no loc], loaded [symbolic = constants.%Self]
  881. // CHECK:STDOUT: %PackageB.import_ref.f06: <witness> = import_ref PackageB//default, loc13_25, loaded [concrete = constants.%HasG.impl_witness]
  882. // CHECK:STDOUT: %PackageB.import_ref.dfb: type = import_ref PackageB//default, loc13_14, loaded [concrete = constants.%C]
  883. // CHECK:STDOUT: %PackageB.import_ref.cee586.1: type = import_ref PackageB//default, loc13_20, loaded [concrete = constants.%HasG.type]
  884. // CHECK:STDOUT: %PackageB.import_ref.25f = import_ref PackageB//default, loc23_16, unloaded
  885. // CHECK:STDOUT: %PackageB.import_ref.8f2: <witness> = import_ref PackageB//default, loc10_10, loaded [concrete = constants.%complete_type]
  886. // CHECK:STDOUT: %PackageB.import_ref.cab = import_ref PackageB//default, inst45 [no loc], unloaded
  887. // CHECK:STDOUT: %PackageB.import_ref.aa9: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D]
  888. // CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type]
  889. // CHECK:STDOUT: %PackageB.import_ref.872: %C.as.HasG.impl.G.type = import_ref PackageB//default, loc14_22, loaded [concrete = constants.%C.as.HasG.impl.G]
  890. // CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.872), @C.as.HasG.impl [concrete]
  891. // CHECK:STDOUT: }
  892. // CHECK:STDOUT:
  893. // CHECK:STDOUT: file {
  894. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  895. // CHECK:STDOUT: .Core = imports.%Core
  896. // CHECK:STDOUT: .PackageA = imports.%PackageA
  897. // CHECK:STDOUT: .PackageB = imports.%PackageB
  898. // CHECK:STDOUT: .TestCG = %TestCG.decl
  899. // CHECK:STDOUT: }
  900. // CHECK:STDOUT: %Core.import = import Core
  901. // CHECK:STDOUT: %PackageA.import = import PackageA
  902. // CHECK:STDOUT: %PackageB.import = import PackageB
  903. // CHECK:STDOUT: %TestCG.decl: %TestCG.type = fn_decl @TestCG [concrete = constants.%TestCG] {
  904. // CHECK:STDOUT: %c.patt: %pattern_type.8e5 = binding_pattern c [concrete]
  905. // CHECK:STDOUT: %c.param_patt: %pattern_type.8e5 = value_param_pattern %c.patt, call_param0 [concrete]
  906. // CHECK:STDOUT: } {
  907. // CHECK:STDOUT: %c.param: %C = value_param call_param0
  908. // CHECK:STDOUT: %.loc7: type = splice_block %C.ref [concrete = constants.%C] {
  909. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  910. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%PackageA.C [concrete = constants.%C]
  911. // CHECK:STDOUT: }
  912. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  913. // CHECK:STDOUT: }
  914. // CHECK:STDOUT: }
  915. // CHECK:STDOUT:
  916. // CHECK:STDOUT: interface @HasG [from "package_b.carbon"] {
  917. // CHECK:STDOUT: !members:
  918. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.c0d
  919. // CHECK:STDOUT: .G = imports.%PackageB.import_ref.6c2
  920. // CHECK:STDOUT: witness = (imports.%PackageB.G)
  921. // CHECK:STDOUT: }
  922. // CHECK:STDOUT:
  923. // CHECK:STDOUT: impl @C.as.HasG.impl: imports.%PackageB.import_ref.dfb as imports.%PackageB.import_ref.cee586.1 [from "package_b.carbon"] {
  924. // CHECK:STDOUT: !members:
  925. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.f06
  926. // CHECK:STDOUT: }
  927. // CHECK:STDOUT:
  928. // CHECK:STDOUT: impl @D.as.HasG.impl: imports.%PackageB.import_ref.aa9 as imports.%PackageB.import_ref.cee586.2 [from "package_b.carbon"] {
  929. // CHECK:STDOUT: !members:
  930. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.25f
  931. // CHECK:STDOUT: }
  932. // CHECK:STDOUT:
  933. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  934. // CHECK:STDOUT: complete_type_witness = imports.%PackageA.import_ref.8f2
  935. // CHECK:STDOUT:
  936. // CHECK:STDOUT: !members:
  937. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.2c4
  938. // CHECK:STDOUT: }
  939. // CHECK:STDOUT:
  940. // CHECK:STDOUT: class @D [from "package_b.carbon"] {
  941. // CHECK:STDOUT: complete_type_witness = imports.%PackageB.import_ref.8f2
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: !members:
  944. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.cab
  945. // CHECK:STDOUT: }
  946. // CHECK:STDOUT:
  947. // CHECK:STDOUT: fn @TestCG(%c.param: %C) {
  948. // CHECK:STDOUT: !entry:
  949. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  950. // CHECK:STDOUT: %PackageB.ref: <namespace> = name_ref PackageB, imports.%PackageB [concrete = imports.%PackageB]
  951. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%PackageB.HasG [concrete = constants.%HasG.type]
  952. // CHECK:STDOUT: %G.ref: %HasG.assoc_type = name_ref G, imports.%PackageB.import_ref.6c2 [concrete = constants.%assoc0]
  953. // CHECK:STDOUT: %impl.elem0: %.f91 = impl_witness_access constants.%HasG.impl_witness, element0 [concrete = constants.%C.as.HasG.impl.G]
  954. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.ref, %impl.elem0
  955. // CHECK:STDOUT: %C.as.HasG.impl.G.call: init %empty_tuple.type = call %bound_method(%c.ref)
  956. // CHECK:STDOUT: return
  957. // CHECK:STDOUT: }
  958. // CHECK:STDOUT:
  959. // CHECK:STDOUT: generic fn @HasG.G(imports.%PackageB.import_ref.4b1: %HasG.type) [from "package_b.carbon"] {
  960. // CHECK:STDOUT: %Self: %HasG.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  961. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  962. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.bf4)]
  963. // CHECK:STDOUT:
  964. // CHECK:STDOUT: fn;
  965. // CHECK:STDOUT: }
  966. // CHECK:STDOUT:
  967. // CHECK:STDOUT: fn @C.as.HasG.impl.G [from "package_b.carbon"];
  968. // CHECK:STDOUT:
  969. // CHECK:STDOUT: specific @HasG.G(constants.%Self) {
  970. // CHECK:STDOUT: %Self => constants.%Self
  971. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  972. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.bf4
  973. // CHECK:STDOUT: }
  974. // CHECK:STDOUT:
  975. // CHECK:STDOUT: --- use_dg.carbon
  976. // CHECK:STDOUT:
  977. // CHECK:STDOUT: constants {
  978. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  979. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  980. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  981. // CHECK:STDOUT: %pattern_type.f09: type = pattern_type %D [concrete]
  982. // CHECK:STDOUT: %TestDG.type: type = fn_type @TestDG [concrete]
  983. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  984. // CHECK:STDOUT: %TestDG: %TestDG.type = struct_value () [concrete]
  985. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [concrete]
  986. // CHECK:STDOUT: %Self: %HasG.type = bind_symbolic_name Self, 0 [symbolic]
  987. // CHECK:STDOUT: %HasG.assoc_type: type = assoc_entity_type @HasG [concrete]
  988. // CHECK:STDOUT: %assoc0: %HasG.assoc_type = assoc_entity element0, imports.%PackageB.import_ref.70a [concrete]
  989. // CHECK:STDOUT: %HasG.G.type: type = fn_type @HasG.G [concrete]
  990. // CHECK:STDOUT: %HasG.G: %HasG.G.type = struct_value () [concrete]
  991. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  992. // CHECK:STDOUT: %pattern_type.bf4: type = pattern_type %Self.as_type [symbolic]
  993. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  994. // CHECK:STDOUT: %HasG.impl_witness: <witness> = impl_witness imports.%HasG.impl_witness_table [concrete]
  995. // CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %D, (%HasG.impl_witness) [concrete]
  996. // CHECK:STDOUT: %.3e2: type = fn_type_with_self_type %HasG.G.type, %HasG.facet [concrete]
  997. // CHECK:STDOUT: %D.as.HasG.impl.G.type: type = fn_type @D.as.HasG.impl.G [concrete]
  998. // CHECK:STDOUT: %D.as.HasG.impl.G: %D.as.HasG.impl.G.type = struct_value () [concrete]
  999. // CHECK:STDOUT: }
  1000. // CHECK:STDOUT:
  1001. // CHECK:STDOUT: imports {
  1002. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1003. // CHECK:STDOUT: import Core//prelude
  1004. // CHECK:STDOUT: import Core//prelude/...
  1005. // CHECK:STDOUT: }
  1006. // CHECK:STDOUT: %PackageB: <namespace> = namespace file.%PackageB.import, [concrete] {
  1007. // CHECK:STDOUT: .D = %PackageB.D
  1008. // CHECK:STDOUT: .HasG = %PackageB.HasG
  1009. // CHECK:STDOUT: import PackageB//default
  1010. // CHECK:STDOUT: }
  1011. // CHECK:STDOUT: %PackageB.D: type = import_ref PackageB//default, D, loaded [concrete = constants.%D]
  1012. // CHECK:STDOUT: %PackageB.import_ref.8f2: <witness> = import_ref PackageB//default, loc10_10, loaded [concrete = constants.%complete_type]
  1013. // CHECK:STDOUT: %PackageB.import_ref.cab = import_ref PackageB//default, inst45 [no loc], unloaded
  1014. // CHECK:STDOUT: %PackageB.HasG: type = import_ref PackageB//default, HasG, loaded [concrete = constants.%HasG.type]
  1015. // CHECK:STDOUT: %PackageB.import_ref.c0d = import_ref PackageB//default, inst21 [no loc], unloaded
  1016. // CHECK:STDOUT: %PackageB.import_ref.6c2: %HasG.assoc_type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%assoc0]
  1017. // CHECK:STDOUT: %PackageB.G = import_ref PackageB//default, G, unloaded
  1018. // CHECK:STDOUT: %PackageB.import_ref.70a: %HasG.G.type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%HasG.G]
  1019. // CHECK:STDOUT: %PackageB.import_ref.4b1: %HasG.type = import_ref PackageB//default, inst21 [no loc], loaded [symbolic = constants.%Self]
  1020. // CHECK:STDOUT: %PackageB.import_ref.f94 = import_ref PackageB//default, loc13_25, unloaded
  1021. // CHECK:STDOUT: %PackageB.import_ref.8db: <witness> = import_ref PackageB//default, inst92 [indirect], loaded [concrete = constants.%complete_type]
  1022. // CHECK:STDOUT: %PackageB.import_ref.6a9 = import_ref PackageB//default, inst93 [indirect], unloaded
  1023. // CHECK:STDOUT: %PackageB.import_ref.dfb: type = import_ref PackageB//default, loc13_14, loaded [concrete = constants.%C]
  1024. // CHECK:STDOUT: %PackageB.import_ref.cee586.1: type = import_ref PackageB//default, loc13_20, loaded [concrete = constants.%HasG.type]
  1025. // CHECK:STDOUT: %PackageB.import_ref.179: <witness> = import_ref PackageB//default, loc23_16, loaded [concrete = constants.%HasG.impl_witness]
  1026. // CHECK:STDOUT: %PackageB.import_ref.aa9: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D]
  1027. // CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type]
  1028. // CHECK:STDOUT: %PackageB.import_ref.ad0: %D.as.HasG.impl.G.type = import_ref PackageB//default, loc24_22, loaded [concrete = constants.%D.as.HasG.impl.G]
  1029. // CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.ad0), @D.as.HasG.impl [concrete]
  1030. // CHECK:STDOUT: }
  1031. // CHECK:STDOUT:
  1032. // CHECK:STDOUT: file {
  1033. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1034. // CHECK:STDOUT: .Core = imports.%Core
  1035. // CHECK:STDOUT: .PackageB = imports.%PackageB
  1036. // CHECK:STDOUT: .TestDG = %TestDG.decl
  1037. // CHECK:STDOUT: }
  1038. // CHECK:STDOUT: %Core.import = import Core
  1039. // CHECK:STDOUT: %PackageB.import = import PackageB
  1040. // CHECK:STDOUT: %TestDG.decl: %TestDG.type = fn_decl @TestDG [concrete = constants.%TestDG] {
  1041. // CHECK:STDOUT: %d.patt: %pattern_type.f09 = binding_pattern d [concrete]
  1042. // CHECK:STDOUT: %d.param_patt: %pattern_type.f09 = value_param_pattern %d.patt, call_param0 [concrete]
  1043. // CHECK:STDOUT: } {
  1044. // CHECK:STDOUT: %d.param: %D = value_param call_param0
  1045. // CHECK:STDOUT: %.loc6: type = splice_block %D.ref [concrete = constants.%D] {
  1046. // CHECK:STDOUT: %PackageB.ref.loc6: <namespace> = name_ref PackageB, imports.%PackageB [concrete = imports.%PackageB]
  1047. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%PackageB.D [concrete = constants.%D]
  1048. // CHECK:STDOUT: }
  1049. // CHECK:STDOUT: %d: %D = bind_name d, %d.param
  1050. // CHECK:STDOUT: }
  1051. // CHECK:STDOUT: }
  1052. // CHECK:STDOUT:
  1053. // CHECK:STDOUT: interface @HasG [from "package_b.carbon"] {
  1054. // CHECK:STDOUT: !members:
  1055. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.c0d
  1056. // CHECK:STDOUT: .G = imports.%PackageB.import_ref.6c2
  1057. // CHECK:STDOUT: witness = (imports.%PackageB.G)
  1058. // CHECK:STDOUT: }
  1059. // CHECK:STDOUT:
  1060. // CHECK:STDOUT: impl @C.as.HasG.impl: imports.%PackageB.import_ref.dfb as imports.%PackageB.import_ref.cee586.1 [from "package_b.carbon"] {
  1061. // CHECK:STDOUT: !members:
  1062. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.f94
  1063. // CHECK:STDOUT: }
  1064. // CHECK:STDOUT:
  1065. // CHECK:STDOUT: impl @D.as.HasG.impl: imports.%PackageB.import_ref.aa9 as imports.%PackageB.import_ref.cee586.2 [from "package_b.carbon"] {
  1066. // CHECK:STDOUT: !members:
  1067. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.179
  1068. // CHECK:STDOUT: }
  1069. // CHECK:STDOUT:
  1070. // CHECK:STDOUT: class @D [from "package_b.carbon"] {
  1071. // CHECK:STDOUT: complete_type_witness = imports.%PackageB.import_ref.8f2
  1072. // CHECK:STDOUT:
  1073. // CHECK:STDOUT: !members:
  1074. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.cab
  1075. // CHECK:STDOUT: }
  1076. // CHECK:STDOUT:
  1077. // CHECK:STDOUT: class @C [from "package_b.carbon"] {
  1078. // CHECK:STDOUT: complete_type_witness = imports.%PackageB.import_ref.8db
  1079. // CHECK:STDOUT:
  1080. // CHECK:STDOUT: !members:
  1081. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.6a9
  1082. // CHECK:STDOUT: }
  1083. // CHECK:STDOUT:
  1084. // CHECK:STDOUT: fn @TestDG(%d.param: %D) {
  1085. // CHECK:STDOUT: !entry:
  1086. // CHECK:STDOUT: %d.ref: %D = name_ref d, %d
  1087. // CHECK:STDOUT: %PackageB.ref.loc7: <namespace> = name_ref PackageB, imports.%PackageB [concrete = imports.%PackageB]
  1088. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%PackageB.HasG [concrete = constants.%HasG.type]
  1089. // CHECK:STDOUT: %G.ref: %HasG.assoc_type = name_ref G, imports.%PackageB.import_ref.6c2 [concrete = constants.%assoc0]
  1090. // CHECK:STDOUT: %impl.elem0: %.3e2 = impl_witness_access constants.%HasG.impl_witness, element0 [concrete = constants.%D.as.HasG.impl.G]
  1091. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %d.ref, %impl.elem0
  1092. // CHECK:STDOUT: %D.as.HasG.impl.G.call: init %empty_tuple.type = call %bound_method(%d.ref)
  1093. // CHECK:STDOUT: return
  1094. // CHECK:STDOUT: }
  1095. // CHECK:STDOUT:
  1096. // CHECK:STDOUT: generic fn @HasG.G(imports.%PackageB.import_ref.4b1: %HasG.type) [from "package_b.carbon"] {
  1097. // CHECK:STDOUT: %Self: %HasG.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1098. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  1099. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.bf4)]
  1100. // CHECK:STDOUT:
  1101. // CHECK:STDOUT: fn;
  1102. // CHECK:STDOUT: }
  1103. // CHECK:STDOUT:
  1104. // CHECK:STDOUT: fn @D.as.HasG.impl.G [from "package_b.carbon"];
  1105. // CHECK:STDOUT:
  1106. // CHECK:STDOUT: specific @HasG.G(constants.%Self) {
  1107. // CHECK:STDOUT: %Self => constants.%Self
  1108. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  1109. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.bf4
  1110. // CHECK:STDOUT: }
  1111. // CHECK:STDOUT:
  1112. // CHECK:STDOUT: --- associated_interface.carbon
  1113. // CHECK:STDOUT:
  1114. // CHECK:STDOUT: constants {
  1115. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  1116. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic]
  1117. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1118. // CHECK:STDOUT: %pattern_type.c8d: type = pattern_type %Self.as_type [symbolic]
  1119. // CHECK:STDOUT: %Z.H.type: type = fn_type @Z.H [concrete]
  1120. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1121. // CHECK:STDOUT: %Z.H: %Z.H.type = struct_value () [concrete]
  1122. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  1123. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, @Z.%Z.H.decl [concrete]
  1124. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table [concrete]
  1125. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  1126. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H.type: type = fn_type @empty_tuple.type.as.Z.impl.H [concrete]
  1127. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H: %empty_tuple.type.as.Z.impl.H.type = struct_value () [concrete]
  1128. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, (%Z.impl_witness) [concrete]
  1129. // CHECK:STDOUT: }
  1130. // CHECK:STDOUT:
  1131. // CHECK:STDOUT: imports {
  1132. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1133. // CHECK:STDOUT: import Core//prelude
  1134. // CHECK:STDOUT: import Core//prelude/...
  1135. // CHECK:STDOUT: }
  1136. // CHECK:STDOUT: }
  1137. // CHECK:STDOUT:
  1138. // CHECK:STDOUT: file {
  1139. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1140. // CHECK:STDOUT: .Core = imports.%Core
  1141. // CHECK:STDOUT: .Z = %Z.decl
  1142. // CHECK:STDOUT: }
  1143. // CHECK:STDOUT: %Core.import = import Core
  1144. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  1145. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.Z.impl [concrete] {} {
  1146. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  1147. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1148. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1149. // CHECK:STDOUT: }
  1150. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (@empty_tuple.type.as.Z.impl.%empty_tuple.type.as.Z.impl.H.decl), @empty_tuple.type.as.Z.impl [concrete]
  1151. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness]
  1152. // CHECK:STDOUT: }
  1153. // CHECK:STDOUT:
  1154. // CHECK:STDOUT: interface @Z {
  1155. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1156. // CHECK:STDOUT: %Z.H.decl: %Z.H.type = fn_decl @Z.H [concrete = constants.%Z.H] {
  1157. // CHECK:STDOUT: %self.patt: @Z.H.%pattern_type (%pattern_type.c8d) = binding_pattern self [concrete]
  1158. // CHECK:STDOUT: %self.param_patt: @Z.H.%pattern_type (%pattern_type.c8d) = value_param_pattern %self.patt, call_param0 [concrete]
  1159. // CHECK:STDOUT: } {
  1160. // CHECK:STDOUT: %self.param: @Z.H.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0
  1161. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] {
  1162. // CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self [symbolic = %Self (constants.%Self)]
  1163. // 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)]
  1164. // 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)]
  1165. // CHECK:STDOUT: }
  1166. // CHECK:STDOUT: %self: @Z.H.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param
  1167. // CHECK:STDOUT: }
  1168. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, %Z.H.decl [concrete = constants.%assoc0]
  1169. // CHECK:STDOUT:
  1170. // CHECK:STDOUT: !members:
  1171. // CHECK:STDOUT: .Self = %Self
  1172. // CHECK:STDOUT: .H = %assoc0
  1173. // CHECK:STDOUT: witness = (%Z.H.decl)
  1174. // CHECK:STDOUT: }
  1175. // CHECK:STDOUT:
  1176. // CHECK:STDOUT: impl @empty_tuple.type.as.Z.impl: %.loc8_7.2 as %Z.ref {
  1177. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H.decl: %empty_tuple.type.as.Z.impl.H.type = fn_decl @empty_tuple.type.as.Z.impl.H [concrete = constants.%empty_tuple.type.as.Z.impl.H] {
  1178. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
  1179. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  1180. // CHECK:STDOUT: } {
  1181. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  1182. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.Z.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  1183. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  1184. // CHECK:STDOUT: }
  1185. // CHECK:STDOUT:
  1186. // CHECK:STDOUT: !members:
  1187. // CHECK:STDOUT: .H = %empty_tuple.type.as.Z.impl.H.decl
  1188. // CHECK:STDOUT: witness = file.%Z.impl_witness
  1189. // CHECK:STDOUT: }
  1190. // CHECK:STDOUT:
  1191. // CHECK:STDOUT: generic fn @Z.H(@Z.%Self: %Z.type) {
  1192. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1193. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  1194. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.c8d)]
  1195. // CHECK:STDOUT:
  1196. // CHECK:STDOUT: fn(%self.param: @Z.H.%Self.as_type.loc5_14.1 (%Self.as_type));
  1197. // CHECK:STDOUT: }
  1198. // CHECK:STDOUT:
  1199. // CHECK:STDOUT: fn @empty_tuple.type.as.Z.impl.H(%self.param: %empty_tuple.type) {
  1200. // CHECK:STDOUT: !entry:
  1201. // CHECK:STDOUT: return
  1202. // CHECK:STDOUT: }
  1203. // CHECK:STDOUT:
  1204. // CHECK:STDOUT: specific @Z.H(constants.%Self) {
  1205. // CHECK:STDOUT: %Self => constants.%Self
  1206. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type
  1207. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c8d
  1208. // CHECK:STDOUT: }
  1209. // CHECK:STDOUT:
  1210. // CHECK:STDOUT: specific @Z.H(constants.%Z.facet) {
  1211. // CHECK:STDOUT: %Self => constants.%Z.facet
  1212. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_tuple.type
  1213. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb1
  1214. // CHECK:STDOUT: }
  1215. // CHECK:STDOUT:
  1216. // CHECK:STDOUT: --- import_associated_interface.carbon
  1217. // CHECK:STDOUT:
  1218. // CHECK:STDOUT: constants {
  1219. // CHECK:STDOUT: %J.type: type = fn_type @J [concrete]
  1220. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1221. // CHECK:STDOUT: %J: %J.type = struct_value () [concrete]
  1222. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  1223. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic]
  1224. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  1225. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, imports.%PackageAssociatedInterface.import_ref.250 [concrete]
  1226. // CHECK:STDOUT: %Z.H.type: type = fn_type @Z.H [concrete]
  1227. // CHECK:STDOUT: %Z.H: %Z.H.type = struct_value () [concrete]
  1228. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1229. // CHECK:STDOUT: %pattern_type.6b0: type = pattern_type %Self.as_type [symbolic]
  1230. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness imports.%Z.impl_witness_table [concrete]
  1231. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, (%Z.impl_witness) [concrete]
  1232. // CHECK:STDOUT: %.a1b: type = fn_type_with_self_type %Z.H.type, %Z.facet [concrete]
  1233. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H.type: type = fn_type @empty_tuple.type.as.Z.impl.H [concrete]
  1234. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H: %empty_tuple.type.as.Z.impl.H.type = struct_value () [concrete]
  1235. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  1236. // CHECK:STDOUT: }
  1237. // CHECK:STDOUT:
  1238. // CHECK:STDOUT: imports {
  1239. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1240. // CHECK:STDOUT: import Core//prelude
  1241. // CHECK:STDOUT: import Core//prelude/...
  1242. // CHECK:STDOUT: }
  1243. // CHECK:STDOUT: %PackageAssociatedInterface: <namespace> = namespace file.%PackageAssociatedInterface.import, [concrete] {
  1244. // CHECK:STDOUT: .Z = %PackageAssociatedInterface.Z
  1245. // CHECK:STDOUT: import PackageAssociatedInterface//default
  1246. // CHECK:STDOUT: }
  1247. // CHECK:STDOUT: %PackageAssociatedInterface.Z: type = import_ref PackageAssociatedInterface//default, Z, loaded [concrete = constants.%Z.type]
  1248. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.362 = import_ref PackageAssociatedInterface//default, inst19 [no loc], unloaded
  1249. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.609: %Z.assoc_type = import_ref PackageAssociatedInterface//default, loc5_21, loaded [concrete = constants.%assoc0]
  1250. // CHECK:STDOUT: %PackageAssociatedInterface.H = import_ref PackageAssociatedInterface//default, H, unloaded
  1251. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.250: %Z.H.type = import_ref PackageAssociatedInterface//default, loc5_21, loaded [concrete = constants.%Z.H]
  1252. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.863: %Z.type = import_ref PackageAssociatedInterface//default, inst19 [no loc], loaded [symbolic = constants.%Self]
  1253. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.915: <witness> = import_ref PackageAssociatedInterface//default, loc8_14, loaded [concrete = constants.%Z.impl_witness]
  1254. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.e5c: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [concrete = constants.%empty_tuple.type]
  1255. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.df1: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [concrete = constants.%Z.type]
  1256. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.108: %empty_tuple.type.as.Z.impl.H.type = import_ref PackageAssociatedInterface//default, loc9_22, loaded [concrete = constants.%empty_tuple.type.as.Z.impl.H]
  1257. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%PackageAssociatedInterface.import_ref.108), @empty_tuple.type.as.Z.impl [concrete]
  1258. // CHECK:STDOUT: }
  1259. // CHECK:STDOUT:
  1260. // CHECK:STDOUT: file {
  1261. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1262. // CHECK:STDOUT: .Core = imports.%Core
  1263. // CHECK:STDOUT: .PackageAssociatedInterface = imports.%PackageAssociatedInterface
  1264. // CHECK:STDOUT: .J = %J.decl
  1265. // CHECK:STDOUT: }
  1266. // CHECK:STDOUT: %Core.import = import Core
  1267. // CHECK:STDOUT: %PackageAssociatedInterface.import = import PackageAssociatedInterface
  1268. // CHECK:STDOUT: %J.decl: %J.type = fn_decl @J [concrete = constants.%J] {} {}
  1269. // CHECK:STDOUT: }
  1270. // CHECK:STDOUT:
  1271. // CHECK:STDOUT: interface @Z [from "associated_interface.carbon"] {
  1272. // CHECK:STDOUT: !members:
  1273. // CHECK:STDOUT: .Self = imports.%PackageAssociatedInterface.import_ref.362
  1274. // CHECK:STDOUT: .H = imports.%PackageAssociatedInterface.import_ref.609
  1275. // CHECK:STDOUT: witness = (imports.%PackageAssociatedInterface.H)
  1276. // CHECK:STDOUT: }
  1277. // CHECK:STDOUT:
  1278. // CHECK:STDOUT: impl @empty_tuple.type.as.Z.impl: imports.%PackageAssociatedInterface.import_ref.e5c as imports.%PackageAssociatedInterface.import_ref.df1 [from "associated_interface.carbon"] {
  1279. // CHECK:STDOUT: !members:
  1280. // CHECK:STDOUT: witness = imports.%PackageAssociatedInterface.import_ref.915
  1281. // CHECK:STDOUT: }
  1282. // CHECK:STDOUT:
  1283. // CHECK:STDOUT: fn @J() {
  1284. // CHECK:STDOUT: !entry:
  1285. // CHECK:STDOUT: %.loc7_4.1: %empty_tuple.type = tuple_literal ()
  1286. // CHECK:STDOUT: %PackageAssociatedInterface.ref: <namespace> = name_ref PackageAssociatedInterface, imports.%PackageAssociatedInterface [concrete = imports.%PackageAssociatedInterface]
  1287. // CHECK:STDOUT: %Z.ref: type = name_ref Z, imports.%PackageAssociatedInterface.Z [concrete = constants.%Z.type]
  1288. // CHECK:STDOUT: %H.ref: %Z.assoc_type = name_ref H, imports.%PackageAssociatedInterface.import_ref.609 [concrete = constants.%assoc0]
  1289. // CHECK:STDOUT: %impl.elem0: %.a1b = impl_witness_access constants.%Z.impl_witness, element0 [concrete = constants.%empty_tuple.type.as.Z.impl.H]
  1290. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc7_4.1, %impl.elem0
  1291. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  1292. // CHECK:STDOUT: %.loc7_4.2: %empty_tuple.type = converted %.loc7_4.1, %empty_tuple [concrete = constants.%empty_tuple]
  1293. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H.call: init %empty_tuple.type = call %bound_method(%.loc7_4.2)
  1294. // CHECK:STDOUT: return
  1295. // CHECK:STDOUT: }
  1296. // CHECK:STDOUT:
  1297. // CHECK:STDOUT: generic fn @Z.H(imports.%PackageAssociatedInterface.import_ref.863: %Z.type) [from "associated_interface.carbon"] {
  1298. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1299. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  1300. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.6b0)]
  1301. // CHECK:STDOUT:
  1302. // CHECK:STDOUT: fn;
  1303. // CHECK:STDOUT: }
  1304. // CHECK:STDOUT:
  1305. // CHECK:STDOUT: fn @empty_tuple.type.as.Z.impl.H [from "associated_interface.carbon"];
  1306. // CHECK:STDOUT:
  1307. // CHECK:STDOUT: specific @Z.H(constants.%Self) {
  1308. // CHECK:STDOUT: %Self => constants.%Self
  1309. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  1310. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6b0
  1311. // CHECK:STDOUT: }
  1312. // CHECK:STDOUT:
  1313. // CHECK:STDOUT: --- has_param.carbon
  1314. // CHECK:STDOUT:
  1315. // CHECK:STDOUT: constants {
  1316. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1317. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  1318. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1319. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1320. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  1321. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1322. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  1323. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  1324. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  1325. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1326. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1327. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @AnyParam.%Destroy.impl_witness_table, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1328. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  1329. // CHECK:STDOUT: %ptr.eba: type = ptr_type %AnyParam [symbolic]
  1330. // CHECK:STDOUT: %pattern_type.74e: type = pattern_type %ptr.eba [symbolic]
  1331. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1332. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: %AnyParam.as.Destroy.impl.Op.type = struct_value () [symbolic]
  1333. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1334. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1335. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  1336. // CHECK:STDOUT: %Self.045: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1337. // CHECK:STDOUT: %Self.as_type.fca: type = facet_access_type %Self.045 [symbolic]
  1338. // CHECK:STDOUT: %pattern_type.5da: type = pattern_type %Self.as_type.fca [symbolic]
  1339. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  1340. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  1341. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  1342. // CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, @Y.%Y.K.decl [concrete]
  1343. // CHECK:STDOUT: %require_complete.dc2: <witness> = require_complete_type %Self.as_type.fca [symbolic]
  1344. // CHECK:STDOUT: }
  1345. // CHECK:STDOUT:
  1346. // CHECK:STDOUT: imports {
  1347. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1348. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1349. // CHECK:STDOUT: import Core//prelude
  1350. // CHECK:STDOUT: import Core//prelude/...
  1351. // CHECK:STDOUT: }
  1352. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1353. // CHECK:STDOUT: }
  1354. // CHECK:STDOUT:
  1355. // CHECK:STDOUT: file {
  1356. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1357. // CHECK:STDOUT: .Core = imports.%Core
  1358. // CHECK:STDOUT: .AnyParam = %AnyParam.decl
  1359. // CHECK:STDOUT: .Y = %Y.decl
  1360. // CHECK:STDOUT: }
  1361. // CHECK:STDOUT: %Core.import = import Core
  1362. // CHECK:STDOUT: %AnyParam.decl: %AnyParam.type = class_decl @AnyParam [concrete = constants.%AnyParam.generic] {
  1363. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1364. // CHECK:STDOUT: %X.patt: @AnyParam.%pattern_type (%pattern_type.7dc) = symbolic_binding_pattern X, 1 [concrete]
  1365. // CHECK:STDOUT: } {
  1366. // CHECK:STDOUT: %.Self.1: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1367. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  1368. // CHECK:STDOUT: %.loc4: type = splice_block %T.ref [symbolic = %T.loc4_16.1 (constants.%T)] {
  1369. // CHECK:STDOUT: %.Self.2: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1370. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [symbolic = %T.loc4_16.1 (constants.%T)]
  1371. // CHECK:STDOUT: }
  1372. // CHECK:STDOUT: %X.loc4_26.2: @AnyParam.%T.loc4_16.1 (%T) = bind_symbolic_name X, 1 [symbolic = %X.loc4_26.1 (constants.%X)]
  1373. // CHECK:STDOUT: }
  1374. // CHECK:STDOUT: %Y.decl: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
  1375. // CHECK:STDOUT: }
  1376. // CHECK:STDOUT:
  1377. // CHECK:STDOUT: interface @Y {
  1378. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.045]
  1379. // CHECK:STDOUT: %Y.K.decl: %Y.K.type = fn_decl @Y.K [concrete = constants.%Y.K] {
  1380. // CHECK:STDOUT: %self.patt: @Y.K.%pattern_type (%pattern_type.5da) = binding_pattern self [concrete]
  1381. // CHECK:STDOUT: %self.param_patt: @Y.K.%pattern_type (%pattern_type.5da) = value_param_pattern %self.patt, call_param0 [concrete]
  1382. // CHECK:STDOUT: } {
  1383. // CHECK:STDOUT: %self.param: @Y.K.%Self.as_type.loc7_14.1 (%Self.as_type.fca) = value_param call_param0
  1384. // CHECK:STDOUT: %.loc7_14.1: type = splice_block %.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.fca)] {
  1385. // CHECK:STDOUT: %Self.ref: %Y.type = name_ref Self, @Y.%Self [symbolic = %Self (constants.%Self.045)]
  1386. // CHECK:STDOUT: %Self.as_type.loc7_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.fca)]
  1387. // CHECK:STDOUT: %.loc7_14.2: type = converted %Self.ref, %Self.as_type.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.fca)]
  1388. // CHECK:STDOUT: }
  1389. // CHECK:STDOUT: %self: @Y.K.%Self.as_type.loc7_14.1 (%Self.as_type.fca) = bind_name self, %self.param
  1390. // CHECK:STDOUT: }
  1391. // CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, %Y.K.decl [concrete = constants.%assoc0]
  1392. // CHECK:STDOUT:
  1393. // CHECK:STDOUT: !members:
  1394. // CHECK:STDOUT: .Self = %Self
  1395. // CHECK:STDOUT: .K = %assoc0
  1396. // CHECK:STDOUT: witness = (%Y.K.decl)
  1397. // CHECK:STDOUT: }
  1398. // CHECK:STDOUT:
  1399. // CHECK:STDOUT: generic impl @AnyParam.as.Destroy.impl(@AnyParam.%T.loc4_16.2: type, @AnyParam.%X.loc4_26.2: @AnyParam.%T.loc4_16.1 (%T)) {
  1400. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1401. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1402. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam)]
  1403. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @AnyParam.%Destroy.impl_witness_table, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness)]
  1404. // CHECK:STDOUT:
  1405. // CHECK:STDOUT: !definition:
  1406. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %AnyParam.as.Destroy.impl.Op.type (constants.%AnyParam.as.Destroy.impl.Op.type)]
  1407. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type) = struct_value () [symbolic = %AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op)]
  1408. // CHECK:STDOUT:
  1409. // CHECK:STDOUT: impl: @AnyParam.%Self.ref as constants.%Destroy.type {
  1410. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.decl: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type) = fn_decl @AnyParam.as.Destroy.impl.Op [symbolic = @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op)] {
  1411. // CHECK:STDOUT: %self.patt: @AnyParam.as.Destroy.impl.Op.%pattern_type (%pattern_type.74e) = binding_pattern self [concrete]
  1412. // CHECK:STDOUT: %self.param_patt: @AnyParam.as.Destroy.impl.Op.%pattern_type (%pattern_type.74e) = value_param_pattern %self.patt, call_param0 [concrete]
  1413. // CHECK:STDOUT: %.loc4_33.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1414. // CHECK:STDOUT: } {
  1415. // CHECK:STDOUT: %self.param: @AnyParam.as.Destroy.impl.Op.%ptr (%ptr.eba) = value_param call_param0
  1416. // CHECK:STDOUT: %.loc4_33.2: type = splice_block %Self.ref [symbolic = %AnyParam (constants.%AnyParam)] {
  1417. // CHECK:STDOUT: %.loc4_33.3: type = specific_constant constants.%AnyParam, @AnyParam(constants.%T, constants.%X) [symbolic = %AnyParam (constants.%AnyParam)]
  1418. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc4_33.3 [symbolic = %AnyParam (constants.%AnyParam)]
  1419. // CHECK:STDOUT: }
  1420. // CHECK:STDOUT: %self: @AnyParam.as.Destroy.impl.Op.%ptr (%ptr.eba) = bind_name self, %self.param
  1421. // CHECK:STDOUT: }
  1422. // CHECK:STDOUT:
  1423. // CHECK:STDOUT: !members:
  1424. // CHECK:STDOUT: .Op = %AnyParam.as.Destroy.impl.Op.decl
  1425. // CHECK:STDOUT: witness = @AnyParam.%Destroy.impl_witness
  1426. // CHECK:STDOUT: }
  1427. // CHECK:STDOUT: }
  1428. // CHECK:STDOUT:
  1429. // CHECK:STDOUT: generic class @AnyParam(%T.loc4_16.2: type, %X.loc4_26.2: @AnyParam.%T.loc4_16.1 (%T)) {
  1430. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  1431. // CHECK:STDOUT: %X.loc4_26.1: @AnyParam.%T.loc4_16.1 (%T) = bind_symbolic_name X, 1 [symbolic = %X.loc4_26.1 (constants.%X)]
  1432. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_16.1 [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1433. // CHECK:STDOUT:
  1434. // CHECK:STDOUT: !definition:
  1435. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc4_16.1 [symbolic = %require_complete (constants.%require_complete.4ae)]
  1436. // CHECK:STDOUT:
  1437. // CHECK:STDOUT: class {
  1438. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%AnyParam [symbolic = @AnyParam.as.Destroy.impl.%AnyParam (constants.%AnyParam)]
  1439. // CHECK:STDOUT: impl_decl @AnyParam.as.Destroy.impl [concrete] {} {}
  1440. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.decl), @AnyParam.as.Destroy.impl [concrete]
  1441. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table, @AnyParam.as.Destroy.impl(constants.%T, constants.%X) [symbolic = @AnyParam.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness)]
  1442. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1443. // CHECK:STDOUT: complete_type_witness = %complete_type
  1444. // CHECK:STDOUT:
  1445. // CHECK:STDOUT: !members:
  1446. // CHECK:STDOUT: .Self = constants.%AnyParam
  1447. // CHECK:STDOUT: }
  1448. // CHECK:STDOUT: }
  1449. // CHECK:STDOUT:
  1450. // CHECK:STDOUT: generic fn @AnyParam.as.Destroy.impl.Op(@AnyParam.%T.loc4_16.2: type, @AnyParam.%X.loc4_26.2: @AnyParam.%T.loc4_16.1 (%T)) {
  1451. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1452. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1453. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam)]
  1454. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.eba)]
  1455. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.74e)]
  1456. // CHECK:STDOUT:
  1457. // CHECK:STDOUT: !definition:
  1458. // CHECK:STDOUT:
  1459. // CHECK:STDOUT: fn(%self.param: @AnyParam.as.Destroy.impl.Op.%ptr (%ptr.eba)) = "no_op";
  1460. // CHECK:STDOUT: }
  1461. // CHECK:STDOUT:
  1462. // CHECK:STDOUT: generic fn @Y.K(@Y.%Self: %Y.type) {
  1463. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.045)]
  1464. // CHECK:STDOUT: %Self.as_type.loc7_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.fca)]
  1465. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc7_14.1 [symbolic = %pattern_type (constants.%pattern_type.5da)]
  1466. // CHECK:STDOUT:
  1467. // CHECK:STDOUT: !definition:
  1468. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type.loc7_14.1 [symbolic = %require_complete (constants.%require_complete.dc2)]
  1469. // CHECK:STDOUT:
  1470. // CHECK:STDOUT: fn(%self.param: @Y.K.%Self.as_type.loc7_14.1 (%Self.as_type.fca)) {
  1471. // CHECK:STDOUT: !entry:
  1472. // CHECK:STDOUT: return
  1473. // CHECK:STDOUT: }
  1474. // CHECK:STDOUT: }
  1475. // CHECK:STDOUT:
  1476. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  1477. // CHECK:STDOUT: %T.loc4_16.1 => constants.%T
  1478. // CHECK:STDOUT: %X.loc4_26.1 => constants.%X
  1479. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1480. // CHECK:STDOUT: }
  1481. // CHECK:STDOUT:
  1482. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  1483. // CHECK:STDOUT: %T => constants.%T
  1484. // CHECK:STDOUT: %X => constants.%X
  1485. // CHECK:STDOUT: %AnyParam => constants.%AnyParam
  1486. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness
  1487. // CHECK:STDOUT: }
  1488. // CHECK:STDOUT:
  1489. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  1490. // CHECK:STDOUT: %T => constants.%T
  1491. // CHECK:STDOUT: %X => constants.%X
  1492. // CHECK:STDOUT: %AnyParam => constants.%AnyParam
  1493. // CHECK:STDOUT: %ptr => constants.%ptr.eba
  1494. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.74e
  1495. // CHECK:STDOUT: }
  1496. // CHECK:STDOUT:
  1497. // CHECK:STDOUT: specific @Y.K(constants.%Self.045) {
  1498. // CHECK:STDOUT: %Self => constants.%Self.045
  1499. // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%Self.as_type.fca
  1500. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.5da
  1501. // CHECK:STDOUT: }
  1502. // CHECK:STDOUT:
  1503. // CHECK:STDOUT: --- has_generic_interface.carbon
  1504. // CHECK:STDOUT:
  1505. // CHECK:STDOUT: constants {
  1506. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1507. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  1508. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  1509. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1510. // CHECK:STDOUT: %GenericInterface.type.c92: type = generic_interface_type @GenericInterface [concrete]
  1511. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1512. // CHECK:STDOUT: %GenericInterface.generic: %GenericInterface.type.c92 = struct_value () [concrete]
  1513. // CHECK:STDOUT: %GenericInterface.type.0d7: type = facet_type <@GenericInterface, @GenericInterface(%U)> [symbolic]
  1514. // CHECK:STDOUT: %Self.185: %GenericInterface.type.0d7 = bind_symbolic_name Self, 1 [symbolic]
  1515. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  1516. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  1517. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1518. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1519. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1520. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  1521. // CHECK:STDOUT: %AnyParam.560: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  1522. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1523. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  1524. // CHECK:STDOUT: %pattern_type.438: type = pattern_type %GenericInterface.type.c92 [concrete]
  1525. // CHECK:STDOUT: %AnyParam.241: type = class_type @AnyParam, @AnyParam(%GenericInterface.type.c92, %GenericInterface.generic) [concrete]
  1526. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  1527. // CHECK:STDOUT: %Self.2f4: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1528. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  1529. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  1530. // CHECK:STDOUT: %Self.as_type.84b: type = facet_access_type %Self.2f4 [symbolic]
  1531. // CHECK:STDOUT: %pattern_type.e57: type = pattern_type %Self.as_type.84b [symbolic]
  1532. // CHECK:STDOUT: %require_complete.040: <witness> = require_complete_type %Self.as_type.84b [symbolic]
  1533. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table [concrete]
  1534. // CHECK:STDOUT: %pattern_type.004: type = pattern_type %AnyParam.241 [concrete]
  1535. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
  1536. // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]
  1537. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.241, (%Y.impl_witness) [concrete]
  1538. // CHECK:STDOUT: %complete_type.eb2: <witness> = complete_type_witness %GenericInterface.type.c92 [concrete]
  1539. // CHECK:STDOUT: %L.type: type = fn_type @L [concrete]
  1540. // CHECK:STDOUT: %L: %L.type = struct_value () [concrete]
  1541. // CHECK:STDOUT: %AnyParam.val: %AnyParam.241 = struct_value () [concrete]
  1542. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  1543. // CHECK:STDOUT: %assoc0.494: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [concrete]
  1544. // CHECK:STDOUT: %.41c: type = fn_type_with_self_type %Y.K.type, %Y.facet [concrete]
  1545. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1546. // CHECK:STDOUT: %Destroy.impl_witness.07c: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1547. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type.694: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1548. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.1db: %AnyParam.as.Destroy.impl.Op.type.694 = struct_value () [symbolic]
  1549. // CHECK:STDOUT: %ptr.4a9: type = ptr_type %AnyParam.560 [symbolic]
  1550. // CHECK:STDOUT: %pattern_type.84c: type = pattern_type %ptr.4a9 [symbolic]
  1551. // CHECK:STDOUT: %Destroy.impl_witness.4a8: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%GenericInterface.type.c92, %GenericInterface.generic) [concrete]
  1552. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type.a20: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%GenericInterface.type.c92, %GenericInterface.generic) [concrete]
  1553. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.882: %AnyParam.as.Destroy.impl.Op.type.a20 = struct_value () [concrete]
  1554. // CHECK:STDOUT: %ptr.301: type = ptr_type %AnyParam.241 [concrete]
  1555. // CHECK:STDOUT: %pattern_type.027: type = pattern_type %ptr.301 [concrete]
  1556. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %AnyParam.as.Destroy.impl.Op.882, @AnyParam.as.Destroy.impl.Op(%GenericInterface.type.c92, %GenericInterface.generic) [concrete]
  1557. // CHECK:STDOUT: }
  1558. // CHECK:STDOUT:
  1559. // CHECK:STDOUT: imports {
  1560. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1561. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1562. // CHECK:STDOUT: import Core//prelude
  1563. // CHECK:STDOUT: import Core//prelude/...
  1564. // CHECK:STDOUT: }
  1565. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [concrete] {
  1566. // CHECK:STDOUT: .AnyParam = %PackageHasParam.AnyParam
  1567. // CHECK:STDOUT: .Y = %PackageHasParam.Y
  1568. // CHECK:STDOUT: import PackageHasParam//default
  1569. // CHECK:STDOUT: }
  1570. // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [concrete = constants.%AnyParam.generic]
  1571. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.1: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1572. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1573. // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [concrete = constants.%complete_type.357]
  1574. // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst38 [no loc], unloaded
  1575. // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
  1576. // CHECK:STDOUT: %PackageHasParam.import_ref.0f3 = import_ref PackageHasParam//default, inst99 [no loc], unloaded
  1577. // CHECK:STDOUT: %PackageHasParam.import_ref.f69: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.494]
  1578. // CHECK:STDOUT: %PackageHasParam.K: %Y.K.type = import_ref PackageHasParam//default, K, loaded [concrete = constants.%Y.K]
  1579. // CHECK:STDOUT: %PackageHasParam.import_ref.28c: %Y.type = import_ref PackageHasParam//default, inst99 [no loc], loaded [symbolic = constants.%Self.2f4]
  1580. // CHECK:STDOUT: %PackageHasParam.import_ref.ce2: %Y.K.type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%Y.K]
  1581. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1582. // CHECK:STDOUT: %PackageHasParam.import_ref.043: <witness> = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.07c)]
  1583. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.2: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1584. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1585. // CHECK:STDOUT: %PackageHasParam.import_ref.cdc: type = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%AnyParam (constants.%AnyParam.560)]
  1586. // CHECK:STDOUT: %PackageHasParam.import_ref.e45: type = import_ref PackageHasParam//default, inst41 [no loc], loaded [concrete = constants.%Destroy.type]
  1587. // CHECK:STDOUT: %PackageHasParam.import_ref.f8b: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type.694) = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op.1db)]
  1588. // CHECK:STDOUT: %Destroy.impl_witness_table.761 = impl_witness_table (%PackageHasParam.import_ref.f8b), @AnyParam.as.Destroy.impl [concrete]
  1589. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.3: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1590. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1591. // CHECK:STDOUT: }
  1592. // CHECK:STDOUT:
  1593. // CHECK:STDOUT: file {
  1594. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1595. // CHECK:STDOUT: .Core = imports.%Core
  1596. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  1597. // CHECK:STDOUT: .GenericInterface = %GenericInterface.decl
  1598. // CHECK:STDOUT: .L = %L.decl
  1599. // CHECK:STDOUT: }
  1600. // CHECK:STDOUT: %Core.import = import Core
  1601. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  1602. // CHECK:STDOUT: %GenericInterface.decl: %GenericInterface.type.c92 = interface_decl @GenericInterface [concrete = constants.%GenericInterface.generic] {
  1603. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  1604. // CHECK:STDOUT: } {
  1605. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1606. // CHECK:STDOUT: %U.loc6_28.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_28.1 (constants.%U)]
  1607. // CHECK:STDOUT: }
  1608. // CHECK:STDOUT: impl_decl @AnyParam.as.Y.impl [concrete] {} {
  1609. // CHECK:STDOUT: %PackageHasParam.ref.loc8_6: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  1610. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  1611. // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.c92 = name_ref GenericInterface, file.%GenericInterface.decl [concrete = constants.%GenericInterface.generic]
  1612. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) [concrete = constants.%AnyParam.241]
  1613. // CHECK:STDOUT: %PackageHasParam.ref.loc8_52: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  1614. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  1615. // CHECK:STDOUT: }
  1616. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (@AnyParam.as.Y.impl.%AnyParam.as.Y.impl.K.decl), @AnyParam.as.Y.impl [concrete]
  1617. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness]
  1618. // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [concrete = constants.%L] {} {}
  1619. // CHECK:STDOUT: }
  1620. // CHECK:STDOUT:
  1621. // CHECK:STDOUT: generic interface @GenericInterface(%U.loc6_28.2: type) {
  1622. // CHECK:STDOUT: %U.loc6_28.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_28.1 (constants.%U)]
  1623. // CHECK:STDOUT:
  1624. // CHECK:STDOUT: !definition:
  1625. // CHECK:STDOUT: %GenericInterface.type: type = facet_type <@GenericInterface, @GenericInterface(%U.loc6_28.1)> [symbolic = %GenericInterface.type (constants.%GenericInterface.type.0d7)]
  1626. // CHECK:STDOUT: %Self.2: @GenericInterface.%GenericInterface.type (%GenericInterface.type.0d7) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.185)]
  1627. // CHECK:STDOUT:
  1628. // CHECK:STDOUT: interface {
  1629. // CHECK:STDOUT: %Self.1: @GenericInterface.%GenericInterface.type (%GenericInterface.type.0d7) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.185)]
  1630. // CHECK:STDOUT:
  1631. // CHECK:STDOUT: !members:
  1632. // CHECK:STDOUT: .Self = %Self.1
  1633. // CHECK:STDOUT: witness = ()
  1634. // CHECK:STDOUT: }
  1635. // CHECK:STDOUT: }
  1636. // CHECK:STDOUT:
  1637. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  1638. // CHECK:STDOUT: !members:
  1639. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.0f3
  1640. // CHECK:STDOUT: .K = imports.%PackageHasParam.import_ref.f69
  1641. // CHECK:STDOUT: witness = (imports.%PackageHasParam.K)
  1642. // CHECK:STDOUT: }
  1643. // CHECK:STDOUT:
  1644. // CHECK:STDOUT: impl @AnyParam.as.Y.impl: %AnyParam as %Y.ref {
  1645. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.decl: %AnyParam.as.Y.impl.K.type = fn_decl @AnyParam.as.Y.impl.K [concrete = constants.%AnyParam.as.Y.impl.K] {
  1646. // CHECK:STDOUT: %self.patt: %pattern_type.004 = binding_pattern self [concrete]
  1647. // CHECK:STDOUT: %self.param_patt: %pattern_type.004 = value_param_pattern %self.patt, call_param0 [concrete]
  1648. // CHECK:STDOUT: } {
  1649. // CHECK:STDOUT: %self.param: %AnyParam.241 = value_param call_param0
  1650. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @AnyParam.as.Y.impl.%AnyParam [concrete = constants.%AnyParam.241]
  1651. // CHECK:STDOUT: %self: %AnyParam.241 = bind_name self, %self.param
  1652. // CHECK:STDOUT: }
  1653. // CHECK:STDOUT:
  1654. // CHECK:STDOUT: !members:
  1655. // CHECK:STDOUT: .K = %AnyParam.as.Y.impl.K.decl
  1656. // CHECK:STDOUT: witness = file.%Y.impl_witness
  1657. // CHECK:STDOUT: }
  1658. // CHECK:STDOUT:
  1659. // CHECK:STDOUT: generic impl @AnyParam.as.Destroy.impl(imports.%PackageHasParam.import_ref.5ab3ec.2: type, imports.%PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  1660. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1661. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1662. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  1663. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.07c)]
  1664. // CHECK:STDOUT:
  1665. // CHECK:STDOUT: !definition:
  1666. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %AnyParam.as.Destroy.impl.Op.type (constants.%AnyParam.as.Destroy.impl.Op.type.694)]
  1667. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type.694) = struct_value () [symbolic = %AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op.1db)]
  1668. // CHECK:STDOUT:
  1669. // CHECK:STDOUT: impl: imports.%PackageHasParam.import_ref.cdc as imports.%PackageHasParam.import_ref.e45 {
  1670. // CHECK:STDOUT: !members:
  1671. // CHECK:STDOUT: witness = imports.%PackageHasParam.import_ref.043
  1672. // CHECK:STDOUT: }
  1673. // CHECK:STDOUT: }
  1674. // CHECK:STDOUT:
  1675. // CHECK:STDOUT: generic class @AnyParam(imports.%PackageHasParam.import_ref.5ab3ec.1: type, imports.%PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  1676. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1677. // CHECK:STDOUT: %X: @AnyParam.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1678. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1679. // CHECK:STDOUT:
  1680. // CHECK:STDOUT: !definition:
  1681. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  1682. // CHECK:STDOUT:
  1683. // CHECK:STDOUT: class {
  1684. // CHECK:STDOUT: complete_type_witness = imports.%PackageHasParam.import_ref.8f2
  1685. // CHECK:STDOUT:
  1686. // CHECK:STDOUT: !members:
  1687. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.601
  1688. // CHECK:STDOUT: }
  1689. // CHECK:STDOUT: }
  1690. // CHECK:STDOUT:
  1691. // CHECK:STDOUT: generic fn @Y.K(imports.%PackageHasParam.import_ref.28c: %Y.type) [from "has_param.carbon"] {
  1692. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2f4)]
  1693. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.84b)]
  1694. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.e57)]
  1695. // CHECK:STDOUT:
  1696. // CHECK:STDOUT: !definition:
  1697. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.040)]
  1698. // CHECK:STDOUT:
  1699. // CHECK:STDOUT: fn;
  1700. // CHECK:STDOUT: }
  1701. // CHECK:STDOUT:
  1702. // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K(%self.param: %AnyParam.241) {
  1703. // CHECK:STDOUT: !entry:
  1704. // CHECK:STDOUT: return
  1705. // CHECK:STDOUT: }
  1706. // CHECK:STDOUT:
  1707. // CHECK:STDOUT: fn @L() {
  1708. // CHECK:STDOUT: !entry:
  1709. // CHECK:STDOUT: name_binding_decl {
  1710. // CHECK:STDOUT: %obj.patt: %pattern_type.004 = binding_pattern obj [concrete]
  1711. // CHECK:STDOUT: %obj.var_patt: %pattern_type.004 = var_pattern %obj.patt [concrete]
  1712. // CHECK:STDOUT: }
  1713. // CHECK:STDOUT: %obj.var: ref %AnyParam.241 = var %obj.var_patt
  1714. // CHECK:STDOUT: %.loc13_58.1: %empty_struct_type = struct_literal ()
  1715. // CHECK:STDOUT: %.loc13_58.2: init %AnyParam.241 = class_init (), %obj.var [concrete = constants.%AnyParam.val]
  1716. // CHECK:STDOUT: %.loc13_3: init %AnyParam.241 = converted %.loc13_58.1, %.loc13_58.2 [concrete = constants.%AnyParam.val]
  1717. // CHECK:STDOUT: assign %obj.var, %.loc13_3
  1718. // CHECK:STDOUT: %.loc13_53: type = splice_block %AnyParam [concrete = constants.%AnyParam.241] {
  1719. // CHECK:STDOUT: %PackageHasParam.ref.loc13: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  1720. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  1721. // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.c92 = name_ref GenericInterface, file.%GenericInterface.decl [concrete = constants.%GenericInterface.generic]
  1722. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) [concrete = constants.%AnyParam.241]
  1723. // CHECK:STDOUT: }
  1724. // CHECK:STDOUT: %obj: ref %AnyParam.241 = bind_name obj, %obj.var
  1725. // CHECK:STDOUT: %obj.ref: ref %AnyParam.241 = name_ref obj, %obj
  1726. // CHECK:STDOUT: %PackageHasParam.ref.loc14: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  1727. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  1728. // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.f69 [concrete = constants.%assoc0.494]
  1729. // CHECK:STDOUT: %impl.elem0: %.41c = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K]
  1730. // CHECK:STDOUT: %bound_method.loc14: <bound method> = bound_method %obj.ref, %impl.elem0
  1731. // CHECK:STDOUT: %.loc14: %AnyParam.241 = bind_value %obj.ref
  1732. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method.loc14(%.loc14)
  1733. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.bound: <bound method> = bound_method %obj.var, constants.%AnyParam.as.Destroy.impl.Op.882
  1734. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%AnyParam.as.Destroy.impl.Op.882, @AnyParam.as.Destroy.impl.Op(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) [concrete = constants.%AnyParam.as.Destroy.impl.Op.specific_fn]
  1735. // CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %obj.var, %AnyParam.as.Destroy.impl.Op.specific_fn
  1736. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %obj.var
  1737. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc13(%addr)
  1738. // CHECK:STDOUT: return
  1739. // CHECK:STDOUT: }
  1740. // CHECK:STDOUT:
  1741. // CHECK:STDOUT: generic fn @AnyParam.as.Destroy.impl.Op(imports.%PackageHasParam.import_ref.5ab3ec.3: type, imports.%PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  1742. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1743. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1744. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  1745. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.4a9)]
  1746. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.84c)]
  1747. // CHECK:STDOUT:
  1748. // CHECK:STDOUT: !definition:
  1749. // CHECK:STDOUT:
  1750. // CHECK:STDOUT: fn = "no_op";
  1751. // CHECK:STDOUT: }
  1752. // CHECK:STDOUT:
  1753. // CHECK:STDOUT: specific @GenericInterface(constants.%U) {
  1754. // CHECK:STDOUT: %U.loc6_28.1 => constants.%U
  1755. // CHECK:STDOUT: }
  1756. // CHECK:STDOUT:
  1757. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  1758. // CHECK:STDOUT: %T => constants.%T
  1759. // CHECK:STDOUT: %X => constants.%X
  1760. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1761. // CHECK:STDOUT: }
  1762. // CHECK:STDOUT:
  1763. // CHECK:STDOUT: specific @AnyParam(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) {
  1764. // CHECK:STDOUT: %T => constants.%GenericInterface.type.c92
  1765. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  1766. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.438
  1767. // CHECK:STDOUT:
  1768. // CHECK:STDOUT: !definition:
  1769. // CHECK:STDOUT: %require_complete => constants.%complete_type.eb2
  1770. // CHECK:STDOUT: }
  1771. // CHECK:STDOUT:
  1772. // CHECK:STDOUT: specific @Y.K(constants.%Self.2f4) {
  1773. // CHECK:STDOUT: %Self => constants.%Self.2f4
  1774. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.84b
  1775. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e57
  1776. // CHECK:STDOUT: }
  1777. // CHECK:STDOUT:
  1778. // CHECK:STDOUT: specific @Y.K(constants.%Y.facet) {
  1779. // CHECK:STDOUT: %Self => constants.%Y.facet
  1780. // CHECK:STDOUT: %Self.as_type => constants.%AnyParam.241
  1781. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.004
  1782. // CHECK:STDOUT: }
  1783. // CHECK:STDOUT:
  1784. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  1785. // CHECK:STDOUT: %T => constants.%T
  1786. // CHECK:STDOUT: %X => constants.%X
  1787. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  1788. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.07c
  1789. // CHECK:STDOUT: }
  1790. // CHECK:STDOUT:
  1791. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  1792. // CHECK:STDOUT: %T => constants.%T
  1793. // CHECK:STDOUT: %X => constants.%X
  1794. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  1795. // CHECK:STDOUT: %ptr => constants.%ptr.4a9
  1796. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.84c
  1797. // CHECK:STDOUT: }
  1798. // CHECK:STDOUT:
  1799. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) {
  1800. // CHECK:STDOUT: %T => constants.%GenericInterface.type.c92
  1801. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  1802. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.241
  1803. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.4a8
  1804. // CHECK:STDOUT:
  1805. // CHECK:STDOUT: !definition:
  1806. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type => constants.%AnyParam.as.Destroy.impl.Op.type.a20
  1807. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op => constants.%AnyParam.as.Destroy.impl.Op.882
  1808. // CHECK:STDOUT: }
  1809. // CHECK:STDOUT:
  1810. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) {
  1811. // CHECK:STDOUT: %T => constants.%GenericInterface.type.c92
  1812. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  1813. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.241
  1814. // CHECK:STDOUT: %ptr => constants.%ptr.301
  1815. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.027
  1816. // CHECK:STDOUT: }
  1817. // CHECK:STDOUT:
  1818. // CHECK:STDOUT: --- use_generic_interface_as_param.carbon
  1819. // CHECK:STDOUT:
  1820. // CHECK:STDOUT: constants {
  1821. // CHECK:STDOUT: %M.type: type = fn_type @M [concrete]
  1822. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1823. // CHECK:STDOUT: %M: %M.type = struct_value () [concrete]
  1824. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  1825. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  1826. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1827. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1828. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1829. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  1830. // CHECK:STDOUT: %AnyParam.560: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  1831. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1832. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  1833. // CHECK:STDOUT: %GenericInterface.type.0da: type = generic_interface_type @GenericInterface [concrete]
  1834. // CHECK:STDOUT: %GenericInterface.generic: %GenericInterface.type.0da = struct_value () [concrete]
  1835. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  1836. // CHECK:STDOUT: %GenericInterface.type.55d: type = facet_type <@GenericInterface, @GenericInterface(%U)> [symbolic]
  1837. // CHECK:STDOUT: %Self.719: %GenericInterface.type.55d = bind_symbolic_name Self, 1 [symbolic]
  1838. // CHECK:STDOUT: %pattern_type.a64: type = pattern_type %GenericInterface.type.0da [concrete]
  1839. // CHECK:STDOUT: %AnyParam.861: type = class_type @AnyParam, @AnyParam(%GenericInterface.type.0da, %GenericInterface.generic) [concrete]
  1840. // CHECK:STDOUT: %complete_type.42f: <witness> = complete_type_witness %GenericInterface.type.0da [concrete]
  1841. // CHECK:STDOUT: %pattern_type.3ad: type = pattern_type %AnyParam.861 [concrete]
  1842. // CHECK:STDOUT: %AnyParam.val: %AnyParam.861 = struct_value () [concrete]
  1843. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  1844. // CHECK:STDOUT: %Self.2f4: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1845. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  1846. // CHECK:STDOUT: %assoc0.494: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [concrete]
  1847. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  1848. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  1849. // CHECK:STDOUT: %Self.as_type.84b: type = facet_access_type %Self.2f4 [symbolic]
  1850. // CHECK:STDOUT: %pattern_type.e57: type = pattern_type %Self.as_type.84b [symbolic]
  1851. // CHECK:STDOUT: %require_complete.040: <witness> = require_complete_type %Self.as_type.84b [symbolic]
  1852. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness imports.%Y.impl_witness_table [concrete]
  1853. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.861, (%Y.impl_witness) [concrete]
  1854. // CHECK:STDOUT: %.ed5: type = fn_type_with_self_type %Y.K.type, %Y.facet [concrete]
  1855. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
  1856. // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]
  1857. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1858. // CHECK:STDOUT: %Destroy.impl_witness.07c: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1859. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type.694: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1860. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.1db: %AnyParam.as.Destroy.impl.Op.type.694 = struct_value () [symbolic]
  1861. // CHECK:STDOUT: %ptr.4a9: type = ptr_type %AnyParam.560 [symbolic]
  1862. // CHECK:STDOUT: %pattern_type.84c: type = pattern_type %ptr.4a9 [symbolic]
  1863. // CHECK:STDOUT: %Destroy.impl_witness.bd2: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%GenericInterface.type.0da, %GenericInterface.generic) [concrete]
  1864. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type.db8: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%GenericInterface.type.0da, %GenericInterface.generic) [concrete]
  1865. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.102: %AnyParam.as.Destroy.impl.Op.type.db8 = struct_value () [concrete]
  1866. // CHECK:STDOUT: %ptr.1ef: type = ptr_type %AnyParam.861 [concrete]
  1867. // CHECK:STDOUT: %pattern_type.cac: type = pattern_type %ptr.1ef [concrete]
  1868. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %AnyParam.as.Destroy.impl.Op.102, @AnyParam.as.Destroy.impl.Op(%GenericInterface.type.0da, %GenericInterface.generic) [concrete]
  1869. // CHECK:STDOUT: }
  1870. // CHECK:STDOUT:
  1871. // CHECK:STDOUT: imports {
  1872. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1873. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1874. // CHECK:STDOUT: import Core//prelude
  1875. // CHECK:STDOUT: import Core//prelude/...
  1876. // CHECK:STDOUT: }
  1877. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [concrete] {
  1878. // CHECK:STDOUT: .AnyParam = %PackageHasParam.AnyParam
  1879. // CHECK:STDOUT: .Y = %PackageHasParam.Y
  1880. // CHECK:STDOUT: import PackageHasParam//default
  1881. // CHECK:STDOUT: }
  1882. // CHECK:STDOUT: %PackageGenericInterface: <namespace> = namespace file.%PackageGenericInterface.import, [concrete] {
  1883. // CHECK:STDOUT: .GenericInterface = %PackageGenericInterface.GenericInterface
  1884. // CHECK:STDOUT: import PackageGenericInterface//default
  1885. // CHECK:STDOUT: }
  1886. // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [concrete = constants.%AnyParam.generic]
  1887. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.1: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1888. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1889. // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [concrete = constants.%complete_type.357]
  1890. // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst38 [no loc], unloaded
  1891. // CHECK:STDOUT: %PackageGenericInterface.GenericInterface: %GenericInterface.type.0da = import_ref PackageGenericInterface//default, GenericInterface, loaded [concrete = constants.%GenericInterface.generic]
  1892. // CHECK:STDOUT: %PackageGenericInterface.import_ref.5ab: type = import_ref PackageGenericInterface//default, loc6_28, loaded [symbolic = @GenericInterface.%U (constants.%U)]
  1893. // CHECK:STDOUT: %PackageGenericInterface.import_ref.b37 = import_ref PackageGenericInterface//default, inst32 [no loc], unloaded
  1894. // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
  1895. // CHECK:STDOUT: %PackageHasParam.import_ref.0f3 = import_ref PackageHasParam//default, inst99 [no loc], unloaded
  1896. // CHECK:STDOUT: %PackageHasParam.import_ref.f69: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.494]
  1897. // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded
  1898. // CHECK:STDOUT: %PackageHasParam.import_ref.ce2: %Y.K.type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%Y.K]
  1899. // CHECK:STDOUT: %PackageHasParam.import_ref.28c: %Y.type = import_ref PackageHasParam//default, inst99 [no loc], loaded [symbolic = constants.%Self.2f4]
  1900. // CHECK:STDOUT: %PackageGenericInterface.import_ref.ba6: <witness> = import_ref PackageGenericInterface//default, loc8_70, loaded [concrete = constants.%Y.impl_witness]
  1901. // CHECK:STDOUT: %PackageGenericInterface.import_ref.321: type = import_ref PackageGenericInterface//default, loc8_47, loaded [concrete = constants.%AnyParam.861]
  1902. // CHECK:STDOUT: %PackageGenericInterface.import_ref.ca6: type = import_ref PackageGenericInterface//default, loc8_67, loaded [concrete = constants.%Y.type]
  1903. // CHECK:STDOUT: %PackageGenericInterface.import_ref.0fb: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericInterface//default, loc9_22, loaded [concrete = constants.%AnyParam.as.Y.impl.K]
  1904. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericInterface.import_ref.0fb), @AnyParam.as.Y.impl [concrete]
  1905. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1906. // CHECK:STDOUT: %PackageHasParam.import_ref.043: <witness> = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.07c)]
  1907. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.2: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1908. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1909. // CHECK:STDOUT: %PackageHasParam.import_ref.cdc: type = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%AnyParam (constants.%AnyParam.560)]
  1910. // CHECK:STDOUT: %PackageHasParam.import_ref.e45: type = import_ref PackageHasParam//default, inst41 [no loc], loaded [concrete = constants.%Destroy.type]
  1911. // CHECK:STDOUT: %PackageHasParam.import_ref.f8b: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type.694) = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op.1db)]
  1912. // CHECK:STDOUT: %Destroy.impl_witness_table.761 = impl_witness_table (%PackageHasParam.import_ref.f8b), @AnyParam.as.Destroy.impl [concrete]
  1913. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.3: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1914. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1915. // CHECK:STDOUT: }
  1916. // CHECK:STDOUT:
  1917. // CHECK:STDOUT: file {
  1918. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1919. // CHECK:STDOUT: .Core = imports.%Core
  1920. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  1921. // CHECK:STDOUT: .PackageGenericInterface = imports.%PackageGenericInterface
  1922. // CHECK:STDOUT: .M = %M.decl
  1923. // CHECK:STDOUT: }
  1924. // CHECK:STDOUT: %Core.import = import Core
  1925. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  1926. // CHECK:STDOUT: %PackageGenericInterface.import = import PackageGenericInterface
  1927. // CHECK:STDOUT: %M.decl: %M.type = fn_decl @M [concrete = constants.%M] {} {}
  1928. // CHECK:STDOUT: }
  1929. // CHECK:STDOUT:
  1930. // CHECK:STDOUT: generic interface @GenericInterface(imports.%PackageGenericInterface.import_ref.5ab: type) [from "has_generic_interface.carbon"] {
  1931. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  1932. // CHECK:STDOUT:
  1933. // CHECK:STDOUT: !definition:
  1934. // CHECK:STDOUT: %GenericInterface.type: type = facet_type <@GenericInterface, @GenericInterface(%U)> [symbolic = %GenericInterface.type (constants.%GenericInterface.type.55d)]
  1935. // CHECK:STDOUT: %Self: @GenericInterface.%GenericInterface.type (%GenericInterface.type.55d) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.719)]
  1936. // CHECK:STDOUT:
  1937. // CHECK:STDOUT: interface {
  1938. // CHECK:STDOUT: !members:
  1939. // CHECK:STDOUT: .Self = imports.%PackageGenericInterface.import_ref.b37
  1940. // CHECK:STDOUT: witness = ()
  1941. // CHECK:STDOUT: }
  1942. // CHECK:STDOUT: }
  1943. // CHECK:STDOUT:
  1944. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  1945. // CHECK:STDOUT: !members:
  1946. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.0f3
  1947. // CHECK:STDOUT: .K = imports.%PackageHasParam.import_ref.f69
  1948. // CHECK:STDOUT: witness = (imports.%PackageHasParam.K)
  1949. // CHECK:STDOUT: }
  1950. // CHECK:STDOUT:
  1951. // CHECK:STDOUT: impl @AnyParam.as.Y.impl: imports.%PackageGenericInterface.import_ref.321 as imports.%PackageGenericInterface.import_ref.ca6 [from "has_generic_interface.carbon"] {
  1952. // CHECK:STDOUT: !members:
  1953. // CHECK:STDOUT: witness = imports.%PackageGenericInterface.import_ref.ba6
  1954. // CHECK:STDOUT: }
  1955. // CHECK:STDOUT:
  1956. // CHECK:STDOUT: generic impl @AnyParam.as.Destroy.impl(imports.%PackageHasParam.import_ref.5ab3ec.2: type, imports.%PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  1957. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1958. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1959. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  1960. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.07c)]
  1961. // CHECK:STDOUT:
  1962. // CHECK:STDOUT: !definition:
  1963. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %AnyParam.as.Destroy.impl.Op.type (constants.%AnyParam.as.Destroy.impl.Op.type.694)]
  1964. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type.694) = struct_value () [symbolic = %AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op.1db)]
  1965. // CHECK:STDOUT:
  1966. // CHECK:STDOUT: impl: imports.%PackageHasParam.import_ref.cdc as imports.%PackageHasParam.import_ref.e45 {
  1967. // CHECK:STDOUT: !members:
  1968. // CHECK:STDOUT: witness = imports.%PackageHasParam.import_ref.043
  1969. // CHECK:STDOUT: }
  1970. // CHECK:STDOUT: }
  1971. // CHECK:STDOUT:
  1972. // CHECK:STDOUT: generic class @AnyParam(imports.%PackageHasParam.import_ref.5ab3ec.1: type, imports.%PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  1973. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1974. // CHECK:STDOUT: %X: @AnyParam.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1975. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1976. // CHECK:STDOUT:
  1977. // CHECK:STDOUT: !definition:
  1978. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  1979. // CHECK:STDOUT:
  1980. // CHECK:STDOUT: class {
  1981. // CHECK:STDOUT: complete_type_witness = imports.%PackageHasParam.import_ref.8f2
  1982. // CHECK:STDOUT:
  1983. // CHECK:STDOUT: !members:
  1984. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.601
  1985. // CHECK:STDOUT: }
  1986. // CHECK:STDOUT: }
  1987. // CHECK:STDOUT:
  1988. // CHECK:STDOUT: fn @M() {
  1989. // CHECK:STDOUT: !entry:
  1990. // CHECK:STDOUT: name_binding_decl {
  1991. // CHECK:STDOUT: %obj.patt: %pattern_type.3ad = binding_pattern obj [concrete]
  1992. // CHECK:STDOUT: %obj.var_patt: %pattern_type.3ad = var_pattern %obj.patt [concrete]
  1993. // CHECK:STDOUT: }
  1994. // CHECK:STDOUT: %obj.var: ref %AnyParam.861 = var %obj.var_patt
  1995. // CHECK:STDOUT: %.loc9_50.1: %empty_struct_type = struct_literal ()
  1996. // CHECK:STDOUT: %.loc9_50.2: init %AnyParam.861 = class_init (), %obj.var [concrete = constants.%AnyParam.val]
  1997. // CHECK:STDOUT: %.loc8: init %AnyParam.861 = converted %.loc9_50.1, %.loc9_50.2 [concrete = constants.%AnyParam.val]
  1998. // CHECK:STDOUT: assign %obj.var, %.loc8
  1999. // CHECK:STDOUT: %.loc9_45: type = splice_block %AnyParam [concrete = constants.%AnyParam.861] {
  2000. // CHECK:STDOUT: %PackageHasParam.ref.loc8: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2001. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  2002. // CHECK:STDOUT: %PackageGenericInterface.ref: <namespace> = name_ref PackageGenericInterface, imports.%PackageGenericInterface [concrete = imports.%PackageGenericInterface]
  2003. // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.0da = name_ref GenericInterface, imports.%PackageGenericInterface.GenericInterface [concrete = constants.%GenericInterface.generic]
  2004. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.0da, constants.%GenericInterface.generic) [concrete = constants.%AnyParam.861]
  2005. // CHECK:STDOUT: }
  2006. // CHECK:STDOUT: %obj: ref %AnyParam.861 = bind_name obj, %obj.var
  2007. // CHECK:STDOUT: %obj.ref: ref %AnyParam.861 = name_ref obj, %obj
  2008. // CHECK:STDOUT: %PackageHasParam.ref.loc10: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2009. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  2010. // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.f69 [concrete = constants.%assoc0.494]
  2011. // CHECK:STDOUT: %impl.elem0: %.ed5 = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K]
  2012. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %obj.ref, %impl.elem0
  2013. // CHECK:STDOUT: %.loc10: %AnyParam.861 = bind_value %obj.ref
  2014. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method.loc10(%.loc10)
  2015. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.bound: <bound method> = bound_method %obj.var, constants.%AnyParam.as.Destroy.impl.Op.102
  2016. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%AnyParam.as.Destroy.impl.Op.102, @AnyParam.as.Destroy.impl.Op(constants.%GenericInterface.type.0da, constants.%GenericInterface.generic) [concrete = constants.%AnyParam.as.Destroy.impl.Op.specific_fn]
  2017. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %obj.var, %AnyParam.as.Destroy.impl.Op.specific_fn
  2018. // CHECK:STDOUT: %addr: %ptr.1ef = addr_of %obj.var
  2019. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8(%addr)
  2020. // CHECK:STDOUT: return
  2021. // CHECK:STDOUT: }
  2022. // CHECK:STDOUT:
  2023. // CHECK:STDOUT: generic fn @Y.K(imports.%PackageHasParam.import_ref.28c: %Y.type) [from "has_param.carbon"] {
  2024. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2f4)]
  2025. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.84b)]
  2026. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.e57)]
  2027. // CHECK:STDOUT:
  2028. // CHECK:STDOUT: !definition:
  2029. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.040)]
  2030. // CHECK:STDOUT:
  2031. // CHECK:STDOUT: fn;
  2032. // CHECK:STDOUT: }
  2033. // CHECK:STDOUT:
  2034. // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K [from "has_generic_interface.carbon"];
  2035. // CHECK:STDOUT:
  2036. // CHECK:STDOUT: generic fn @AnyParam.as.Destroy.impl.Op(imports.%PackageHasParam.import_ref.5ab3ec.3: type, imports.%PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  2037. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2038. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2039. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  2040. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.4a9)]
  2041. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.84c)]
  2042. // CHECK:STDOUT:
  2043. // CHECK:STDOUT: !definition:
  2044. // CHECK:STDOUT:
  2045. // CHECK:STDOUT: fn = "no_op";
  2046. // CHECK:STDOUT: }
  2047. // CHECK:STDOUT:
  2048. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  2049. // CHECK:STDOUT: %T => constants.%T
  2050. // CHECK:STDOUT: %X => constants.%X
  2051. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  2052. // CHECK:STDOUT: }
  2053. // CHECK:STDOUT:
  2054. // CHECK:STDOUT: specific @GenericInterface(constants.%U) {
  2055. // CHECK:STDOUT: %U => constants.%U
  2056. // CHECK:STDOUT: }
  2057. // CHECK:STDOUT:
  2058. // CHECK:STDOUT: specific @AnyParam(constants.%GenericInterface.type.0da, constants.%GenericInterface.generic) {
  2059. // CHECK:STDOUT: %T => constants.%GenericInterface.type.0da
  2060. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  2061. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a64
  2062. // CHECK:STDOUT:
  2063. // CHECK:STDOUT: !definition:
  2064. // CHECK:STDOUT: %require_complete => constants.%complete_type.42f
  2065. // CHECK:STDOUT: }
  2066. // CHECK:STDOUT:
  2067. // CHECK:STDOUT: specific @Y.K(constants.%Self.2f4) {
  2068. // CHECK:STDOUT: %Self => constants.%Self.2f4
  2069. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.84b
  2070. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e57
  2071. // CHECK:STDOUT: }
  2072. // CHECK:STDOUT:
  2073. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  2074. // CHECK:STDOUT: %T => constants.%T
  2075. // CHECK:STDOUT: %X => constants.%X
  2076. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  2077. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.07c
  2078. // CHECK:STDOUT: }
  2079. // CHECK:STDOUT:
  2080. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  2081. // CHECK:STDOUT: %T => constants.%T
  2082. // CHECK:STDOUT: %X => constants.%X
  2083. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  2084. // CHECK:STDOUT: %ptr => constants.%ptr.4a9
  2085. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.84c
  2086. // CHECK:STDOUT: }
  2087. // CHECK:STDOUT:
  2088. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%GenericInterface.type.0da, constants.%GenericInterface.generic) {
  2089. // CHECK:STDOUT: %T => constants.%GenericInterface.type.0da
  2090. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  2091. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.861
  2092. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.bd2
  2093. // CHECK:STDOUT:
  2094. // CHECK:STDOUT: !definition:
  2095. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type => constants.%AnyParam.as.Destroy.impl.Op.type.db8
  2096. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op => constants.%AnyParam.as.Destroy.impl.Op.102
  2097. // CHECK:STDOUT: }
  2098. // CHECK:STDOUT:
  2099. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%GenericInterface.type.0da, constants.%GenericInterface.generic) {
  2100. // CHECK:STDOUT: %T => constants.%GenericInterface.type.0da
  2101. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  2102. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.861
  2103. // CHECK:STDOUT: %ptr => constants.%ptr.1ef
  2104. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cac
  2105. // CHECK:STDOUT: }
  2106. // CHECK:STDOUT:
  2107. // CHECK:STDOUT: --- has_generic_class.carbon
  2108. // CHECK:STDOUT:
  2109. // CHECK:STDOUT: constants {
  2110. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  2111. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  2112. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  2113. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  2114. // CHECK:STDOUT: %GenericClass.type: type = generic_class_type @GenericClass [concrete]
  2115. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2116. // CHECK:STDOUT: %GenericClass.generic: %GenericClass.type = struct_value () [concrete]
  2117. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic]
  2118. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  2119. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  2120. // CHECK:STDOUT: %Destroy.impl_witness.102: <witness> = impl_witness @GenericClass.%Destroy.impl_witness_table, @GenericClass.as.Destroy.impl(%U) [symbolic]
  2121. // CHECK:STDOUT: %ptr.b1a: type = ptr_type %GenericClass [symbolic]
  2122. // CHECK:STDOUT: %pattern_type.0e2: type = pattern_type %ptr.b1a [symbolic]
  2123. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op.type: type = fn_type @GenericClass.as.Destroy.impl.Op, @GenericClass.as.Destroy.impl(%U) [symbolic]
  2124. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op: %GenericClass.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2125. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2126. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  2127. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  2128. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  2129. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  2130. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  2131. // CHECK:STDOUT: %AnyParam.560: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  2132. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  2133. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  2134. // CHECK:STDOUT: %pattern_type.17e: type = pattern_type %GenericClass.type [concrete]
  2135. // CHECK:STDOUT: %AnyParam.0dd: type = class_type @AnyParam, @AnyParam(%GenericClass.type, %GenericClass.generic) [concrete]
  2136. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  2137. // CHECK:STDOUT: %Self.2f4: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  2138. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  2139. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  2140. // CHECK:STDOUT: %Self.as_type.84b: type = facet_access_type %Self.2f4 [symbolic]
  2141. // CHECK:STDOUT: %pattern_type.e57: type = pattern_type %Self.as_type.84b [symbolic]
  2142. // CHECK:STDOUT: %require_complete.040: <witness> = require_complete_type %Self.as_type.84b [symbolic]
  2143. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table [concrete]
  2144. // CHECK:STDOUT: %pattern_type.64f: type = pattern_type %AnyParam.0dd [concrete]
  2145. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
  2146. // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]
  2147. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.0dd, (%Y.impl_witness) [concrete]
  2148. // CHECK:STDOUT: %complete_type.398: <witness> = complete_type_witness %GenericClass.type [concrete]
  2149. // CHECK:STDOUT: %L.type: type = fn_type @L [concrete]
  2150. // CHECK:STDOUT: %L: %L.type = struct_value () [concrete]
  2151. // CHECK:STDOUT: %AnyParam.val: %AnyParam.0dd = struct_value () [concrete]
  2152. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  2153. // CHECK:STDOUT: %assoc0.494: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [concrete]
  2154. // CHECK:STDOUT: %.507: type = fn_type_with_self_type %Y.K.type, %Y.facet [concrete]
  2155. // CHECK:STDOUT: %Destroy.impl_witness.07c: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  2156. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type.694: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  2157. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.1db: %AnyParam.as.Destroy.impl.Op.type.694 = struct_value () [symbolic]
  2158. // CHECK:STDOUT: %ptr.4a9: type = ptr_type %AnyParam.560 [symbolic]
  2159. // CHECK:STDOUT: %pattern_type.84c: type = pattern_type %ptr.4a9 [symbolic]
  2160. // CHECK:STDOUT: %Destroy.impl_witness.456: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%GenericClass.type, %GenericClass.generic) [concrete]
  2161. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type.f67: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%GenericClass.type, %GenericClass.generic) [concrete]
  2162. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.422: %AnyParam.as.Destroy.impl.Op.type.f67 = struct_value () [concrete]
  2163. // CHECK:STDOUT: %ptr.d96: type = ptr_type %AnyParam.0dd [concrete]
  2164. // CHECK:STDOUT: %pattern_type.fb7: type = pattern_type %ptr.d96 [concrete]
  2165. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %AnyParam.as.Destroy.impl.Op.422, @AnyParam.as.Destroy.impl.Op(%GenericClass.type, %GenericClass.generic) [concrete]
  2166. // CHECK:STDOUT: }
  2167. // CHECK:STDOUT:
  2168. // CHECK:STDOUT: imports {
  2169. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2170. // CHECK:STDOUT: .Destroy = %Core.Destroy
  2171. // CHECK:STDOUT: import Core//prelude
  2172. // CHECK:STDOUT: import Core//prelude/...
  2173. // CHECK:STDOUT: }
  2174. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [concrete] {
  2175. // CHECK:STDOUT: .AnyParam = %PackageHasParam.AnyParam
  2176. // CHECK:STDOUT: .Y = %PackageHasParam.Y
  2177. // CHECK:STDOUT: import PackageHasParam//default
  2178. // CHECK:STDOUT: }
  2179. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  2180. // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [concrete = constants.%AnyParam.generic]
  2181. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.1: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2182. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2183. // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [concrete = constants.%complete_type.357]
  2184. // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst38 [no loc], unloaded
  2185. // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
  2186. // CHECK:STDOUT: %PackageHasParam.import_ref.0f3 = import_ref PackageHasParam//default, inst99 [no loc], unloaded
  2187. // CHECK:STDOUT: %PackageHasParam.import_ref.f69: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.494]
  2188. // CHECK:STDOUT: %PackageHasParam.K: %Y.K.type = import_ref PackageHasParam//default, K, loaded [concrete = constants.%Y.K]
  2189. // CHECK:STDOUT: %PackageHasParam.import_ref.28c: %Y.type = import_ref PackageHasParam//default, inst99 [no loc], loaded [symbolic = constants.%Self.2f4]
  2190. // CHECK:STDOUT: %PackageHasParam.import_ref.ce2: %Y.K.type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%Y.K]
  2191. // CHECK:STDOUT: %PackageHasParam.import_ref.043: <witness> = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.07c)]
  2192. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.2: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2193. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2194. // CHECK:STDOUT: %PackageHasParam.import_ref.cdc: type = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%AnyParam (constants.%AnyParam.560)]
  2195. // CHECK:STDOUT: %PackageHasParam.import_ref.e45: type = import_ref PackageHasParam//default, inst41 [no loc], loaded [concrete = constants.%Destroy.type]
  2196. // CHECK:STDOUT: %PackageHasParam.import_ref.f8b: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type.694) = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op.1db)]
  2197. // CHECK:STDOUT: %Destroy.impl_witness_table.761 = impl_witness_table (%PackageHasParam.import_ref.f8b), @AnyParam.as.Destroy.impl [concrete]
  2198. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.3: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2199. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2200. // CHECK:STDOUT: }
  2201. // CHECK:STDOUT:
  2202. // CHECK:STDOUT: file {
  2203. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2204. // CHECK:STDOUT: .Core = imports.%Core
  2205. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  2206. // CHECK:STDOUT: .GenericClass = %GenericClass.decl
  2207. // CHECK:STDOUT: .L = %L.decl
  2208. // CHECK:STDOUT: }
  2209. // CHECK:STDOUT: %Core.import = import Core
  2210. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  2211. // CHECK:STDOUT: %GenericClass.decl: %GenericClass.type = class_decl @GenericClass [concrete = constants.%GenericClass.generic] {
  2212. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  2213. // CHECK:STDOUT: } {
  2214. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  2215. // CHECK:STDOUT: %U.loc6_20.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_20.1 (constants.%U)]
  2216. // CHECK:STDOUT: }
  2217. // CHECK:STDOUT: impl_decl @AnyParam.as.Y.impl [concrete] {} {
  2218. // CHECK:STDOUT: %PackageHasParam.ref.loc8_6: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2219. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  2220. // CHECK:STDOUT: %GenericClass.ref: %GenericClass.type = name_ref GenericClass, file.%GenericClass.decl [concrete = constants.%GenericClass.generic]
  2221. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) [concrete = constants.%AnyParam.0dd]
  2222. // CHECK:STDOUT: %PackageHasParam.ref.loc8_48: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2223. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  2224. // CHECK:STDOUT: }
  2225. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (@AnyParam.as.Y.impl.%AnyParam.as.Y.impl.K.decl), @AnyParam.as.Y.impl [concrete]
  2226. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness]
  2227. // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [concrete = constants.%L] {} {}
  2228. // CHECK:STDOUT: }
  2229. // CHECK:STDOUT:
  2230. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  2231. // CHECK:STDOUT: !members:
  2232. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.0f3
  2233. // CHECK:STDOUT: .K = imports.%PackageHasParam.import_ref.f69
  2234. // CHECK:STDOUT: witness = (imports.%PackageHasParam.K)
  2235. // CHECK:STDOUT: }
  2236. // CHECK:STDOUT:
  2237. // CHECK:STDOUT: generic impl @GenericClass.as.Destroy.impl(@GenericClass.%U.loc6_20.2: type) {
  2238. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2239. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic = %GenericClass (constants.%GenericClass)]
  2240. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @GenericClass.%Destroy.impl_witness_table, @GenericClass.as.Destroy.impl(%U) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.102)]
  2241. // CHECK:STDOUT:
  2242. // CHECK:STDOUT: !definition:
  2243. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op.type: type = fn_type @GenericClass.as.Destroy.impl.Op, @GenericClass.as.Destroy.impl(%U) [symbolic = %GenericClass.as.Destroy.impl.Op.type (constants.%GenericClass.as.Destroy.impl.Op.type)]
  2244. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op: @GenericClass.as.Destroy.impl.%GenericClass.as.Destroy.impl.Op.type (%GenericClass.as.Destroy.impl.Op.type) = struct_value () [symbolic = %GenericClass.as.Destroy.impl.Op (constants.%GenericClass.as.Destroy.impl.Op)]
  2245. // CHECK:STDOUT:
  2246. // CHECK:STDOUT: impl: @GenericClass.%Self.ref as constants.%Destroy.type {
  2247. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op.decl: @GenericClass.as.Destroy.impl.%GenericClass.as.Destroy.impl.Op.type (%GenericClass.as.Destroy.impl.Op.type) = fn_decl @GenericClass.as.Destroy.impl.Op [symbolic = @GenericClass.as.Destroy.impl.%GenericClass.as.Destroy.impl.Op (constants.%GenericClass.as.Destroy.impl.Op)] {
  2248. // CHECK:STDOUT: %self.patt: @GenericClass.as.Destroy.impl.Op.%pattern_type (%pattern_type.0e2) = binding_pattern self [concrete]
  2249. // CHECK:STDOUT: %self.param_patt: @GenericClass.as.Destroy.impl.Op.%pattern_type (%pattern_type.0e2) = value_param_pattern %self.patt, call_param0 [concrete]
  2250. // CHECK:STDOUT: %.loc6_30.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  2251. // CHECK:STDOUT: } {
  2252. // CHECK:STDOUT: %self.param: @GenericClass.as.Destroy.impl.Op.%ptr (%ptr.b1a) = value_param call_param0
  2253. // CHECK:STDOUT: %.loc6_30.2: type = splice_block %Self.ref [symbolic = %GenericClass (constants.%GenericClass)] {
  2254. // CHECK:STDOUT: %.loc6_30.3: type = specific_constant constants.%GenericClass, @GenericClass(constants.%U) [symbolic = %GenericClass (constants.%GenericClass)]
  2255. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_30.3 [symbolic = %GenericClass (constants.%GenericClass)]
  2256. // CHECK:STDOUT: }
  2257. // CHECK:STDOUT: %self: @GenericClass.as.Destroy.impl.Op.%ptr (%ptr.b1a) = bind_name self, %self.param
  2258. // CHECK:STDOUT: }
  2259. // CHECK:STDOUT:
  2260. // CHECK:STDOUT: !members:
  2261. // CHECK:STDOUT: .Op = %GenericClass.as.Destroy.impl.Op.decl
  2262. // CHECK:STDOUT: witness = @GenericClass.%Destroy.impl_witness
  2263. // CHECK:STDOUT: }
  2264. // CHECK:STDOUT: }
  2265. // CHECK:STDOUT:
  2266. // CHECK:STDOUT: impl @AnyParam.as.Y.impl: %AnyParam as %Y.ref {
  2267. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.decl: %AnyParam.as.Y.impl.K.type = fn_decl @AnyParam.as.Y.impl.K [concrete = constants.%AnyParam.as.Y.impl.K] {
  2268. // CHECK:STDOUT: %self.patt: %pattern_type.64f = binding_pattern self [concrete]
  2269. // CHECK:STDOUT: %self.param_patt: %pattern_type.64f = value_param_pattern %self.patt, call_param0 [concrete]
  2270. // CHECK:STDOUT: } {
  2271. // CHECK:STDOUT: %self.param: %AnyParam.0dd = value_param call_param0
  2272. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @AnyParam.as.Y.impl.%AnyParam [concrete = constants.%AnyParam.0dd]
  2273. // CHECK:STDOUT: %self: %AnyParam.0dd = bind_name self, %self.param
  2274. // CHECK:STDOUT: }
  2275. // CHECK:STDOUT:
  2276. // CHECK:STDOUT: !members:
  2277. // CHECK:STDOUT: .K = %AnyParam.as.Y.impl.K.decl
  2278. // CHECK:STDOUT: witness = file.%Y.impl_witness
  2279. // CHECK:STDOUT: }
  2280. // CHECK:STDOUT:
  2281. // CHECK:STDOUT: generic impl @AnyParam.as.Destroy.impl(imports.%PackageHasParam.import_ref.5ab3ec.2: type, imports.%PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  2282. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2283. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2284. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  2285. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.07c)]
  2286. // CHECK:STDOUT:
  2287. // CHECK:STDOUT: !definition:
  2288. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %AnyParam.as.Destroy.impl.Op.type (constants.%AnyParam.as.Destroy.impl.Op.type.694)]
  2289. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type.694) = struct_value () [symbolic = %AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op.1db)]
  2290. // CHECK:STDOUT:
  2291. // CHECK:STDOUT: impl: imports.%PackageHasParam.import_ref.cdc as imports.%PackageHasParam.import_ref.e45 {
  2292. // CHECK:STDOUT: !members:
  2293. // CHECK:STDOUT: witness = imports.%PackageHasParam.import_ref.043
  2294. // CHECK:STDOUT: }
  2295. // CHECK:STDOUT: }
  2296. // CHECK:STDOUT:
  2297. // CHECK:STDOUT: generic class @GenericClass(%U.loc6_20.2: type) {
  2298. // CHECK:STDOUT: %U.loc6_20.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_20.1 (constants.%U)]
  2299. // CHECK:STDOUT:
  2300. // CHECK:STDOUT: !definition:
  2301. // CHECK:STDOUT:
  2302. // CHECK:STDOUT: class {
  2303. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%GenericClass [symbolic = @GenericClass.as.Destroy.impl.%GenericClass (constants.%GenericClass)]
  2304. // CHECK:STDOUT: impl_decl @GenericClass.as.Destroy.impl [concrete] {} {}
  2305. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@GenericClass.as.Destroy.impl.%GenericClass.as.Destroy.impl.Op.decl), @GenericClass.as.Destroy.impl [concrete]
  2306. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table, @GenericClass.as.Destroy.impl(constants.%U) [symbolic = @GenericClass.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.102)]
  2307. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  2308. // CHECK:STDOUT: complete_type_witness = %complete_type
  2309. // CHECK:STDOUT:
  2310. // CHECK:STDOUT: !members:
  2311. // CHECK:STDOUT: .Self = constants.%GenericClass
  2312. // CHECK:STDOUT: }
  2313. // CHECK:STDOUT: }
  2314. // CHECK:STDOUT:
  2315. // CHECK:STDOUT: generic class @AnyParam(imports.%PackageHasParam.import_ref.5ab3ec.1: type, imports.%PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  2316. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2317. // CHECK:STDOUT: %X: @AnyParam.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2318. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  2319. // CHECK:STDOUT:
  2320. // CHECK:STDOUT: !definition:
  2321. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  2322. // CHECK:STDOUT:
  2323. // CHECK:STDOUT: class {
  2324. // CHECK:STDOUT: complete_type_witness = imports.%PackageHasParam.import_ref.8f2
  2325. // CHECK:STDOUT:
  2326. // CHECK:STDOUT: !members:
  2327. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.601
  2328. // CHECK:STDOUT: }
  2329. // CHECK:STDOUT: }
  2330. // CHECK:STDOUT:
  2331. // CHECK:STDOUT: generic fn @GenericClass.as.Destroy.impl.Op(@GenericClass.%U.loc6_20.2: type) {
  2332. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2333. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic = %GenericClass (constants.%GenericClass)]
  2334. // CHECK:STDOUT: %ptr: type = ptr_type %GenericClass [symbolic = %ptr (constants.%ptr.b1a)]
  2335. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.0e2)]
  2336. // CHECK:STDOUT:
  2337. // CHECK:STDOUT: !definition:
  2338. // CHECK:STDOUT:
  2339. // CHECK:STDOUT: fn(%self.param: @GenericClass.as.Destroy.impl.Op.%ptr (%ptr.b1a)) = "no_op";
  2340. // CHECK:STDOUT: }
  2341. // CHECK:STDOUT:
  2342. // CHECK:STDOUT: generic fn @Y.K(imports.%PackageHasParam.import_ref.28c: %Y.type) [from "has_param.carbon"] {
  2343. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2f4)]
  2344. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.84b)]
  2345. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.e57)]
  2346. // CHECK:STDOUT:
  2347. // CHECK:STDOUT: !definition:
  2348. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.040)]
  2349. // CHECK:STDOUT:
  2350. // CHECK:STDOUT: fn;
  2351. // CHECK:STDOUT: }
  2352. // CHECK:STDOUT:
  2353. // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K(%self.param: %AnyParam.0dd) {
  2354. // CHECK:STDOUT: !entry:
  2355. // CHECK:STDOUT: return
  2356. // CHECK:STDOUT: }
  2357. // CHECK:STDOUT:
  2358. // CHECK:STDOUT: fn @L() {
  2359. // CHECK:STDOUT: !entry:
  2360. // CHECK:STDOUT: name_binding_decl {
  2361. // CHECK:STDOUT: %obj.patt: %pattern_type.64f = binding_pattern obj [concrete]
  2362. // CHECK:STDOUT: %obj.var_patt: %pattern_type.64f = var_pattern %obj.patt [concrete]
  2363. // CHECK:STDOUT: }
  2364. // CHECK:STDOUT: %obj.var: ref %AnyParam.0dd = var %obj.var_patt
  2365. // CHECK:STDOUT: %.loc13_54.1: %empty_struct_type = struct_literal ()
  2366. // CHECK:STDOUT: %.loc13_54.2: init %AnyParam.0dd = class_init (), %obj.var [concrete = constants.%AnyParam.val]
  2367. // CHECK:STDOUT: %.loc13_3: init %AnyParam.0dd = converted %.loc13_54.1, %.loc13_54.2 [concrete = constants.%AnyParam.val]
  2368. // CHECK:STDOUT: assign %obj.var, %.loc13_3
  2369. // CHECK:STDOUT: %.loc13_49: type = splice_block %AnyParam [concrete = constants.%AnyParam.0dd] {
  2370. // CHECK:STDOUT: %PackageHasParam.ref.loc13: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2371. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  2372. // CHECK:STDOUT: %GenericClass.ref: %GenericClass.type = name_ref GenericClass, file.%GenericClass.decl [concrete = constants.%GenericClass.generic]
  2373. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) [concrete = constants.%AnyParam.0dd]
  2374. // CHECK:STDOUT: }
  2375. // CHECK:STDOUT: %obj: ref %AnyParam.0dd = bind_name obj, %obj.var
  2376. // CHECK:STDOUT: %obj.ref: ref %AnyParam.0dd = name_ref obj, %obj
  2377. // CHECK:STDOUT: %PackageHasParam.ref.loc14: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2378. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  2379. // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.f69 [concrete = constants.%assoc0.494]
  2380. // CHECK:STDOUT: %impl.elem0: %.507 = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K]
  2381. // CHECK:STDOUT: %bound_method.loc14: <bound method> = bound_method %obj.ref, %impl.elem0
  2382. // CHECK:STDOUT: %.loc14: %AnyParam.0dd = bind_value %obj.ref
  2383. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method.loc14(%.loc14)
  2384. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.bound: <bound method> = bound_method %obj.var, constants.%AnyParam.as.Destroy.impl.Op.422
  2385. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%AnyParam.as.Destroy.impl.Op.422, @AnyParam.as.Destroy.impl.Op(constants.%GenericClass.type, constants.%GenericClass.generic) [concrete = constants.%AnyParam.as.Destroy.impl.Op.specific_fn]
  2386. // CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %obj.var, %AnyParam.as.Destroy.impl.Op.specific_fn
  2387. // CHECK:STDOUT: %addr: %ptr.d96 = addr_of %obj.var
  2388. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc13(%addr)
  2389. // CHECK:STDOUT: return
  2390. // CHECK:STDOUT: }
  2391. // CHECK:STDOUT:
  2392. // CHECK:STDOUT: generic fn @AnyParam.as.Destroy.impl.Op(imports.%PackageHasParam.import_ref.5ab3ec.3: type, imports.%PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  2393. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2394. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2395. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  2396. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.4a9)]
  2397. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.84c)]
  2398. // CHECK:STDOUT:
  2399. // CHECK:STDOUT: !definition:
  2400. // CHECK:STDOUT:
  2401. // CHECK:STDOUT: fn = "no_op";
  2402. // CHECK:STDOUT: }
  2403. // CHECK:STDOUT:
  2404. // CHECK:STDOUT: specific @GenericClass(constants.%U) {
  2405. // CHECK:STDOUT: %U.loc6_20.1 => constants.%U
  2406. // CHECK:STDOUT: }
  2407. // CHECK:STDOUT:
  2408. // CHECK:STDOUT: specific @GenericClass.as.Destroy.impl(constants.%U) {
  2409. // CHECK:STDOUT: %U => constants.%U
  2410. // CHECK:STDOUT: %GenericClass => constants.%GenericClass
  2411. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.102
  2412. // CHECK:STDOUT: }
  2413. // CHECK:STDOUT:
  2414. // CHECK:STDOUT: specific @GenericClass.as.Destroy.impl.Op(constants.%U) {
  2415. // CHECK:STDOUT: %U => constants.%U
  2416. // CHECK:STDOUT: %GenericClass => constants.%GenericClass
  2417. // CHECK:STDOUT: %ptr => constants.%ptr.b1a
  2418. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.0e2
  2419. // CHECK:STDOUT: }
  2420. // CHECK:STDOUT:
  2421. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  2422. // CHECK:STDOUT: %T => constants.%T
  2423. // CHECK:STDOUT: %X => constants.%X
  2424. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  2425. // CHECK:STDOUT: }
  2426. // CHECK:STDOUT:
  2427. // CHECK:STDOUT: specific @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2428. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2429. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2430. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.17e
  2431. // CHECK:STDOUT:
  2432. // CHECK:STDOUT: !definition:
  2433. // CHECK:STDOUT: %require_complete => constants.%complete_type.398
  2434. // CHECK:STDOUT: }
  2435. // CHECK:STDOUT:
  2436. // CHECK:STDOUT: specific @Y.K(constants.%Self.2f4) {
  2437. // CHECK:STDOUT: %Self => constants.%Self.2f4
  2438. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.84b
  2439. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e57
  2440. // CHECK:STDOUT: }
  2441. // CHECK:STDOUT:
  2442. // CHECK:STDOUT: specific @Y.K(constants.%Y.facet) {
  2443. // CHECK:STDOUT: %Self => constants.%Y.facet
  2444. // CHECK:STDOUT: %Self.as_type => constants.%AnyParam.0dd
  2445. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.64f
  2446. // CHECK:STDOUT: }
  2447. // CHECK:STDOUT:
  2448. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  2449. // CHECK:STDOUT: %T => constants.%T
  2450. // CHECK:STDOUT: %X => constants.%X
  2451. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  2452. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.07c
  2453. // CHECK:STDOUT: }
  2454. // CHECK:STDOUT:
  2455. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  2456. // CHECK:STDOUT: %T => constants.%T
  2457. // CHECK:STDOUT: %X => constants.%X
  2458. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  2459. // CHECK:STDOUT: %ptr => constants.%ptr.4a9
  2460. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.84c
  2461. // CHECK:STDOUT: }
  2462. // CHECK:STDOUT:
  2463. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2464. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2465. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2466. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.0dd
  2467. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.456
  2468. // CHECK:STDOUT:
  2469. // CHECK:STDOUT: !definition:
  2470. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type => constants.%AnyParam.as.Destroy.impl.Op.type.f67
  2471. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op => constants.%AnyParam.as.Destroy.impl.Op.422
  2472. // CHECK:STDOUT: }
  2473. // CHECK:STDOUT:
  2474. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2475. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2476. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2477. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.0dd
  2478. // CHECK:STDOUT: %ptr => constants.%ptr.d96
  2479. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fb7
  2480. // CHECK:STDOUT: }
  2481. // CHECK:STDOUT:
  2482. // CHECK:STDOUT: --- use_generic_class_as_param.carbon
  2483. // CHECK:STDOUT:
  2484. // CHECK:STDOUT: constants {
  2485. // CHECK:STDOUT: %M.type: type = fn_type @M [concrete]
  2486. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2487. // CHECK:STDOUT: %M: %M.type = struct_value () [concrete]
  2488. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  2489. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  2490. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2491. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  2492. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  2493. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  2494. // CHECK:STDOUT: %AnyParam.560: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  2495. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  2496. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  2497. // CHECK:STDOUT: %GenericClass.type: type = generic_class_type @GenericClass [concrete]
  2498. // CHECK:STDOUT: %GenericClass.generic: %GenericClass.type = struct_value () [concrete]
  2499. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  2500. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic]
  2501. // CHECK:STDOUT: %pattern_type.17a: type = pattern_type %GenericClass.type [concrete]
  2502. // CHECK:STDOUT: %AnyParam.d71: type = class_type @AnyParam, @AnyParam(%GenericClass.type, %GenericClass.generic) [concrete]
  2503. // CHECK:STDOUT: %complete_type.426: <witness> = complete_type_witness %GenericClass.type [concrete]
  2504. // CHECK:STDOUT: %pattern_type.312: type = pattern_type %AnyParam.d71 [concrete]
  2505. // CHECK:STDOUT: %AnyParam.val: %AnyParam.d71 = struct_value () [concrete]
  2506. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  2507. // CHECK:STDOUT: %Self.2f4: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  2508. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  2509. // CHECK:STDOUT: %assoc0.494: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [concrete]
  2510. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  2511. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  2512. // CHECK:STDOUT: %Self.as_type.84b: type = facet_access_type %Self.2f4 [symbolic]
  2513. // CHECK:STDOUT: %pattern_type.e57: type = pattern_type %Self.as_type.84b [symbolic]
  2514. // CHECK:STDOUT: %require_complete.040: <witness> = require_complete_type %Self.as_type.84b [symbolic]
  2515. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness imports.%Y.impl_witness_table [concrete]
  2516. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.d71, (%Y.impl_witness) [concrete]
  2517. // CHECK:STDOUT: %.79f: type = fn_type_with_self_type %Y.K.type, %Y.facet [concrete]
  2518. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
  2519. // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]
  2520. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  2521. // CHECK:STDOUT: %Destroy.impl_witness.07c: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  2522. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type.694: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  2523. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.1db: %AnyParam.as.Destroy.impl.Op.type.694 = struct_value () [symbolic]
  2524. // CHECK:STDOUT: %ptr.4a9: type = ptr_type %AnyParam.560 [symbolic]
  2525. // CHECK:STDOUT: %pattern_type.84c: type = pattern_type %ptr.4a9 [symbolic]
  2526. // CHECK:STDOUT: %Destroy.impl_witness.ae4: <witness> = impl_witness imports.%Destroy.impl_witness_table.0e5, @GenericClass.as.Destroy.impl(%U) [symbolic]
  2527. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op.type: type = fn_type @GenericClass.as.Destroy.impl.Op, @GenericClass.as.Destroy.impl(%U) [symbolic]
  2528. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op: %GenericClass.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2529. // CHECK:STDOUT: %ptr.d95: type = ptr_type %GenericClass [symbolic]
  2530. // CHECK:STDOUT: %pattern_type.327: type = pattern_type %ptr.d95 [symbolic]
  2531. // CHECK:STDOUT: %Destroy.impl_witness.156: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%GenericClass.type, %GenericClass.generic) [concrete]
  2532. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type.cf0: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%GenericClass.type, %GenericClass.generic) [concrete]
  2533. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.5b1: %AnyParam.as.Destroy.impl.Op.type.cf0 = struct_value () [concrete]
  2534. // CHECK:STDOUT: %ptr.8ee: type = ptr_type %AnyParam.d71 [concrete]
  2535. // CHECK:STDOUT: %pattern_type.470: type = pattern_type %ptr.8ee [concrete]
  2536. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %AnyParam.as.Destroy.impl.Op.5b1, @AnyParam.as.Destroy.impl.Op(%GenericClass.type, %GenericClass.generic) [concrete]
  2537. // CHECK:STDOUT: }
  2538. // CHECK:STDOUT:
  2539. // CHECK:STDOUT: imports {
  2540. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2541. // CHECK:STDOUT: .Destroy = %Core.Destroy
  2542. // CHECK:STDOUT: import Core//prelude
  2543. // CHECK:STDOUT: import Core//prelude/...
  2544. // CHECK:STDOUT: }
  2545. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [concrete] {
  2546. // CHECK:STDOUT: .AnyParam = %PackageHasParam.AnyParam
  2547. // CHECK:STDOUT: .Y = %PackageHasParam.Y
  2548. // CHECK:STDOUT: import PackageHasParam//default
  2549. // CHECK:STDOUT: }
  2550. // CHECK:STDOUT: %PackageGenericClass: <namespace> = namespace file.%PackageGenericClass.import, [concrete] {
  2551. // CHECK:STDOUT: .GenericClass = %PackageGenericClass.GenericClass
  2552. // CHECK:STDOUT: import PackageGenericClass//default
  2553. // CHECK:STDOUT: }
  2554. // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [concrete = constants.%AnyParam.generic]
  2555. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.1: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2556. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2557. // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [concrete = constants.%complete_type.357]
  2558. // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst38 [no loc], unloaded
  2559. // CHECK:STDOUT: %PackageGenericClass.GenericClass: %GenericClass.type = import_ref PackageGenericClass//default, GenericClass, loaded [concrete = constants.%GenericClass.generic]
  2560. // CHECK:STDOUT: %PackageGenericClass.import_ref.5ab3ec.1: type = import_ref PackageGenericClass//default, loc6_20, loaded [symbolic = @GenericClass.%U (constants.%U)]
  2561. // CHECK:STDOUT: %PackageGenericClass.import_ref.8f2: <witness> = import_ref PackageGenericClass//default, loc6_31, loaded [concrete = constants.%complete_type.357]
  2562. // CHECK:STDOUT: %PackageGenericClass.import_ref.065 = import_ref PackageGenericClass//default, inst31 [no loc], unloaded
  2563. // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
  2564. // CHECK:STDOUT: %PackageHasParam.import_ref.0f3 = import_ref PackageHasParam//default, inst99 [no loc], unloaded
  2565. // CHECK:STDOUT: %PackageHasParam.import_ref.f69: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.494]
  2566. // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded
  2567. // CHECK:STDOUT: %PackageHasParam.import_ref.ce2: %Y.K.type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%Y.K]
  2568. // CHECK:STDOUT: %PackageHasParam.import_ref.28c: %Y.type = import_ref PackageHasParam//default, inst99 [no loc], loaded [symbolic = constants.%Self.2f4]
  2569. // CHECK:STDOUT: %PackageGenericClass.import_ref.812: <witness> = import_ref PackageGenericClass//default, loc8_66, loaded [concrete = constants.%Y.impl_witness]
  2570. // CHECK:STDOUT: %PackageGenericClass.import_ref.a0e: type = import_ref PackageGenericClass//default, loc8_43, loaded [concrete = constants.%AnyParam.d71]
  2571. // CHECK:STDOUT: %PackageGenericClass.import_ref.ca6: type = import_ref PackageGenericClass//default, loc8_63, loaded [concrete = constants.%Y.type]
  2572. // CHECK:STDOUT: %PackageGenericClass.import_ref.434: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericClass//default, loc9_22, loaded [concrete = constants.%AnyParam.as.Y.impl.K]
  2573. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericClass.import_ref.434), @AnyParam.as.Y.impl [concrete]
  2574. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  2575. // CHECK:STDOUT: %PackageHasParam.import_ref.043: <witness> = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.07c)]
  2576. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.2: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2577. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2578. // CHECK:STDOUT: %PackageHasParam.import_ref.cdc: type = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%AnyParam (constants.%AnyParam.560)]
  2579. // CHECK:STDOUT: %PackageHasParam.import_ref.e45: type = import_ref PackageHasParam//default, inst41 [no loc], loaded [concrete = constants.%Destroy.type]
  2580. // CHECK:STDOUT: %PackageHasParam.import_ref.f8b: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type.694) = import_ref PackageHasParam//default, loc4_33, loaded [symbolic = @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op.1db)]
  2581. // CHECK:STDOUT: %Destroy.impl_witness_table.761 = impl_witness_table (%PackageHasParam.import_ref.f8b), @AnyParam.as.Destroy.impl [concrete]
  2582. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.3: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2583. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2584. // CHECK:STDOUT: %PackageGenericClass.import_ref.c5d = import_ref PackageGenericClass//default, loc6_30, unloaded
  2585. // CHECK:STDOUT: %PackageGenericClass.import_ref.5ab3ec.2: type = import_ref PackageGenericClass//default, loc6_20, loaded [symbolic = @GenericClass.%U (constants.%U)]
  2586. // CHECK:STDOUT: %PackageGenericClass.import_ref.5a9: type = import_ref PackageGenericClass//default, loc6_30, loaded [symbolic = @GenericClass.as.Destroy.impl.%GenericClass (constants.%GenericClass)]
  2587. // CHECK:STDOUT: %PackageGenericClass.import_ref.e45: type = import_ref PackageGenericClass//default, inst34 [no loc], loaded [concrete = constants.%Destroy.type]
  2588. // CHECK:STDOUT: %PackageGenericClass.import_ref.bea = import_ref PackageGenericClass//default, loc6_30, unloaded
  2589. // CHECK:STDOUT: %Destroy.impl_witness_table.0e5 = impl_witness_table (%PackageGenericClass.import_ref.bea), @GenericClass.as.Destroy.impl [concrete]
  2590. // CHECK:STDOUT: %PackageGenericClass.import_ref.5ab3ec.3: type = import_ref PackageGenericClass//default, loc6_20, loaded [symbolic = @GenericClass.%U (constants.%U)]
  2591. // CHECK:STDOUT: }
  2592. // CHECK:STDOUT:
  2593. // CHECK:STDOUT: file {
  2594. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2595. // CHECK:STDOUT: .Core = imports.%Core
  2596. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  2597. // CHECK:STDOUT: .PackageGenericClass = imports.%PackageGenericClass
  2598. // CHECK:STDOUT: .M = %M.decl
  2599. // CHECK:STDOUT: }
  2600. // CHECK:STDOUT: %Core.import = import Core
  2601. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  2602. // CHECK:STDOUT: %PackageGenericClass.import = import PackageGenericClass
  2603. // CHECK:STDOUT: %M.decl: %M.type = fn_decl @M [concrete = constants.%M] {} {}
  2604. // CHECK:STDOUT: }
  2605. // CHECK:STDOUT:
  2606. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  2607. // CHECK:STDOUT: !members:
  2608. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.0f3
  2609. // CHECK:STDOUT: .K = imports.%PackageHasParam.import_ref.f69
  2610. // CHECK:STDOUT: witness = (imports.%PackageHasParam.K)
  2611. // CHECK:STDOUT: }
  2612. // CHECK:STDOUT:
  2613. // CHECK:STDOUT: impl @AnyParam.as.Y.impl: imports.%PackageGenericClass.import_ref.a0e as imports.%PackageGenericClass.import_ref.ca6 [from "has_generic_class.carbon"] {
  2614. // CHECK:STDOUT: !members:
  2615. // CHECK:STDOUT: witness = imports.%PackageGenericClass.import_ref.812
  2616. // CHECK:STDOUT: }
  2617. // CHECK:STDOUT:
  2618. // CHECK:STDOUT: generic impl @AnyParam.as.Destroy.impl(imports.%PackageHasParam.import_ref.5ab3ec.2: type, imports.%PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  2619. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2620. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2621. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  2622. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.761, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.07c)]
  2623. // CHECK:STDOUT:
  2624. // CHECK:STDOUT: !definition:
  2625. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %AnyParam.as.Destroy.impl.Op.type (constants.%AnyParam.as.Destroy.impl.Op.type.694)]
  2626. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: @AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.type (%AnyParam.as.Destroy.impl.Op.type.694) = struct_value () [symbolic = %AnyParam.as.Destroy.impl.Op (constants.%AnyParam.as.Destroy.impl.Op.1db)]
  2627. // CHECK:STDOUT:
  2628. // CHECK:STDOUT: impl: imports.%PackageHasParam.import_ref.cdc as imports.%PackageHasParam.import_ref.e45 {
  2629. // CHECK:STDOUT: !members:
  2630. // CHECK:STDOUT: witness = imports.%PackageHasParam.import_ref.043
  2631. // CHECK:STDOUT: }
  2632. // CHECK:STDOUT: }
  2633. // CHECK:STDOUT:
  2634. // CHECK:STDOUT: generic impl @GenericClass.as.Destroy.impl(imports.%PackageGenericClass.import_ref.5ab3ec.2: type) [from "has_generic_class.carbon"] {
  2635. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2636. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic = %GenericClass (constants.%GenericClass)]
  2637. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.0e5, @GenericClass.as.Destroy.impl(%U) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.ae4)]
  2638. // CHECK:STDOUT:
  2639. // CHECK:STDOUT: !definition:
  2640. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op.type: type = fn_type @GenericClass.as.Destroy.impl.Op, @GenericClass.as.Destroy.impl(%U) [symbolic = %GenericClass.as.Destroy.impl.Op.type (constants.%GenericClass.as.Destroy.impl.Op.type)]
  2641. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op: @GenericClass.as.Destroy.impl.%GenericClass.as.Destroy.impl.Op.type (%GenericClass.as.Destroy.impl.Op.type) = struct_value () [symbolic = %GenericClass.as.Destroy.impl.Op (constants.%GenericClass.as.Destroy.impl.Op)]
  2642. // CHECK:STDOUT:
  2643. // CHECK:STDOUT: impl: imports.%PackageGenericClass.import_ref.5a9 as imports.%PackageGenericClass.import_ref.e45 {
  2644. // CHECK:STDOUT: !members:
  2645. // CHECK:STDOUT: witness = imports.%PackageGenericClass.import_ref.c5d
  2646. // CHECK:STDOUT: }
  2647. // CHECK:STDOUT: }
  2648. // CHECK:STDOUT:
  2649. // CHECK:STDOUT: generic class @AnyParam(imports.%PackageHasParam.import_ref.5ab3ec.1: type, imports.%PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  2650. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2651. // CHECK:STDOUT: %X: @AnyParam.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2652. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  2653. // CHECK:STDOUT:
  2654. // CHECK:STDOUT: !definition:
  2655. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  2656. // CHECK:STDOUT:
  2657. // CHECK:STDOUT: class {
  2658. // CHECK:STDOUT: complete_type_witness = imports.%PackageHasParam.import_ref.8f2
  2659. // CHECK:STDOUT:
  2660. // CHECK:STDOUT: !members:
  2661. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.601
  2662. // CHECK:STDOUT: }
  2663. // CHECK:STDOUT: }
  2664. // CHECK:STDOUT:
  2665. // CHECK:STDOUT: generic class @GenericClass(imports.%PackageGenericClass.import_ref.5ab3ec.1: type) [from "has_generic_class.carbon"] {
  2666. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2667. // CHECK:STDOUT:
  2668. // CHECK:STDOUT: !definition:
  2669. // CHECK:STDOUT:
  2670. // CHECK:STDOUT: class {
  2671. // CHECK:STDOUT: complete_type_witness = imports.%PackageGenericClass.import_ref.8f2
  2672. // CHECK:STDOUT:
  2673. // CHECK:STDOUT: !members:
  2674. // CHECK:STDOUT: .Self = imports.%PackageGenericClass.import_ref.065
  2675. // CHECK:STDOUT: }
  2676. // CHECK:STDOUT: }
  2677. // CHECK:STDOUT:
  2678. // CHECK:STDOUT: fn @M() {
  2679. // CHECK:STDOUT: !entry:
  2680. // CHECK:STDOUT: name_binding_decl {
  2681. // CHECK:STDOUT: %obj.patt: %pattern_type.312 = binding_pattern obj [concrete]
  2682. // CHECK:STDOUT: %obj.var_patt: %pattern_type.312 = var_pattern %obj.patt [concrete]
  2683. // CHECK:STDOUT: }
  2684. // CHECK:STDOUT: %obj.var: ref %AnyParam.d71 = var %obj.var_patt
  2685. // CHECK:STDOUT: %.loc8_74.1: %empty_struct_type = struct_literal ()
  2686. // CHECK:STDOUT: %.loc8_74.2: init %AnyParam.d71 = class_init (), %obj.var [concrete = constants.%AnyParam.val]
  2687. // CHECK:STDOUT: %.loc8_3: init %AnyParam.d71 = converted %.loc8_74.1, %.loc8_74.2 [concrete = constants.%AnyParam.val]
  2688. // CHECK:STDOUT: assign %obj.var, %.loc8_3
  2689. // CHECK:STDOUT: %.loc8_69: type = splice_block %AnyParam [concrete = constants.%AnyParam.d71] {
  2690. // CHECK:STDOUT: %PackageHasParam.ref.loc8: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2691. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  2692. // CHECK:STDOUT: %PackageGenericClass.ref: <namespace> = name_ref PackageGenericClass, imports.%PackageGenericClass [concrete = imports.%PackageGenericClass]
  2693. // CHECK:STDOUT: %GenericClass.ref: %GenericClass.type = name_ref GenericClass, imports.%PackageGenericClass.GenericClass [concrete = constants.%GenericClass.generic]
  2694. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) [concrete = constants.%AnyParam.d71]
  2695. // CHECK:STDOUT: }
  2696. // CHECK:STDOUT: %obj: ref %AnyParam.d71 = bind_name obj, %obj.var
  2697. // CHECK:STDOUT: %obj.ref: ref %AnyParam.d71 = name_ref obj, %obj
  2698. // CHECK:STDOUT: %PackageHasParam.ref.loc9: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2699. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  2700. // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.f69 [concrete = constants.%assoc0.494]
  2701. // CHECK:STDOUT: %impl.elem0: %.79f = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K]
  2702. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %obj.ref, %impl.elem0
  2703. // CHECK:STDOUT: %.loc9: %AnyParam.d71 = bind_value %obj.ref
  2704. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method.loc9(%.loc9)
  2705. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.bound: <bound method> = bound_method %obj.var, constants.%AnyParam.as.Destroy.impl.Op.5b1
  2706. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%AnyParam.as.Destroy.impl.Op.5b1, @AnyParam.as.Destroy.impl.Op(constants.%GenericClass.type, constants.%GenericClass.generic) [concrete = constants.%AnyParam.as.Destroy.impl.Op.specific_fn]
  2707. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %obj.var, %AnyParam.as.Destroy.impl.Op.specific_fn
  2708. // CHECK:STDOUT: %addr: %ptr.8ee = addr_of %obj.var
  2709. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8(%addr)
  2710. // CHECK:STDOUT: return
  2711. // CHECK:STDOUT: }
  2712. // CHECK:STDOUT:
  2713. // CHECK:STDOUT: generic fn @Y.K(imports.%PackageHasParam.import_ref.28c: %Y.type) [from "has_param.carbon"] {
  2714. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.2f4)]
  2715. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.84b)]
  2716. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.e57)]
  2717. // CHECK:STDOUT:
  2718. // CHECK:STDOUT: !definition:
  2719. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.040)]
  2720. // CHECK:STDOUT:
  2721. // CHECK:STDOUT: fn;
  2722. // CHECK:STDOUT: }
  2723. // CHECK:STDOUT:
  2724. // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K [from "has_generic_class.carbon"];
  2725. // CHECK:STDOUT:
  2726. // CHECK:STDOUT: generic fn @AnyParam.as.Destroy.impl.Op(imports.%PackageHasParam.import_ref.5ab3ec.3: type, imports.%PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T)) [from "has_param.carbon"] {
  2727. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2728. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2729. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  2730. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.4a9)]
  2731. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.84c)]
  2732. // CHECK:STDOUT:
  2733. // CHECK:STDOUT: !definition:
  2734. // CHECK:STDOUT:
  2735. // CHECK:STDOUT: fn = "no_op";
  2736. // CHECK:STDOUT: }
  2737. // CHECK:STDOUT:
  2738. // CHECK:STDOUT: generic fn @GenericClass.as.Destroy.impl.Op(imports.%PackageGenericClass.import_ref.5ab3ec.3: type) [from "has_generic_class.carbon"] {
  2739. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2740. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic = %GenericClass (constants.%GenericClass)]
  2741. // CHECK:STDOUT: %ptr: type = ptr_type %GenericClass [symbolic = %ptr (constants.%ptr.d95)]
  2742. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.327)]
  2743. // CHECK:STDOUT:
  2744. // CHECK:STDOUT: !definition:
  2745. // CHECK:STDOUT:
  2746. // CHECK:STDOUT: fn = "no_op";
  2747. // CHECK:STDOUT: }
  2748. // CHECK:STDOUT:
  2749. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  2750. // CHECK:STDOUT: %T => constants.%T
  2751. // CHECK:STDOUT: %X => constants.%X
  2752. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  2753. // CHECK:STDOUT: }
  2754. // CHECK:STDOUT:
  2755. // CHECK:STDOUT: specific @GenericClass(constants.%U) {
  2756. // CHECK:STDOUT: %U => constants.%U
  2757. // CHECK:STDOUT: }
  2758. // CHECK:STDOUT:
  2759. // CHECK:STDOUT: specific @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2760. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2761. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2762. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.17a
  2763. // CHECK:STDOUT:
  2764. // CHECK:STDOUT: !definition:
  2765. // CHECK:STDOUT: %require_complete => constants.%complete_type.426
  2766. // CHECK:STDOUT: }
  2767. // CHECK:STDOUT:
  2768. // CHECK:STDOUT: specific @Y.K(constants.%Self.2f4) {
  2769. // CHECK:STDOUT: %Self => constants.%Self.2f4
  2770. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.84b
  2771. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e57
  2772. // CHECK:STDOUT: }
  2773. // CHECK:STDOUT:
  2774. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  2775. // CHECK:STDOUT: %T => constants.%T
  2776. // CHECK:STDOUT: %X => constants.%X
  2777. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  2778. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.07c
  2779. // CHECK:STDOUT: }
  2780. // CHECK:STDOUT:
  2781. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  2782. // CHECK:STDOUT: %T => constants.%T
  2783. // CHECK:STDOUT: %X => constants.%X
  2784. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  2785. // CHECK:STDOUT: %ptr => constants.%ptr.4a9
  2786. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.84c
  2787. // CHECK:STDOUT: }
  2788. // CHECK:STDOUT:
  2789. // CHECK:STDOUT: specific @GenericClass.as.Destroy.impl(constants.%U) {
  2790. // CHECK:STDOUT: %U => constants.%U
  2791. // CHECK:STDOUT: %GenericClass => constants.%GenericClass
  2792. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.ae4
  2793. // CHECK:STDOUT: }
  2794. // CHECK:STDOUT:
  2795. // CHECK:STDOUT: specific @GenericClass.as.Destroy.impl.Op(constants.%U) {
  2796. // CHECK:STDOUT: %U => constants.%U
  2797. // CHECK:STDOUT: %GenericClass => constants.%GenericClass
  2798. // CHECK:STDOUT: %ptr => constants.%ptr.d95
  2799. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.327
  2800. // CHECK:STDOUT: }
  2801. // CHECK:STDOUT:
  2802. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2803. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2804. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2805. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.d71
  2806. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.156
  2807. // CHECK:STDOUT:
  2808. // CHECK:STDOUT: !definition:
  2809. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type => constants.%AnyParam.as.Destroy.impl.Op.type.cf0
  2810. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op => constants.%AnyParam.as.Destroy.impl.Op.5b1
  2811. // CHECK:STDOUT: }
  2812. // CHECK:STDOUT:
  2813. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2814. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2815. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2816. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.d71
  2817. // CHECK:STDOUT: %ptr => constants.%ptr.8ee
  2818. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.470
  2819. // CHECK:STDOUT: }
  2820. // CHECK:STDOUT:
  2821. // CHECK:STDOUT: --- has_extra_interfaces.carbon
  2822. // CHECK:STDOUT:
  2823. // CHECK:STDOUT: constants {
  2824. // CHECK:STDOUT: %Extra1.type: type = facet_type <@Extra1> [concrete]
  2825. // CHECK:STDOUT: %Self.d36: %Extra1.type = bind_symbolic_name Self, 0 [symbolic]
  2826. // CHECK:STDOUT: %Extra2.type: type = facet_type <@Extra2> [concrete]
  2827. // CHECK:STDOUT: %Self.a47: %Extra2.type = bind_symbolic_name Self, 0 [symbolic]
  2828. // CHECK:STDOUT: %Extra3.type: type = facet_type <@Extra3> [concrete]
  2829. // CHECK:STDOUT: %Self.c02: %Extra3.type = bind_symbolic_name Self, 0 [symbolic]
  2830. // CHECK:STDOUT: %Extra4.type: type = facet_type <@Extra4> [concrete]
  2831. // CHECK:STDOUT: %Self.696: %Extra4.type = bind_symbolic_name Self, 0 [symbolic]
  2832. // CHECK:STDOUT: %Extra5.type: type = facet_type <@Extra5> [concrete]
  2833. // CHECK:STDOUT: %Self.b07: %Extra5.type = bind_symbolic_name Self, 0 [symbolic]
  2834. // CHECK:STDOUT: %Extra6.type: type = facet_type <@Extra6> [concrete]
  2835. // CHECK:STDOUT: %Self.5c5: %Extra6.type = bind_symbolic_name Self, 0 [symbolic]
  2836. // CHECK:STDOUT: %Extra7.type: type = facet_type <@Extra7> [concrete]
  2837. // CHECK:STDOUT: %Self.f52: %Extra7.type = bind_symbolic_name Self, 0 [symbolic]
  2838. // CHECK:STDOUT: %Extra8.type: type = facet_type <@Extra8> [concrete]
  2839. // CHECK:STDOUT: %Self.779: %Extra8.type = bind_symbolic_name Self, 0 [symbolic]
  2840. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  2841. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  2842. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  2843. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  2844. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  2845. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  2846. // CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic]
  2847. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  2848. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  2849. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic]
  2850. // CHECK:STDOUT: %ptr.7d2: type = ptr_type %C.f2e [symbolic]
  2851. // CHECK:STDOUT: %pattern_type.1d2: type = pattern_type %ptr.7d2 [symbolic]
  2852. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%T) [symbolic]
  2853. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2854. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2855. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2856. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  2857. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  2858. // CHECK:STDOUT: %Self.as_type.a67: type = facet_access_type %Self.7ee [symbolic]
  2859. // CHECK:STDOUT: %pattern_type.d22: type = pattern_type %Self.as_type.a67 [symbolic]
  2860. // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
  2861. // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
  2862. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  2863. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete]
  2864. // CHECK:STDOUT: %tuple.type.c53: type = tuple_type (type, type, type, type, type, type, type, type) [concrete]
  2865. // CHECK:STDOUT: %tuple.type.f7c: type = tuple_type (%Extra1.type, %Extra2.type, %Extra3.type, %Extra4.type, %Extra5.type, %Extra6.type, %Extra7.type, %Extra8.type) [concrete]
  2866. // CHECK:STDOUT: %C.763: type = class_type @C, @C(%tuple.type.f7c) [concrete]
  2867. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  2868. // CHECK:STDOUT: %pattern_type.fc9: type = pattern_type %C.763 [concrete]
  2869. // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F [concrete]
  2870. // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [concrete]
  2871. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C.763, (%I.impl_witness) [concrete]
  2872. // CHECK:STDOUT: }
  2873. // CHECK:STDOUT:
  2874. // CHECK:STDOUT: imports {
  2875. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2876. // CHECK:STDOUT: .Destroy = %Core.Destroy
  2877. // CHECK:STDOUT: import Core//prelude
  2878. // CHECK:STDOUT: import Core//prelude/...
  2879. // CHECK:STDOUT: }
  2880. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  2881. // CHECK:STDOUT: }
  2882. // CHECK:STDOUT:
  2883. // CHECK:STDOUT: file {
  2884. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2885. // CHECK:STDOUT: .Core = imports.%Core
  2886. // CHECK:STDOUT: .Extra1 = %Extra1.decl
  2887. // CHECK:STDOUT: .Extra2 = %Extra2.decl
  2888. // CHECK:STDOUT: .Extra3 = %Extra3.decl
  2889. // CHECK:STDOUT: .Extra4 = %Extra4.decl
  2890. // CHECK:STDOUT: .Extra5 = %Extra5.decl
  2891. // CHECK:STDOUT: .Extra6 = %Extra6.decl
  2892. // CHECK:STDOUT: .Extra7 = %Extra7.decl
  2893. // CHECK:STDOUT: .Extra8 = %Extra8.decl
  2894. // CHECK:STDOUT: .C = %C.decl
  2895. // CHECK:STDOUT: .I = %I.decl
  2896. // CHECK:STDOUT: }
  2897. // CHECK:STDOUT: %Core.import = import Core
  2898. // CHECK:STDOUT: %Extra1.decl: type = interface_decl @Extra1 [concrete = constants.%Extra1.type] {} {}
  2899. // CHECK:STDOUT: %Extra2.decl: type = interface_decl @Extra2 [concrete = constants.%Extra2.type] {} {}
  2900. // CHECK:STDOUT: %Extra3.decl: type = interface_decl @Extra3 [concrete = constants.%Extra3.type] {} {}
  2901. // CHECK:STDOUT: %Extra4.decl: type = interface_decl @Extra4 [concrete = constants.%Extra4.type] {} {}
  2902. // CHECK:STDOUT: %Extra5.decl: type = interface_decl @Extra5 [concrete = constants.%Extra5.type] {} {}
  2903. // CHECK:STDOUT: %Extra6.decl: type = interface_decl @Extra6 [concrete = constants.%Extra6.type] {} {}
  2904. // CHECK:STDOUT: %Extra7.decl: type = interface_decl @Extra7 [concrete = constants.%Extra7.type] {} {}
  2905. // CHECK:STDOUT: %Extra8.decl: type = interface_decl @Extra8 [concrete = constants.%Extra8.type] {} {}
  2906. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  2907. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  2908. // CHECK:STDOUT: } {
  2909. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  2910. // CHECK:STDOUT: %T.loc13_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc13_9.1 (constants.%T)]
  2911. // CHECK:STDOUT: }
  2912. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  2913. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  2914. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  2915. // CHECK:STDOUT: %Extra1.ref: type = name_ref Extra1, file.%Extra1.decl [concrete = constants.%Extra1.type]
  2916. // CHECK:STDOUT: %Extra2.ref: type = name_ref Extra2, file.%Extra2.decl [concrete = constants.%Extra2.type]
  2917. // CHECK:STDOUT: %Extra3.ref: type = name_ref Extra3, file.%Extra3.decl [concrete = constants.%Extra3.type]
  2918. // CHECK:STDOUT: %Extra4.ref: type = name_ref Extra4, file.%Extra4.decl [concrete = constants.%Extra4.type]
  2919. // CHECK:STDOUT: %Extra5.ref: type = name_ref Extra5, file.%Extra5.decl [concrete = constants.%Extra5.type]
  2920. // CHECK:STDOUT: %Extra6.ref: type = name_ref Extra6, file.%Extra6.decl [concrete = constants.%Extra6.type]
  2921. // CHECK:STDOUT: %Extra7.ref: type = name_ref Extra7, file.%Extra7.decl [concrete = constants.%Extra7.type]
  2922. // CHECK:STDOUT: %Extra8.ref: type = name_ref Extra8, file.%Extra8.decl [concrete = constants.%Extra8.type]
  2923. // CHECK:STDOUT: %.loc16_71: %tuple.type.c53 = tuple_literal (%Extra1.ref, %Extra2.ref, %Extra3.ref, %Extra4.ref, %Extra5.ref, %Extra6.ref, %Extra7.ref, %Extra8.ref)
  2924. // CHECK:STDOUT: %.loc16_72: type = converted %.loc16_71, constants.%tuple.type.f7c [concrete = constants.%tuple.type.f7c]
  2925. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.type.f7c) [concrete = constants.%C.763]
  2926. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  2927. // CHECK:STDOUT: }
  2928. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl), @C.as.I.impl [concrete]
  2929. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  2930. // CHECK:STDOUT: }
  2931. // CHECK:STDOUT:
  2932. // CHECK:STDOUT: interface @Extra1 {
  2933. // CHECK:STDOUT: %Self: %Extra1.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.d36]
  2934. // CHECK:STDOUT:
  2935. // CHECK:STDOUT: !members:
  2936. // CHECK:STDOUT: .Self = %Self
  2937. // CHECK:STDOUT: witness = ()
  2938. // CHECK:STDOUT: }
  2939. // CHECK:STDOUT:
  2940. // CHECK:STDOUT: interface @Extra2 {
  2941. // CHECK:STDOUT: %Self: %Extra2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.a47]
  2942. // CHECK:STDOUT:
  2943. // CHECK:STDOUT: !members:
  2944. // CHECK:STDOUT: .Self = %Self
  2945. // CHECK:STDOUT: witness = ()
  2946. // CHECK:STDOUT: }
  2947. // CHECK:STDOUT:
  2948. // CHECK:STDOUT: interface @Extra3 {
  2949. // CHECK:STDOUT: %Self: %Extra3.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.c02]
  2950. // CHECK:STDOUT:
  2951. // CHECK:STDOUT: !members:
  2952. // CHECK:STDOUT: .Self = %Self
  2953. // CHECK:STDOUT: witness = ()
  2954. // CHECK:STDOUT: }
  2955. // CHECK:STDOUT:
  2956. // CHECK:STDOUT: interface @Extra4 {
  2957. // CHECK:STDOUT: %Self: %Extra4.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.696]
  2958. // CHECK:STDOUT:
  2959. // CHECK:STDOUT: !members:
  2960. // CHECK:STDOUT: .Self = %Self
  2961. // CHECK:STDOUT: witness = ()
  2962. // CHECK:STDOUT: }
  2963. // CHECK:STDOUT:
  2964. // CHECK:STDOUT: interface @Extra5 {
  2965. // CHECK:STDOUT: %Self: %Extra5.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.b07]
  2966. // CHECK:STDOUT:
  2967. // CHECK:STDOUT: !members:
  2968. // CHECK:STDOUT: .Self = %Self
  2969. // CHECK:STDOUT: witness = ()
  2970. // CHECK:STDOUT: }
  2971. // CHECK:STDOUT:
  2972. // CHECK:STDOUT: interface @Extra6 {
  2973. // CHECK:STDOUT: %Self: %Extra6.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.5c5]
  2974. // CHECK:STDOUT:
  2975. // CHECK:STDOUT: !members:
  2976. // CHECK:STDOUT: .Self = %Self
  2977. // CHECK:STDOUT: witness = ()
  2978. // CHECK:STDOUT: }
  2979. // CHECK:STDOUT:
  2980. // CHECK:STDOUT: interface @Extra7 {
  2981. // CHECK:STDOUT: %Self: %Extra7.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.f52]
  2982. // CHECK:STDOUT:
  2983. // CHECK:STDOUT: !members:
  2984. // CHECK:STDOUT: .Self = %Self
  2985. // CHECK:STDOUT: witness = ()
  2986. // CHECK:STDOUT: }
  2987. // CHECK:STDOUT:
  2988. // CHECK:STDOUT: interface @Extra8 {
  2989. // CHECK:STDOUT: %Self: %Extra8.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.779]
  2990. // CHECK:STDOUT:
  2991. // CHECK:STDOUT: !members:
  2992. // CHECK:STDOUT: .Self = %Self
  2993. // CHECK:STDOUT: witness = ()
  2994. // CHECK:STDOUT: }
  2995. // CHECK:STDOUT:
  2996. // CHECK:STDOUT: interface @I {
  2997. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  2998. // CHECK:STDOUT: %I.F.decl: %I.F.type = fn_decl @I.F [concrete = constants.%I.F] {
  2999. // CHECK:STDOUT: %self.patt: @I.F.%pattern_type (%pattern_type.d22) = binding_pattern self [concrete]
  3000. // CHECK:STDOUT: %self.param_patt: @I.F.%pattern_type (%pattern_type.d22) = value_param_pattern %self.patt, call_param0 [concrete]
  3001. // CHECK:STDOUT: } {
  3002. // CHECK:STDOUT: %self.param: @I.F.%Self.as_type.loc14_26.1 (%Self.as_type.a67) = value_param call_param0
  3003. // CHECK:STDOUT: %.loc14_26.1: type = splice_block %.loc14_26.2 [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type.a67)] {
  3004. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.7ee)]
  3005. // CHECK:STDOUT: %Self.as_type.loc14_26.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type.a67)]
  3006. // CHECK:STDOUT: %.loc14_26.2: type = converted %Self.ref, %Self.as_type.loc14_26.2 [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type.a67)]
  3007. // CHECK:STDOUT: }
  3008. // CHECK:STDOUT: %self: @I.F.%Self.as_type.loc14_26.1 (%Self.as_type.a67) = bind_name self, %self.param
  3009. // CHECK:STDOUT: }
  3010. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.F.decl [concrete = constants.%assoc0]
  3011. // CHECK:STDOUT:
  3012. // CHECK:STDOUT: !members:
  3013. // CHECK:STDOUT: .Self = %Self
  3014. // CHECK:STDOUT: .F = %assoc0
  3015. // CHECK:STDOUT: witness = (%I.F.decl)
  3016. // CHECK:STDOUT: }
  3017. // CHECK:STDOUT:
  3018. // CHECK:STDOUT: generic impl @C.as.Destroy.impl(@C.%T.loc13_9.2: type) {
  3019. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  3020. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)]
  3021. // 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)]
  3022. // CHECK:STDOUT:
  3023. // CHECK:STDOUT: !definition:
  3024. // 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)]
  3025. // 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)]
  3026. // CHECK:STDOUT:
  3027. // CHECK:STDOUT: impl: @C.%Self.ref as constants.%Destroy.type {
  3028. // 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)] {
  3029. // CHECK:STDOUT: %self.patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.1d2) = binding_pattern self [concrete]
  3030. // CHECK:STDOUT: %self.param_patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.1d2) = value_param_pattern %self.patt, call_param0 [concrete]
  3031. // CHECK:STDOUT: %.loc13_19.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  3032. // CHECK:STDOUT: } {
  3033. // CHECK:STDOUT: %self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2) = value_param call_param0
  3034. // CHECK:STDOUT: %.loc13_19.2: type = splice_block %Self.ref [symbolic = %C (constants.%C.f2e)] {
  3035. // CHECK:STDOUT: %.loc13_19.3: type = specific_constant constants.%C.f2e, @C(constants.%T) [symbolic = %C (constants.%C.f2e)]
  3036. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc13_19.3 [symbolic = %C (constants.%C.f2e)]
  3037. // CHECK:STDOUT: }
  3038. // CHECK:STDOUT: %self: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2) = bind_name self, %self.param
  3039. // CHECK:STDOUT: }
  3040. // CHECK:STDOUT:
  3041. // CHECK:STDOUT: !members:
  3042. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  3043. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  3044. // CHECK:STDOUT: }
  3045. // CHECK:STDOUT: }
  3046. // CHECK:STDOUT:
  3047. // CHECK:STDOUT: impl @C.as.I.impl: %C as %I.ref {
  3048. // CHECK:STDOUT: %C.as.I.impl.F.decl: %C.as.I.impl.F.type = fn_decl @C.as.I.impl.F [concrete = constants.%C.as.I.impl.F] {
  3049. // CHECK:STDOUT: %self.patt: %pattern_type.fc9 = binding_pattern self [concrete]
  3050. // CHECK:STDOUT: %self.param_patt: %pattern_type.fc9 = value_param_pattern %self.patt, call_param0 [concrete]
  3051. // CHECK:STDOUT: } {
  3052. // CHECK:STDOUT: %self.param: %C.763 = value_param call_param0
  3053. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.I.impl.%C [concrete = constants.%C.763]
  3054. // CHECK:STDOUT: %self: %C.763 = bind_name self, %self.param
  3055. // CHECK:STDOUT: }
  3056. // CHECK:STDOUT:
  3057. // CHECK:STDOUT: !members:
  3058. // CHECK:STDOUT: .F = %C.as.I.impl.F.decl
  3059. // CHECK:STDOUT: witness = file.%I.impl_witness
  3060. // CHECK:STDOUT: }
  3061. // CHECK:STDOUT:
  3062. // CHECK:STDOUT: generic class @C(%T.loc13_9.2: type) {
  3063. // CHECK:STDOUT: %T.loc13_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc13_9.1 (constants.%T)]
  3064. // CHECK:STDOUT:
  3065. // CHECK:STDOUT: !definition:
  3066. // CHECK:STDOUT:
  3067. // CHECK:STDOUT: class {
  3068. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C.f2e [symbolic = @C.as.Destroy.impl.%C (constants.%C.f2e)]
  3069. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  3070. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  3071. // 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)]
  3072. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  3073. // CHECK:STDOUT: complete_type_witness = %complete_type
  3074. // CHECK:STDOUT:
  3075. // CHECK:STDOUT: !members:
  3076. // CHECK:STDOUT: .Self = constants.%C.f2e
  3077. // CHECK:STDOUT: }
  3078. // CHECK:STDOUT: }
  3079. // CHECK:STDOUT:
  3080. // CHECK:STDOUT: generic fn @C.as.Destroy.impl.Op(@C.%T.loc13_9.2: type) {
  3081. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  3082. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)]
  3083. // CHECK:STDOUT: %ptr: type = ptr_type %C [symbolic = %ptr (constants.%ptr.7d2)]
  3084. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.1d2)]
  3085. // CHECK:STDOUT:
  3086. // CHECK:STDOUT: !definition:
  3087. // CHECK:STDOUT:
  3088. // CHECK:STDOUT: fn(%self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2)) = "no_op";
  3089. // CHECK:STDOUT: }
  3090. // CHECK:STDOUT:
  3091. // CHECK:STDOUT: generic fn @I.F(@I.%Self: %I.type) {
  3092. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  3093. // CHECK:STDOUT: %Self.as_type.loc14_26.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type.a67)]
  3094. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc14_26.1 [symbolic = %pattern_type (constants.%pattern_type.d22)]
  3095. // CHECK:STDOUT:
  3096. // CHECK:STDOUT: fn(%self.param: @I.F.%Self.as_type.loc14_26.1 (%Self.as_type.a67));
  3097. // CHECK:STDOUT: }
  3098. // CHECK:STDOUT:
  3099. // CHECK:STDOUT: fn @C.as.I.impl.F(%self.param: %C.763) {
  3100. // CHECK:STDOUT: !entry:
  3101. // CHECK:STDOUT: return
  3102. // CHECK:STDOUT: }
  3103. // CHECK:STDOUT:
  3104. // CHECK:STDOUT: specific @C(constants.%T) {
  3105. // CHECK:STDOUT: %T.loc13_9.1 => constants.%T
  3106. // CHECK:STDOUT: }
  3107. // CHECK:STDOUT:
  3108. // CHECK:STDOUT: specific @C.as.Destroy.impl(constants.%T) {
  3109. // CHECK:STDOUT: %T => constants.%T
  3110. // CHECK:STDOUT: %C => constants.%C.f2e
  3111. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness
  3112. // CHECK:STDOUT: }
  3113. // CHECK:STDOUT:
  3114. // CHECK:STDOUT: specific @C.as.Destroy.impl.Op(constants.%T) {
  3115. // CHECK:STDOUT: %T => constants.%T
  3116. // CHECK:STDOUT: %C => constants.%C.f2e
  3117. // CHECK:STDOUT: %ptr => constants.%ptr.7d2
  3118. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1d2
  3119. // CHECK:STDOUT: }
  3120. // CHECK:STDOUT:
  3121. // CHECK:STDOUT: specific @I.F(constants.%Self.7ee) {
  3122. // CHECK:STDOUT: %Self => constants.%Self.7ee
  3123. // CHECK:STDOUT: %Self.as_type.loc14_26.1 => constants.%Self.as_type.a67
  3124. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.d22
  3125. // CHECK:STDOUT: }
  3126. // CHECK:STDOUT:
  3127. // CHECK:STDOUT: specific @C(constants.%tuple.type.f7c) {
  3128. // CHECK:STDOUT: %T.loc13_9.1 => constants.%tuple.type.f7c
  3129. // CHECK:STDOUT:
  3130. // CHECK:STDOUT: !definition:
  3131. // CHECK:STDOUT: }
  3132. // CHECK:STDOUT:
  3133. // CHECK:STDOUT: specific @I.F(constants.%I.facet) {
  3134. // CHECK:STDOUT: %Self => constants.%I.facet
  3135. // CHECK:STDOUT: %Self.as_type.loc14_26.1 => constants.%C.763
  3136. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fc9
  3137. // CHECK:STDOUT: }
  3138. // CHECK:STDOUT:
  3139. // CHECK:STDOUT: --- fail_use_has_extra_interfaces.carbon
  3140. // CHECK:STDOUT:
  3141. // CHECK:STDOUT: constants {
  3142. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  3143. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  3144. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3145. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  3146. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  3147. // CHECK:STDOUT: %C.42e: type = class_type @C, @C(type) [concrete]
  3148. // CHECK:STDOUT: %pattern_type.6e4: type = pattern_type %C.42e [concrete]
  3149. // CHECK:STDOUT: %Test.type: type = fn_type @Test [concrete]
  3150. // CHECK:STDOUT: %Test: %Test.type = struct_value () [concrete]
  3151. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  3152. // CHECK:STDOUT: %Self.caa: %I.type = bind_symbolic_name Self, 0 [symbolic]
  3153. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  3154. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%HasExtraInterfaces.import_ref.d54 [concrete]
  3155. // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
  3156. // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
  3157. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.caa [symbolic]
  3158. // CHECK:STDOUT: %pattern_type.95f: type = pattern_type %Self.as_type [symbolic]
  3159. // CHECK:STDOUT: %Extra8.type: type = facet_type <@Extra8> [concrete]
  3160. // CHECK:STDOUT: %Extra7.type: type = facet_type <@Extra7> [concrete]
  3161. // CHECK:STDOUT: %Extra6.type: type = facet_type <@Extra6> [concrete]
  3162. // CHECK:STDOUT: %Extra5.type: type = facet_type <@Extra5> [concrete]
  3163. // CHECK:STDOUT: %Extra4.type: type = facet_type <@Extra4> [concrete]
  3164. // CHECK:STDOUT: %Extra3.type: type = facet_type <@Extra3> [concrete]
  3165. // CHECK:STDOUT: %Extra2.type: type = facet_type <@Extra2> [concrete]
  3166. // CHECK:STDOUT: %Extra1.type: type = facet_type <@Extra1> [concrete]
  3167. // CHECK:STDOUT: %tuple.type: type = tuple_type (%Extra1.type, %Extra2.type, %Extra3.type, %Extra4.type, %Extra5.type, %Extra6.type, %Extra7.type, %Extra8.type) [concrete]
  3168. // CHECK:STDOUT: %C.c07: type = class_type @C, @C(%tuple.type) [concrete]
  3169. // CHECK:STDOUT: }
  3170. // CHECK:STDOUT:
  3171. // CHECK:STDOUT: imports {
  3172. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3173. // CHECK:STDOUT: import Core//prelude
  3174. // CHECK:STDOUT: import Core//prelude/...
  3175. // CHECK:STDOUT: }
  3176. // CHECK:STDOUT: %HasExtraInterfaces: <namespace> = namespace file.%HasExtraInterfaces.import, [concrete] {
  3177. // CHECK:STDOUT: .C = %HasExtraInterfaces.C
  3178. // CHECK:STDOUT: .I = %HasExtraInterfaces.I
  3179. // CHECK:STDOUT: import HasExtraInterfaces//default
  3180. // CHECK:STDOUT: }
  3181. // CHECK:STDOUT: %HasExtraInterfaces.C: %C.type = import_ref HasExtraInterfaces//default, C, loaded [concrete = constants.%C.generic]
  3182. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.5ab: type = import_ref HasExtraInterfaces//default, loc13_9, loaded [symbolic = @C.%T (constants.%T)]
  3183. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.8f2: <witness> = import_ref HasExtraInterfaces//default, loc13_20, loaded [concrete = constants.%complete_type]
  3184. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.4c0 = import_ref HasExtraInterfaces//default, inst69 [no loc], unloaded
  3185. // CHECK:STDOUT: %HasExtraInterfaces.I: type = import_ref HasExtraInterfaces//default, I, loaded [concrete = constants.%I.type]
  3186. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.8e7 = import_ref HasExtraInterfaces//default, inst125 [no loc], unloaded
  3187. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.be9: %I.assoc_type = import_ref HasExtraInterfaces//default, loc14_33, loaded [concrete = constants.%assoc0]
  3188. // CHECK:STDOUT: %HasExtraInterfaces.F = import_ref HasExtraInterfaces//default, F, unloaded
  3189. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.d54: %I.F.type = import_ref HasExtraInterfaces//default, loc14_33, loaded [concrete = constants.%I.F]
  3190. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.59a: %I.type = import_ref HasExtraInterfaces//default, inst125 [no loc], loaded [symbolic = constants.%Self.caa]
  3191. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.80c = import_ref HasExtraInterfaces//default, loc16_79, unloaded
  3192. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.23a = import_ref HasExtraInterfaces//default, inst54 [no loc], unloaded
  3193. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.a8e = import_ref HasExtraInterfaces//default, inst49 [no loc], unloaded
  3194. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.8be = import_ref HasExtraInterfaces//default, inst44 [no loc], unloaded
  3195. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.04c = import_ref HasExtraInterfaces//default, inst39 [no loc], unloaded
  3196. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.29b = import_ref HasExtraInterfaces//default, inst34 [no loc], unloaded
  3197. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.330 = import_ref HasExtraInterfaces//default, inst29 [no loc], unloaded
  3198. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.636 = import_ref HasExtraInterfaces//default, inst24 [no loc], unloaded
  3199. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.d01 = import_ref HasExtraInterfaces//default, inst19 [no loc], unloaded
  3200. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.ef7: type = import_ref HasExtraInterfaces//default, loc16_72, loaded [concrete = constants.%C.c07]
  3201. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.301: type = import_ref HasExtraInterfaces//default, loc16_77, loaded [concrete = constants.%I.type]
  3202. // CHECK:STDOUT: }
  3203. // CHECK:STDOUT:
  3204. // CHECK:STDOUT: file {
  3205. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3206. // CHECK:STDOUT: .Core = imports.%Core
  3207. // CHECK:STDOUT: .HasExtraInterfaces = imports.%HasExtraInterfaces
  3208. // CHECK:STDOUT: .Test = %Test.decl
  3209. // CHECK:STDOUT: }
  3210. // CHECK:STDOUT: %Core.import = import Core
  3211. // CHECK:STDOUT: %HasExtraInterfaces.import = import HasExtraInterfaces
  3212. // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [concrete = constants.%Test] {
  3213. // CHECK:STDOUT: %c.patt: %pattern_type.6e4 = binding_pattern c [concrete]
  3214. // CHECK:STDOUT: %c.param_patt: %pattern_type.6e4 = value_param_pattern %c.patt, call_param0 [concrete]
  3215. // CHECK:STDOUT: } {
  3216. // CHECK:STDOUT: %c.param: %C.42e = value_param call_param0
  3217. // CHECK:STDOUT: %.loc5: type = splice_block %C [concrete = constants.%C.42e] {
  3218. // CHECK:STDOUT: %HasExtraInterfaces.ref.loc5: <namespace> = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [concrete = imports.%HasExtraInterfaces]
  3219. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%HasExtraInterfaces.C [concrete = constants.%C.generic]
  3220. // CHECK:STDOUT: %C: type = class_type @C, @C(type) [concrete = constants.%C.42e]
  3221. // CHECK:STDOUT: }
  3222. // CHECK:STDOUT: %c: %C.42e = bind_name c, %c.param
  3223. // CHECK:STDOUT: }
  3224. // CHECK:STDOUT: }
  3225. // CHECK:STDOUT:
  3226. // CHECK:STDOUT: interface @I [from "has_extra_interfaces.carbon"] {
  3227. // CHECK:STDOUT: !members:
  3228. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.8e7
  3229. // CHECK:STDOUT: .F = imports.%HasExtraInterfaces.import_ref.be9
  3230. // CHECK:STDOUT: witness = (imports.%HasExtraInterfaces.F)
  3231. // CHECK:STDOUT: }
  3232. // CHECK:STDOUT:
  3233. // CHECK:STDOUT: interface @Extra8 [from "has_extra_interfaces.carbon"] {
  3234. // CHECK:STDOUT: !members:
  3235. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.23a
  3236. // CHECK:STDOUT: witness = ()
  3237. // CHECK:STDOUT: }
  3238. // CHECK:STDOUT:
  3239. // CHECK:STDOUT: interface @Extra7 [from "has_extra_interfaces.carbon"] {
  3240. // CHECK:STDOUT: !members:
  3241. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.a8e
  3242. // CHECK:STDOUT: witness = ()
  3243. // CHECK:STDOUT: }
  3244. // CHECK:STDOUT:
  3245. // CHECK:STDOUT: interface @Extra6 [from "has_extra_interfaces.carbon"] {
  3246. // CHECK:STDOUT: !members:
  3247. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.8be
  3248. // CHECK:STDOUT: witness = ()
  3249. // CHECK:STDOUT: }
  3250. // CHECK:STDOUT:
  3251. // CHECK:STDOUT: interface @Extra5 [from "has_extra_interfaces.carbon"] {
  3252. // CHECK:STDOUT: !members:
  3253. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.04c
  3254. // CHECK:STDOUT: witness = ()
  3255. // CHECK:STDOUT: }
  3256. // CHECK:STDOUT:
  3257. // CHECK:STDOUT: interface @Extra4 [from "has_extra_interfaces.carbon"] {
  3258. // CHECK:STDOUT: !members:
  3259. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.29b
  3260. // CHECK:STDOUT: witness = ()
  3261. // CHECK:STDOUT: }
  3262. // CHECK:STDOUT:
  3263. // CHECK:STDOUT: interface @Extra3 [from "has_extra_interfaces.carbon"] {
  3264. // CHECK:STDOUT: !members:
  3265. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.330
  3266. // CHECK:STDOUT: witness = ()
  3267. // CHECK:STDOUT: }
  3268. // CHECK:STDOUT:
  3269. // CHECK:STDOUT: interface @Extra2 [from "has_extra_interfaces.carbon"] {
  3270. // CHECK:STDOUT: !members:
  3271. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.636
  3272. // CHECK:STDOUT: witness = ()
  3273. // CHECK:STDOUT: }
  3274. // CHECK:STDOUT:
  3275. // CHECK:STDOUT: interface @Extra1 [from "has_extra_interfaces.carbon"] {
  3276. // CHECK:STDOUT: !members:
  3277. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.d01
  3278. // CHECK:STDOUT: witness = ()
  3279. // CHECK:STDOUT: }
  3280. // CHECK:STDOUT:
  3281. // CHECK:STDOUT: impl @C.as.I.impl: imports.%HasExtraInterfaces.import_ref.ef7 as imports.%HasExtraInterfaces.import_ref.301 [from "has_extra_interfaces.carbon"] {
  3282. // CHECK:STDOUT: !members:
  3283. // CHECK:STDOUT: witness = imports.%HasExtraInterfaces.import_ref.80c
  3284. // CHECK:STDOUT: }
  3285. // CHECK:STDOUT:
  3286. // CHECK:STDOUT: generic class @C(imports.%HasExtraInterfaces.import_ref.5ab: type) [from "has_extra_interfaces.carbon"] {
  3287. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  3288. // CHECK:STDOUT:
  3289. // CHECK:STDOUT: !definition:
  3290. // CHECK:STDOUT:
  3291. // CHECK:STDOUT: class {
  3292. // CHECK:STDOUT: complete_type_witness = imports.%HasExtraInterfaces.import_ref.8f2
  3293. // CHECK:STDOUT:
  3294. // CHECK:STDOUT: !members:
  3295. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.4c0
  3296. // CHECK:STDOUT: }
  3297. // CHECK:STDOUT: }
  3298. // CHECK:STDOUT:
  3299. // CHECK:STDOUT: fn @Test(%c.param: %C.42e) {
  3300. // CHECK:STDOUT: !entry:
  3301. // CHECK:STDOUT: %c.ref: %C.42e = name_ref c, %c
  3302. // CHECK:STDOUT: %HasExtraInterfaces.ref.loc12: <namespace> = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [concrete = imports.%HasExtraInterfaces]
  3303. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%HasExtraInterfaces.I [concrete = constants.%I.type]
  3304. // CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, imports.%HasExtraInterfaces.import_ref.be9 [concrete = constants.%assoc0]
  3305. // CHECK:STDOUT: return
  3306. // CHECK:STDOUT: }
  3307. // CHECK:STDOUT:
  3308. // CHECK:STDOUT: generic fn @I.F(imports.%HasExtraInterfaces.import_ref.59a: %I.type) [from "has_extra_interfaces.carbon"] {
  3309. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.caa)]
  3310. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  3311. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.95f)]
  3312. // CHECK:STDOUT:
  3313. // CHECK:STDOUT: fn;
  3314. // CHECK:STDOUT: }
  3315. // CHECK:STDOUT:
  3316. // CHECK:STDOUT: specific @C(constants.%T) {
  3317. // CHECK:STDOUT: %T => constants.%T
  3318. // CHECK:STDOUT: }
  3319. // CHECK:STDOUT:
  3320. // CHECK:STDOUT: specific @C(type) {
  3321. // CHECK:STDOUT: %T => type
  3322. // CHECK:STDOUT:
  3323. // CHECK:STDOUT: !definition:
  3324. // CHECK:STDOUT: }
  3325. // CHECK:STDOUT:
  3326. // CHECK:STDOUT: specific @I.F(constants.%Self.caa) {
  3327. // CHECK:STDOUT: %Self => constants.%Self.caa
  3328. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  3329. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.95f
  3330. // CHECK:STDOUT: }
  3331. // CHECK:STDOUT:
  3332. // CHECK:STDOUT: specific @C(constants.%tuple.type) {
  3333. // CHECK:STDOUT: %T => constants.%tuple.type
  3334. // CHECK:STDOUT:
  3335. // CHECK:STDOUT: !definition:
  3336. // CHECK:STDOUT: }
  3337. // CHECK:STDOUT: