import.carbon 226 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497
  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.f0c: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  160. // CHECK:STDOUT: %Self.as_type.308: type = facet_access_type %Self.f0c [symbolic]
  161. // CHECK:STDOUT: %pattern_type.28f: type = pattern_type %Self.as_type.308 [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.f0c]
  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.28f) = binding_pattern self [concrete]
  213. // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.28f) = 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.308) = 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.308)] {
  217. // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.f0c)]
  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.308)]
  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.308)]
  220. // CHECK:STDOUT: }
  221. // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.308) = 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: constants.%C 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: impl_decl @C.as.Destroy.impl [concrete] {} {}
  264. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  265. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness]
  266. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  267. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %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.f0c)]
  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.308)]
  277. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.28f)]
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.308));
  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.f0c) {
  290. // CHECK:STDOUT: %Self => constants.%Self.f0c
  291. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.308
  292. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.28f
  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.d42: %HasG.type = bind_symbolic_name Self, 0 [symbolic]
  306. // CHECK:STDOUT: %Self.as_type.133: type = facet_access_type %Self.d42 [symbolic]
  307. // CHECK:STDOUT: %pattern_type.293: type = pattern_type %Self.as_type.133 [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.69b: <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.704: %HasG.type = facet_value %C, (%HasG.impl_witness.69b) [concrete]
  328. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  329. // CHECK:STDOUT: %Self.cf3: %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.7cf: type = facet_access_type %Self.cf3 [symbolic]
  333. // CHECK:STDOUT: %pattern_type.dc3: type = pattern_type %Self.as_type.7cf [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.b2b: <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.9c8: %HasG.type = facet_value %D, (%HasG.impl_witness.b2b) [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.28c = 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.e73: %HasF.type = import_ref PackageA//default, inst19 [no loc], loaded [symbolic = constants.%Self.cf3]
  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.69b]
  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.b2b]
  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.d42]
  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.293) = binding_pattern self [concrete]
  404. // CHECK:STDOUT: %self.param_patt: @HasG.G.%pattern_type (%pattern_type.293) = 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.133) = 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.133)] {
  408. // CHECK:STDOUT: %Self.ref: %HasG.type = name_ref Self, @HasG.%Self [symbolic = %Self (constants.%Self.d42)]
  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.133)]
  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.133)]
  411. // CHECK:STDOUT: }
  412. // CHECK:STDOUT: %self: @HasG.G.%Self.as_type.loc7_14.1 (%Self.as_type.133) = 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.28c
  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: constants.%D 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: impl_decl @D.as.Destroy.impl [concrete] {} {}
  492. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@D.as.Destroy.impl.%D.as.Destroy.impl.Op.decl), @D.as.Destroy.impl [concrete]
  493. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness]
  494. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  495. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %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.d42)]
  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.133)]
  512. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc7_14.1 [symbolic = %pattern_type (constants.%pattern_type.293)]
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: fn(%self.param: @HasG.G.%Self.as_type.loc7_14.1 (%Self.as_type.133));
  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.e73: %HasF.type) [from "package_a.carbon"] {
  525. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.cf3)]
  526. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.7cf)]
  527. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.dc3)]
  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.d42) {
  543. // CHECK:STDOUT: %Self => constants.%Self.d42
  544. // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%Self.as_type.133
  545. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.293
  546. // CHECK:STDOUT: }
  547. // CHECK:STDOUT:
  548. // CHECK:STDOUT: specific @HasG.G(constants.%HasG.facet.704) {
  549. // CHECK:STDOUT: %Self => constants.%HasG.facet.704
  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.cf3) {
  555. // CHECK:STDOUT: %Self => constants.%Self.cf3
  556. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.7cf
  557. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc3
  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.9c8) {
  567. // CHECK:STDOUT: %Self => constants.%HasG.facet.9c8
  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.cf3: %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.cf3 [symbolic]
  589. // CHECK:STDOUT: %pattern_type.dc3: type = pattern_type %Self.as_type [symbolic]
  590. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  591. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness imports.%HasF.impl_witness_table [concrete]
  592. // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, (%HasF.impl_witness) [concrete]
  593. // CHECK:STDOUT: %.d3f: type = fn_type_with_self_type %HasF.F.type, %HasF.facet [concrete]
  594. // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F [concrete]
  595. // CHECK:STDOUT: %C.as.HasF.impl.F: %C.as.HasF.impl.F.type = struct_value () [concrete]
  596. // CHECK:STDOUT: }
  597. // CHECK:STDOUT:
  598. // CHECK:STDOUT: imports {
  599. // CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
  600. // CHECK:STDOUT: import Core//prelude
  601. // CHECK:STDOUT: import Core//prelude/...
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [concrete] {
  604. // CHECK:STDOUT: .C = %PackageA.C
  605. // CHECK:STDOUT: .HasF = %PackageA.HasF
  606. // CHECK:STDOUT: import PackageA//default
  607. // CHECK:STDOUT: }
  608. // CHECK:STDOUT: %PackageA.C: type = import_ref PackageA//default, C, loaded [concrete = constants.%C]
  609. // CHECK:STDOUT: %PackageA.import_ref.8f2: <witness> = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type]
  610. // CHECK:STDOUT: %PackageA.import_ref.2c4 = import_ref PackageA//default, inst43 [no loc], unloaded
  611. // CHECK:STDOUT: %PackageA.HasF: type = import_ref PackageA//default, HasF, loaded [concrete = constants.%HasF.type]
  612. // CHECK:STDOUT: %PackageA.import_ref.28c = import_ref PackageA//default, inst19 [no loc], unloaded
  613. // CHECK:STDOUT: %PackageA.import_ref.b36: %HasF.assoc_type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%assoc0]
  614. // CHECK:STDOUT: %PackageA.F = import_ref PackageA//default, F, unloaded
  615. // CHECK:STDOUT: %PackageA.import_ref.ab2: %HasF.F.type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%HasF.F]
  616. // CHECK:STDOUT: %PackageA.import_ref.e73: %HasF.type = import_ref PackageA//default, inst19 [no loc], loaded [symbolic = constants.%Self.cf3]
  617. // CHECK:STDOUT: %PackageA.import_ref.34c = import_ref PackageA//default, loc8_9, unloaded
  618. // CHECK:STDOUT: %PackageA.import_ref.c0c: type = import_ref PackageA//default, inst43 [no loc], loaded [concrete = constants.%C]
  619. // CHECK:STDOUT: %PackageA.import_ref.cb9: type = import_ref PackageA//default, inst46 [no loc], loaded [concrete = constants.%Destroy.type]
  620. // CHECK:STDOUT: %PackageA.import_ref.c12: <witness> = import_ref PackageA//default, loc11_16, loaded [concrete = constants.%HasF.impl_witness]
  621. // CHECK:STDOUT: %PackageA.import_ref.29a: type = import_ref PackageA//default, loc11_6, loaded [concrete = constants.%C]
  622. // CHECK:STDOUT: %PackageA.import_ref.e8c: type = import_ref PackageA//default, loc11_11, loaded [concrete = constants.%HasF.type]
  623. // CHECK:STDOUT: %PackageA.import_ref.148: %C.as.HasF.impl.F.type = import_ref PackageA//default, loc12_22, loaded [concrete = constants.%C.as.HasF.impl.F]
  624. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageA.import_ref.148), @C.as.HasF.impl [concrete]
  625. // CHECK:STDOUT: }
  626. // CHECK:STDOUT:
  627. // CHECK:STDOUT: file {
  628. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  629. // CHECK:STDOUT: .Core = imports.%Core.ece
  630. // CHECK:STDOUT: .PackageA = imports.%PackageA
  631. // CHECK:STDOUT: .TestCF = %TestCF.decl
  632. // CHECK:STDOUT: }
  633. // CHECK:STDOUT: %Core.import = import Core
  634. // CHECK:STDOUT: %PackageA.import = import PackageA
  635. // CHECK:STDOUT: %TestCF.decl: %TestCF.type = fn_decl @TestCF [concrete = constants.%TestCF] {
  636. // CHECK:STDOUT: %c.patt: %pattern_type.8e5 = binding_pattern c [concrete]
  637. // CHECK:STDOUT: %c.param_patt: %pattern_type.8e5 = value_param_pattern %c.patt, call_param0 [concrete]
  638. // CHECK:STDOUT: } {
  639. // CHECK:STDOUT: %c.param: %C = value_param call_param0
  640. // CHECK:STDOUT: %.loc6: type = splice_block %C.ref [concrete = constants.%C] {
  641. // CHECK:STDOUT: %PackageA.ref.loc6: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  642. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%PackageA.C [concrete = constants.%C]
  643. // CHECK:STDOUT: }
  644. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  645. // CHECK:STDOUT: }
  646. // CHECK:STDOUT: }
  647. // CHECK:STDOUT:
  648. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  649. // CHECK:STDOUT: !members:
  650. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.28c
  651. // CHECK:STDOUT: .F = imports.%PackageA.import_ref.b36
  652. // CHECK:STDOUT: witness = (imports.%PackageA.F)
  653. // CHECK:STDOUT: }
  654. // CHECK:STDOUT:
  655. // CHECK:STDOUT: impl @C.as.Destroy.impl: imports.%PackageA.import_ref.c0c as imports.%PackageA.import_ref.cb9 [from "package_a.carbon"] {
  656. // CHECK:STDOUT: !members:
  657. // CHECK:STDOUT: witness = imports.%PackageA.import_ref.34c
  658. // CHECK:STDOUT: }
  659. // CHECK:STDOUT:
  660. // CHECK:STDOUT: impl @C.as.HasF.impl: imports.%PackageA.import_ref.29a as imports.%PackageA.import_ref.e8c [from "package_a.carbon"] {
  661. // CHECK:STDOUT: !members:
  662. // CHECK:STDOUT: witness = imports.%PackageA.import_ref.c12
  663. // CHECK:STDOUT: }
  664. // CHECK:STDOUT:
  665. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  666. // CHECK:STDOUT: complete_type_witness = imports.%PackageA.import_ref.8f2
  667. // CHECK:STDOUT:
  668. // CHECK:STDOUT: !members:
  669. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.2c4
  670. // CHECK:STDOUT: }
  671. // CHECK:STDOUT:
  672. // CHECK:STDOUT: fn @TestCF(%c.param: %C) {
  673. // CHECK:STDOUT: !entry:
  674. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  675. // CHECK:STDOUT: %PackageA.ref.loc7: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  676. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%PackageA.HasF [concrete = constants.%HasF.type]
  677. // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, imports.%PackageA.import_ref.b36 [concrete = constants.%assoc0]
  678. // CHECK:STDOUT: %impl.elem0: %.d3f = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F]
  679. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.ref, %impl.elem0
  680. // CHECK:STDOUT: %C.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method(%c.ref)
  681. // CHECK:STDOUT: return
  682. // CHECK:STDOUT: }
  683. // CHECK:STDOUT:
  684. // CHECK:STDOUT: generic fn @HasF.F(imports.%PackageA.import_ref.e73: %HasF.type) [from "package_a.carbon"] {
  685. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.cf3)]
  686. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  687. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.dc3)]
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: fn;
  690. // CHECK:STDOUT: }
  691. // CHECK:STDOUT:
  692. // CHECK:STDOUT: fn @C.as.HasF.impl.F [from "package_a.carbon"];
  693. // CHECK:STDOUT:
  694. // CHECK:STDOUT: specific @HasF.F(constants.%Self.cf3) {
  695. // CHECK:STDOUT: %Self => constants.%Self.cf3
  696. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  697. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc3
  698. // CHECK:STDOUT: }
  699. // CHECK:STDOUT:
  700. // CHECK:STDOUT: --- use_df.carbon
  701. // CHECK:STDOUT:
  702. // CHECK:STDOUT: constants {
  703. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  704. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  705. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  706. // CHECK:STDOUT: %pattern_type.f09: type = pattern_type %D [concrete]
  707. // CHECK:STDOUT: %TestDF.type: type = fn_type @TestDF [concrete]
  708. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  709. // CHECK:STDOUT: %TestDF: %TestDF.type = struct_value () [concrete]
  710. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  711. // CHECK:STDOUT: %Self.cf3: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  712. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete]
  713. // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, imports.%PackageA.import_ref.ab2 [concrete]
  714. // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete]
  715. // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete]
  716. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.cf3 [symbolic]
  717. // CHECK:STDOUT: %pattern_type.dc3: type = pattern_type %Self.as_type [symbolic]
  718. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  719. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  720. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [concrete]
  721. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness imports.%HasF.impl_witness_table [concrete]
  722. // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %D, (%HasF.impl_witness) [concrete]
  723. // CHECK:STDOUT: %.bc0: type = fn_type_with_self_type %HasF.F.type, %HasF.facet [concrete]
  724. // CHECK:STDOUT: %D.as.HasF.impl.F.type: type = fn_type @D.as.HasF.impl.F [concrete]
  725. // CHECK:STDOUT: %D.as.HasF.impl.F: %D.as.HasF.impl.F.type = struct_value () [concrete]
  726. // CHECK:STDOUT: }
  727. // CHECK:STDOUT:
  728. // CHECK:STDOUT: imports {
  729. // CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
  730. // CHECK:STDOUT: import Core//prelude
  731. // CHECK:STDOUT: import Core//prelude/...
  732. // CHECK:STDOUT: }
  733. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [concrete] {
  734. // CHECK:STDOUT: .HasF = %PackageA.HasF
  735. // CHECK:STDOUT: import PackageA//default
  736. // CHECK:STDOUT: }
  737. // CHECK:STDOUT: %PackageB: <namespace> = namespace file.%PackageB.import, [concrete] {
  738. // CHECK:STDOUT: .D = %PackageB.D
  739. // CHECK:STDOUT: import PackageB//default
  740. // CHECK:STDOUT: }
  741. // CHECK:STDOUT: %PackageB.D: type = import_ref PackageB//default, D, loaded [concrete = constants.%D]
  742. // CHECK:STDOUT: %PackageB.import_ref.8f2: <witness> = import_ref PackageB//default, loc10_10, loaded [concrete = constants.%complete_type]
  743. // CHECK:STDOUT: %PackageB.import_ref.cab = import_ref PackageB//default, inst45 [no loc], unloaded
  744. // CHECK:STDOUT: %PackageA.HasF: type = import_ref PackageA//default, HasF, loaded [concrete = constants.%HasF.type]
  745. // CHECK:STDOUT: %PackageA.import_ref.28c = import_ref PackageA//default, inst19 [no loc], unloaded
  746. // CHECK:STDOUT: %PackageA.import_ref.b36: %HasF.assoc_type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%assoc0]
  747. // CHECK:STDOUT: %PackageA.F = import_ref PackageA//default, F, unloaded
  748. // CHECK:STDOUT: %PackageA.import_ref.ab2: %HasF.F.type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%HasF.F]
  749. // CHECK:STDOUT: %PackageA.import_ref.e73: %HasF.type = import_ref PackageA//default, inst19 [no loc], loaded [symbolic = constants.%Self.cf3]
  750. // CHECK:STDOUT: %PackageA.import_ref.34c = import_ref PackageA//default, loc8_9, unloaded
  751. // CHECK:STDOUT: %PackageA.import_ref.8f2: <witness> = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type]
  752. // CHECK:STDOUT: %PackageA.import_ref.2c4 = import_ref PackageA//default, inst43 [no loc], unloaded
  753. // CHECK:STDOUT: %PackageA.import_ref.c0c: type = import_ref PackageA//default, inst43 [no loc], loaded [concrete = constants.%C]
  754. // CHECK:STDOUT: %PackageA.import_ref.cb9: type = import_ref PackageA//default, inst46 [no loc], loaded [concrete = constants.%Destroy.type]
  755. // CHECK:STDOUT: %PackageA.import_ref.5cd = import_ref PackageA//default, loc11_16, unloaded
  756. // CHECK:STDOUT: %PackageA.import_ref.29a: type = import_ref PackageA//default, loc11_6, loaded [concrete = constants.%C]
  757. // CHECK:STDOUT: %PackageA.import_ref.e8c: type = import_ref PackageA//default, loc11_11, loaded [concrete = constants.%HasF.type]
  758. // CHECK:STDOUT: %PackageB.import_ref.0c3 = import_ref PackageB//default, loc10_9, unloaded
  759. // CHECK:STDOUT: %PackageB.import_ref.4aa: type = import_ref PackageB//default, inst45 [no loc], loaded [concrete = constants.%D]
  760. // CHECK:STDOUT: %PackageB.import_ref.cb9: type = import_ref PackageB//default, inst48 [no loc], loaded [concrete = constants.%Destroy.type]
  761. // CHECK:STDOUT: %PackageB.import_ref.5d8 = import_ref PackageB//default, inst21 [no loc], unloaded
  762. // CHECK:STDOUT: %PackageB.import_ref.910 = import_ref PackageB//default, loc7_21, unloaded
  763. // CHECK:STDOUT: %PackageB.G = import_ref PackageB//default, G, unloaded
  764. // CHECK:STDOUT: %PackageB.import_ref.ea7 = import_ref PackageB//default, loc13_25, unloaded
  765. // CHECK:STDOUT: %PackageB.import_ref.dfb: type = import_ref PackageB//default, loc13_14, loaded [concrete = constants.%C]
  766. // CHECK:STDOUT: %PackageB.import_ref.cee586.1: type = import_ref PackageB//default, loc13_20, loaded [concrete = constants.%HasG.type]
  767. // CHECK:STDOUT: %PackageB.import_ref.ce6: <witness> = import_ref PackageB//default, loc18_25, loaded [concrete = constants.%HasF.impl_witness]
  768. // CHECK:STDOUT: %PackageB.import_ref.aa9f8a.1: type = import_ref PackageB//default, loc18_6, loaded [concrete = constants.%D]
  769. // CHECK:STDOUT: %PackageB.import_ref.831: type = import_ref PackageB//default, loc18_19, loaded [concrete = constants.%HasF.type]
  770. // CHECK:STDOUT: %PackageB.import_ref.569 = import_ref PackageB//default, loc23_16, unloaded
  771. // CHECK:STDOUT: %PackageB.import_ref.aa9f8a.2: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D]
  772. // CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type]
  773. // CHECK:STDOUT: %PackageB.import_ref.0cd: %D.as.HasF.impl.F.type = import_ref PackageB//default, loc19_22, loaded [concrete = constants.%D.as.HasF.impl.F]
  774. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageB.import_ref.0cd), @D.as.HasF.impl [concrete]
  775. // CHECK:STDOUT: }
  776. // CHECK:STDOUT:
  777. // CHECK:STDOUT: file {
  778. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  779. // CHECK:STDOUT: .Core = imports.%Core.ece
  780. // CHECK:STDOUT: .PackageA = imports.%PackageA
  781. // CHECK:STDOUT: .PackageB = imports.%PackageB
  782. // CHECK:STDOUT: .TestDF = %TestDF.decl
  783. // CHECK:STDOUT: }
  784. // CHECK:STDOUT: %Core.import = import Core
  785. // CHECK:STDOUT: %PackageA.import = import PackageA
  786. // CHECK:STDOUT: %PackageB.import = import PackageB
  787. // CHECK:STDOUT: %TestDF.decl: %TestDF.type = fn_decl @TestDF [concrete = constants.%TestDF] {
  788. // CHECK:STDOUT: %d.patt: %pattern_type.f09 = binding_pattern d [concrete]
  789. // CHECK:STDOUT: %d.param_patt: %pattern_type.f09 = value_param_pattern %d.patt, call_param0 [concrete]
  790. // CHECK:STDOUT: } {
  791. // CHECK:STDOUT: %d.param: %D = value_param call_param0
  792. // CHECK:STDOUT: %.loc7: type = splice_block %D.ref [concrete = constants.%D] {
  793. // CHECK:STDOUT: %PackageB.ref: <namespace> = name_ref PackageB, imports.%PackageB [concrete = imports.%PackageB]
  794. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%PackageB.D [concrete = constants.%D]
  795. // CHECK:STDOUT: }
  796. // CHECK:STDOUT: %d: %D = bind_name d, %d.param
  797. // CHECK:STDOUT: }
  798. // CHECK:STDOUT: }
  799. // CHECK:STDOUT:
  800. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  801. // CHECK:STDOUT: !members:
  802. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.28c
  803. // CHECK:STDOUT: .F = imports.%PackageA.import_ref.b36
  804. // CHECK:STDOUT: witness = (imports.%PackageA.F)
  805. // CHECK:STDOUT: }
  806. // CHECK:STDOUT:
  807. // CHECK:STDOUT: interface @HasG [from "package_b.carbon"] {
  808. // CHECK:STDOUT: !members:
  809. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.5d8
  810. // CHECK:STDOUT: .G = imports.%PackageB.import_ref.910
  811. // CHECK:STDOUT: witness = (imports.%PackageB.G)
  812. // CHECK:STDOUT: }
  813. // CHECK:STDOUT:
  814. // CHECK:STDOUT: impl @C.as.Destroy.impl: imports.%PackageA.import_ref.c0c as imports.%PackageA.import_ref.cb9 [from "package_a.carbon"] {
  815. // CHECK:STDOUT: !members:
  816. // CHECK:STDOUT: witness = imports.%PackageA.import_ref.34c
  817. // CHECK:STDOUT: }
  818. // CHECK:STDOUT:
  819. // CHECK:STDOUT: impl @C.as.HasF.impl: imports.%PackageA.import_ref.29a as imports.%PackageA.import_ref.e8c [from "package_a.carbon"] {
  820. // CHECK:STDOUT: !members:
  821. // CHECK:STDOUT: witness = imports.%PackageA.import_ref.5cd
  822. // CHECK:STDOUT: }
  823. // CHECK:STDOUT:
  824. // CHECK:STDOUT: impl @D.as.Destroy.impl: imports.%PackageB.import_ref.4aa as imports.%PackageB.import_ref.cb9 [from "package_b.carbon"] {
  825. // CHECK:STDOUT: !members:
  826. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.0c3
  827. // CHECK:STDOUT: }
  828. // CHECK:STDOUT:
  829. // CHECK:STDOUT: impl @C.as.HasG.impl: imports.%PackageB.import_ref.dfb as imports.%PackageB.import_ref.cee586.1 [from "package_b.carbon"] {
  830. // CHECK:STDOUT: !members:
  831. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.ea7
  832. // CHECK:STDOUT: }
  833. // CHECK:STDOUT:
  834. // CHECK:STDOUT: impl @D.as.HasF.impl: imports.%PackageB.import_ref.aa9f8a.1 as imports.%PackageB.import_ref.831 [from "package_b.carbon"] {
  835. // CHECK:STDOUT: !members:
  836. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.ce6
  837. // CHECK:STDOUT: }
  838. // CHECK:STDOUT:
  839. // CHECK:STDOUT: impl @D.as.HasG.impl: imports.%PackageB.import_ref.aa9f8a.2 as imports.%PackageB.import_ref.cee586.2 [from "package_b.carbon"] {
  840. // CHECK:STDOUT: !members:
  841. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.569
  842. // CHECK:STDOUT: }
  843. // CHECK:STDOUT:
  844. // CHECK:STDOUT: class @D [from "package_b.carbon"] {
  845. // CHECK:STDOUT: complete_type_witness = imports.%PackageB.import_ref.8f2
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: !members:
  848. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.cab
  849. // CHECK:STDOUT: }
  850. // CHECK:STDOUT:
  851. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  852. // CHECK:STDOUT: complete_type_witness = imports.%PackageA.import_ref.8f2
  853. // CHECK:STDOUT:
  854. // CHECK:STDOUT: !members:
  855. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.2c4
  856. // CHECK:STDOUT: }
  857. // CHECK:STDOUT:
  858. // CHECK:STDOUT: fn @TestDF(%d.param: %D) {
  859. // CHECK:STDOUT: !entry:
  860. // CHECK:STDOUT: %d.ref: %D = name_ref d, %d
  861. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  862. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%PackageA.HasF [concrete = constants.%HasF.type]
  863. // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, imports.%PackageA.import_ref.b36 [concrete = constants.%assoc0]
  864. // CHECK:STDOUT: %impl.elem0: %.bc0 = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%D.as.HasF.impl.F]
  865. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %d.ref, %impl.elem0
  866. // CHECK:STDOUT: %D.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method(%d.ref)
  867. // CHECK:STDOUT: return
  868. // CHECK:STDOUT: }
  869. // CHECK:STDOUT:
  870. // CHECK:STDOUT: generic fn @HasF.F(imports.%PackageA.import_ref.e73: %HasF.type) [from "package_a.carbon"] {
  871. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.cf3)]
  872. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  873. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.dc3)]
  874. // CHECK:STDOUT:
  875. // CHECK:STDOUT: fn;
  876. // CHECK:STDOUT: }
  877. // CHECK:STDOUT:
  878. // CHECK:STDOUT: fn @D.as.HasF.impl.F [from "package_b.carbon"];
  879. // CHECK:STDOUT:
  880. // CHECK:STDOUT: specific @HasF.F(constants.%Self.cf3) {
  881. // CHECK:STDOUT: %Self => constants.%Self.cf3
  882. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  883. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc3
  884. // CHECK:STDOUT: }
  885. // CHECK:STDOUT:
  886. // CHECK:STDOUT: --- use_cg.carbon
  887. // CHECK:STDOUT:
  888. // CHECK:STDOUT: constants {
  889. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  890. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  891. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  892. // CHECK:STDOUT: %pattern_type.8e5: type = pattern_type %C [concrete]
  893. // CHECK:STDOUT: %TestCG.type: type = fn_type @TestCG [concrete]
  894. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  895. // CHECK:STDOUT: %TestCG: %TestCG.type = struct_value () [concrete]
  896. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [concrete]
  897. // CHECK:STDOUT: %Self.fcb: %HasG.type = bind_symbolic_name Self, 0 [symbolic]
  898. // CHECK:STDOUT: %HasG.assoc_type: type = assoc_entity_type @HasG [concrete]
  899. // CHECK:STDOUT: %assoc0: %HasG.assoc_type = assoc_entity element0, imports.%PackageB.import_ref.70a [concrete]
  900. // CHECK:STDOUT: %HasG.G.type: type = fn_type @HasG.G [concrete]
  901. // CHECK:STDOUT: %HasG.G: %HasG.G.type = struct_value () [concrete]
  902. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.fcb [symbolic]
  903. // CHECK:STDOUT: %pattern_type.76a: type = pattern_type %Self.as_type [symbolic]
  904. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  905. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  906. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  907. // CHECK:STDOUT: %HasG.impl_witness: <witness> = impl_witness imports.%HasG.impl_witness_table [concrete]
  908. // CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %C, (%HasG.impl_witness) [concrete]
  909. // CHECK:STDOUT: %.a26: type = fn_type_with_self_type %HasG.G.type, %HasG.facet [concrete]
  910. // CHECK:STDOUT: %C.as.HasG.impl.G.type: type = fn_type @C.as.HasG.impl.G [concrete]
  911. // CHECK:STDOUT: %C.as.HasG.impl.G: %C.as.HasG.impl.G.type = struct_value () [concrete]
  912. // CHECK:STDOUT: }
  913. // CHECK:STDOUT:
  914. // CHECK:STDOUT: imports {
  915. // CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
  916. // CHECK:STDOUT: import Core//prelude
  917. // CHECK:STDOUT: import Core//prelude/...
  918. // CHECK:STDOUT: }
  919. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [concrete] {
  920. // CHECK:STDOUT: .C = %PackageA.C
  921. // CHECK:STDOUT: import PackageA//default
  922. // CHECK:STDOUT: }
  923. // CHECK:STDOUT: %PackageB: <namespace> = namespace file.%PackageB.import, [concrete] {
  924. // CHECK:STDOUT: .HasG = %PackageB.HasG
  925. // CHECK:STDOUT: import PackageB//default
  926. // CHECK:STDOUT: }
  927. // CHECK:STDOUT: %PackageA.C: type = import_ref PackageA//default, C, loaded [concrete = constants.%C]
  928. // CHECK:STDOUT: %PackageA.import_ref.8f2: <witness> = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type]
  929. // CHECK:STDOUT: %PackageA.import_ref.2c4 = import_ref PackageA//default, inst43 [no loc], unloaded
  930. // CHECK:STDOUT: %PackageB.HasG: type = import_ref PackageB//default, HasG, loaded [concrete = constants.%HasG.type]
  931. // CHECK:STDOUT: %PackageB.import_ref.5d8 = import_ref PackageB//default, inst21 [no loc], unloaded
  932. // CHECK:STDOUT: %PackageB.import_ref.6c2: %HasG.assoc_type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%assoc0]
  933. // CHECK:STDOUT: %PackageB.G = import_ref PackageB//default, G, unloaded
  934. // CHECK:STDOUT: %PackageB.import_ref.70a: %HasG.G.type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%HasG.G]
  935. // CHECK:STDOUT: %PackageB.import_ref.ef5: %HasG.type = import_ref PackageB//default, inst21 [no loc], loaded [symbolic = constants.%Self.fcb]
  936. // CHECK:STDOUT: %PackageA.import_ref.34c = import_ref PackageA//default, loc8_9, unloaded
  937. // CHECK:STDOUT: %PackageA.import_ref.c0c: type = import_ref PackageA//default, inst43 [no loc], loaded [concrete = constants.%C]
  938. // CHECK:STDOUT: %PackageA.import_ref.cb9: type = import_ref PackageA//default, inst46 [no loc], loaded [concrete = constants.%Destroy.type]
  939. // CHECK:STDOUT: %PackageA.import_ref.28c = import_ref PackageA//default, inst19 [no loc], unloaded
  940. // CHECK:STDOUT: %PackageA.import_ref.c63 = import_ref PackageA//default, loc5_21, unloaded
  941. // CHECK:STDOUT: %PackageA.F = import_ref PackageA//default, F, unloaded
  942. // CHECK:STDOUT: %PackageA.import_ref.5cd = import_ref PackageA//default, loc11_16, unloaded
  943. // CHECK:STDOUT: %PackageA.import_ref.29a: type = import_ref PackageA//default, loc11_6, loaded [concrete = constants.%C]
  944. // CHECK:STDOUT: %PackageA.import_ref.e8c: type = import_ref PackageA//default, loc11_11, loaded [concrete = constants.%HasF.type]
  945. // CHECK:STDOUT: %PackageB.import_ref.0c3 = import_ref PackageB//default, loc10_9, unloaded
  946. // CHECK:STDOUT: %PackageB.import_ref.8f2: <witness> = import_ref PackageB//default, loc10_10, loaded [concrete = constants.%complete_type]
  947. // CHECK:STDOUT: %PackageB.import_ref.cab = import_ref PackageB//default, inst45 [no loc], unloaded
  948. // CHECK:STDOUT: %PackageB.import_ref.4aa: type = import_ref PackageB//default, inst45 [no loc], loaded [concrete = constants.%D]
  949. // CHECK:STDOUT: %PackageB.import_ref.cb9: type = import_ref PackageB//default, inst48 [no loc], loaded [concrete = constants.%Destroy.type]
  950. // CHECK:STDOUT: %PackageB.import_ref.1f6: <witness> = import_ref PackageB//default, loc13_25, loaded [concrete = constants.%HasG.impl_witness]
  951. // CHECK:STDOUT: %PackageB.import_ref.dfb: type = import_ref PackageB//default, loc13_14, loaded [concrete = constants.%C]
  952. // CHECK:STDOUT: %PackageB.import_ref.cee586.1: type = import_ref PackageB//default, loc13_20, loaded [concrete = constants.%HasG.type]
  953. // CHECK:STDOUT: %PackageB.import_ref.5ba = import_ref PackageB//default, loc18_25, unloaded
  954. // CHECK:STDOUT: %PackageB.import_ref.aa9f8a.1: type = import_ref PackageB//default, loc18_6, loaded [concrete = constants.%D]
  955. // CHECK:STDOUT: %PackageB.import_ref.831: type = import_ref PackageB//default, loc18_19, loaded [concrete = constants.%HasF.type]
  956. // CHECK:STDOUT: %PackageB.import_ref.569 = import_ref PackageB//default, loc23_16, unloaded
  957. // CHECK:STDOUT: %PackageB.import_ref.aa9f8a.2: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D]
  958. // CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type]
  959. // CHECK:STDOUT: %PackageB.import_ref.9ec: %C.as.HasG.impl.G.type = import_ref PackageB//default, loc14_22, loaded [concrete = constants.%C.as.HasG.impl.G]
  960. // CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.9ec), @C.as.HasG.impl [concrete]
  961. // CHECK:STDOUT: }
  962. // CHECK:STDOUT:
  963. // CHECK:STDOUT: file {
  964. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  965. // CHECK:STDOUT: .Core = imports.%Core.ece
  966. // CHECK:STDOUT: .PackageA = imports.%PackageA
  967. // CHECK:STDOUT: .PackageB = imports.%PackageB
  968. // CHECK:STDOUT: .TestCG = %TestCG.decl
  969. // CHECK:STDOUT: }
  970. // CHECK:STDOUT: %Core.import = import Core
  971. // CHECK:STDOUT: %PackageA.import = import PackageA
  972. // CHECK:STDOUT: %PackageB.import = import PackageB
  973. // CHECK:STDOUT: %TestCG.decl: %TestCG.type = fn_decl @TestCG [concrete = constants.%TestCG] {
  974. // CHECK:STDOUT: %c.patt: %pattern_type.8e5 = binding_pattern c [concrete]
  975. // CHECK:STDOUT: %c.param_patt: %pattern_type.8e5 = value_param_pattern %c.patt, call_param0 [concrete]
  976. // CHECK:STDOUT: } {
  977. // CHECK:STDOUT: %c.param: %C = value_param call_param0
  978. // CHECK:STDOUT: %.loc7: type = splice_block %C.ref [concrete = constants.%C] {
  979. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [concrete = imports.%PackageA]
  980. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%PackageA.C [concrete = constants.%C]
  981. // CHECK:STDOUT: }
  982. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  983. // CHECK:STDOUT: }
  984. // CHECK:STDOUT: }
  985. // CHECK:STDOUT:
  986. // CHECK:STDOUT: interface @HasG [from "package_b.carbon"] {
  987. // CHECK:STDOUT: !members:
  988. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.5d8
  989. // CHECK:STDOUT: .G = imports.%PackageB.import_ref.6c2
  990. // CHECK:STDOUT: witness = (imports.%PackageB.G)
  991. // CHECK:STDOUT: }
  992. // CHECK:STDOUT:
  993. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  994. // CHECK:STDOUT: !members:
  995. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.28c
  996. // CHECK:STDOUT: .F = imports.%PackageA.import_ref.c63
  997. // CHECK:STDOUT: witness = (imports.%PackageA.F)
  998. // CHECK:STDOUT: }
  999. // CHECK:STDOUT:
  1000. // CHECK:STDOUT: impl @C.as.Destroy.impl: imports.%PackageA.import_ref.c0c as imports.%PackageA.import_ref.cb9 [from "package_a.carbon"] {
  1001. // CHECK:STDOUT: !members:
  1002. // CHECK:STDOUT: witness = imports.%PackageA.import_ref.34c
  1003. // CHECK:STDOUT: }
  1004. // CHECK:STDOUT:
  1005. // CHECK:STDOUT: impl @C.as.HasF.impl: imports.%PackageA.import_ref.29a as imports.%PackageA.import_ref.e8c [from "package_a.carbon"] {
  1006. // CHECK:STDOUT: !members:
  1007. // CHECK:STDOUT: witness = imports.%PackageA.import_ref.5cd
  1008. // CHECK:STDOUT: }
  1009. // CHECK:STDOUT:
  1010. // CHECK:STDOUT: impl @D.as.Destroy.impl: imports.%PackageB.import_ref.4aa as imports.%PackageB.import_ref.cb9 [from "package_b.carbon"] {
  1011. // CHECK:STDOUT: !members:
  1012. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.0c3
  1013. // CHECK:STDOUT: }
  1014. // CHECK:STDOUT:
  1015. // CHECK:STDOUT: impl @C.as.HasG.impl: imports.%PackageB.import_ref.dfb as imports.%PackageB.import_ref.cee586.1 [from "package_b.carbon"] {
  1016. // CHECK:STDOUT: !members:
  1017. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.1f6
  1018. // CHECK:STDOUT: }
  1019. // CHECK:STDOUT:
  1020. // CHECK:STDOUT: impl @D.as.HasF.impl: imports.%PackageB.import_ref.aa9f8a.1 as imports.%PackageB.import_ref.831 [from "package_b.carbon"] {
  1021. // CHECK:STDOUT: !members:
  1022. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.5ba
  1023. // CHECK:STDOUT: }
  1024. // CHECK:STDOUT:
  1025. // CHECK:STDOUT: impl @D.as.HasG.impl: imports.%PackageB.import_ref.aa9f8a.2 as imports.%PackageB.import_ref.cee586.2 [from "package_b.carbon"] {
  1026. // CHECK:STDOUT: !members:
  1027. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.569
  1028. // CHECK:STDOUT: }
  1029. // CHECK:STDOUT:
  1030. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  1031. // CHECK:STDOUT: complete_type_witness = imports.%PackageA.import_ref.8f2
  1032. // CHECK:STDOUT:
  1033. // CHECK:STDOUT: !members:
  1034. // CHECK:STDOUT: .Self = imports.%PackageA.import_ref.2c4
  1035. // CHECK:STDOUT: }
  1036. // CHECK:STDOUT:
  1037. // CHECK:STDOUT: class @D [from "package_b.carbon"] {
  1038. // CHECK:STDOUT: complete_type_witness = imports.%PackageB.import_ref.8f2
  1039. // CHECK:STDOUT:
  1040. // CHECK:STDOUT: !members:
  1041. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.cab
  1042. // CHECK:STDOUT: }
  1043. // CHECK:STDOUT:
  1044. // CHECK:STDOUT: fn @TestCG(%c.param: %C) {
  1045. // CHECK:STDOUT: !entry:
  1046. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  1047. // CHECK:STDOUT: %PackageB.ref: <namespace> = name_ref PackageB, imports.%PackageB [concrete = imports.%PackageB]
  1048. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%PackageB.HasG [concrete = constants.%HasG.type]
  1049. // CHECK:STDOUT: %G.ref: %HasG.assoc_type = name_ref G, imports.%PackageB.import_ref.6c2 [concrete = constants.%assoc0]
  1050. // CHECK:STDOUT: %impl.elem0: %.a26 = impl_witness_access constants.%HasG.impl_witness, element0 [concrete = constants.%C.as.HasG.impl.G]
  1051. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.ref, %impl.elem0
  1052. // CHECK:STDOUT: %C.as.HasG.impl.G.call: init %empty_tuple.type = call %bound_method(%c.ref)
  1053. // CHECK:STDOUT: return
  1054. // CHECK:STDOUT: }
  1055. // CHECK:STDOUT:
  1056. // CHECK:STDOUT: generic fn @HasG.G(imports.%PackageB.import_ref.ef5: %HasG.type) [from "package_b.carbon"] {
  1057. // CHECK:STDOUT: %Self: %HasG.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.fcb)]
  1058. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  1059. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.76a)]
  1060. // CHECK:STDOUT:
  1061. // CHECK:STDOUT: fn;
  1062. // CHECK:STDOUT: }
  1063. // CHECK:STDOUT:
  1064. // CHECK:STDOUT: fn @C.as.HasG.impl.G [from "package_b.carbon"];
  1065. // CHECK:STDOUT:
  1066. // CHECK:STDOUT: specific @HasG.G(constants.%Self.fcb) {
  1067. // CHECK:STDOUT: %Self => constants.%Self.fcb
  1068. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  1069. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.76a
  1070. // CHECK:STDOUT: }
  1071. // CHECK:STDOUT:
  1072. // CHECK:STDOUT: --- use_dg.carbon
  1073. // CHECK:STDOUT:
  1074. // CHECK:STDOUT: constants {
  1075. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  1076. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1077. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1078. // CHECK:STDOUT: %pattern_type.f09: type = pattern_type %D [concrete]
  1079. // CHECK:STDOUT: %TestDG.type: type = fn_type @TestDG [concrete]
  1080. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1081. // CHECK:STDOUT: %TestDG: %TestDG.type = struct_value () [concrete]
  1082. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [concrete]
  1083. // CHECK:STDOUT: %Self.fcb: %HasG.type = bind_symbolic_name Self, 0 [symbolic]
  1084. // CHECK:STDOUT: %HasG.assoc_type: type = assoc_entity_type @HasG [concrete]
  1085. // CHECK:STDOUT: %assoc0: %HasG.assoc_type = assoc_entity element0, imports.%PackageB.import_ref.70a [concrete]
  1086. // CHECK:STDOUT: %HasG.G.type: type = fn_type @HasG.G [concrete]
  1087. // CHECK:STDOUT: %HasG.G: %HasG.G.type = struct_value () [concrete]
  1088. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.fcb [symbolic]
  1089. // CHECK:STDOUT: %pattern_type.76a: type = pattern_type %Self.as_type [symbolic]
  1090. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1091. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1092. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete]
  1093. // CHECK:STDOUT: %HasG.impl_witness: <witness> = impl_witness imports.%HasG.impl_witness_table [concrete]
  1094. // CHECK:STDOUT: %HasG.facet: %HasG.type = facet_value %D, (%HasG.impl_witness) [concrete]
  1095. // CHECK:STDOUT: %.132: type = fn_type_with_self_type %HasG.G.type, %HasG.facet [concrete]
  1096. // CHECK:STDOUT: %D.as.HasG.impl.G.type: type = fn_type @D.as.HasG.impl.G [concrete]
  1097. // CHECK:STDOUT: %D.as.HasG.impl.G: %D.as.HasG.impl.G.type = struct_value () [concrete]
  1098. // CHECK:STDOUT: }
  1099. // CHECK:STDOUT:
  1100. // CHECK:STDOUT: imports {
  1101. // CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
  1102. // CHECK:STDOUT: import Core//prelude
  1103. // CHECK:STDOUT: import Core//prelude/...
  1104. // CHECK:STDOUT: }
  1105. // CHECK:STDOUT: %PackageB: <namespace> = namespace file.%PackageB.import, [concrete] {
  1106. // CHECK:STDOUT: .D = %PackageB.D
  1107. // CHECK:STDOUT: .HasG = %PackageB.HasG
  1108. // CHECK:STDOUT: import PackageB//default
  1109. // CHECK:STDOUT: }
  1110. // CHECK:STDOUT: %PackageB.D: type = import_ref PackageB//default, D, loaded [concrete = constants.%D]
  1111. // CHECK:STDOUT: %PackageB.import_ref.8f2: <witness> = import_ref PackageB//default, loc10_10, loaded [concrete = constants.%complete_type]
  1112. // CHECK:STDOUT: %PackageB.import_ref.cab = import_ref PackageB//default, inst45 [no loc], unloaded
  1113. // CHECK:STDOUT: %PackageB.HasG: type = import_ref PackageB//default, HasG, loaded [concrete = constants.%HasG.type]
  1114. // CHECK:STDOUT: %PackageB.import_ref.5d8 = import_ref PackageB//default, inst21 [no loc], unloaded
  1115. // CHECK:STDOUT: %PackageB.import_ref.6c2: %HasG.assoc_type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%assoc0]
  1116. // CHECK:STDOUT: %PackageB.G = import_ref PackageB//default, G, unloaded
  1117. // CHECK:STDOUT: %PackageB.import_ref.70a: %HasG.G.type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%HasG.G]
  1118. // CHECK:STDOUT: %PackageB.import_ref.ef5: %HasG.type = import_ref PackageB//default, inst21 [no loc], loaded [symbolic = constants.%Self.fcb]
  1119. // CHECK:STDOUT: %PackageB.import_ref.0c3 = import_ref PackageB//default, loc10_9, unloaded
  1120. // CHECK:STDOUT: %PackageB.import_ref.4aa: type = import_ref PackageB//default, inst45 [no loc], loaded [concrete = constants.%D]
  1121. // CHECK:STDOUT: %PackageB.import_ref.cb9: type = import_ref PackageB//default, inst48 [no loc], loaded [concrete = constants.%Destroy.type]
  1122. // CHECK:STDOUT: %PackageB.import_ref.ea7 = import_ref PackageB//default, loc13_25, unloaded
  1123. // CHECK:STDOUT: %PackageB.import_ref.8db: <witness> = import_ref PackageB//default, inst92 [indirect], loaded [concrete = constants.%complete_type]
  1124. // CHECK:STDOUT: %PackageB.import_ref.6a9 = import_ref PackageB//default, inst93 [indirect], unloaded
  1125. // CHECK:STDOUT: %PackageB.import_ref.dfb: type = import_ref PackageB//default, loc13_14, loaded [concrete = constants.%C]
  1126. // CHECK:STDOUT: %PackageB.import_ref.cee586.1: type = import_ref PackageB//default, loc13_20, loaded [concrete = constants.%HasG.type]
  1127. // CHECK:STDOUT: %PackageB.import_ref.96f = import_ref PackageB//default, inst118 [indirect], unloaded
  1128. // CHECK:STDOUT: %PackageB.import_ref.a0b = import_ref PackageB//default, inst119 [indirect], unloaded
  1129. // CHECK:STDOUT: %PackageB.F = import_ref PackageB//default, F, unloaded
  1130. // CHECK:STDOUT: %PackageB.import_ref.5ba = import_ref PackageB//default, loc18_25, unloaded
  1131. // CHECK:STDOUT: %PackageB.import_ref.aa9f8a.1: type = import_ref PackageB//default, loc18_6, loaded [concrete = constants.%D]
  1132. // CHECK:STDOUT: %PackageB.import_ref.831: type = import_ref PackageB//default, loc18_19, loaded [concrete = constants.%HasF.type]
  1133. // CHECK:STDOUT: %PackageB.import_ref.bb9: <witness> = import_ref PackageB//default, loc23_16, loaded [concrete = constants.%HasG.impl_witness]
  1134. // CHECK:STDOUT: %PackageB.import_ref.aa9f8a.2: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D]
  1135. // CHECK:STDOUT: %PackageB.import_ref.cee586.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type]
  1136. // CHECK:STDOUT: %PackageB.import_ref.b0a: %D.as.HasG.impl.G.type = import_ref PackageB//default, loc24_22, loaded [concrete = constants.%D.as.HasG.impl.G]
  1137. // CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.b0a), @D.as.HasG.impl [concrete]
  1138. // CHECK:STDOUT: }
  1139. // CHECK:STDOUT:
  1140. // CHECK:STDOUT: file {
  1141. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1142. // CHECK:STDOUT: .Core = imports.%Core.ece
  1143. // CHECK:STDOUT: .PackageB = imports.%PackageB
  1144. // CHECK:STDOUT: .TestDG = %TestDG.decl
  1145. // CHECK:STDOUT: }
  1146. // CHECK:STDOUT: %Core.import = import Core
  1147. // CHECK:STDOUT: %PackageB.import = import PackageB
  1148. // CHECK:STDOUT: %TestDG.decl: %TestDG.type = fn_decl @TestDG [concrete = constants.%TestDG] {
  1149. // CHECK:STDOUT: %d.patt: %pattern_type.f09 = binding_pattern d [concrete]
  1150. // CHECK:STDOUT: %d.param_patt: %pattern_type.f09 = value_param_pattern %d.patt, call_param0 [concrete]
  1151. // CHECK:STDOUT: } {
  1152. // CHECK:STDOUT: %d.param: %D = value_param call_param0
  1153. // CHECK:STDOUT: %.loc6: type = splice_block %D.ref [concrete = constants.%D] {
  1154. // CHECK:STDOUT: %PackageB.ref.loc6: <namespace> = name_ref PackageB, imports.%PackageB [concrete = imports.%PackageB]
  1155. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%PackageB.D [concrete = constants.%D]
  1156. // CHECK:STDOUT: }
  1157. // CHECK:STDOUT: %d: %D = bind_name d, %d.param
  1158. // CHECK:STDOUT: }
  1159. // CHECK:STDOUT: }
  1160. // CHECK:STDOUT:
  1161. // CHECK:STDOUT: interface @HasG [from "package_b.carbon"] {
  1162. // CHECK:STDOUT: !members:
  1163. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.5d8
  1164. // CHECK:STDOUT: .G = imports.%PackageB.import_ref.6c2
  1165. // CHECK:STDOUT: witness = (imports.%PackageB.G)
  1166. // CHECK:STDOUT: }
  1167. // CHECK:STDOUT:
  1168. // CHECK:STDOUT: interface @HasF [from "package_b.carbon"] {
  1169. // CHECK:STDOUT: !members:
  1170. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.96f
  1171. // CHECK:STDOUT: .F = imports.%PackageB.import_ref.a0b
  1172. // CHECK:STDOUT: witness = (imports.%PackageB.F)
  1173. // CHECK:STDOUT: }
  1174. // CHECK:STDOUT:
  1175. // CHECK:STDOUT: impl @D.as.Destroy.impl: imports.%PackageB.import_ref.4aa as imports.%PackageB.import_ref.cb9 [from "package_b.carbon"] {
  1176. // CHECK:STDOUT: !members:
  1177. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.0c3
  1178. // CHECK:STDOUT: }
  1179. // CHECK:STDOUT:
  1180. // CHECK:STDOUT: impl @C.as.HasG.impl: imports.%PackageB.import_ref.dfb as imports.%PackageB.import_ref.cee586.1 [from "package_b.carbon"] {
  1181. // CHECK:STDOUT: !members:
  1182. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.ea7
  1183. // CHECK:STDOUT: }
  1184. // CHECK:STDOUT:
  1185. // CHECK:STDOUT: impl @D.as.HasF.impl: imports.%PackageB.import_ref.aa9f8a.1 as imports.%PackageB.import_ref.831 [from "package_b.carbon"] {
  1186. // CHECK:STDOUT: !members:
  1187. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.5ba
  1188. // CHECK:STDOUT: }
  1189. // CHECK:STDOUT:
  1190. // CHECK:STDOUT: impl @D.as.HasG.impl: imports.%PackageB.import_ref.aa9f8a.2 as imports.%PackageB.import_ref.cee586.2 [from "package_b.carbon"] {
  1191. // CHECK:STDOUT: !members:
  1192. // CHECK:STDOUT: witness = imports.%PackageB.import_ref.bb9
  1193. // CHECK:STDOUT: }
  1194. // CHECK:STDOUT:
  1195. // CHECK:STDOUT: class @D [from "package_b.carbon"] {
  1196. // CHECK:STDOUT: complete_type_witness = imports.%PackageB.import_ref.8f2
  1197. // CHECK:STDOUT:
  1198. // CHECK:STDOUT: !members:
  1199. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.cab
  1200. // CHECK:STDOUT: }
  1201. // CHECK:STDOUT:
  1202. // CHECK:STDOUT: class @C [from "package_b.carbon"] {
  1203. // CHECK:STDOUT: complete_type_witness = imports.%PackageB.import_ref.8db
  1204. // CHECK:STDOUT:
  1205. // CHECK:STDOUT: !members:
  1206. // CHECK:STDOUT: .Self = imports.%PackageB.import_ref.6a9
  1207. // CHECK:STDOUT: }
  1208. // CHECK:STDOUT:
  1209. // CHECK:STDOUT: fn @TestDG(%d.param: %D) {
  1210. // CHECK:STDOUT: !entry:
  1211. // CHECK:STDOUT: %d.ref: %D = name_ref d, %d
  1212. // CHECK:STDOUT: %PackageB.ref.loc7: <namespace> = name_ref PackageB, imports.%PackageB [concrete = imports.%PackageB]
  1213. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%PackageB.HasG [concrete = constants.%HasG.type]
  1214. // CHECK:STDOUT: %G.ref: %HasG.assoc_type = name_ref G, imports.%PackageB.import_ref.6c2 [concrete = constants.%assoc0]
  1215. // CHECK:STDOUT: %impl.elem0: %.132 = impl_witness_access constants.%HasG.impl_witness, element0 [concrete = constants.%D.as.HasG.impl.G]
  1216. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %d.ref, %impl.elem0
  1217. // CHECK:STDOUT: %D.as.HasG.impl.G.call: init %empty_tuple.type = call %bound_method(%d.ref)
  1218. // CHECK:STDOUT: return
  1219. // CHECK:STDOUT: }
  1220. // CHECK:STDOUT:
  1221. // CHECK:STDOUT: generic fn @HasG.G(imports.%PackageB.import_ref.ef5: %HasG.type) [from "package_b.carbon"] {
  1222. // CHECK:STDOUT: %Self: %HasG.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.fcb)]
  1223. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  1224. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.76a)]
  1225. // CHECK:STDOUT:
  1226. // CHECK:STDOUT: fn;
  1227. // CHECK:STDOUT: }
  1228. // CHECK:STDOUT:
  1229. // CHECK:STDOUT: fn @D.as.HasG.impl.G [from "package_b.carbon"];
  1230. // CHECK:STDOUT:
  1231. // CHECK:STDOUT: specific @HasG.G(constants.%Self.fcb) {
  1232. // CHECK:STDOUT: %Self => constants.%Self.fcb
  1233. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  1234. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.76a
  1235. // CHECK:STDOUT: }
  1236. // CHECK:STDOUT:
  1237. // CHECK:STDOUT: --- associated_interface.carbon
  1238. // CHECK:STDOUT:
  1239. // CHECK:STDOUT: constants {
  1240. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  1241. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic]
  1242. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1243. // CHECK:STDOUT: %pattern_type.a40: type = pattern_type %Self.as_type [symbolic]
  1244. // CHECK:STDOUT: %Z.H.type: type = fn_type @Z.H [concrete]
  1245. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1246. // CHECK:STDOUT: %Z.H: %Z.H.type = struct_value () [concrete]
  1247. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  1248. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, @Z.%Z.H.decl [concrete]
  1249. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table [concrete]
  1250. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  1251. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H.type: type = fn_type @empty_tuple.type.as.Z.impl.H [concrete]
  1252. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H: %empty_tuple.type.as.Z.impl.H.type = struct_value () [concrete]
  1253. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, (%Z.impl_witness) [concrete]
  1254. // CHECK:STDOUT: }
  1255. // CHECK:STDOUT:
  1256. // CHECK:STDOUT: imports {
  1257. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1258. // CHECK:STDOUT: import Core//prelude
  1259. // CHECK:STDOUT: import Core//prelude/...
  1260. // CHECK:STDOUT: }
  1261. // CHECK:STDOUT: }
  1262. // CHECK:STDOUT:
  1263. // CHECK:STDOUT: file {
  1264. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1265. // CHECK:STDOUT: .Core = imports.%Core
  1266. // CHECK:STDOUT: .Z = %Z.decl
  1267. // CHECK:STDOUT: }
  1268. // CHECK:STDOUT: %Core.import = import Core
  1269. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  1270. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.Z.impl [concrete] {} {
  1271. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  1272. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1273. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1274. // CHECK:STDOUT: }
  1275. // 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]
  1276. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness]
  1277. // CHECK:STDOUT: }
  1278. // CHECK:STDOUT:
  1279. // CHECK:STDOUT: interface @Z {
  1280. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1281. // CHECK:STDOUT: %Z.H.decl: %Z.H.type = fn_decl @Z.H [concrete = constants.%Z.H] {
  1282. // CHECK:STDOUT: %self.patt: @Z.H.%pattern_type (%pattern_type.a40) = binding_pattern self [concrete]
  1283. // CHECK:STDOUT: %self.param_patt: @Z.H.%pattern_type (%pattern_type.a40) = value_param_pattern %self.patt, call_param0 [concrete]
  1284. // CHECK:STDOUT: } {
  1285. // CHECK:STDOUT: %self.param: @Z.H.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0
  1286. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] {
  1287. // CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self [symbolic = %Self (constants.%Self)]
  1288. // 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)]
  1289. // 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)]
  1290. // CHECK:STDOUT: }
  1291. // CHECK:STDOUT: %self: @Z.H.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param
  1292. // CHECK:STDOUT: }
  1293. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, %Z.H.decl [concrete = constants.%assoc0]
  1294. // CHECK:STDOUT:
  1295. // CHECK:STDOUT: !members:
  1296. // CHECK:STDOUT: .Self = %Self
  1297. // CHECK:STDOUT: .H = %assoc0
  1298. // CHECK:STDOUT: witness = (%Z.H.decl)
  1299. // CHECK:STDOUT: }
  1300. // CHECK:STDOUT:
  1301. // CHECK:STDOUT: impl @empty_tuple.type.as.Z.impl: %.loc8_7.2 as %Z.ref {
  1302. // 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] {
  1303. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
  1304. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  1305. // CHECK:STDOUT: } {
  1306. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  1307. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.Z.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  1308. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  1309. // CHECK:STDOUT: }
  1310. // CHECK:STDOUT:
  1311. // CHECK:STDOUT: !members:
  1312. // CHECK:STDOUT: .H = %empty_tuple.type.as.Z.impl.H.decl
  1313. // CHECK:STDOUT: witness = file.%Z.impl_witness
  1314. // CHECK:STDOUT: }
  1315. // CHECK:STDOUT:
  1316. // CHECK:STDOUT: generic fn @Z.H(@Z.%Self: %Z.type) {
  1317. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1318. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  1319. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.a40)]
  1320. // CHECK:STDOUT:
  1321. // CHECK:STDOUT: fn(%self.param: @Z.H.%Self.as_type.loc5_14.1 (%Self.as_type));
  1322. // CHECK:STDOUT: }
  1323. // CHECK:STDOUT:
  1324. // CHECK:STDOUT: fn @empty_tuple.type.as.Z.impl.H(%self.param: %empty_tuple.type) {
  1325. // CHECK:STDOUT: !entry:
  1326. // CHECK:STDOUT: return
  1327. // CHECK:STDOUT: }
  1328. // CHECK:STDOUT:
  1329. // CHECK:STDOUT: specific @Z.H(constants.%Self) {
  1330. // CHECK:STDOUT: %Self => constants.%Self
  1331. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type
  1332. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a40
  1333. // CHECK:STDOUT: }
  1334. // CHECK:STDOUT:
  1335. // CHECK:STDOUT: specific @Z.H(constants.%Z.facet) {
  1336. // CHECK:STDOUT: %Self => constants.%Z.facet
  1337. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_tuple.type
  1338. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb1
  1339. // CHECK:STDOUT: }
  1340. // CHECK:STDOUT:
  1341. // CHECK:STDOUT: --- import_associated_interface.carbon
  1342. // CHECK:STDOUT:
  1343. // CHECK:STDOUT: constants {
  1344. // CHECK:STDOUT: %J.type: type = fn_type @J [concrete]
  1345. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1346. // CHECK:STDOUT: %J: %J.type = struct_value () [concrete]
  1347. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  1348. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic]
  1349. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  1350. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, imports.%PackageAssociatedInterface.import_ref.250 [concrete]
  1351. // CHECK:STDOUT: %Z.H.type: type = fn_type @Z.H [concrete]
  1352. // CHECK:STDOUT: %Z.H: %Z.H.type = struct_value () [concrete]
  1353. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1354. // CHECK:STDOUT: %pattern_type.75f: type = pattern_type %Self.as_type [symbolic]
  1355. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness imports.%Z.impl_witness_table [concrete]
  1356. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, (%Z.impl_witness) [concrete]
  1357. // CHECK:STDOUT: %.7f5: type = fn_type_with_self_type %Z.H.type, %Z.facet [concrete]
  1358. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H.type: type = fn_type @empty_tuple.type.as.Z.impl.H [concrete]
  1359. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H: %empty_tuple.type.as.Z.impl.H.type = struct_value () [concrete]
  1360. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  1361. // CHECK:STDOUT: }
  1362. // CHECK:STDOUT:
  1363. // CHECK:STDOUT: imports {
  1364. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1365. // CHECK:STDOUT: import Core//prelude
  1366. // CHECK:STDOUT: import Core//prelude/...
  1367. // CHECK:STDOUT: }
  1368. // CHECK:STDOUT: %PackageAssociatedInterface: <namespace> = namespace file.%PackageAssociatedInterface.import, [concrete] {
  1369. // CHECK:STDOUT: .Z = %PackageAssociatedInterface.Z
  1370. // CHECK:STDOUT: import PackageAssociatedInterface//default
  1371. // CHECK:STDOUT: }
  1372. // CHECK:STDOUT: %PackageAssociatedInterface.Z: type = import_ref PackageAssociatedInterface//default, Z, loaded [concrete = constants.%Z.type]
  1373. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.f88 = import_ref PackageAssociatedInterface//default, inst19 [no loc], unloaded
  1374. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.609: %Z.assoc_type = import_ref PackageAssociatedInterface//default, loc5_21, loaded [concrete = constants.%assoc0]
  1375. // CHECK:STDOUT: %PackageAssociatedInterface.H = import_ref PackageAssociatedInterface//default, H, unloaded
  1376. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.250: %Z.H.type = import_ref PackageAssociatedInterface//default, loc5_21, loaded [concrete = constants.%Z.H]
  1377. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.d26: %Z.type = import_ref PackageAssociatedInterface//default, inst19 [no loc], loaded [symbolic = constants.%Self]
  1378. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.d8c: <witness> = import_ref PackageAssociatedInterface//default, loc8_14, loaded [concrete = constants.%Z.impl_witness]
  1379. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.e5c: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [concrete = constants.%empty_tuple.type]
  1380. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.df1: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [concrete = constants.%Z.type]
  1381. // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.6d7: %empty_tuple.type.as.Z.impl.H.type = import_ref PackageAssociatedInterface//default, loc9_22, loaded [concrete = constants.%empty_tuple.type.as.Z.impl.H]
  1382. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%PackageAssociatedInterface.import_ref.6d7), @empty_tuple.type.as.Z.impl [concrete]
  1383. // CHECK:STDOUT: }
  1384. // CHECK:STDOUT:
  1385. // CHECK:STDOUT: file {
  1386. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1387. // CHECK:STDOUT: .Core = imports.%Core
  1388. // CHECK:STDOUT: .PackageAssociatedInterface = imports.%PackageAssociatedInterface
  1389. // CHECK:STDOUT: .J = %J.decl
  1390. // CHECK:STDOUT: }
  1391. // CHECK:STDOUT: %Core.import = import Core
  1392. // CHECK:STDOUT: %PackageAssociatedInterface.import = import PackageAssociatedInterface
  1393. // CHECK:STDOUT: %J.decl: %J.type = fn_decl @J [concrete = constants.%J] {} {}
  1394. // CHECK:STDOUT: }
  1395. // CHECK:STDOUT:
  1396. // CHECK:STDOUT: interface @Z [from "associated_interface.carbon"] {
  1397. // CHECK:STDOUT: !members:
  1398. // CHECK:STDOUT: .Self = imports.%PackageAssociatedInterface.import_ref.f88
  1399. // CHECK:STDOUT: .H = imports.%PackageAssociatedInterface.import_ref.609
  1400. // CHECK:STDOUT: witness = (imports.%PackageAssociatedInterface.H)
  1401. // CHECK:STDOUT: }
  1402. // CHECK:STDOUT:
  1403. // CHECK:STDOUT: impl @empty_tuple.type.as.Z.impl: imports.%PackageAssociatedInterface.import_ref.e5c as imports.%PackageAssociatedInterface.import_ref.df1 [from "associated_interface.carbon"] {
  1404. // CHECK:STDOUT: !members:
  1405. // CHECK:STDOUT: witness = imports.%PackageAssociatedInterface.import_ref.d8c
  1406. // CHECK:STDOUT: }
  1407. // CHECK:STDOUT:
  1408. // CHECK:STDOUT: fn @J() {
  1409. // CHECK:STDOUT: !entry:
  1410. // CHECK:STDOUT: %.loc7_4.1: %empty_tuple.type = tuple_literal ()
  1411. // CHECK:STDOUT: %PackageAssociatedInterface.ref: <namespace> = name_ref PackageAssociatedInterface, imports.%PackageAssociatedInterface [concrete = imports.%PackageAssociatedInterface]
  1412. // CHECK:STDOUT: %Z.ref: type = name_ref Z, imports.%PackageAssociatedInterface.Z [concrete = constants.%Z.type]
  1413. // CHECK:STDOUT: %H.ref: %Z.assoc_type = name_ref H, imports.%PackageAssociatedInterface.import_ref.609 [concrete = constants.%assoc0]
  1414. // CHECK:STDOUT: %impl.elem0: %.7f5 = impl_witness_access constants.%Z.impl_witness, element0 [concrete = constants.%empty_tuple.type.as.Z.impl.H]
  1415. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc7_4.1, %impl.elem0
  1416. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  1417. // CHECK:STDOUT: %.loc7_4.2: %empty_tuple.type = converted %.loc7_4.1, %empty_tuple [concrete = constants.%empty_tuple]
  1418. // CHECK:STDOUT: %empty_tuple.type.as.Z.impl.H.call: init %empty_tuple.type = call %bound_method(%.loc7_4.2)
  1419. // CHECK:STDOUT: return
  1420. // CHECK:STDOUT: }
  1421. // CHECK:STDOUT:
  1422. // CHECK:STDOUT: generic fn @Z.H(imports.%PackageAssociatedInterface.import_ref.d26: %Z.type) [from "associated_interface.carbon"] {
  1423. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1424. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  1425. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.75f)]
  1426. // CHECK:STDOUT:
  1427. // CHECK:STDOUT: fn;
  1428. // CHECK:STDOUT: }
  1429. // CHECK:STDOUT:
  1430. // CHECK:STDOUT: fn @empty_tuple.type.as.Z.impl.H [from "associated_interface.carbon"];
  1431. // CHECK:STDOUT:
  1432. // CHECK:STDOUT: specific @Z.H(constants.%Self) {
  1433. // CHECK:STDOUT: %Self => constants.%Self
  1434. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  1435. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.75f
  1436. // CHECK:STDOUT: }
  1437. // CHECK:STDOUT:
  1438. // CHECK:STDOUT: --- has_param.carbon
  1439. // CHECK:STDOUT:
  1440. // CHECK:STDOUT: constants {
  1441. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1442. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1443. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  1444. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1445. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  1446. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  1447. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  1448. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1449. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1450. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @AnyParam.%Destroy.impl_witness_table, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1451. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  1452. // CHECK:STDOUT: %ptr.eba: type = ptr_type %AnyParam [symbolic]
  1453. // CHECK:STDOUT: %pattern_type.74e: type = pattern_type %ptr.eba [symbolic]
  1454. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1455. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: %AnyParam.as.Destroy.impl.Op.type = struct_value () [symbolic]
  1456. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1457. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1458. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  1459. // CHECK:STDOUT: %Self.b29: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1460. // CHECK:STDOUT: %Self.as_type.744: type = facet_access_type %Self.b29 [symbolic]
  1461. // CHECK:STDOUT: %pattern_type.f04: type = pattern_type %Self.as_type.744 [symbolic]
  1462. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  1463. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  1464. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  1465. // CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, @Y.%Y.K.decl [concrete]
  1466. // CHECK:STDOUT: %require_complete.18c: <witness> = require_complete_type %Self.as_type.744 [symbolic]
  1467. // CHECK:STDOUT: }
  1468. // CHECK:STDOUT:
  1469. // CHECK:STDOUT: imports {
  1470. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1471. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1472. // CHECK:STDOUT: import Core//prelude
  1473. // CHECK:STDOUT: import Core//prelude/...
  1474. // CHECK:STDOUT: }
  1475. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1476. // CHECK:STDOUT: }
  1477. // CHECK:STDOUT:
  1478. // CHECK:STDOUT: file {
  1479. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1480. // CHECK:STDOUT: .Core = imports.%Core
  1481. // CHECK:STDOUT: .AnyParam = %AnyParam.decl
  1482. // CHECK:STDOUT: .Y = %Y.decl
  1483. // CHECK:STDOUT: }
  1484. // CHECK:STDOUT: %Core.import = import Core
  1485. // CHECK:STDOUT: %AnyParam.decl: %AnyParam.type = class_decl @AnyParam [concrete = constants.%AnyParam.generic] {
  1486. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1487. // CHECK:STDOUT: %X.patt: @AnyParam.%pattern_type (%pattern_type.7dc) = symbolic_binding_pattern X, 1 [concrete]
  1488. // CHECK:STDOUT: } {
  1489. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  1490. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [symbolic = %T.loc4_16.1 (constants.%T)]
  1491. // CHECK:STDOUT: %X.loc4_26.2: @AnyParam.%T.loc4_16.1 (%T) = bind_symbolic_name X, 1 [symbolic = %X.loc4_26.1 (constants.%X)]
  1492. // CHECK:STDOUT: }
  1493. // CHECK:STDOUT: %Y.decl: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
  1494. // CHECK:STDOUT: }
  1495. // CHECK:STDOUT:
  1496. // CHECK:STDOUT: interface @Y {
  1497. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.b29]
  1498. // CHECK:STDOUT: %Y.K.decl: %Y.K.type = fn_decl @Y.K [concrete = constants.%Y.K] {
  1499. // CHECK:STDOUT: %self.patt: @Y.K.%pattern_type (%pattern_type.f04) = binding_pattern self [concrete]
  1500. // CHECK:STDOUT: %self.param_patt: @Y.K.%pattern_type (%pattern_type.f04) = value_param_pattern %self.patt, call_param0 [concrete]
  1501. // CHECK:STDOUT: } {
  1502. // CHECK:STDOUT: %self.param: @Y.K.%Self.as_type.loc7_14.1 (%Self.as_type.744) = value_param call_param0
  1503. // CHECK:STDOUT: %.loc7_14.1: type = splice_block %.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.744)] {
  1504. // CHECK:STDOUT: %Self.ref: %Y.type = name_ref Self, @Y.%Self [symbolic = %Self (constants.%Self.b29)]
  1505. // 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.744)]
  1506. // 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.744)]
  1507. // CHECK:STDOUT: }
  1508. // CHECK:STDOUT: %self: @Y.K.%Self.as_type.loc7_14.1 (%Self.as_type.744) = bind_name self, %self.param
  1509. // CHECK:STDOUT: }
  1510. // CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, %Y.K.decl [concrete = constants.%assoc0]
  1511. // CHECK:STDOUT:
  1512. // CHECK:STDOUT: !members:
  1513. // CHECK:STDOUT: .Self = %Self
  1514. // CHECK:STDOUT: .K = %assoc0
  1515. // CHECK:STDOUT: witness = (%Y.K.decl)
  1516. // CHECK:STDOUT: }
  1517. // CHECK:STDOUT:
  1518. // 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)) {
  1519. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1520. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1521. // 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)]
  1522. // CHECK:STDOUT:
  1523. // CHECK:STDOUT: !definition:
  1524. // 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)]
  1525. // 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)]
  1526. // CHECK:STDOUT:
  1527. // CHECK:STDOUT: impl: constants.%AnyParam as constants.%Destroy.type {
  1528. // 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)] {
  1529. // CHECK:STDOUT: %self.patt: @AnyParam.as.Destroy.impl.Op.%pattern_type (%pattern_type.74e) = binding_pattern self [concrete]
  1530. // CHECK:STDOUT: %self.param_patt: @AnyParam.as.Destroy.impl.Op.%pattern_type (%pattern_type.74e) = value_param_pattern %self.patt, call_param0 [concrete]
  1531. // CHECK:STDOUT: %.loc4_33.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1532. // CHECK:STDOUT: } {
  1533. // CHECK:STDOUT: %self.param: @AnyParam.as.Destroy.impl.Op.%ptr (%ptr.eba) = value_param call_param0
  1534. // CHECK:STDOUT: %.loc4_33.2: type = splice_block %Self.ref [symbolic = %AnyParam (constants.%AnyParam)] {
  1535. // CHECK:STDOUT: %.loc4_33.3: type = specific_constant constants.%AnyParam, @AnyParam(constants.%T, constants.%X) [symbolic = %AnyParam (constants.%AnyParam)]
  1536. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc4_33.3 [symbolic = %AnyParam (constants.%AnyParam)]
  1537. // CHECK:STDOUT: }
  1538. // CHECK:STDOUT: %self: @AnyParam.as.Destroy.impl.Op.%ptr (%ptr.eba) = bind_name self, %self.param
  1539. // CHECK:STDOUT: }
  1540. // CHECK:STDOUT:
  1541. // CHECK:STDOUT: !members:
  1542. // CHECK:STDOUT: .Op = %AnyParam.as.Destroy.impl.Op.decl
  1543. // CHECK:STDOUT: witness = @AnyParam.%Destroy.impl_witness
  1544. // CHECK:STDOUT: }
  1545. // CHECK:STDOUT: }
  1546. // CHECK:STDOUT:
  1547. // CHECK:STDOUT: generic class @AnyParam(%T.loc4_16.2: type, %X.loc4_26.2: @AnyParam.%T.loc4_16.1 (%T)) {
  1548. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  1549. // CHECK:STDOUT: %X.loc4_26.1: @AnyParam.%T.loc4_16.1 (%T) = bind_symbolic_name X, 1 [symbolic = %X.loc4_26.1 (constants.%X)]
  1550. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_16.1 [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1551. // CHECK:STDOUT:
  1552. // CHECK:STDOUT: !definition:
  1553. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc4_16.1 [symbolic = %require_complete (constants.%require_complete.4ae)]
  1554. // CHECK:STDOUT:
  1555. // CHECK:STDOUT: class {
  1556. // CHECK:STDOUT: impl_decl @AnyParam.as.Destroy.impl [concrete] {} {}
  1557. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@AnyParam.as.Destroy.impl.%AnyParam.as.Destroy.impl.Op.decl), @AnyParam.as.Destroy.impl [concrete]
  1558. // 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)]
  1559. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1560. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1561. // CHECK:STDOUT: complete_type_witness = %complete_type
  1562. // CHECK:STDOUT:
  1563. // CHECK:STDOUT: !members:
  1564. // CHECK:STDOUT: .Self = constants.%AnyParam
  1565. // CHECK:STDOUT: }
  1566. // CHECK:STDOUT: }
  1567. // CHECK:STDOUT:
  1568. // 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)) {
  1569. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1570. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1571. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam)]
  1572. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.eba)]
  1573. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.74e)]
  1574. // CHECK:STDOUT:
  1575. // CHECK:STDOUT: !definition:
  1576. // CHECK:STDOUT:
  1577. // CHECK:STDOUT: fn(%self.param: @AnyParam.as.Destroy.impl.Op.%ptr (%ptr.eba)) = "no_op";
  1578. // CHECK:STDOUT: }
  1579. // CHECK:STDOUT:
  1580. // CHECK:STDOUT: generic fn @Y.K(@Y.%Self: %Y.type) {
  1581. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.b29)]
  1582. // CHECK:STDOUT: %Self.as_type.loc7_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.744)]
  1583. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc7_14.1 [symbolic = %pattern_type (constants.%pattern_type.f04)]
  1584. // CHECK:STDOUT:
  1585. // CHECK:STDOUT: !definition:
  1586. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type.loc7_14.1 [symbolic = %require_complete (constants.%require_complete.18c)]
  1587. // CHECK:STDOUT:
  1588. // CHECK:STDOUT: fn(%self.param: @Y.K.%Self.as_type.loc7_14.1 (%Self.as_type.744)) {
  1589. // CHECK:STDOUT: !entry:
  1590. // CHECK:STDOUT: return
  1591. // CHECK:STDOUT: }
  1592. // CHECK:STDOUT: }
  1593. // CHECK:STDOUT:
  1594. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  1595. // CHECK:STDOUT: %T.loc4_16.1 => constants.%T
  1596. // CHECK:STDOUT: %X.loc4_26.1 => constants.%X
  1597. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1598. // CHECK:STDOUT: }
  1599. // CHECK:STDOUT:
  1600. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  1601. // CHECK:STDOUT: %T => constants.%T
  1602. // CHECK:STDOUT: %X => constants.%X
  1603. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness
  1604. // CHECK:STDOUT: }
  1605. // CHECK:STDOUT:
  1606. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  1607. // CHECK:STDOUT: %T => constants.%T
  1608. // CHECK:STDOUT: %X => constants.%X
  1609. // CHECK:STDOUT: %AnyParam => constants.%AnyParam
  1610. // CHECK:STDOUT: %ptr => constants.%ptr.eba
  1611. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.74e
  1612. // CHECK:STDOUT: }
  1613. // CHECK:STDOUT:
  1614. // CHECK:STDOUT: specific @Y.K(constants.%Self.b29) {
  1615. // CHECK:STDOUT: %Self => constants.%Self.b29
  1616. // CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%Self.as_type.744
  1617. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f04
  1618. // CHECK:STDOUT: }
  1619. // CHECK:STDOUT:
  1620. // CHECK:STDOUT: --- has_generic_interface.carbon
  1621. // CHECK:STDOUT:
  1622. // CHECK:STDOUT: constants {
  1623. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  1624. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1625. // CHECK:STDOUT: %GenericInterface.type.c92: type = generic_interface_type @GenericInterface [concrete]
  1626. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1627. // CHECK:STDOUT: %GenericInterface.generic: %GenericInterface.type.c92 = struct_value () [concrete]
  1628. // CHECK:STDOUT: %GenericInterface.type.3fe: type = facet_type <@GenericInterface, @GenericInterface(%U)> [symbolic]
  1629. // CHECK:STDOUT: %Self.a1c: %GenericInterface.type.3fe = bind_symbolic_name Self, 1 [symbolic]
  1630. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  1631. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  1632. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1633. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1634. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1635. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  1636. // CHECK:STDOUT: %AnyParam.560: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  1637. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1638. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  1639. // CHECK:STDOUT: %pattern_type.438: type = pattern_type %GenericInterface.type.c92 [concrete]
  1640. // CHECK:STDOUT: %AnyParam.241: type = class_type @AnyParam, @AnyParam(%GenericInterface.type.c92, %GenericInterface.generic) [concrete]
  1641. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  1642. // CHECK:STDOUT: %Self.f64: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1643. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  1644. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  1645. // CHECK:STDOUT: %Self.as_type.61d: type = facet_access_type %Self.f64 [symbolic]
  1646. // CHECK:STDOUT: %pattern_type.cb4: type = pattern_type %Self.as_type.61d [symbolic]
  1647. // CHECK:STDOUT: %require_complete.b14: <witness> = require_complete_type %Self.as_type.61d [symbolic]
  1648. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table [concrete]
  1649. // CHECK:STDOUT: %pattern_type.004: type = pattern_type %AnyParam.241 [concrete]
  1650. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
  1651. // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]
  1652. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.241, (%Y.impl_witness) [concrete]
  1653. // CHECK:STDOUT: %complete_type.eb2: <witness> = complete_type_witness %GenericInterface.type.c92 [concrete]
  1654. // CHECK:STDOUT: %L.type: type = fn_type @L [concrete]
  1655. // CHECK:STDOUT: %L: %L.type = struct_value () [concrete]
  1656. // CHECK:STDOUT: %AnyParam.val: %AnyParam.241 = struct_value () [concrete]
  1657. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  1658. // CHECK:STDOUT: %assoc0.494: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [concrete]
  1659. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1660. // CHECK:STDOUT: %Destroy.impl_witness.7ff: <witness> = impl_witness imports.%Destroy.impl_witness_table.f0b, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1661. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1662. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: %AnyParam.as.Destroy.impl.Op.type = struct_value () [symbolic]
  1663. // CHECK:STDOUT: %ptr.4a9: type = ptr_type %AnyParam.560 [symbolic]
  1664. // CHECK:STDOUT: %pattern_type.84c: type = pattern_type %ptr.4a9 [symbolic]
  1665. // CHECK:STDOUT: %.0fb: type = fn_type_with_self_type %Y.K.type, %Y.facet [concrete]
  1666. // CHECK:STDOUT: %Destroy.impl_witness.0ad: <witness> = impl_witness imports.%Destroy.impl_witness_table.f0b, @AnyParam.as.Destroy.impl(%GenericInterface.type.c92, %GenericInterface.generic) [concrete]
  1667. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.90e: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%AnyParam.241) [concrete]
  1668. // CHECK:STDOUT: %T.as.Destroy.impl.Op.ec3: %T.as.Destroy.impl.Op.type.90e = struct_value () [concrete]
  1669. // CHECK:STDOUT: %ptr.301: type = ptr_type %AnyParam.241 [concrete]
  1670. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.ec3, @T.as.Destroy.impl.Op(%AnyParam.241) [concrete]
  1671. // CHECK:STDOUT: }
  1672. // CHECK:STDOUT:
  1673. // CHECK:STDOUT: imports {
  1674. // CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
  1675. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1676. // CHECK:STDOUT: import Core//prelude
  1677. // CHECK:STDOUT: import Core//prelude/...
  1678. // CHECK:STDOUT: }
  1679. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [concrete] {
  1680. // CHECK:STDOUT: .AnyParam = %PackageHasParam.AnyParam
  1681. // CHECK:STDOUT: .Y = %PackageHasParam.Y
  1682. // CHECK:STDOUT: import PackageHasParam//default
  1683. // CHECK:STDOUT: }
  1684. // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [concrete = constants.%AnyParam.generic]
  1685. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.1: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1686. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1687. // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [concrete = constants.%complete_type.357]
  1688. // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst33 [no loc], unloaded
  1689. // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
  1690. // CHECK:STDOUT: %PackageHasParam.import_ref.dc1 = import_ref PackageHasParam//default, inst93 [no loc], unloaded
  1691. // CHECK:STDOUT: %PackageHasParam.import_ref.f69: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.494]
  1692. // CHECK:STDOUT: %PackageHasParam.K: %Y.K.type = import_ref PackageHasParam//default, K, loaded [concrete = constants.%Y.K]
  1693. // CHECK:STDOUT: %PackageHasParam.import_ref.292: %Y.type = import_ref PackageHasParam//default, inst93 [no loc], loaded [symbolic = constants.%Self.f64]
  1694. // CHECK:STDOUT: %PackageHasParam.import_ref.ce2: %Y.K.type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%Y.K]
  1695. // CHECK:STDOUT: %PackageHasParam.import_ref.9da = import_ref PackageHasParam//default, loc4_33, unloaded
  1696. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.2: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1697. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1698. // CHECK:STDOUT: %PackageHasParam.import_ref.758: type = import_ref PackageHasParam//default, inst33 [no loc], loaded [symbolic = constants.%AnyParam.560]
  1699. // CHECK:STDOUT: %PackageHasParam.import_ref.cb9: type = import_ref PackageHasParam//default, inst36 [no loc], loaded [concrete = constants.%Destroy.type]
  1700. // CHECK:STDOUT: %PackageHasParam.import_ref.ba8 = import_ref PackageHasParam//default, loc4_33, unloaded
  1701. // CHECK:STDOUT: %Destroy.impl_witness_table.f0b = impl_witness_table (%PackageHasParam.import_ref.ba8), @AnyParam.as.Destroy.impl [concrete]
  1702. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.3: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1703. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1704. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1705. // CHECK:STDOUT: }
  1706. // CHECK:STDOUT:
  1707. // CHECK:STDOUT: file {
  1708. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1709. // CHECK:STDOUT: .Core = imports.%Core.ece
  1710. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  1711. // CHECK:STDOUT: .GenericInterface = %GenericInterface.decl
  1712. // CHECK:STDOUT: .L = %L.decl
  1713. // CHECK:STDOUT: }
  1714. // CHECK:STDOUT: %Core.import = import Core
  1715. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  1716. // CHECK:STDOUT: %GenericInterface.decl: %GenericInterface.type.c92 = interface_decl @GenericInterface [concrete = constants.%GenericInterface.generic] {
  1717. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  1718. // CHECK:STDOUT: } {
  1719. // CHECK:STDOUT: %U.loc6_28.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_28.1 (constants.%U)]
  1720. // CHECK:STDOUT: }
  1721. // CHECK:STDOUT: impl_decl @AnyParam.as.Y.impl [concrete] {} {
  1722. // CHECK:STDOUT: %PackageHasParam.ref.loc8_6: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  1723. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  1724. // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.c92 = name_ref GenericInterface, file.%GenericInterface.decl [concrete = constants.%GenericInterface.generic]
  1725. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) [concrete = constants.%AnyParam.241]
  1726. // CHECK:STDOUT: %PackageHasParam.ref.loc8_52: <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: }
  1729. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (@AnyParam.as.Y.impl.%AnyParam.as.Y.impl.K.decl), @AnyParam.as.Y.impl [concrete]
  1730. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness]
  1731. // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [concrete = constants.%L] {} {}
  1732. // CHECK:STDOUT: }
  1733. // CHECK:STDOUT:
  1734. // CHECK:STDOUT: generic interface @GenericInterface(%U.loc6_28.2: type) {
  1735. // CHECK:STDOUT: %U.loc6_28.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_28.1 (constants.%U)]
  1736. // CHECK:STDOUT:
  1737. // CHECK:STDOUT: !definition:
  1738. // CHECK:STDOUT: %GenericInterface.type: type = facet_type <@GenericInterface, @GenericInterface(%U.loc6_28.1)> [symbolic = %GenericInterface.type (constants.%GenericInterface.type.3fe)]
  1739. // CHECK:STDOUT: %Self.2: @GenericInterface.%GenericInterface.type (%GenericInterface.type.3fe) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.a1c)]
  1740. // CHECK:STDOUT:
  1741. // CHECK:STDOUT: interface {
  1742. // CHECK:STDOUT: %Self.1: @GenericInterface.%GenericInterface.type (%GenericInterface.type.3fe) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.a1c)]
  1743. // CHECK:STDOUT:
  1744. // CHECK:STDOUT: !members:
  1745. // CHECK:STDOUT: .Self = %Self.1
  1746. // CHECK:STDOUT: witness = ()
  1747. // CHECK:STDOUT: }
  1748. // CHECK:STDOUT: }
  1749. // CHECK:STDOUT:
  1750. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  1751. // CHECK:STDOUT: !members:
  1752. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.dc1
  1753. // CHECK:STDOUT: .K = imports.%PackageHasParam.import_ref.f69
  1754. // CHECK:STDOUT: witness = (imports.%PackageHasParam.K)
  1755. // CHECK:STDOUT: }
  1756. // CHECK:STDOUT:
  1757. // CHECK:STDOUT: impl @AnyParam.as.Y.impl: %AnyParam as %Y.ref {
  1758. // 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] {
  1759. // CHECK:STDOUT: %self.patt: %pattern_type.004 = binding_pattern self [concrete]
  1760. // CHECK:STDOUT: %self.param_patt: %pattern_type.004 = value_param_pattern %self.patt, call_param0 [concrete]
  1761. // CHECK:STDOUT: } {
  1762. // CHECK:STDOUT: %self.param: %AnyParam.241 = value_param call_param0
  1763. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @AnyParam.as.Y.impl.%AnyParam [concrete = constants.%AnyParam.241]
  1764. // CHECK:STDOUT: %self: %AnyParam.241 = bind_name self, %self.param
  1765. // CHECK:STDOUT: }
  1766. // CHECK:STDOUT:
  1767. // CHECK:STDOUT: !members:
  1768. // CHECK:STDOUT: .K = %AnyParam.as.Y.impl.K.decl
  1769. // CHECK:STDOUT: witness = file.%Y.impl_witness
  1770. // CHECK:STDOUT: }
  1771. // CHECK:STDOUT:
  1772. // 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"] {
  1773. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1774. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1775. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.f0b, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.7ff)]
  1776. // CHECK:STDOUT:
  1777. // CHECK:STDOUT: !definition:
  1778. // 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)]
  1779. // 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)]
  1780. // CHECK:STDOUT:
  1781. // CHECK:STDOUT: impl: imports.%PackageHasParam.import_ref.758 as imports.%PackageHasParam.import_ref.cb9 {
  1782. // CHECK:STDOUT: !members:
  1783. // CHECK:STDOUT: witness = imports.%PackageHasParam.import_ref.9da
  1784. // CHECK:STDOUT: }
  1785. // CHECK:STDOUT: }
  1786. // CHECK:STDOUT:
  1787. // 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"] {
  1788. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1789. // CHECK:STDOUT: %X: @AnyParam.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1790. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1791. // CHECK:STDOUT:
  1792. // CHECK:STDOUT: !definition:
  1793. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  1794. // CHECK:STDOUT:
  1795. // CHECK:STDOUT: class {
  1796. // CHECK:STDOUT: complete_type_witness = imports.%PackageHasParam.import_ref.8f2
  1797. // CHECK:STDOUT:
  1798. // CHECK:STDOUT: !members:
  1799. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.601
  1800. // CHECK:STDOUT: }
  1801. // CHECK:STDOUT: }
  1802. // CHECK:STDOUT:
  1803. // CHECK:STDOUT: generic fn @Y.K(imports.%PackageHasParam.import_ref.292: %Y.type) [from "has_param.carbon"] {
  1804. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.f64)]
  1805. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.61d)]
  1806. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.cb4)]
  1807. // CHECK:STDOUT:
  1808. // CHECK:STDOUT: !definition:
  1809. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.b14)]
  1810. // CHECK:STDOUT:
  1811. // CHECK:STDOUT: fn;
  1812. // CHECK:STDOUT: }
  1813. // CHECK:STDOUT:
  1814. // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K(%self.param: %AnyParam.241) {
  1815. // CHECK:STDOUT: !entry:
  1816. // CHECK:STDOUT: return
  1817. // CHECK:STDOUT: }
  1818. // CHECK:STDOUT:
  1819. // CHECK:STDOUT: fn @L() {
  1820. // CHECK:STDOUT: !entry:
  1821. // CHECK:STDOUT: name_binding_decl {
  1822. // CHECK:STDOUT: %obj.patt: %pattern_type.004 = binding_pattern obj [concrete]
  1823. // CHECK:STDOUT: %obj.var_patt: %pattern_type.004 = var_pattern %obj.patt [concrete]
  1824. // CHECK:STDOUT: }
  1825. // CHECK:STDOUT: %obj.var: ref %AnyParam.241 = var %obj.var_patt
  1826. // CHECK:STDOUT: %.loc13_58.1: %empty_struct_type = struct_literal ()
  1827. // CHECK:STDOUT: %.loc13_58.2: init %AnyParam.241 = class_init (), %obj.var [concrete = constants.%AnyParam.val]
  1828. // CHECK:STDOUT: %.loc13_3: init %AnyParam.241 = converted %.loc13_58.1, %.loc13_58.2 [concrete = constants.%AnyParam.val]
  1829. // CHECK:STDOUT: assign %obj.var, %.loc13_3
  1830. // CHECK:STDOUT: %.loc13_53: type = splice_block %AnyParam [concrete = constants.%AnyParam.241] {
  1831. // CHECK:STDOUT: %PackageHasParam.ref.loc13: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  1832. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  1833. // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.c92 = name_ref GenericInterface, file.%GenericInterface.decl [concrete = constants.%GenericInterface.generic]
  1834. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) [concrete = constants.%AnyParam.241]
  1835. // CHECK:STDOUT: }
  1836. // CHECK:STDOUT: %obj: ref %AnyParam.241 = bind_name obj, %obj.var
  1837. // CHECK:STDOUT: %obj.ref: ref %AnyParam.241 = name_ref obj, %obj
  1838. // CHECK:STDOUT: %PackageHasParam.ref.loc14: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  1839. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  1840. // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.f69 [concrete = constants.%assoc0.494]
  1841. // CHECK:STDOUT: %impl.elem0: %.0fb = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K]
  1842. // CHECK:STDOUT: %bound_method.loc14: <bound method> = bound_method %obj.ref, %impl.elem0
  1843. // CHECK:STDOUT: %.loc14: %AnyParam.241 = bind_value %obj.ref
  1844. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method.loc14(%.loc14)
  1845. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %obj.var, constants.%T.as.Destroy.impl.Op.ec3
  1846. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.ec3, @T.as.Destroy.impl.Op(constants.%AnyParam.241) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  1847. // CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %obj.var, %T.as.Destroy.impl.Op.specific_fn
  1848. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %obj.var
  1849. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc13(%addr)
  1850. // CHECK:STDOUT: return
  1851. // CHECK:STDOUT: }
  1852. // CHECK:STDOUT:
  1853. // 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"] {
  1854. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1855. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1856. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  1857. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.4a9)]
  1858. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.84c)]
  1859. // CHECK:STDOUT:
  1860. // CHECK:STDOUT: !definition:
  1861. // CHECK:STDOUT:
  1862. // CHECK:STDOUT: fn = "no_op";
  1863. // CHECK:STDOUT: }
  1864. // CHECK:STDOUT:
  1865. // CHECK:STDOUT: specific @GenericInterface(constants.%U) {
  1866. // CHECK:STDOUT: %U.loc6_28.1 => constants.%U
  1867. // CHECK:STDOUT: }
  1868. // CHECK:STDOUT:
  1869. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  1870. // CHECK:STDOUT: %T => constants.%T
  1871. // CHECK:STDOUT: %X => constants.%X
  1872. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1873. // CHECK:STDOUT: }
  1874. // CHECK:STDOUT:
  1875. // CHECK:STDOUT: specific @AnyParam(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) {
  1876. // CHECK:STDOUT: %T => constants.%GenericInterface.type.c92
  1877. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  1878. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.438
  1879. // CHECK:STDOUT:
  1880. // CHECK:STDOUT: !definition:
  1881. // CHECK:STDOUT: %require_complete => constants.%complete_type.eb2
  1882. // CHECK:STDOUT: }
  1883. // CHECK:STDOUT:
  1884. // CHECK:STDOUT: specific @Y.K(constants.%Self.f64) {
  1885. // CHECK:STDOUT: %Self => constants.%Self.f64
  1886. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.61d
  1887. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb4
  1888. // CHECK:STDOUT: }
  1889. // CHECK:STDOUT:
  1890. // CHECK:STDOUT: specific @Y.K(constants.%Y.facet) {
  1891. // CHECK:STDOUT: %Self => constants.%Y.facet
  1892. // CHECK:STDOUT: %Self.as_type => constants.%AnyParam.241
  1893. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.004
  1894. // CHECK:STDOUT: }
  1895. // CHECK:STDOUT:
  1896. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  1897. // CHECK:STDOUT: %T => constants.%T
  1898. // CHECK:STDOUT: %X => constants.%X
  1899. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.7ff
  1900. // CHECK:STDOUT: }
  1901. // CHECK:STDOUT:
  1902. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  1903. // CHECK:STDOUT: %T => constants.%T
  1904. // CHECK:STDOUT: %X => constants.%X
  1905. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  1906. // CHECK:STDOUT: %ptr => constants.%ptr.4a9
  1907. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.84c
  1908. // CHECK:STDOUT: }
  1909. // CHECK:STDOUT:
  1910. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) {
  1911. // CHECK:STDOUT: %T => constants.%GenericInterface.type.c92
  1912. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  1913. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.0ad
  1914. // CHECK:STDOUT: }
  1915. // CHECK:STDOUT:
  1916. // CHECK:STDOUT: --- use_generic_interface_as_param.carbon
  1917. // CHECK:STDOUT:
  1918. // CHECK:STDOUT: constants {
  1919. // CHECK:STDOUT: %M.type: type = fn_type @M [concrete]
  1920. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1921. // CHECK:STDOUT: %M: %M.type = struct_value () [concrete]
  1922. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  1923. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  1924. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1925. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1926. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1927. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  1928. // CHECK:STDOUT: %AnyParam.560: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  1929. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1930. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  1931. // CHECK:STDOUT: %GenericInterface.type.0da: type = generic_interface_type @GenericInterface [concrete]
  1932. // CHECK:STDOUT: %GenericInterface.generic: %GenericInterface.type.0da = struct_value () [concrete]
  1933. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  1934. // CHECK:STDOUT: %GenericInterface.type.138: type = facet_type <@GenericInterface, @GenericInterface(%U)> [symbolic]
  1935. // CHECK:STDOUT: %Self.13b: %GenericInterface.type.138 = bind_symbolic_name Self, 1 [symbolic]
  1936. // CHECK:STDOUT: %pattern_type.a64: type = pattern_type %GenericInterface.type.0da [concrete]
  1937. // CHECK:STDOUT: %AnyParam.861: type = class_type @AnyParam, @AnyParam(%GenericInterface.type.0da, %GenericInterface.generic) [concrete]
  1938. // CHECK:STDOUT: %complete_type.42f: <witness> = complete_type_witness %GenericInterface.type.0da [concrete]
  1939. // CHECK:STDOUT: %pattern_type.3ad: type = pattern_type %AnyParam.861 [concrete]
  1940. // CHECK:STDOUT: %AnyParam.val: %AnyParam.861 = struct_value () [concrete]
  1941. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  1942. // CHECK:STDOUT: %Self.f64: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1943. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  1944. // CHECK:STDOUT: %assoc0.494: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [concrete]
  1945. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  1946. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  1947. // CHECK:STDOUT: %Self.as_type.61d: type = facet_access_type %Self.f64 [symbolic]
  1948. // CHECK:STDOUT: %pattern_type.cb4: type = pattern_type %Self.as_type.61d [symbolic]
  1949. // CHECK:STDOUT: %require_complete.b14: <witness> = require_complete_type %Self.as_type.61d [symbolic]
  1950. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1951. // CHECK:STDOUT: %Destroy.impl_witness.7ff: <witness> = impl_witness imports.%Destroy.impl_witness_table.f0b, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1952. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  1953. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: %AnyParam.as.Destroy.impl.Op.type = struct_value () [symbolic]
  1954. // CHECK:STDOUT: %ptr.4a9: type = ptr_type %AnyParam.560 [symbolic]
  1955. // CHECK:STDOUT: %pattern_type.84c: type = pattern_type %ptr.4a9 [symbolic]
  1956. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness imports.%Y.impl_witness_table [concrete]
  1957. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.861, (%Y.impl_witness) [concrete]
  1958. // CHECK:STDOUT: %.e17: type = fn_type_with_self_type %Y.K.type, %Y.facet [concrete]
  1959. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
  1960. // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]
  1961. // CHECK:STDOUT: %Destroy.impl_witness.ae4: <witness> = impl_witness imports.%Destroy.impl_witness_table.f0b, @AnyParam.as.Destroy.impl(%GenericInterface.type.0da, %GenericInterface.generic) [concrete]
  1962. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.d25: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%AnyParam.861) [concrete]
  1963. // CHECK:STDOUT: %T.as.Destroy.impl.Op.a41: %T.as.Destroy.impl.Op.type.d25 = struct_value () [concrete]
  1964. // CHECK:STDOUT: %ptr.1ef: type = ptr_type %AnyParam.861 [concrete]
  1965. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.a41, @T.as.Destroy.impl.Op(%AnyParam.861) [concrete]
  1966. // CHECK:STDOUT: }
  1967. // CHECK:STDOUT:
  1968. // CHECK:STDOUT: imports {
  1969. // CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
  1970. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1971. // CHECK:STDOUT: import Core//prelude
  1972. // CHECK:STDOUT: import Core//prelude/...
  1973. // CHECK:STDOUT: }
  1974. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [concrete] {
  1975. // CHECK:STDOUT: .AnyParam = %PackageHasParam.AnyParam
  1976. // CHECK:STDOUT: .Y = %PackageHasParam.Y
  1977. // CHECK:STDOUT: import PackageHasParam//default
  1978. // CHECK:STDOUT: }
  1979. // CHECK:STDOUT: %PackageGenericInterface: <namespace> = namespace file.%PackageGenericInterface.import, [concrete] {
  1980. // CHECK:STDOUT: .GenericInterface = %PackageGenericInterface.GenericInterface
  1981. // CHECK:STDOUT: import PackageGenericInterface//default
  1982. // CHECK:STDOUT: }
  1983. // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [concrete = constants.%AnyParam.generic]
  1984. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.1: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1985. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  1986. // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [concrete = constants.%complete_type.357]
  1987. // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst33 [no loc], unloaded
  1988. // CHECK:STDOUT: %PackageGenericInterface.GenericInterface: %GenericInterface.type.0da = import_ref PackageGenericInterface//default, GenericInterface, loaded [concrete = constants.%GenericInterface.generic]
  1989. // CHECK:STDOUT: %PackageGenericInterface.import_ref.5ab: type = import_ref PackageGenericInterface//default, loc6_28, loaded [symbolic = @GenericInterface.%U (constants.%U)]
  1990. // CHECK:STDOUT: %PackageGenericInterface.import_ref.c3b = import_ref PackageGenericInterface//default, inst29 [no loc], unloaded
  1991. // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
  1992. // CHECK:STDOUT: %PackageHasParam.import_ref.dc1 = import_ref PackageHasParam//default, inst93 [no loc], unloaded
  1993. // CHECK:STDOUT: %PackageHasParam.import_ref.f69: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.494]
  1994. // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded
  1995. // CHECK:STDOUT: %PackageHasParam.import_ref.ce2: %Y.K.type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%Y.K]
  1996. // CHECK:STDOUT: %PackageHasParam.import_ref.292: %Y.type = import_ref PackageHasParam//default, inst93 [no loc], loaded [symbolic = constants.%Self.f64]
  1997. // CHECK:STDOUT: %PackageHasParam.import_ref.9da = import_ref PackageHasParam//default, loc4_33, unloaded
  1998. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.2: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  1999. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2000. // CHECK:STDOUT: %PackageHasParam.import_ref.758: type = import_ref PackageHasParam//default, inst33 [no loc], loaded [symbolic = constants.%AnyParam.560]
  2001. // CHECK:STDOUT: %PackageHasParam.import_ref.cb9: type = import_ref PackageHasParam//default, inst36 [no loc], loaded [concrete = constants.%Destroy.type]
  2002. // CHECK:STDOUT: %PackageHasParam.import_ref.ba8 = import_ref PackageHasParam//default, loc4_33, unloaded
  2003. // CHECK:STDOUT: %Destroy.impl_witness_table.f0b = impl_witness_table (%PackageHasParam.import_ref.ba8), @AnyParam.as.Destroy.impl [concrete]
  2004. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.3: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2005. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2006. // CHECK:STDOUT: %PackageGenericInterface.import_ref.53c: <witness> = import_ref PackageGenericInterface//default, loc8_70, loaded [concrete = constants.%Y.impl_witness]
  2007. // CHECK:STDOUT: %PackageGenericInterface.import_ref.321: type = import_ref PackageGenericInterface//default, loc8_47, loaded [concrete = constants.%AnyParam.861]
  2008. // CHECK:STDOUT: %PackageGenericInterface.import_ref.ca6: type = import_ref PackageGenericInterface//default, loc8_67, loaded [concrete = constants.%Y.type]
  2009. // CHECK:STDOUT: %PackageGenericInterface.import_ref.456: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericInterface//default, loc9_22, loaded [concrete = constants.%AnyParam.as.Y.impl.K]
  2010. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericInterface.import_ref.456), @AnyParam.as.Y.impl [concrete]
  2011. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  2012. // CHECK:STDOUT: }
  2013. // CHECK:STDOUT:
  2014. // CHECK:STDOUT: file {
  2015. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2016. // CHECK:STDOUT: .Core = imports.%Core.ece
  2017. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  2018. // CHECK:STDOUT: .PackageGenericInterface = imports.%PackageGenericInterface
  2019. // CHECK:STDOUT: .M = %M.decl
  2020. // CHECK:STDOUT: }
  2021. // CHECK:STDOUT: %Core.import = import Core
  2022. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  2023. // CHECK:STDOUT: %PackageGenericInterface.import = import PackageGenericInterface
  2024. // CHECK:STDOUT: %M.decl: %M.type = fn_decl @M [concrete = constants.%M] {} {}
  2025. // CHECK:STDOUT: }
  2026. // CHECK:STDOUT:
  2027. // CHECK:STDOUT: generic interface @GenericInterface(imports.%PackageGenericInterface.import_ref.5ab: type) [from "has_generic_interface.carbon"] {
  2028. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2029. // CHECK:STDOUT:
  2030. // CHECK:STDOUT: !definition:
  2031. // CHECK:STDOUT: %GenericInterface.type: type = facet_type <@GenericInterface, @GenericInterface(%U)> [symbolic = %GenericInterface.type (constants.%GenericInterface.type.138)]
  2032. // CHECK:STDOUT: %Self: @GenericInterface.%GenericInterface.type (%GenericInterface.type.138) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.13b)]
  2033. // CHECK:STDOUT:
  2034. // CHECK:STDOUT: interface {
  2035. // CHECK:STDOUT: !members:
  2036. // CHECK:STDOUT: .Self = imports.%PackageGenericInterface.import_ref.c3b
  2037. // CHECK:STDOUT: witness = ()
  2038. // CHECK:STDOUT: }
  2039. // CHECK:STDOUT: }
  2040. // CHECK:STDOUT:
  2041. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  2042. // CHECK:STDOUT: !members:
  2043. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.dc1
  2044. // CHECK:STDOUT: .K = imports.%PackageHasParam.import_ref.f69
  2045. // CHECK:STDOUT: witness = (imports.%PackageHasParam.K)
  2046. // CHECK:STDOUT: }
  2047. // CHECK:STDOUT:
  2048. // 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"] {
  2049. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2050. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2051. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.f0b, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.7ff)]
  2052. // CHECK:STDOUT:
  2053. // CHECK:STDOUT: !definition:
  2054. // 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)]
  2055. // 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)]
  2056. // CHECK:STDOUT:
  2057. // CHECK:STDOUT: impl: imports.%PackageHasParam.import_ref.758 as imports.%PackageHasParam.import_ref.cb9 {
  2058. // CHECK:STDOUT: !members:
  2059. // CHECK:STDOUT: witness = imports.%PackageHasParam.import_ref.9da
  2060. // CHECK:STDOUT: }
  2061. // CHECK:STDOUT: }
  2062. // CHECK:STDOUT:
  2063. // CHECK:STDOUT: impl @AnyParam.as.Y.impl: imports.%PackageGenericInterface.import_ref.321 as imports.%PackageGenericInterface.import_ref.ca6 [from "has_generic_interface.carbon"] {
  2064. // CHECK:STDOUT: !members:
  2065. // CHECK:STDOUT: witness = imports.%PackageGenericInterface.import_ref.53c
  2066. // CHECK:STDOUT: }
  2067. // CHECK:STDOUT:
  2068. // 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"] {
  2069. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2070. // CHECK:STDOUT: %X: @AnyParam.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2071. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  2072. // CHECK:STDOUT:
  2073. // CHECK:STDOUT: !definition:
  2074. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  2075. // CHECK:STDOUT:
  2076. // CHECK:STDOUT: class {
  2077. // CHECK:STDOUT: complete_type_witness = imports.%PackageHasParam.import_ref.8f2
  2078. // CHECK:STDOUT:
  2079. // CHECK:STDOUT: !members:
  2080. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.601
  2081. // CHECK:STDOUT: }
  2082. // CHECK:STDOUT: }
  2083. // CHECK:STDOUT:
  2084. // CHECK:STDOUT: fn @M() {
  2085. // CHECK:STDOUT: !entry:
  2086. // CHECK:STDOUT: name_binding_decl {
  2087. // CHECK:STDOUT: %obj.patt: %pattern_type.3ad = binding_pattern obj [concrete]
  2088. // CHECK:STDOUT: %obj.var_patt: %pattern_type.3ad = var_pattern %obj.patt [concrete]
  2089. // CHECK:STDOUT: }
  2090. // CHECK:STDOUT: %obj.var: ref %AnyParam.861 = var %obj.var_patt
  2091. // CHECK:STDOUT: %.loc9_50.1: %empty_struct_type = struct_literal ()
  2092. // CHECK:STDOUT: %.loc9_50.2: init %AnyParam.861 = class_init (), %obj.var [concrete = constants.%AnyParam.val]
  2093. // CHECK:STDOUT: %.loc8: init %AnyParam.861 = converted %.loc9_50.1, %.loc9_50.2 [concrete = constants.%AnyParam.val]
  2094. // CHECK:STDOUT: assign %obj.var, %.loc8
  2095. // CHECK:STDOUT: %.loc9_45: type = splice_block %AnyParam [concrete = constants.%AnyParam.861] {
  2096. // CHECK:STDOUT: %PackageHasParam.ref.loc8: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2097. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  2098. // CHECK:STDOUT: %PackageGenericInterface.ref: <namespace> = name_ref PackageGenericInterface, imports.%PackageGenericInterface [concrete = imports.%PackageGenericInterface]
  2099. // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.0da = name_ref GenericInterface, imports.%PackageGenericInterface.GenericInterface [concrete = constants.%GenericInterface.generic]
  2100. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.0da, constants.%GenericInterface.generic) [concrete = constants.%AnyParam.861]
  2101. // CHECK:STDOUT: }
  2102. // CHECK:STDOUT: %obj: ref %AnyParam.861 = bind_name obj, %obj.var
  2103. // CHECK:STDOUT: %obj.ref: ref %AnyParam.861 = name_ref obj, %obj
  2104. // CHECK:STDOUT: %PackageHasParam.ref.loc10: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2105. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  2106. // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.f69 [concrete = constants.%assoc0.494]
  2107. // CHECK:STDOUT: %impl.elem0: %.e17 = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K]
  2108. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %obj.ref, %impl.elem0
  2109. // CHECK:STDOUT: %.loc10: %AnyParam.861 = bind_value %obj.ref
  2110. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method.loc10(%.loc10)
  2111. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %obj.var, constants.%T.as.Destroy.impl.Op.a41
  2112. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.a41, @T.as.Destroy.impl.Op(constants.%AnyParam.861) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  2113. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %obj.var, %T.as.Destroy.impl.Op.specific_fn
  2114. // CHECK:STDOUT: %addr: %ptr.1ef = addr_of %obj.var
  2115. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8(%addr)
  2116. // CHECK:STDOUT: return
  2117. // CHECK:STDOUT: }
  2118. // CHECK:STDOUT:
  2119. // CHECK:STDOUT: generic fn @Y.K(imports.%PackageHasParam.import_ref.292: %Y.type) [from "has_param.carbon"] {
  2120. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.f64)]
  2121. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.61d)]
  2122. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.cb4)]
  2123. // CHECK:STDOUT:
  2124. // CHECK:STDOUT: !definition:
  2125. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.b14)]
  2126. // CHECK:STDOUT:
  2127. // CHECK:STDOUT: fn;
  2128. // CHECK:STDOUT: }
  2129. // CHECK:STDOUT:
  2130. // 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"] {
  2131. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2132. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2133. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  2134. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.4a9)]
  2135. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.84c)]
  2136. // CHECK:STDOUT:
  2137. // CHECK:STDOUT: !definition:
  2138. // CHECK:STDOUT:
  2139. // CHECK:STDOUT: fn = "no_op";
  2140. // CHECK:STDOUT: }
  2141. // CHECK:STDOUT:
  2142. // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K [from "has_generic_interface.carbon"];
  2143. // CHECK:STDOUT:
  2144. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  2145. // CHECK:STDOUT: %T => constants.%T
  2146. // CHECK:STDOUT: %X => constants.%X
  2147. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  2148. // CHECK:STDOUT: }
  2149. // CHECK:STDOUT:
  2150. // CHECK:STDOUT: specific @GenericInterface(constants.%U) {
  2151. // CHECK:STDOUT: %U => constants.%U
  2152. // CHECK:STDOUT: }
  2153. // CHECK:STDOUT:
  2154. // CHECK:STDOUT: specific @AnyParam(constants.%GenericInterface.type.0da, constants.%GenericInterface.generic) {
  2155. // CHECK:STDOUT: %T => constants.%GenericInterface.type.0da
  2156. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  2157. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a64
  2158. // CHECK:STDOUT:
  2159. // CHECK:STDOUT: !definition:
  2160. // CHECK:STDOUT: %require_complete => constants.%complete_type.42f
  2161. // CHECK:STDOUT: }
  2162. // CHECK:STDOUT:
  2163. // CHECK:STDOUT: specific @Y.K(constants.%Self.f64) {
  2164. // CHECK:STDOUT: %Self => constants.%Self.f64
  2165. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.61d
  2166. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb4
  2167. // CHECK:STDOUT: }
  2168. // CHECK:STDOUT:
  2169. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  2170. // CHECK:STDOUT: %T => constants.%T
  2171. // CHECK:STDOUT: %X => constants.%X
  2172. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.7ff
  2173. // CHECK:STDOUT: }
  2174. // CHECK:STDOUT:
  2175. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  2176. // CHECK:STDOUT: %T => constants.%T
  2177. // CHECK:STDOUT: %X => constants.%X
  2178. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  2179. // CHECK:STDOUT: %ptr => constants.%ptr.4a9
  2180. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.84c
  2181. // CHECK:STDOUT: }
  2182. // CHECK:STDOUT:
  2183. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%GenericInterface.type.0da, constants.%GenericInterface.generic) {
  2184. // CHECK:STDOUT: %T => constants.%GenericInterface.type.0da
  2185. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  2186. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.ae4
  2187. // CHECK:STDOUT: }
  2188. // CHECK:STDOUT:
  2189. // CHECK:STDOUT: --- has_generic_class.carbon
  2190. // CHECK:STDOUT:
  2191. // CHECK:STDOUT: constants {
  2192. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  2193. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  2194. // CHECK:STDOUT: %GenericClass.type: type = generic_class_type @GenericClass [concrete]
  2195. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2196. // CHECK:STDOUT: %GenericClass.generic: %GenericClass.type = struct_value () [concrete]
  2197. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic]
  2198. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  2199. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  2200. // CHECK:STDOUT: %Destroy.impl_witness.633: <witness> = impl_witness @GenericClass.%Destroy.impl_witness_table, @GenericClass.as.Destroy.impl(%U) [symbolic]
  2201. // CHECK:STDOUT: %ptr.b1a: type = ptr_type %GenericClass [symbolic]
  2202. // CHECK:STDOUT: %pattern_type.0e2: type = pattern_type %ptr.b1a [symbolic]
  2203. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op.type: type = fn_type @GenericClass.as.Destroy.impl.Op, @GenericClass.as.Destroy.impl(%U) [symbolic]
  2204. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op: %GenericClass.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2205. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2206. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  2207. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  2208. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  2209. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  2210. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  2211. // CHECK:STDOUT: %AnyParam.560: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  2212. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  2213. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  2214. // CHECK:STDOUT: %pattern_type.17e: type = pattern_type %GenericClass.type [concrete]
  2215. // CHECK:STDOUT: %AnyParam.0dd: type = class_type @AnyParam, @AnyParam(%GenericClass.type, %GenericClass.generic) [concrete]
  2216. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  2217. // CHECK:STDOUT: %Self.f64: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  2218. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  2219. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  2220. // CHECK:STDOUT: %Self.as_type.61d: type = facet_access_type %Self.f64 [symbolic]
  2221. // CHECK:STDOUT: %pattern_type.cb4: type = pattern_type %Self.as_type.61d [symbolic]
  2222. // CHECK:STDOUT: %require_complete.b14: <witness> = require_complete_type %Self.as_type.61d [symbolic]
  2223. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table [concrete]
  2224. // CHECK:STDOUT: %pattern_type.64f: type = pattern_type %AnyParam.0dd [concrete]
  2225. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
  2226. // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]
  2227. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.0dd, (%Y.impl_witness) [concrete]
  2228. // CHECK:STDOUT: %complete_type.398: <witness> = complete_type_witness %GenericClass.type [concrete]
  2229. // CHECK:STDOUT: %L.type: type = fn_type @L [concrete]
  2230. // CHECK:STDOUT: %L: %L.type = struct_value () [concrete]
  2231. // CHECK:STDOUT: %AnyParam.val: %AnyParam.0dd = struct_value () [concrete]
  2232. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  2233. // CHECK:STDOUT: %assoc0.494: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [concrete]
  2234. // CHECK:STDOUT: %Destroy.impl_witness.2c3: <witness> = impl_witness imports.%Destroy.impl_witness_table.5b0, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  2235. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  2236. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: %AnyParam.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2237. // CHECK:STDOUT: %ptr.4a9: type = ptr_type %AnyParam.560 [symbolic]
  2238. // CHECK:STDOUT: %pattern_type.84c: type = pattern_type %ptr.4a9 [symbolic]
  2239. // CHECK:STDOUT: %.701: type = fn_type_with_self_type %Y.K.type, %Y.facet [concrete]
  2240. // CHECK:STDOUT: %Destroy.impl_witness.105: <witness> = impl_witness imports.%Destroy.impl_witness_table.5b0, @AnyParam.as.Destroy.impl(%GenericClass.type, %GenericClass.generic) [concrete]
  2241. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.f56: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%AnyParam.0dd) [concrete]
  2242. // CHECK:STDOUT: %T.as.Destroy.impl.Op.1fa: %T.as.Destroy.impl.Op.type.f56 = struct_value () [concrete]
  2243. // CHECK:STDOUT: %ptr.d96: type = ptr_type %AnyParam.0dd [concrete]
  2244. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.1fa, @T.as.Destroy.impl.Op(%AnyParam.0dd) [concrete]
  2245. // CHECK:STDOUT: }
  2246. // CHECK:STDOUT:
  2247. // CHECK:STDOUT: imports {
  2248. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2249. // CHECK:STDOUT: .Destroy = %Core.Destroy
  2250. // CHECK:STDOUT: import Core//prelude
  2251. // CHECK:STDOUT: import Core//prelude/...
  2252. // CHECK:STDOUT: }
  2253. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [concrete] {
  2254. // CHECK:STDOUT: .AnyParam = %PackageHasParam.AnyParam
  2255. // CHECK:STDOUT: .Y = %PackageHasParam.Y
  2256. // CHECK:STDOUT: import PackageHasParam//default
  2257. // CHECK:STDOUT: }
  2258. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  2259. // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [concrete = constants.%AnyParam.generic]
  2260. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.1: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2261. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2262. // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [concrete = constants.%complete_type.357]
  2263. // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst33 [no loc], unloaded
  2264. // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
  2265. // CHECK:STDOUT: %PackageHasParam.import_ref.dc1 = import_ref PackageHasParam//default, inst93 [no loc], unloaded
  2266. // CHECK:STDOUT: %PackageHasParam.import_ref.f69: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.494]
  2267. // CHECK:STDOUT: %PackageHasParam.K: %Y.K.type = import_ref PackageHasParam//default, K, loaded [concrete = constants.%Y.K]
  2268. // CHECK:STDOUT: %PackageHasParam.import_ref.292: %Y.type = import_ref PackageHasParam//default, inst93 [no loc], loaded [symbolic = constants.%Self.f64]
  2269. // CHECK:STDOUT: %PackageHasParam.import_ref.ce2: %Y.K.type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%Y.K]
  2270. // CHECK:STDOUT: %PackageHasParam.import_ref.9da = import_ref PackageHasParam//default, loc4_33, unloaded
  2271. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.2: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2272. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2273. // CHECK:STDOUT: %PackageHasParam.import_ref.758: type = import_ref PackageHasParam//default, inst33 [no loc], loaded [symbolic = constants.%AnyParam.560]
  2274. // CHECK:STDOUT: %PackageHasParam.import_ref.cb9: type = import_ref PackageHasParam//default, inst36 [no loc], loaded [concrete = constants.%Destroy.type]
  2275. // CHECK:STDOUT: %PackageHasParam.import_ref.ba8 = import_ref PackageHasParam//default, loc4_33, unloaded
  2276. // CHECK:STDOUT: %Destroy.impl_witness_table.5b0 = impl_witness_table (%PackageHasParam.import_ref.ba8), @AnyParam.as.Destroy.impl [concrete]
  2277. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.3: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2278. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2279. // CHECK:STDOUT: }
  2280. // CHECK:STDOUT:
  2281. // CHECK:STDOUT: file {
  2282. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2283. // CHECK:STDOUT: .Core = imports.%Core
  2284. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  2285. // CHECK:STDOUT: .GenericClass = %GenericClass.decl
  2286. // CHECK:STDOUT: .L = %L.decl
  2287. // CHECK:STDOUT: }
  2288. // CHECK:STDOUT: %Core.import = import Core
  2289. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  2290. // CHECK:STDOUT: %GenericClass.decl: %GenericClass.type = class_decl @GenericClass [concrete = constants.%GenericClass.generic] {
  2291. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  2292. // CHECK:STDOUT: } {
  2293. // CHECK:STDOUT: %U.loc6_20.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_20.1 (constants.%U)]
  2294. // CHECK:STDOUT: }
  2295. // CHECK:STDOUT: impl_decl @AnyParam.as.Y.impl [concrete] {} {
  2296. // CHECK:STDOUT: %PackageHasParam.ref.loc8_6: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2297. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  2298. // CHECK:STDOUT: %GenericClass.ref: %GenericClass.type = name_ref GenericClass, file.%GenericClass.decl [concrete = constants.%GenericClass.generic]
  2299. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) [concrete = constants.%AnyParam.0dd]
  2300. // CHECK:STDOUT: %PackageHasParam.ref.loc8_48: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2301. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  2302. // CHECK:STDOUT: }
  2303. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (@AnyParam.as.Y.impl.%AnyParam.as.Y.impl.K.decl), @AnyParam.as.Y.impl [concrete]
  2304. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness]
  2305. // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [concrete = constants.%L] {} {}
  2306. // CHECK:STDOUT: }
  2307. // CHECK:STDOUT:
  2308. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  2309. // CHECK:STDOUT: !members:
  2310. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.dc1
  2311. // CHECK:STDOUT: .K = imports.%PackageHasParam.import_ref.f69
  2312. // CHECK:STDOUT: witness = (imports.%PackageHasParam.K)
  2313. // CHECK:STDOUT: }
  2314. // CHECK:STDOUT:
  2315. // CHECK:STDOUT: generic impl @GenericClass.as.Destroy.impl(@GenericClass.%U.loc6_20.2: type) {
  2316. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2317. // 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.633)]
  2318. // CHECK:STDOUT:
  2319. // CHECK:STDOUT: !definition:
  2320. // 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)]
  2321. // 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)]
  2322. // CHECK:STDOUT:
  2323. // CHECK:STDOUT: impl: constants.%GenericClass as constants.%Destroy.type {
  2324. // 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)] {
  2325. // CHECK:STDOUT: %self.patt: @GenericClass.as.Destroy.impl.Op.%pattern_type (%pattern_type.0e2) = binding_pattern self [concrete]
  2326. // CHECK:STDOUT: %self.param_patt: @GenericClass.as.Destroy.impl.Op.%pattern_type (%pattern_type.0e2) = value_param_pattern %self.patt, call_param0 [concrete]
  2327. // CHECK:STDOUT: %.loc6_30.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  2328. // CHECK:STDOUT: } {
  2329. // CHECK:STDOUT: %self.param: @GenericClass.as.Destroy.impl.Op.%ptr (%ptr.b1a) = value_param call_param0
  2330. // CHECK:STDOUT: %.loc6_30.2: type = splice_block %Self.ref [symbolic = %GenericClass (constants.%GenericClass)] {
  2331. // CHECK:STDOUT: %.loc6_30.3: type = specific_constant constants.%GenericClass, @GenericClass(constants.%U) [symbolic = %GenericClass (constants.%GenericClass)]
  2332. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_30.3 [symbolic = %GenericClass (constants.%GenericClass)]
  2333. // CHECK:STDOUT: }
  2334. // CHECK:STDOUT: %self: @GenericClass.as.Destroy.impl.Op.%ptr (%ptr.b1a) = bind_name self, %self.param
  2335. // CHECK:STDOUT: }
  2336. // CHECK:STDOUT:
  2337. // CHECK:STDOUT: !members:
  2338. // CHECK:STDOUT: .Op = %GenericClass.as.Destroy.impl.Op.decl
  2339. // CHECK:STDOUT: witness = @GenericClass.%Destroy.impl_witness
  2340. // CHECK:STDOUT: }
  2341. // CHECK:STDOUT: }
  2342. // CHECK:STDOUT:
  2343. // CHECK:STDOUT: impl @AnyParam.as.Y.impl: %AnyParam as %Y.ref {
  2344. // 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] {
  2345. // CHECK:STDOUT: %self.patt: %pattern_type.64f = binding_pattern self [concrete]
  2346. // CHECK:STDOUT: %self.param_patt: %pattern_type.64f = value_param_pattern %self.patt, call_param0 [concrete]
  2347. // CHECK:STDOUT: } {
  2348. // CHECK:STDOUT: %self.param: %AnyParam.0dd = value_param call_param0
  2349. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @AnyParam.as.Y.impl.%AnyParam [concrete = constants.%AnyParam.0dd]
  2350. // CHECK:STDOUT: %self: %AnyParam.0dd = bind_name self, %self.param
  2351. // CHECK:STDOUT: }
  2352. // CHECK:STDOUT:
  2353. // CHECK:STDOUT: !members:
  2354. // CHECK:STDOUT: .K = %AnyParam.as.Y.impl.K.decl
  2355. // CHECK:STDOUT: witness = file.%Y.impl_witness
  2356. // CHECK:STDOUT: }
  2357. // CHECK:STDOUT:
  2358. // 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"] {
  2359. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2360. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2361. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.5b0, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.2c3)]
  2362. // CHECK:STDOUT:
  2363. // CHECK:STDOUT: !definition:
  2364. // 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)]
  2365. // 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)]
  2366. // CHECK:STDOUT:
  2367. // CHECK:STDOUT: impl: imports.%PackageHasParam.import_ref.758 as imports.%PackageHasParam.import_ref.cb9 {
  2368. // CHECK:STDOUT: !members:
  2369. // CHECK:STDOUT: witness = imports.%PackageHasParam.import_ref.9da
  2370. // CHECK:STDOUT: }
  2371. // CHECK:STDOUT: }
  2372. // CHECK:STDOUT:
  2373. // CHECK:STDOUT: generic class @GenericClass(%U.loc6_20.2: type) {
  2374. // CHECK:STDOUT: %U.loc6_20.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_20.1 (constants.%U)]
  2375. // CHECK:STDOUT:
  2376. // CHECK:STDOUT: !definition:
  2377. // CHECK:STDOUT:
  2378. // CHECK:STDOUT: class {
  2379. // CHECK:STDOUT: impl_decl @GenericClass.as.Destroy.impl [concrete] {} {}
  2380. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@GenericClass.as.Destroy.impl.%GenericClass.as.Destroy.impl.Op.decl), @GenericClass.as.Destroy.impl [concrete]
  2381. // 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.633)]
  2382. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  2383. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  2384. // CHECK:STDOUT: complete_type_witness = %complete_type
  2385. // CHECK:STDOUT:
  2386. // CHECK:STDOUT: !members:
  2387. // CHECK:STDOUT: .Self = constants.%GenericClass
  2388. // CHECK:STDOUT: }
  2389. // CHECK:STDOUT: }
  2390. // CHECK:STDOUT:
  2391. // 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"] {
  2392. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2393. // CHECK:STDOUT: %X: @AnyParam.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2394. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  2395. // CHECK:STDOUT:
  2396. // CHECK:STDOUT: !definition:
  2397. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  2398. // CHECK:STDOUT:
  2399. // CHECK:STDOUT: class {
  2400. // CHECK:STDOUT: complete_type_witness = imports.%PackageHasParam.import_ref.8f2
  2401. // CHECK:STDOUT:
  2402. // CHECK:STDOUT: !members:
  2403. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.601
  2404. // CHECK:STDOUT: }
  2405. // CHECK:STDOUT: }
  2406. // CHECK:STDOUT:
  2407. // CHECK:STDOUT: generic fn @GenericClass.as.Destroy.impl.Op(@GenericClass.%U.loc6_20.2: type) {
  2408. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2409. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic = %GenericClass (constants.%GenericClass)]
  2410. // CHECK:STDOUT: %ptr: type = ptr_type %GenericClass [symbolic = %ptr (constants.%ptr.b1a)]
  2411. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.0e2)]
  2412. // CHECK:STDOUT:
  2413. // CHECK:STDOUT: !definition:
  2414. // CHECK:STDOUT:
  2415. // CHECK:STDOUT: fn(%self.param: @GenericClass.as.Destroy.impl.Op.%ptr (%ptr.b1a)) = "no_op";
  2416. // CHECK:STDOUT: }
  2417. // CHECK:STDOUT:
  2418. // CHECK:STDOUT: generic fn @Y.K(imports.%PackageHasParam.import_ref.292: %Y.type) [from "has_param.carbon"] {
  2419. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.f64)]
  2420. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.61d)]
  2421. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.cb4)]
  2422. // CHECK:STDOUT:
  2423. // CHECK:STDOUT: !definition:
  2424. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.b14)]
  2425. // CHECK:STDOUT:
  2426. // CHECK:STDOUT: fn;
  2427. // CHECK:STDOUT: }
  2428. // CHECK:STDOUT:
  2429. // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K(%self.param: %AnyParam.0dd) {
  2430. // CHECK:STDOUT: !entry:
  2431. // CHECK:STDOUT: return
  2432. // CHECK:STDOUT: }
  2433. // CHECK:STDOUT:
  2434. // CHECK:STDOUT: fn @L() {
  2435. // CHECK:STDOUT: !entry:
  2436. // CHECK:STDOUT: name_binding_decl {
  2437. // CHECK:STDOUT: %obj.patt: %pattern_type.64f = binding_pattern obj [concrete]
  2438. // CHECK:STDOUT: %obj.var_patt: %pattern_type.64f = var_pattern %obj.patt [concrete]
  2439. // CHECK:STDOUT: }
  2440. // CHECK:STDOUT: %obj.var: ref %AnyParam.0dd = var %obj.var_patt
  2441. // CHECK:STDOUT: %.loc13_54.1: %empty_struct_type = struct_literal ()
  2442. // CHECK:STDOUT: %.loc13_54.2: init %AnyParam.0dd = class_init (), %obj.var [concrete = constants.%AnyParam.val]
  2443. // CHECK:STDOUT: %.loc13_3: init %AnyParam.0dd = converted %.loc13_54.1, %.loc13_54.2 [concrete = constants.%AnyParam.val]
  2444. // CHECK:STDOUT: assign %obj.var, %.loc13_3
  2445. // CHECK:STDOUT: %.loc13_49: type = splice_block %AnyParam [concrete = constants.%AnyParam.0dd] {
  2446. // CHECK:STDOUT: %PackageHasParam.ref.loc13: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2447. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  2448. // CHECK:STDOUT: %GenericClass.ref: %GenericClass.type = name_ref GenericClass, file.%GenericClass.decl [concrete = constants.%GenericClass.generic]
  2449. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) [concrete = constants.%AnyParam.0dd]
  2450. // CHECK:STDOUT: }
  2451. // CHECK:STDOUT: %obj: ref %AnyParam.0dd = bind_name obj, %obj.var
  2452. // CHECK:STDOUT: %obj.ref: ref %AnyParam.0dd = name_ref obj, %obj
  2453. // CHECK:STDOUT: %PackageHasParam.ref.loc14: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2454. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  2455. // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.f69 [concrete = constants.%assoc0.494]
  2456. // CHECK:STDOUT: %impl.elem0: %.701 = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K]
  2457. // CHECK:STDOUT: %bound_method.loc14: <bound method> = bound_method %obj.ref, %impl.elem0
  2458. // CHECK:STDOUT: %.loc14: %AnyParam.0dd = bind_value %obj.ref
  2459. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method.loc14(%.loc14)
  2460. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %obj.var, constants.%T.as.Destroy.impl.Op.1fa
  2461. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.1fa, @T.as.Destroy.impl.Op(constants.%AnyParam.0dd) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  2462. // CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %obj.var, %T.as.Destroy.impl.Op.specific_fn
  2463. // CHECK:STDOUT: %addr: %ptr.d96 = addr_of %obj.var
  2464. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc13(%addr)
  2465. // CHECK:STDOUT: return
  2466. // CHECK:STDOUT: }
  2467. // CHECK:STDOUT:
  2468. // 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"] {
  2469. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2470. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2471. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  2472. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.4a9)]
  2473. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.84c)]
  2474. // CHECK:STDOUT:
  2475. // CHECK:STDOUT: !definition:
  2476. // CHECK:STDOUT:
  2477. // CHECK:STDOUT: fn = "no_op";
  2478. // CHECK:STDOUT: }
  2479. // CHECK:STDOUT:
  2480. // CHECK:STDOUT: specific @GenericClass(constants.%U) {
  2481. // CHECK:STDOUT: %U.loc6_20.1 => constants.%U
  2482. // CHECK:STDOUT: }
  2483. // CHECK:STDOUT:
  2484. // CHECK:STDOUT: specific @GenericClass.as.Destroy.impl(constants.%U) {
  2485. // CHECK:STDOUT: %U => constants.%U
  2486. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.633
  2487. // CHECK:STDOUT: }
  2488. // CHECK:STDOUT:
  2489. // CHECK:STDOUT: specific @GenericClass.as.Destroy.impl.Op(constants.%U) {
  2490. // CHECK:STDOUT: %U => constants.%U
  2491. // CHECK:STDOUT: %GenericClass => constants.%GenericClass
  2492. // CHECK:STDOUT: %ptr => constants.%ptr.b1a
  2493. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.0e2
  2494. // CHECK:STDOUT: }
  2495. // CHECK:STDOUT:
  2496. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  2497. // CHECK:STDOUT: %T => constants.%T
  2498. // CHECK:STDOUT: %X => constants.%X
  2499. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  2500. // CHECK:STDOUT: }
  2501. // CHECK:STDOUT:
  2502. // CHECK:STDOUT: specific @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2503. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2504. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2505. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.17e
  2506. // CHECK:STDOUT:
  2507. // CHECK:STDOUT: !definition:
  2508. // CHECK:STDOUT: %require_complete => constants.%complete_type.398
  2509. // CHECK:STDOUT: }
  2510. // CHECK:STDOUT:
  2511. // CHECK:STDOUT: specific @Y.K(constants.%Self.f64) {
  2512. // CHECK:STDOUT: %Self => constants.%Self.f64
  2513. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.61d
  2514. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb4
  2515. // CHECK:STDOUT: }
  2516. // CHECK:STDOUT:
  2517. // CHECK:STDOUT: specific @Y.K(constants.%Y.facet) {
  2518. // CHECK:STDOUT: %Self => constants.%Y.facet
  2519. // CHECK:STDOUT: %Self.as_type => constants.%AnyParam.0dd
  2520. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.64f
  2521. // CHECK:STDOUT: }
  2522. // CHECK:STDOUT:
  2523. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  2524. // CHECK:STDOUT: %T => constants.%T
  2525. // CHECK:STDOUT: %X => constants.%X
  2526. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.2c3
  2527. // CHECK:STDOUT: }
  2528. // CHECK:STDOUT:
  2529. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  2530. // CHECK:STDOUT: %T => constants.%T
  2531. // CHECK:STDOUT: %X => constants.%X
  2532. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  2533. // CHECK:STDOUT: %ptr => constants.%ptr.4a9
  2534. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.84c
  2535. // CHECK:STDOUT: }
  2536. // CHECK:STDOUT:
  2537. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2538. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2539. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2540. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.105
  2541. // CHECK:STDOUT: }
  2542. // CHECK:STDOUT:
  2543. // CHECK:STDOUT: --- use_generic_class_as_param.carbon
  2544. // CHECK:STDOUT:
  2545. // CHECK:STDOUT: constants {
  2546. // CHECK:STDOUT: %M.type: type = fn_type @M [concrete]
  2547. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2548. // CHECK:STDOUT: %M: %M.type = struct_value () [concrete]
  2549. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [concrete]
  2550. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [concrete]
  2551. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2552. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  2553. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  2554. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  2555. // CHECK:STDOUT: %AnyParam.560: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  2556. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  2557. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  2558. // CHECK:STDOUT: %GenericClass.type: type = generic_class_type @GenericClass [concrete]
  2559. // CHECK:STDOUT: %GenericClass.generic: %GenericClass.type = struct_value () [concrete]
  2560. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  2561. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic]
  2562. // CHECK:STDOUT: %pattern_type.17a: type = pattern_type %GenericClass.type [concrete]
  2563. // CHECK:STDOUT: %AnyParam.d71: type = class_type @AnyParam, @AnyParam(%GenericClass.type, %GenericClass.generic) [concrete]
  2564. // CHECK:STDOUT: %complete_type.426: <witness> = complete_type_witness %GenericClass.type [concrete]
  2565. // CHECK:STDOUT: %pattern_type.312: type = pattern_type %AnyParam.d71 [concrete]
  2566. // CHECK:STDOUT: %AnyParam.val: %AnyParam.d71 = struct_value () [concrete]
  2567. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  2568. // CHECK:STDOUT: %Self.f64: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  2569. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  2570. // CHECK:STDOUT: %assoc0.494: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ce2 [concrete]
  2571. // CHECK:STDOUT: %Y.K.type: type = fn_type @Y.K [concrete]
  2572. // CHECK:STDOUT: %Y.K: %Y.K.type = struct_value () [concrete]
  2573. // CHECK:STDOUT: %Self.as_type.61d: type = facet_access_type %Self.f64 [symbolic]
  2574. // CHECK:STDOUT: %pattern_type.cb4: type = pattern_type %Self.as_type.61d [symbolic]
  2575. // CHECK:STDOUT: %require_complete.b14: <witness> = require_complete_type %Self.as_type.61d [symbolic]
  2576. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  2577. // CHECK:STDOUT: %Destroy.impl_witness.7ff: <witness> = impl_witness imports.%Destroy.impl_witness_table.f0b, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  2578. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op.type: type = fn_type @AnyParam.as.Destroy.impl.Op, @AnyParam.as.Destroy.impl(%T, %X) [symbolic]
  2579. // CHECK:STDOUT: %AnyParam.as.Destroy.impl.Op: %AnyParam.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2580. // CHECK:STDOUT: %ptr.4a9: type = ptr_type %AnyParam.560 [symbolic]
  2581. // CHECK:STDOUT: %pattern_type.84c: type = pattern_type %ptr.4a9 [symbolic]
  2582. // CHECK:STDOUT: %Destroy.impl_witness.4c0: <witness> = impl_witness imports.%Destroy.impl_witness_table.c53, @GenericClass.as.Destroy.impl(%U) [symbolic]
  2583. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op.type: type = fn_type @GenericClass.as.Destroy.impl.Op, @GenericClass.as.Destroy.impl(%U) [symbolic]
  2584. // CHECK:STDOUT: %GenericClass.as.Destroy.impl.Op: %GenericClass.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2585. // CHECK:STDOUT: %ptr.d95: type = ptr_type %GenericClass [symbolic]
  2586. // CHECK:STDOUT: %pattern_type.327: type = pattern_type %ptr.d95 [symbolic]
  2587. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness imports.%Y.impl_witness_table [concrete]
  2588. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.d71, (%Y.impl_witness) [concrete]
  2589. // CHECK:STDOUT: %.0dd: type = fn_type_with_self_type %Y.K.type, %Y.facet [concrete]
  2590. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete]
  2591. // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete]
  2592. // CHECK:STDOUT: %Destroy.impl_witness.339: <witness> = impl_witness imports.%Destroy.impl_witness_table.f0b, @AnyParam.as.Destroy.impl(%GenericClass.type, %GenericClass.generic) [concrete]
  2593. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.ce0: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%AnyParam.d71) [concrete]
  2594. // CHECK:STDOUT: %T.as.Destroy.impl.Op.07d: %T.as.Destroy.impl.Op.type.ce0 = struct_value () [concrete]
  2595. // CHECK:STDOUT: %ptr.8ee: type = ptr_type %AnyParam.d71 [concrete]
  2596. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.07d, @T.as.Destroy.impl.Op(%AnyParam.d71) [concrete]
  2597. // CHECK:STDOUT: }
  2598. // CHECK:STDOUT:
  2599. // CHECK:STDOUT: imports {
  2600. // CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
  2601. // CHECK:STDOUT: .Destroy = %Core.Destroy
  2602. // CHECK:STDOUT: import Core//prelude
  2603. // CHECK:STDOUT: import Core//prelude/...
  2604. // CHECK:STDOUT: }
  2605. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [concrete] {
  2606. // CHECK:STDOUT: .AnyParam = %PackageHasParam.AnyParam
  2607. // CHECK:STDOUT: .Y = %PackageHasParam.Y
  2608. // CHECK:STDOUT: import PackageHasParam//default
  2609. // CHECK:STDOUT: }
  2610. // CHECK:STDOUT: %PackageGenericClass: <namespace> = namespace file.%PackageGenericClass.import, [concrete] {
  2611. // CHECK:STDOUT: .GenericClass = %PackageGenericClass.GenericClass
  2612. // CHECK:STDOUT: import PackageGenericClass//default
  2613. // CHECK:STDOUT: }
  2614. // CHECK:STDOUT: %PackageHasParam.AnyParam: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [concrete = constants.%AnyParam.generic]
  2615. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.1: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2616. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.1: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2617. // CHECK:STDOUT: %PackageHasParam.import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [concrete = constants.%complete_type.357]
  2618. // CHECK:STDOUT: %PackageHasParam.import_ref.601 = import_ref PackageHasParam//default, inst33 [no loc], unloaded
  2619. // CHECK:STDOUT: %PackageGenericClass.GenericClass: %GenericClass.type = import_ref PackageGenericClass//default, GenericClass, loaded [concrete = constants.%GenericClass.generic]
  2620. // CHECK:STDOUT: %PackageGenericClass.import_ref.5ab3ec.1: type = import_ref PackageGenericClass//default, loc6_20, loaded [symbolic = @GenericClass.%U (constants.%U)]
  2621. // CHECK:STDOUT: %PackageGenericClass.import_ref.8f2: <witness> = import_ref PackageGenericClass//default, loc6_31, loaded [concrete = constants.%complete_type.357]
  2622. // CHECK:STDOUT: %PackageGenericClass.import_ref.065 = import_ref PackageGenericClass//default, inst28 [no loc], unloaded
  2623. // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
  2624. // CHECK:STDOUT: %PackageHasParam.import_ref.dc1 = import_ref PackageHasParam//default, inst93 [no loc], unloaded
  2625. // CHECK:STDOUT: %PackageHasParam.import_ref.f69: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.494]
  2626. // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded
  2627. // CHECK:STDOUT: %PackageHasParam.import_ref.ce2: %Y.K.type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%Y.K]
  2628. // CHECK:STDOUT: %PackageHasParam.import_ref.292: %Y.type = import_ref PackageHasParam//default, inst93 [no loc], loaded [symbolic = constants.%Self.f64]
  2629. // CHECK:STDOUT: %PackageHasParam.import_ref.9da = import_ref PackageHasParam//default, loc4_33, unloaded
  2630. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.2: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2631. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.2: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2632. // CHECK:STDOUT: %PackageHasParam.import_ref.758: type = import_ref PackageHasParam//default, inst33 [no loc], loaded [symbolic = constants.%AnyParam.560]
  2633. // CHECK:STDOUT: %PackageHasParam.import_ref.cb9: type = import_ref PackageHasParam//default, inst36 [no loc], loaded [concrete = constants.%Destroy.type]
  2634. // CHECK:STDOUT: %PackageHasParam.import_ref.ba8 = import_ref PackageHasParam//default, loc4_33, unloaded
  2635. // CHECK:STDOUT: %Destroy.impl_witness_table.f0b = impl_witness_table (%PackageHasParam.import_ref.ba8), @AnyParam.as.Destroy.impl [concrete]
  2636. // CHECK:STDOUT: %PackageHasParam.import_ref.5ab3ec.3: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
  2637. // CHECK:STDOUT: %PackageHasParam.import_ref.34c075.3: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
  2638. // CHECK:STDOUT: %PackageGenericClass.import_ref.877 = import_ref PackageGenericClass//default, loc6_30, unloaded
  2639. // CHECK:STDOUT: %PackageGenericClass.import_ref.5ab3ec.2: type = import_ref PackageGenericClass//default, loc6_20, loaded [symbolic = @GenericClass.%U (constants.%U)]
  2640. // CHECK:STDOUT: %PackageGenericClass.import_ref.594: type = import_ref PackageGenericClass//default, inst28 [no loc], loaded [symbolic = constants.%GenericClass]
  2641. // CHECK:STDOUT: %PackageGenericClass.import_ref.cb9: type = import_ref PackageGenericClass//default, inst31 [no loc], loaded [concrete = constants.%Destroy.type]
  2642. // CHECK:STDOUT: %PackageGenericClass.import_ref.5f2 = import_ref PackageGenericClass//default, loc6_30, unloaded
  2643. // CHECK:STDOUT: %Destroy.impl_witness_table.c53 = impl_witness_table (%PackageGenericClass.import_ref.5f2), @GenericClass.as.Destroy.impl [concrete]
  2644. // CHECK:STDOUT: %PackageGenericClass.import_ref.5ab3ec.3: type = import_ref PackageGenericClass//default, loc6_20, loaded [symbolic = @GenericClass.%U (constants.%U)]
  2645. // CHECK:STDOUT: %PackageGenericClass.import_ref.246: <witness> = import_ref PackageGenericClass//default, loc8_66, loaded [concrete = constants.%Y.impl_witness]
  2646. // CHECK:STDOUT: %PackageGenericClass.import_ref.a0e: type = import_ref PackageGenericClass//default, loc8_43, loaded [concrete = constants.%AnyParam.d71]
  2647. // CHECK:STDOUT: %PackageGenericClass.import_ref.ca6: type = import_ref PackageGenericClass//default, loc8_63, loaded [concrete = constants.%Y.type]
  2648. // CHECK:STDOUT: %PackageGenericClass.import_ref.fbf: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericClass//default, loc9_22, loaded [concrete = constants.%AnyParam.as.Y.impl.K]
  2649. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericClass.import_ref.fbf), @AnyParam.as.Y.impl [concrete]
  2650. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  2651. // CHECK:STDOUT: }
  2652. // CHECK:STDOUT:
  2653. // CHECK:STDOUT: file {
  2654. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2655. // CHECK:STDOUT: .Core = imports.%Core.ece
  2656. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  2657. // CHECK:STDOUT: .PackageGenericClass = imports.%PackageGenericClass
  2658. // CHECK:STDOUT: .M = %M.decl
  2659. // CHECK:STDOUT: }
  2660. // CHECK:STDOUT: %Core.import = import Core
  2661. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  2662. // CHECK:STDOUT: %PackageGenericClass.import = import PackageGenericClass
  2663. // CHECK:STDOUT: %M.decl: %M.type = fn_decl @M [concrete = constants.%M] {} {}
  2664. // CHECK:STDOUT: }
  2665. // CHECK:STDOUT:
  2666. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  2667. // CHECK:STDOUT: !members:
  2668. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.dc1
  2669. // CHECK:STDOUT: .K = imports.%PackageHasParam.import_ref.f69
  2670. // CHECK:STDOUT: witness = (imports.%PackageHasParam.K)
  2671. // CHECK:STDOUT: }
  2672. // CHECK:STDOUT:
  2673. // 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"] {
  2674. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2675. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2676. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.f0b, @AnyParam.as.Destroy.impl(%T, %X) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.7ff)]
  2677. // CHECK:STDOUT:
  2678. // CHECK:STDOUT: !definition:
  2679. // 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)]
  2680. // 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)]
  2681. // CHECK:STDOUT:
  2682. // CHECK:STDOUT: impl: imports.%PackageHasParam.import_ref.758 as imports.%PackageHasParam.import_ref.cb9 {
  2683. // CHECK:STDOUT: !members:
  2684. // CHECK:STDOUT: witness = imports.%PackageHasParam.import_ref.9da
  2685. // CHECK:STDOUT: }
  2686. // CHECK:STDOUT: }
  2687. // CHECK:STDOUT:
  2688. // CHECK:STDOUT: generic impl @GenericClass.as.Destroy.impl(imports.%PackageGenericClass.import_ref.5ab3ec.2: type) [from "has_generic_class.carbon"] {
  2689. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2690. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table.c53, @GenericClass.as.Destroy.impl(%U) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.4c0)]
  2691. // CHECK:STDOUT:
  2692. // CHECK:STDOUT: !definition:
  2693. // 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)]
  2694. // 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)]
  2695. // CHECK:STDOUT:
  2696. // CHECK:STDOUT: impl: imports.%PackageGenericClass.import_ref.594 as imports.%PackageGenericClass.import_ref.cb9 {
  2697. // CHECK:STDOUT: !members:
  2698. // CHECK:STDOUT: witness = imports.%PackageGenericClass.import_ref.877
  2699. // CHECK:STDOUT: }
  2700. // CHECK:STDOUT: }
  2701. // CHECK:STDOUT:
  2702. // CHECK:STDOUT: impl @AnyParam.as.Y.impl: imports.%PackageGenericClass.import_ref.a0e as imports.%PackageGenericClass.import_ref.ca6 [from "has_generic_class.carbon"] {
  2703. // CHECK:STDOUT: !members:
  2704. // CHECK:STDOUT: witness = imports.%PackageGenericClass.import_ref.246
  2705. // CHECK:STDOUT: }
  2706. // CHECK:STDOUT:
  2707. // 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"] {
  2708. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2709. // CHECK:STDOUT: %X: @AnyParam.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2710. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  2711. // CHECK:STDOUT:
  2712. // CHECK:STDOUT: !definition:
  2713. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)]
  2714. // CHECK:STDOUT:
  2715. // CHECK:STDOUT: class {
  2716. // CHECK:STDOUT: complete_type_witness = imports.%PackageHasParam.import_ref.8f2
  2717. // CHECK:STDOUT:
  2718. // CHECK:STDOUT: !members:
  2719. // CHECK:STDOUT: .Self = imports.%PackageHasParam.import_ref.601
  2720. // CHECK:STDOUT: }
  2721. // CHECK:STDOUT: }
  2722. // CHECK:STDOUT:
  2723. // CHECK:STDOUT: generic class @GenericClass(imports.%PackageGenericClass.import_ref.5ab3ec.1: type) [from "has_generic_class.carbon"] {
  2724. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2725. // CHECK:STDOUT:
  2726. // CHECK:STDOUT: !definition:
  2727. // CHECK:STDOUT:
  2728. // CHECK:STDOUT: class {
  2729. // CHECK:STDOUT: complete_type_witness = imports.%PackageGenericClass.import_ref.8f2
  2730. // CHECK:STDOUT:
  2731. // CHECK:STDOUT: !members:
  2732. // CHECK:STDOUT: .Self = imports.%PackageGenericClass.import_ref.065
  2733. // CHECK:STDOUT: }
  2734. // CHECK:STDOUT: }
  2735. // CHECK:STDOUT:
  2736. // CHECK:STDOUT: fn @M() {
  2737. // CHECK:STDOUT: !entry:
  2738. // CHECK:STDOUT: name_binding_decl {
  2739. // CHECK:STDOUT: %obj.patt: %pattern_type.312 = binding_pattern obj [concrete]
  2740. // CHECK:STDOUT: %obj.var_patt: %pattern_type.312 = var_pattern %obj.patt [concrete]
  2741. // CHECK:STDOUT: }
  2742. // CHECK:STDOUT: %obj.var: ref %AnyParam.d71 = var %obj.var_patt
  2743. // CHECK:STDOUT: %.loc8_74.1: %empty_struct_type = struct_literal ()
  2744. // CHECK:STDOUT: %.loc8_74.2: init %AnyParam.d71 = class_init (), %obj.var [concrete = constants.%AnyParam.val]
  2745. // CHECK:STDOUT: %.loc8_3: init %AnyParam.d71 = converted %.loc8_74.1, %.loc8_74.2 [concrete = constants.%AnyParam.val]
  2746. // CHECK:STDOUT: assign %obj.var, %.loc8_3
  2747. // CHECK:STDOUT: %.loc8_69: type = splice_block %AnyParam [concrete = constants.%AnyParam.d71] {
  2748. // CHECK:STDOUT: %PackageHasParam.ref.loc8: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2749. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%PackageHasParam.AnyParam [concrete = constants.%AnyParam.generic]
  2750. // CHECK:STDOUT: %PackageGenericClass.ref: <namespace> = name_ref PackageGenericClass, imports.%PackageGenericClass [concrete = imports.%PackageGenericClass]
  2751. // CHECK:STDOUT: %GenericClass.ref: %GenericClass.type = name_ref GenericClass, imports.%PackageGenericClass.GenericClass [concrete = constants.%GenericClass.generic]
  2752. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) [concrete = constants.%AnyParam.d71]
  2753. // CHECK:STDOUT: }
  2754. // CHECK:STDOUT: %obj: ref %AnyParam.d71 = bind_name obj, %obj.var
  2755. // CHECK:STDOUT: %obj.ref: ref %AnyParam.d71 = name_ref obj, %obj
  2756. // CHECK:STDOUT: %PackageHasParam.ref.loc9: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam]
  2757. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type]
  2758. // CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.f69 [concrete = constants.%assoc0.494]
  2759. // CHECK:STDOUT: %impl.elem0: %.0dd = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K]
  2760. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %obj.ref, %impl.elem0
  2761. // CHECK:STDOUT: %.loc9: %AnyParam.d71 = bind_value %obj.ref
  2762. // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method.loc9(%.loc9)
  2763. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %obj.var, constants.%T.as.Destroy.impl.Op.07d
  2764. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.07d, @T.as.Destroy.impl.Op(constants.%AnyParam.d71) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  2765. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %obj.var, %T.as.Destroy.impl.Op.specific_fn
  2766. // CHECK:STDOUT: %addr: %ptr.8ee = addr_of %obj.var
  2767. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8(%addr)
  2768. // CHECK:STDOUT: return
  2769. // CHECK:STDOUT: }
  2770. // CHECK:STDOUT:
  2771. // CHECK:STDOUT: generic fn @Y.K(imports.%PackageHasParam.import_ref.292: %Y.type) [from "has_param.carbon"] {
  2772. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.f64)]
  2773. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.61d)]
  2774. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.cb4)]
  2775. // CHECK:STDOUT:
  2776. // CHECK:STDOUT: !definition:
  2777. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.b14)]
  2778. // CHECK:STDOUT:
  2779. // CHECK:STDOUT: fn;
  2780. // CHECK:STDOUT: }
  2781. // CHECK:STDOUT:
  2782. // 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"] {
  2783. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2784. // CHECK:STDOUT: %X: @AnyParam.as.Destroy.impl.Op.%T (%T) = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  2785. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic = %AnyParam (constants.%AnyParam.560)]
  2786. // CHECK:STDOUT: %ptr: type = ptr_type %AnyParam [symbolic = %ptr (constants.%ptr.4a9)]
  2787. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.84c)]
  2788. // CHECK:STDOUT:
  2789. // CHECK:STDOUT: !definition:
  2790. // CHECK:STDOUT:
  2791. // CHECK:STDOUT: fn = "no_op";
  2792. // CHECK:STDOUT: }
  2793. // CHECK:STDOUT:
  2794. // CHECK:STDOUT: generic fn @GenericClass.as.Destroy.impl.Op(imports.%PackageGenericClass.import_ref.5ab3ec.3: type) [from "has_generic_class.carbon"] {
  2795. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  2796. // CHECK:STDOUT: %GenericClass: type = class_type @GenericClass, @GenericClass(%U) [symbolic = %GenericClass (constants.%GenericClass)]
  2797. // CHECK:STDOUT: %ptr: type = ptr_type %GenericClass [symbolic = %ptr (constants.%ptr.d95)]
  2798. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.327)]
  2799. // CHECK:STDOUT:
  2800. // CHECK:STDOUT: !definition:
  2801. // CHECK:STDOUT:
  2802. // CHECK:STDOUT: fn = "no_op";
  2803. // CHECK:STDOUT: }
  2804. // CHECK:STDOUT:
  2805. // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K [from "has_generic_class.carbon"];
  2806. // CHECK:STDOUT:
  2807. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  2808. // CHECK:STDOUT: %T => constants.%T
  2809. // CHECK:STDOUT: %X => constants.%X
  2810. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  2811. // CHECK:STDOUT: }
  2812. // CHECK:STDOUT:
  2813. // CHECK:STDOUT: specific @GenericClass(constants.%U) {
  2814. // CHECK:STDOUT: %U => constants.%U
  2815. // CHECK:STDOUT: }
  2816. // CHECK:STDOUT:
  2817. // CHECK:STDOUT: specific @AnyParam(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2818. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2819. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2820. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.17a
  2821. // CHECK:STDOUT:
  2822. // CHECK:STDOUT: !definition:
  2823. // CHECK:STDOUT: %require_complete => constants.%complete_type.426
  2824. // CHECK:STDOUT: }
  2825. // CHECK:STDOUT:
  2826. // CHECK:STDOUT: specific @Y.K(constants.%Self.f64) {
  2827. // CHECK:STDOUT: %Self => constants.%Self.f64
  2828. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.61d
  2829. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb4
  2830. // CHECK:STDOUT: }
  2831. // CHECK:STDOUT:
  2832. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%T, constants.%X) {
  2833. // CHECK:STDOUT: %T => constants.%T
  2834. // CHECK:STDOUT: %X => constants.%X
  2835. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.7ff
  2836. // CHECK:STDOUT: }
  2837. // CHECK:STDOUT:
  2838. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl.Op(constants.%T, constants.%X) {
  2839. // CHECK:STDOUT: %T => constants.%T
  2840. // CHECK:STDOUT: %X => constants.%X
  2841. // CHECK:STDOUT: %AnyParam => constants.%AnyParam.560
  2842. // CHECK:STDOUT: %ptr => constants.%ptr.4a9
  2843. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.84c
  2844. // CHECK:STDOUT: }
  2845. // CHECK:STDOUT:
  2846. // CHECK:STDOUT: specific @GenericClass.as.Destroy.impl(constants.%U) {
  2847. // CHECK:STDOUT: %U => constants.%U
  2848. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.4c0
  2849. // CHECK:STDOUT: }
  2850. // CHECK:STDOUT:
  2851. // CHECK:STDOUT: specific @GenericClass.as.Destroy.impl.Op(constants.%U) {
  2852. // CHECK:STDOUT: %U => constants.%U
  2853. // CHECK:STDOUT: %GenericClass => constants.%GenericClass
  2854. // CHECK:STDOUT: %ptr => constants.%ptr.d95
  2855. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.327
  2856. // CHECK:STDOUT: }
  2857. // CHECK:STDOUT:
  2858. // CHECK:STDOUT: specific @AnyParam.as.Destroy.impl(constants.%GenericClass.type, constants.%GenericClass.generic) {
  2859. // CHECK:STDOUT: %T => constants.%GenericClass.type
  2860. // CHECK:STDOUT: %X => constants.%GenericClass.generic
  2861. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.339
  2862. // CHECK:STDOUT: }
  2863. // CHECK:STDOUT:
  2864. // CHECK:STDOUT: --- has_extra_interfaces.carbon
  2865. // CHECK:STDOUT:
  2866. // CHECK:STDOUT: constants {
  2867. // CHECK:STDOUT: %Extra1.type: type = facet_type <@Extra1> [concrete]
  2868. // CHECK:STDOUT: %Self.66c: %Extra1.type = bind_symbolic_name Self, 0 [symbolic]
  2869. // CHECK:STDOUT: %Extra2.type: type = facet_type <@Extra2> [concrete]
  2870. // CHECK:STDOUT: %Self.2ed: %Extra2.type = bind_symbolic_name Self, 0 [symbolic]
  2871. // CHECK:STDOUT: %Extra3.type: type = facet_type <@Extra3> [concrete]
  2872. // CHECK:STDOUT: %Self.622: %Extra3.type = bind_symbolic_name Self, 0 [symbolic]
  2873. // CHECK:STDOUT: %Extra4.type: type = facet_type <@Extra4> [concrete]
  2874. // CHECK:STDOUT: %Self.234: %Extra4.type = bind_symbolic_name Self, 0 [symbolic]
  2875. // CHECK:STDOUT: %Extra5.type: type = facet_type <@Extra5> [concrete]
  2876. // CHECK:STDOUT: %Self.d1b: %Extra5.type = bind_symbolic_name Self, 0 [symbolic]
  2877. // CHECK:STDOUT: %Extra6.type: type = facet_type <@Extra6> [concrete]
  2878. // CHECK:STDOUT: %Self.aeb: %Extra6.type = bind_symbolic_name Self, 0 [symbolic]
  2879. // CHECK:STDOUT: %Extra7.type: type = facet_type <@Extra7> [concrete]
  2880. // CHECK:STDOUT: %Self.b7e: %Extra7.type = bind_symbolic_name Self, 0 [symbolic]
  2881. // CHECK:STDOUT: %Extra8.type: type = facet_type <@Extra8> [concrete]
  2882. // CHECK:STDOUT: %Self.f90: %Extra8.type = bind_symbolic_name Self, 0 [symbolic]
  2883. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  2884. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  2885. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  2886. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  2887. // CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic]
  2888. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  2889. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  2890. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic]
  2891. // CHECK:STDOUT: %ptr.7d2: type = ptr_type %C.f2e [symbolic]
  2892. // CHECK:STDOUT: %pattern_type.1d2: type = pattern_type %ptr.7d2 [symbolic]
  2893. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%T) [symbolic]
  2894. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2895. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2896. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2897. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  2898. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  2899. // CHECK:STDOUT: %Self.as_type.b70: type = facet_access_type %Self.826 [symbolic]
  2900. // CHECK:STDOUT: %pattern_type.6de: type = pattern_type %Self.as_type.b70 [symbolic]
  2901. // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
  2902. // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
  2903. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  2904. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete]
  2905. // CHECK:STDOUT: %tuple.type.c53: type = tuple_type (type, type, type, type, type, type, type, type) [concrete]
  2906. // CHECK:STDOUT: %tuple.type.15d: type = tuple_type (%Extra1.type, %Extra2.type, %Extra3.type, %Extra4.type, %Extra5.type, %Extra6.type, %Extra7.type, %Extra8.type) [concrete]
  2907. // CHECK:STDOUT: %C.69b: type = class_type @C, @C(%tuple.type.15d) [concrete]
  2908. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  2909. // CHECK:STDOUT: %pattern_type.e23: type = pattern_type %C.69b [concrete]
  2910. // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F [concrete]
  2911. // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [concrete]
  2912. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C.69b, (%I.impl_witness) [concrete]
  2913. // CHECK:STDOUT: }
  2914. // CHECK:STDOUT:
  2915. // CHECK:STDOUT: imports {
  2916. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2917. // CHECK:STDOUT: .Destroy = %Core.Destroy
  2918. // CHECK:STDOUT: import Core//prelude
  2919. // CHECK:STDOUT: import Core//prelude/...
  2920. // CHECK:STDOUT: }
  2921. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  2922. // CHECK:STDOUT: }
  2923. // CHECK:STDOUT:
  2924. // CHECK:STDOUT: file {
  2925. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2926. // CHECK:STDOUT: .Core = imports.%Core
  2927. // CHECK:STDOUT: .Extra1 = %Extra1.decl
  2928. // CHECK:STDOUT: .Extra2 = %Extra2.decl
  2929. // CHECK:STDOUT: .Extra3 = %Extra3.decl
  2930. // CHECK:STDOUT: .Extra4 = %Extra4.decl
  2931. // CHECK:STDOUT: .Extra5 = %Extra5.decl
  2932. // CHECK:STDOUT: .Extra6 = %Extra6.decl
  2933. // CHECK:STDOUT: .Extra7 = %Extra7.decl
  2934. // CHECK:STDOUT: .Extra8 = %Extra8.decl
  2935. // CHECK:STDOUT: .C = %C.decl
  2936. // CHECK:STDOUT: .I = %I.decl
  2937. // CHECK:STDOUT: }
  2938. // CHECK:STDOUT: %Core.import = import Core
  2939. // CHECK:STDOUT: %Extra1.decl: type = interface_decl @Extra1 [concrete = constants.%Extra1.type] {} {}
  2940. // CHECK:STDOUT: %Extra2.decl: type = interface_decl @Extra2 [concrete = constants.%Extra2.type] {} {}
  2941. // CHECK:STDOUT: %Extra3.decl: type = interface_decl @Extra3 [concrete = constants.%Extra3.type] {} {}
  2942. // CHECK:STDOUT: %Extra4.decl: type = interface_decl @Extra4 [concrete = constants.%Extra4.type] {} {}
  2943. // CHECK:STDOUT: %Extra5.decl: type = interface_decl @Extra5 [concrete = constants.%Extra5.type] {} {}
  2944. // CHECK:STDOUT: %Extra6.decl: type = interface_decl @Extra6 [concrete = constants.%Extra6.type] {} {}
  2945. // CHECK:STDOUT: %Extra7.decl: type = interface_decl @Extra7 [concrete = constants.%Extra7.type] {} {}
  2946. // CHECK:STDOUT: %Extra8.decl: type = interface_decl @Extra8 [concrete = constants.%Extra8.type] {} {}
  2947. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  2948. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  2949. // CHECK:STDOUT: } {
  2950. // CHECK:STDOUT: %T.loc13_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc13_9.1 (constants.%T)]
  2951. // CHECK:STDOUT: }
  2952. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  2953. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  2954. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  2955. // CHECK:STDOUT: %Extra1.ref: type = name_ref Extra1, file.%Extra1.decl [concrete = constants.%Extra1.type]
  2956. // CHECK:STDOUT: %Extra2.ref: type = name_ref Extra2, file.%Extra2.decl [concrete = constants.%Extra2.type]
  2957. // CHECK:STDOUT: %Extra3.ref: type = name_ref Extra3, file.%Extra3.decl [concrete = constants.%Extra3.type]
  2958. // CHECK:STDOUT: %Extra4.ref: type = name_ref Extra4, file.%Extra4.decl [concrete = constants.%Extra4.type]
  2959. // CHECK:STDOUT: %Extra5.ref: type = name_ref Extra5, file.%Extra5.decl [concrete = constants.%Extra5.type]
  2960. // CHECK:STDOUT: %Extra6.ref: type = name_ref Extra6, file.%Extra6.decl [concrete = constants.%Extra6.type]
  2961. // CHECK:STDOUT: %Extra7.ref: type = name_ref Extra7, file.%Extra7.decl [concrete = constants.%Extra7.type]
  2962. // CHECK:STDOUT: %Extra8.ref: type = name_ref Extra8, file.%Extra8.decl [concrete = constants.%Extra8.type]
  2963. // 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)
  2964. // CHECK:STDOUT: %.loc16_72: type = converted %.loc16_71, constants.%tuple.type.15d [concrete = constants.%tuple.type.15d]
  2965. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.type.15d) [concrete = constants.%C.69b]
  2966. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  2967. // CHECK:STDOUT: }
  2968. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@C.as.I.impl.%C.as.I.impl.F.decl), @C.as.I.impl [concrete]
  2969. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  2970. // CHECK:STDOUT: }
  2971. // CHECK:STDOUT:
  2972. // CHECK:STDOUT: interface @Extra1 {
  2973. // CHECK:STDOUT: %Self: %Extra1.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.66c]
  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 @Extra2 {
  2981. // CHECK:STDOUT: %Self: %Extra2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2ed]
  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 @Extra3 {
  2989. // CHECK:STDOUT: %Self: %Extra3.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.622]
  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 @Extra4 {
  2997. // CHECK:STDOUT: %Self: %Extra4.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.234]
  2998. // CHECK:STDOUT:
  2999. // CHECK:STDOUT: !members:
  3000. // CHECK:STDOUT: .Self = %Self
  3001. // CHECK:STDOUT: witness = ()
  3002. // CHECK:STDOUT: }
  3003. // CHECK:STDOUT:
  3004. // CHECK:STDOUT: interface @Extra5 {
  3005. // CHECK:STDOUT: %Self: %Extra5.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.d1b]
  3006. // CHECK:STDOUT:
  3007. // CHECK:STDOUT: !members:
  3008. // CHECK:STDOUT: .Self = %Self
  3009. // CHECK:STDOUT: witness = ()
  3010. // CHECK:STDOUT: }
  3011. // CHECK:STDOUT:
  3012. // CHECK:STDOUT: interface @Extra6 {
  3013. // CHECK:STDOUT: %Self: %Extra6.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.aeb]
  3014. // CHECK:STDOUT:
  3015. // CHECK:STDOUT: !members:
  3016. // CHECK:STDOUT: .Self = %Self
  3017. // CHECK:STDOUT: witness = ()
  3018. // CHECK:STDOUT: }
  3019. // CHECK:STDOUT:
  3020. // CHECK:STDOUT: interface @Extra7 {
  3021. // CHECK:STDOUT: %Self: %Extra7.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.b7e]
  3022. // CHECK:STDOUT:
  3023. // CHECK:STDOUT: !members:
  3024. // CHECK:STDOUT: .Self = %Self
  3025. // CHECK:STDOUT: witness = ()
  3026. // CHECK:STDOUT: }
  3027. // CHECK:STDOUT:
  3028. // CHECK:STDOUT: interface @Extra8 {
  3029. // CHECK:STDOUT: %Self: %Extra8.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.f90]
  3030. // CHECK:STDOUT:
  3031. // CHECK:STDOUT: !members:
  3032. // CHECK:STDOUT: .Self = %Self
  3033. // CHECK:STDOUT: witness = ()
  3034. // CHECK:STDOUT: }
  3035. // CHECK:STDOUT:
  3036. // CHECK:STDOUT: interface @I {
  3037. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  3038. // CHECK:STDOUT: %I.F.decl: %I.F.type = fn_decl @I.F [concrete = constants.%I.F] {
  3039. // CHECK:STDOUT: %self.patt: @I.F.%pattern_type (%pattern_type.6de) = binding_pattern self [concrete]
  3040. // CHECK:STDOUT: %self.param_patt: @I.F.%pattern_type (%pattern_type.6de) = value_param_pattern %self.patt, call_param0 [concrete]
  3041. // CHECK:STDOUT: } {
  3042. // CHECK:STDOUT: %self.param: @I.F.%Self.as_type.loc14_26.1 (%Self.as_type.b70) = value_param call_param0
  3043. // CHECK:STDOUT: %.loc14_26.1: type = splice_block %.loc14_26.2 [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type.b70)] {
  3044. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)]
  3045. // 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.b70)]
  3046. // 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.b70)]
  3047. // CHECK:STDOUT: }
  3048. // CHECK:STDOUT: %self: @I.F.%Self.as_type.loc14_26.1 (%Self.as_type.b70) = bind_name self, %self.param
  3049. // CHECK:STDOUT: }
  3050. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.F.decl [concrete = constants.%assoc0]
  3051. // CHECK:STDOUT:
  3052. // CHECK:STDOUT: !members:
  3053. // CHECK:STDOUT: .Self = %Self
  3054. // CHECK:STDOUT: .F = %assoc0
  3055. // CHECK:STDOUT: witness = (%I.F.decl)
  3056. // CHECK:STDOUT: }
  3057. // CHECK:STDOUT:
  3058. // CHECK:STDOUT: generic impl @C.as.Destroy.impl(@C.%T.loc13_9.2: type) {
  3059. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  3060. // 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)]
  3061. // CHECK:STDOUT:
  3062. // CHECK:STDOUT: !definition:
  3063. // 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)]
  3064. // 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)]
  3065. // CHECK:STDOUT:
  3066. // CHECK:STDOUT: impl: constants.%C.f2e as constants.%Destroy.type {
  3067. // 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)] {
  3068. // CHECK:STDOUT: %self.patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.1d2) = binding_pattern self [concrete]
  3069. // CHECK:STDOUT: %self.param_patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.1d2) = value_param_pattern %self.patt, call_param0 [concrete]
  3070. // CHECK:STDOUT: %.loc13_19.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  3071. // CHECK:STDOUT: } {
  3072. // CHECK:STDOUT: %self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2) = value_param call_param0
  3073. // CHECK:STDOUT: %.loc13_19.2: type = splice_block %Self.ref [symbolic = %C (constants.%C.f2e)] {
  3074. // CHECK:STDOUT: %.loc13_19.3: type = specific_constant constants.%C.f2e, @C(constants.%T) [symbolic = %C (constants.%C.f2e)]
  3075. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc13_19.3 [symbolic = %C (constants.%C.f2e)]
  3076. // CHECK:STDOUT: }
  3077. // CHECK:STDOUT: %self: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2) = bind_name self, %self.param
  3078. // CHECK:STDOUT: }
  3079. // CHECK:STDOUT:
  3080. // CHECK:STDOUT: !members:
  3081. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  3082. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  3083. // CHECK:STDOUT: }
  3084. // CHECK:STDOUT: }
  3085. // CHECK:STDOUT:
  3086. // CHECK:STDOUT: impl @C.as.I.impl: %C as %I.ref {
  3087. // 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] {
  3088. // CHECK:STDOUT: %self.patt: %pattern_type.e23 = binding_pattern self [concrete]
  3089. // CHECK:STDOUT: %self.param_patt: %pattern_type.e23 = value_param_pattern %self.patt, call_param0 [concrete]
  3090. // CHECK:STDOUT: } {
  3091. // CHECK:STDOUT: %self.param: %C.69b = value_param call_param0
  3092. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.I.impl.%C [concrete = constants.%C.69b]
  3093. // CHECK:STDOUT: %self: %C.69b = bind_name self, %self.param
  3094. // CHECK:STDOUT: }
  3095. // CHECK:STDOUT:
  3096. // CHECK:STDOUT: !members:
  3097. // CHECK:STDOUT: .F = %C.as.I.impl.F.decl
  3098. // CHECK:STDOUT: witness = file.%I.impl_witness
  3099. // CHECK:STDOUT: }
  3100. // CHECK:STDOUT:
  3101. // CHECK:STDOUT: generic class @C(%T.loc13_9.2: type) {
  3102. // CHECK:STDOUT: %T.loc13_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc13_9.1 (constants.%T)]
  3103. // CHECK:STDOUT:
  3104. // CHECK:STDOUT: !definition:
  3105. // CHECK:STDOUT:
  3106. // CHECK:STDOUT: class {
  3107. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  3108. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  3109. // 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)]
  3110. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  3111. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  3112. // CHECK:STDOUT: complete_type_witness = %complete_type
  3113. // CHECK:STDOUT:
  3114. // CHECK:STDOUT: !members:
  3115. // CHECK:STDOUT: .Self = constants.%C.f2e
  3116. // CHECK:STDOUT: }
  3117. // CHECK:STDOUT: }
  3118. // CHECK:STDOUT:
  3119. // CHECK:STDOUT: generic fn @C.as.Destroy.impl.Op(@C.%T.loc13_9.2: type) {
  3120. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  3121. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)]
  3122. // CHECK:STDOUT: %ptr: type = ptr_type %C [symbolic = %ptr (constants.%ptr.7d2)]
  3123. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.1d2)]
  3124. // CHECK:STDOUT:
  3125. // CHECK:STDOUT: !definition:
  3126. // CHECK:STDOUT:
  3127. // CHECK:STDOUT: fn(%self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2)) = "no_op";
  3128. // CHECK:STDOUT: }
  3129. // CHECK:STDOUT:
  3130. // CHECK:STDOUT: generic fn @I.F(@I.%Self: %I.type) {
  3131. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.826)]
  3132. // CHECK:STDOUT: %Self.as_type.loc14_26.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type.b70)]
  3133. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc14_26.1 [symbolic = %pattern_type (constants.%pattern_type.6de)]
  3134. // CHECK:STDOUT:
  3135. // CHECK:STDOUT: fn(%self.param: @I.F.%Self.as_type.loc14_26.1 (%Self.as_type.b70));
  3136. // CHECK:STDOUT: }
  3137. // CHECK:STDOUT:
  3138. // CHECK:STDOUT: fn @C.as.I.impl.F(%self.param: %C.69b) {
  3139. // CHECK:STDOUT: !entry:
  3140. // CHECK:STDOUT: return
  3141. // CHECK:STDOUT: }
  3142. // CHECK:STDOUT:
  3143. // CHECK:STDOUT: specific @C(constants.%T) {
  3144. // CHECK:STDOUT: %T.loc13_9.1 => constants.%T
  3145. // CHECK:STDOUT: }
  3146. // CHECK:STDOUT:
  3147. // CHECK:STDOUT: specific @C.as.Destroy.impl(constants.%T) {
  3148. // CHECK:STDOUT: %T => constants.%T
  3149. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness
  3150. // CHECK:STDOUT: }
  3151. // CHECK:STDOUT:
  3152. // CHECK:STDOUT: specific @C.as.Destroy.impl.Op(constants.%T) {
  3153. // CHECK:STDOUT: %T => constants.%T
  3154. // CHECK:STDOUT: %C => constants.%C.f2e
  3155. // CHECK:STDOUT: %ptr => constants.%ptr.7d2
  3156. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1d2
  3157. // CHECK:STDOUT: }
  3158. // CHECK:STDOUT:
  3159. // CHECK:STDOUT: specific @I.F(constants.%Self.826) {
  3160. // CHECK:STDOUT: %Self => constants.%Self.826
  3161. // CHECK:STDOUT: %Self.as_type.loc14_26.1 => constants.%Self.as_type.b70
  3162. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6de
  3163. // CHECK:STDOUT: }
  3164. // CHECK:STDOUT:
  3165. // CHECK:STDOUT: specific @C(constants.%tuple.type.15d) {
  3166. // CHECK:STDOUT: %T.loc13_9.1 => constants.%tuple.type.15d
  3167. // CHECK:STDOUT:
  3168. // CHECK:STDOUT: !definition:
  3169. // CHECK:STDOUT: }
  3170. // CHECK:STDOUT:
  3171. // CHECK:STDOUT: specific @I.F(constants.%I.facet) {
  3172. // CHECK:STDOUT: %Self => constants.%I.facet
  3173. // CHECK:STDOUT: %Self.as_type.loc14_26.1 => constants.%C.69b
  3174. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e23
  3175. // CHECK:STDOUT: }
  3176. // CHECK:STDOUT:
  3177. // CHECK:STDOUT: --- fail_use_has_extra_interfaces.carbon
  3178. // CHECK:STDOUT:
  3179. // CHECK:STDOUT: constants {
  3180. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  3181. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  3182. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3183. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  3184. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  3185. // CHECK:STDOUT: %C.c77: type = class_type @C, @C(%T) [symbolic]
  3186. // CHECK:STDOUT: %C.42e: type = class_type @C, @C(type) [concrete]
  3187. // CHECK:STDOUT: %pattern_type.6e4: type = pattern_type %C.42e [concrete]
  3188. // CHECK:STDOUT: %Test.type: type = fn_type @Test [concrete]
  3189. // CHECK:STDOUT: %Test: %Test.type = struct_value () [concrete]
  3190. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  3191. // CHECK:STDOUT: %Self.013: %I.type = bind_symbolic_name Self, 0 [symbolic]
  3192. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  3193. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%HasExtraInterfaces.import_ref.d54 [concrete]
  3194. // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
  3195. // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
  3196. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.013 [symbolic]
  3197. // CHECK:STDOUT: %pattern_type.e10: type = pattern_type %Self.as_type [symbolic]
  3198. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  3199. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic]
  3200. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%T) [symbolic]
  3201. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [symbolic]
  3202. // CHECK:STDOUT: %ptr.534: type = ptr_type %C.c77 [symbolic]
  3203. // CHECK:STDOUT: %pattern_type.663: type = pattern_type %ptr.534 [symbolic]
  3204. // CHECK:STDOUT: %Extra8.type: type = facet_type <@Extra8> [concrete]
  3205. // CHECK:STDOUT: %Extra7.type: type = facet_type <@Extra7> [concrete]
  3206. // CHECK:STDOUT: %Extra6.type: type = facet_type <@Extra6> [concrete]
  3207. // CHECK:STDOUT: %Extra5.type: type = facet_type <@Extra5> [concrete]
  3208. // CHECK:STDOUT: %Extra4.type: type = facet_type <@Extra4> [concrete]
  3209. // CHECK:STDOUT: %Extra3.type: type = facet_type <@Extra3> [concrete]
  3210. // CHECK:STDOUT: %Extra2.type: type = facet_type <@Extra2> [concrete]
  3211. // CHECK:STDOUT: %Extra1.type: type = facet_type <@Extra1> [concrete]
  3212. // CHECK:STDOUT: %tuple.type: type = tuple_type (%Extra1.type, %Extra2.type, %Extra3.type, %Extra4.type, %Extra5.type, %Extra6.type, %Extra7.type, %Extra8.type) [concrete]
  3213. // CHECK:STDOUT: %C.074: type = class_type @C, @C(%tuple.type) [concrete]
  3214. // CHECK:STDOUT: }
  3215. // CHECK:STDOUT:
  3216. // CHECK:STDOUT: imports {
  3217. // CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
  3218. // CHECK:STDOUT: import Core//prelude
  3219. // CHECK:STDOUT: import Core//prelude/...
  3220. // CHECK:STDOUT: }
  3221. // CHECK:STDOUT: %HasExtraInterfaces: <namespace> = namespace file.%HasExtraInterfaces.import, [concrete] {
  3222. // CHECK:STDOUT: .C = %HasExtraInterfaces.C
  3223. // CHECK:STDOUT: .I = %HasExtraInterfaces.I
  3224. // CHECK:STDOUT: import HasExtraInterfaces//default
  3225. // CHECK:STDOUT: }
  3226. // CHECK:STDOUT: %HasExtraInterfaces.C: %C.type = import_ref HasExtraInterfaces//default, C, loaded [concrete = constants.%C.generic]
  3227. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.5ab3ec.1: type = import_ref HasExtraInterfaces//default, loc13_9, loaded [symbolic = @C.%T (constants.%T)]
  3228. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.8f2: <witness> = import_ref HasExtraInterfaces//default, loc13_20, loaded [concrete = constants.%complete_type]
  3229. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.4c0 = import_ref HasExtraInterfaces//default, inst66 [no loc], unloaded
  3230. // CHECK:STDOUT: %HasExtraInterfaces.I: type = import_ref HasExtraInterfaces//default, I, loaded [concrete = constants.%I.type]
  3231. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.e5d = import_ref HasExtraInterfaces//default, inst121 [no loc], unloaded
  3232. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.be9: %I.assoc_type = import_ref HasExtraInterfaces//default, loc14_33, loaded [concrete = constants.%assoc0]
  3233. // CHECK:STDOUT: %HasExtraInterfaces.F = import_ref HasExtraInterfaces//default, F, unloaded
  3234. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.d54: %I.F.type = import_ref HasExtraInterfaces//default, loc14_33, loaded [concrete = constants.%I.F]
  3235. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.1db: %I.type = import_ref HasExtraInterfaces//default, inst121 [no loc], loaded [symbolic = constants.%Self.013]
  3236. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.21a = import_ref HasExtraInterfaces//default, loc13_19, unloaded
  3237. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.5ab3ec.2: type = import_ref HasExtraInterfaces//default, loc13_9, loaded [symbolic = @C.%T (constants.%T)]
  3238. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.499: type = import_ref HasExtraInterfaces//default, inst66 [no loc], loaded [symbolic = constants.%C.c77]
  3239. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.cb9: type = import_ref HasExtraInterfaces//default, inst69 [no loc], loaded [concrete = constants.%Destroy.type]
  3240. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.251 = import_ref HasExtraInterfaces//default, loc13_19, unloaded
  3241. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%HasExtraInterfaces.import_ref.251), @C.as.Destroy.impl [concrete]
  3242. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.5ab3ec.3: type = import_ref HasExtraInterfaces//default, loc13_9, loaded [symbolic = @C.%T (constants.%T)]
  3243. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.bca = import_ref HasExtraInterfaces//default, loc16_79, unloaded
  3244. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.9c8 = import_ref HasExtraInterfaces//default, inst54 [no loc], unloaded
  3245. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.dfe = import_ref HasExtraInterfaces//default, inst49 [no loc], unloaded
  3246. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.6b6 = import_ref HasExtraInterfaces//default, inst44 [no loc], unloaded
  3247. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.576 = import_ref HasExtraInterfaces//default, inst39 [no loc], unloaded
  3248. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.0dd = import_ref HasExtraInterfaces//default, inst34 [no loc], unloaded
  3249. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.f83 = import_ref HasExtraInterfaces//default, inst29 [no loc], unloaded
  3250. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.975 = import_ref HasExtraInterfaces//default, inst24 [no loc], unloaded
  3251. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.a3c = import_ref HasExtraInterfaces//default, inst19 [no loc], unloaded
  3252. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.aa8: type = import_ref HasExtraInterfaces//default, loc16_72, loaded [concrete = constants.%C.074]
  3253. // CHECK:STDOUT: %HasExtraInterfaces.import_ref.301: type = import_ref HasExtraInterfaces//default, loc16_77, loaded [concrete = constants.%I.type]
  3254. // CHECK:STDOUT: }
  3255. // CHECK:STDOUT:
  3256. // CHECK:STDOUT: file {
  3257. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3258. // CHECK:STDOUT: .Core = imports.%Core.ece
  3259. // CHECK:STDOUT: .HasExtraInterfaces = imports.%HasExtraInterfaces
  3260. // CHECK:STDOUT: .Test = %Test.decl
  3261. // CHECK:STDOUT: }
  3262. // CHECK:STDOUT: %Core.import = import Core
  3263. // CHECK:STDOUT: %HasExtraInterfaces.import = import HasExtraInterfaces
  3264. // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [concrete = constants.%Test] {
  3265. // CHECK:STDOUT: %c.patt: %pattern_type.6e4 = binding_pattern c [concrete]
  3266. // CHECK:STDOUT: %c.param_patt: %pattern_type.6e4 = value_param_pattern %c.patt, call_param0 [concrete]
  3267. // CHECK:STDOUT: } {
  3268. // CHECK:STDOUT: %c.param: %C.42e = value_param call_param0
  3269. // CHECK:STDOUT: %.loc5: type = splice_block %C [concrete = constants.%C.42e] {
  3270. // CHECK:STDOUT: %HasExtraInterfaces.ref.loc5: <namespace> = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [concrete = imports.%HasExtraInterfaces]
  3271. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%HasExtraInterfaces.C [concrete = constants.%C.generic]
  3272. // CHECK:STDOUT: %C: type = class_type @C, @C(type) [concrete = constants.%C.42e]
  3273. // CHECK:STDOUT: }
  3274. // CHECK:STDOUT: %c: %C.42e = bind_name c, %c.param
  3275. // CHECK:STDOUT: }
  3276. // CHECK:STDOUT: }
  3277. // CHECK:STDOUT:
  3278. // CHECK:STDOUT: interface @I [from "has_extra_interfaces.carbon"] {
  3279. // CHECK:STDOUT: !members:
  3280. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.e5d
  3281. // CHECK:STDOUT: .F = imports.%HasExtraInterfaces.import_ref.be9
  3282. // CHECK:STDOUT: witness = (imports.%HasExtraInterfaces.F)
  3283. // CHECK:STDOUT: }
  3284. // CHECK:STDOUT:
  3285. // CHECK:STDOUT: interface @Extra8 [from "has_extra_interfaces.carbon"] {
  3286. // CHECK:STDOUT: !members:
  3287. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.9c8
  3288. // CHECK:STDOUT: witness = ()
  3289. // CHECK:STDOUT: }
  3290. // CHECK:STDOUT:
  3291. // CHECK:STDOUT: interface @Extra7 [from "has_extra_interfaces.carbon"] {
  3292. // CHECK:STDOUT: !members:
  3293. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.dfe
  3294. // CHECK:STDOUT: witness = ()
  3295. // CHECK:STDOUT: }
  3296. // CHECK:STDOUT:
  3297. // CHECK:STDOUT: interface @Extra6 [from "has_extra_interfaces.carbon"] {
  3298. // CHECK:STDOUT: !members:
  3299. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.6b6
  3300. // CHECK:STDOUT: witness = ()
  3301. // CHECK:STDOUT: }
  3302. // CHECK:STDOUT:
  3303. // CHECK:STDOUT: interface @Extra5 [from "has_extra_interfaces.carbon"] {
  3304. // CHECK:STDOUT: !members:
  3305. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.576
  3306. // CHECK:STDOUT: witness = ()
  3307. // CHECK:STDOUT: }
  3308. // CHECK:STDOUT:
  3309. // CHECK:STDOUT: interface @Extra4 [from "has_extra_interfaces.carbon"] {
  3310. // CHECK:STDOUT: !members:
  3311. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.0dd
  3312. // CHECK:STDOUT: witness = ()
  3313. // CHECK:STDOUT: }
  3314. // CHECK:STDOUT:
  3315. // CHECK:STDOUT: interface @Extra3 [from "has_extra_interfaces.carbon"] {
  3316. // CHECK:STDOUT: !members:
  3317. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.f83
  3318. // CHECK:STDOUT: witness = ()
  3319. // CHECK:STDOUT: }
  3320. // CHECK:STDOUT:
  3321. // CHECK:STDOUT: interface @Extra2 [from "has_extra_interfaces.carbon"] {
  3322. // CHECK:STDOUT: !members:
  3323. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.975
  3324. // CHECK:STDOUT: witness = ()
  3325. // CHECK:STDOUT: }
  3326. // CHECK:STDOUT:
  3327. // CHECK:STDOUT: interface @Extra1 [from "has_extra_interfaces.carbon"] {
  3328. // CHECK:STDOUT: !members:
  3329. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.a3c
  3330. // CHECK:STDOUT: witness = ()
  3331. // CHECK:STDOUT: }
  3332. // CHECK:STDOUT:
  3333. // CHECK:STDOUT: generic impl @C.as.Destroy.impl(imports.%HasExtraInterfaces.import_ref.5ab3ec.2: type) [from "has_extra_interfaces.carbon"] {
  3334. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  3335. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness)]
  3336. // CHECK:STDOUT:
  3337. // CHECK:STDOUT: !definition:
  3338. // 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)]
  3339. // 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)]
  3340. // CHECK:STDOUT:
  3341. // CHECK:STDOUT: impl: imports.%HasExtraInterfaces.import_ref.499 as imports.%HasExtraInterfaces.import_ref.cb9 {
  3342. // CHECK:STDOUT: !members:
  3343. // CHECK:STDOUT: witness = imports.%HasExtraInterfaces.import_ref.21a
  3344. // CHECK:STDOUT: }
  3345. // CHECK:STDOUT: }
  3346. // CHECK:STDOUT:
  3347. // CHECK:STDOUT: impl @C.as.I.impl: imports.%HasExtraInterfaces.import_ref.aa8 as imports.%HasExtraInterfaces.import_ref.301 [from "has_extra_interfaces.carbon"] {
  3348. // CHECK:STDOUT: !members:
  3349. // CHECK:STDOUT: witness = imports.%HasExtraInterfaces.import_ref.bca
  3350. // CHECK:STDOUT: }
  3351. // CHECK:STDOUT:
  3352. // CHECK:STDOUT: generic class @C(imports.%HasExtraInterfaces.import_ref.5ab3ec.1: type) [from "has_extra_interfaces.carbon"] {
  3353. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  3354. // CHECK:STDOUT:
  3355. // CHECK:STDOUT: !definition:
  3356. // CHECK:STDOUT:
  3357. // CHECK:STDOUT: class {
  3358. // CHECK:STDOUT: complete_type_witness = imports.%HasExtraInterfaces.import_ref.8f2
  3359. // CHECK:STDOUT:
  3360. // CHECK:STDOUT: !members:
  3361. // CHECK:STDOUT: .Self = imports.%HasExtraInterfaces.import_ref.4c0
  3362. // CHECK:STDOUT: }
  3363. // CHECK:STDOUT: }
  3364. // CHECK:STDOUT:
  3365. // CHECK:STDOUT: fn @Test(%c.param: %C.42e) {
  3366. // CHECK:STDOUT: !entry:
  3367. // CHECK:STDOUT: %c.ref: %C.42e = name_ref c, %c
  3368. // CHECK:STDOUT: %HasExtraInterfaces.ref.loc12: <namespace> = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [concrete = imports.%HasExtraInterfaces]
  3369. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%HasExtraInterfaces.I [concrete = constants.%I.type]
  3370. // CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, imports.%HasExtraInterfaces.import_ref.be9 [concrete = constants.%assoc0]
  3371. // CHECK:STDOUT: return
  3372. // CHECK:STDOUT: }
  3373. // CHECK:STDOUT:
  3374. // CHECK:STDOUT: generic fn @I.F(imports.%HasExtraInterfaces.import_ref.1db: %I.type) [from "has_extra_interfaces.carbon"] {
  3375. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.013)]
  3376. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  3377. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.e10)]
  3378. // CHECK:STDOUT:
  3379. // CHECK:STDOUT: fn;
  3380. // CHECK:STDOUT: }
  3381. // CHECK:STDOUT:
  3382. // CHECK:STDOUT: generic fn @C.as.Destroy.impl.Op(imports.%HasExtraInterfaces.import_ref.5ab3ec.3: type) [from "has_extra_interfaces.carbon"] {
  3383. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  3384. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.c77)]
  3385. // CHECK:STDOUT: %ptr: type = ptr_type %C [symbolic = %ptr (constants.%ptr.534)]
  3386. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.663)]
  3387. // CHECK:STDOUT:
  3388. // CHECK:STDOUT: !definition:
  3389. // CHECK:STDOUT:
  3390. // CHECK:STDOUT: fn = "no_op";
  3391. // CHECK:STDOUT: }
  3392. // CHECK:STDOUT:
  3393. // CHECK:STDOUT: specific @C(constants.%T) {
  3394. // CHECK:STDOUT: %T => constants.%T
  3395. // CHECK:STDOUT: }
  3396. // CHECK:STDOUT:
  3397. // CHECK:STDOUT: specific @C(type) {
  3398. // CHECK:STDOUT: %T => type
  3399. // CHECK:STDOUT:
  3400. // CHECK:STDOUT: !definition:
  3401. // CHECK:STDOUT: }
  3402. // CHECK:STDOUT:
  3403. // CHECK:STDOUT: specific @I.F(constants.%Self.013) {
  3404. // CHECK:STDOUT: %Self => constants.%Self.013
  3405. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  3406. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e10
  3407. // CHECK:STDOUT: }
  3408. // CHECK:STDOUT:
  3409. // CHECK:STDOUT: specific @C.as.Destroy.impl(constants.%T) {
  3410. // CHECK:STDOUT: %T => constants.%T
  3411. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness
  3412. // CHECK:STDOUT: }
  3413. // CHECK:STDOUT:
  3414. // CHECK:STDOUT: specific @C.as.Destroy.impl.Op(constants.%T) {
  3415. // CHECK:STDOUT: %T => constants.%T
  3416. // CHECK:STDOUT: %C => constants.%C.c77
  3417. // CHECK:STDOUT: %ptr => constants.%ptr.534
  3418. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.663
  3419. // CHECK:STDOUT: }
  3420. // CHECK:STDOUT:
  3421. // CHECK:STDOUT: specific @C(constants.%tuple.type) {
  3422. // CHECK:STDOUT: %T => constants.%tuple.type
  3423. // CHECK:STDOUT:
  3424. // CHECK:STDOUT: !definition:
  3425. // CHECK:STDOUT: }
  3426. // CHECK:STDOUT: