use_assoc_entity.carbon 355 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800
  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/primitives.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/use_assoc_entity.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/use_assoc_entity.carbon
  14. // --- associated_type_in_method_signature.carbon
  15. library "[[@TEST_NAME]]";
  16. interface J {
  17. let U:! type;
  18. fn F[self: Self](u: U) -> U;
  19. }
  20. impl () as J where .U = i32 {
  21. fn F[unused self: Self](u: i32) -> i32 { return -u; }
  22. }
  23. fn CallMethod(x: ()) -> i32 {
  24. return x.(J.F)(40);
  25. }
  26. class C {
  27. // This allows the type to be copyable so it can be returned.
  28. adapt {};
  29. }
  30. impl C as J where .U = C {
  31. fn F[self: Self](unused u: C) -> C { return self; }
  32. }
  33. // --- associated_type_in_function_signature.carbon
  34. library "[[@TEST_NAME]]";
  35. interface J {
  36. let U:! type;
  37. fn F(u: U) -> U;
  38. }
  39. class D { }
  40. impl D as J where .U = i32 {
  41. fn F(u: i32) -> i32 { return -u; }
  42. }
  43. fn CallFunction() -> i32 {
  44. return D.(J.F)(4);
  45. }
  46. // --- extend_impl_with_associated_type_in_signature.carbon
  47. library "[[@TEST_NAME]]";
  48. interface J {
  49. let U:! type;
  50. fn F(u: U) -> U;
  51. fn G[self: Self](v: U) -> U;
  52. }
  53. class E {
  54. extend impl as J where .U = i32 {
  55. fn F(u: i32) -> i32 {
  56. return -u;
  57. }
  58. fn G[unused self: Self](v: i32) -> i32 {
  59. return -v;
  60. }
  61. }
  62. }
  63. fn CallBoth(e: E) {
  64. let unused e1: i32 = e.F(2);
  65. let unused e2: i32 = e.G(3);
  66. let unused e3: i32 = E.F(4);
  67. let unused e4: i32 = e.(E.G)(5);
  68. let unused e5: i32 = e.(J.G)(6);
  69. }
  70. fn GenericCallF[T:! J](t: T, u: T.U) -> T.U {
  71. return t.F(u);
  72. }
  73. fn CallGeneric(e: E) -> i32 {
  74. return GenericCallF(e, 2);
  75. }
  76. // --- use_constraint_on_associated_type.carbon
  77. library "[[@TEST_NAME]]";
  78. interface I {
  79. fn Op[self: Self](b: Self) -> Self;
  80. }
  81. interface J {
  82. let U:! I & Core.Destroy;
  83. fn F(u: U) -> U;
  84. }
  85. fn GenericResult[T:! J](t: T, u: T.U) -> T.U {
  86. return t.F(u).(I.Op)(T.F(u));
  87. }
  88. // --- interface_qualified.carbon
  89. library "[[@TEST_NAME]]";
  90. interface J {
  91. let U:! type;
  92. fn G[self: Self](v: U) -> U;
  93. }
  94. fn GenericCallInterfaceQualified[T:! J](t: T, u: T.U) -> T.U {
  95. return t.(J.G)(u);
  96. }
  97. // --- use_where.carbon
  98. library "[[@TEST_NAME]]";
  99. interface J {
  100. let U:! type;
  101. fn F(u: U) -> U;
  102. }
  103. fn GenericCallFI32[T:! J where .U = i32](t: T) -> i32 {
  104. return t.F(2);
  105. }
  106. // --- fail_todo_use_associated_constant_in_impl.carbon
  107. library "[[@TEST_NAME]]";
  108. interface J {
  109. let U:! type;
  110. fn F(u: U) -> U;
  111. }
  112. class E {
  113. extend impl as J where .U = i32 {
  114. // TODO: U should be in scope and usable as soon as we finish the
  115. // declaration / enter the definition.
  116. //
  117. // CHECK:STDERR: fail_todo_use_associated_constant_in_impl.carbon:[[@LINE+14]]:13: error: cannot implicitly convert non-type value of type `<associated entity in J>` to `type` [ConversionFailureNonTypeToFacet]
  118. // CHECK:STDERR: fn F(u: U) -> U {
  119. // CHECK:STDERR: ^
  120. // CHECK:STDERR: fail_todo_use_associated_constant_in_impl.carbon:[[@LINE+11]]:13: note: type `<associated entity in J>` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
  121. // CHECK:STDERR: fn F(u: U) -> U {
  122. // CHECK:STDERR: ^
  123. // CHECK:STDERR:
  124. // CHECK:STDERR: fail_todo_use_associated_constant_in_impl.carbon:[[@LINE+7]]:19: error: cannot implicitly convert non-type value of type `<associated entity in J>` to `type` [ConversionFailureNonTypeToFacet]
  125. // CHECK:STDERR: fn F(u: U) -> U {
  126. // CHECK:STDERR: ^
  127. // CHECK:STDERR: fail_todo_use_associated_constant_in_impl.carbon:[[@LINE+4]]:19: note: type `<associated entity in J>` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
  128. // CHECK:STDERR: fn F(u: U) -> U {
  129. // CHECK:STDERR: ^
  130. // CHECK:STDERR:
  131. fn F(u: U) -> U {
  132. return u;
  133. }
  134. }
  135. }
  136. // --- fail_todo_call_extend_fn.carbon
  137. library "[[@TEST_NAME]]";
  138. interface J {
  139. fn F() {}
  140. }
  141. class E {
  142. extend impl as J {
  143. fn F() {}
  144. }
  145. // CHECK:STDERR: fail_todo_call_extend_fn.carbon:[[@LINE+4]]:12: error: value of type `<associated entity in J>` is not callable [CallToNonCallable]
  146. // CHECK:STDERR: fn G() { F(); }
  147. // CHECK:STDERR: ^~~
  148. // CHECK:STDERR:
  149. fn G() { F(); }
  150. }
  151. // --- call_extend_method.carbon
  152. library "[[@TEST_NAME]]";
  153. interface J {
  154. fn F[unused self: Self]() {}
  155. }
  156. class E {
  157. extend impl as J {
  158. fn F[unused self: Self]() {}
  159. }
  160. fn G[self: Self]() { self.F(); }
  161. }
  162. // --- fail_todo_use_extend_constant.carbon
  163. library "[[@TEST_NAME]]";
  164. interface J {
  165. let X:! type;
  166. }
  167. class E {
  168. extend impl as J where .X = () {}
  169. // TODO: `X` should be in scope and directly usable.
  170. // CHECK:STDERR: fail_todo_use_extend_constant.carbon:[[@LINE+7]]:13: error: cannot implicitly convert non-type value of type `<associated entity in J>` to `type` [ConversionFailureNonTypeToFacet]
  171. // CHECK:STDERR: fn G() -> X { return (); }
  172. // CHECK:STDERR: ^
  173. // CHECK:STDERR: fail_todo_use_extend_constant.carbon:[[@LINE+4]]:13: note: type `<associated entity in J>` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
  174. // CHECK:STDERR: fn G() -> X { return (); }
  175. // CHECK:STDERR: ^
  176. // CHECK:STDERR:
  177. fn G() -> X { return (); }
  178. }
  179. // --- fail_todo_self_period_associated_type.carbon
  180. library "[[@TEST_NAME]]";
  181. interface J2 {
  182. let U2:! type;
  183. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE+14]]:23: error: member access into facet of incomplete type `J2` [IncompleteTypeInMemberAccessOfFacet]
  184. // CHECK:STDERR: fn F[self: Self](z: Self.U2) -> Self.U2;
  185. // CHECK:STDERR: ^~~~
  186. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE-5]]:1: note: interface is currently being defined [InterfaceIncompleteWithinDefinition]
  187. // CHECK:STDERR: interface J2 {
  188. // CHECK:STDERR: ^~~~~~~~~~~~~~
  189. // CHECK:STDERR:
  190. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE+7]]:35: error: member access into facet of incomplete type `J2` [IncompleteTypeInMemberAccessOfFacet]
  191. // CHECK:STDERR: fn F[self: Self](z: Self.U2) -> Self.U2;
  192. // CHECK:STDERR: ^~~~
  193. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE-12]]:1: note: interface is currently being defined [InterfaceIncompleteWithinDefinition]
  194. // CHECK:STDERR: interface J2 {
  195. // CHECK:STDERR: ^~~~~~~~~~~~~~
  196. // CHECK:STDERR:
  197. fn F[self: Self](z: Self.U2) -> Self.U2;
  198. }
  199. impl () as J2 where .U2 = {} {
  200. fn F[unused self: Self](z: {}) -> {} { return z; }
  201. }
  202. class C2 {
  203. // This allows the type to be copyable so it can be returned.
  204. adapt {};
  205. }
  206. impl C2 as J2 where .U2 = C2 {
  207. fn F[self: Self](unused z: C2) -> C2 { return self; }
  208. }
  209. // --- fail_associated_type_in_signature_mismatch.carbon
  210. library "[[@TEST_NAME]]";
  211. interface K {
  212. let V:! type;
  213. // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+3]]:20: error: cannot convert from struct type `{.a: ()}` to `{.x: ()}`: missing field `x` in source type [StructInitMissingFieldInConversion]
  214. // CHECK:STDERR: fn F[self: Self](v: V) -> V;
  215. // CHECK:STDERR: ^~~~
  216. fn F[self: Self](v: V) -> V;
  217. }
  218. impl () as K where .V = {.a: ()} {
  219. // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+14]]:27: note: initializing function parameter [InCallToFunctionParam]
  220. // CHECK:STDERR: fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
  221. // CHECK:STDERR: ^~~~~~~~~~~
  222. // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-7]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
  223. // CHECK:STDERR: fn F[self: Self](v: V) -> V;
  224. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  225. // CHECK:STDERR:
  226. // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+7]]:3: error: cannot convert from struct type `{.x: ()}` to `{.a: ()}`: missing field `a` in source type [StructInitMissingFieldInConversion]
  227. // CHECK:STDERR: fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
  228. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  229. // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-14]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
  230. // CHECK:STDERR: fn F[self: Self](v: V) -> V;
  231. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  232. // CHECK:STDERR:
  233. fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
  234. }
  235. // --- use_non-type_in_function.carbon
  236. library "[[@TEST_NAME]]";
  237. interface M {
  238. let Z:! {.b: {}};
  239. fn G() -> {};
  240. }
  241. impl () as M where .Z = {.b = {}} {
  242. fn G() -> {} {
  243. return (Self as M).Z.b;
  244. }
  245. }
  246. // --- self_as_uses_correct_rewrite_constraint.carbon
  247. library "[[@TEST_NAME]]";
  248. class C(T:! type) {}
  249. interface M {
  250. let Z:! {.b: type};
  251. fn G() -> type;
  252. }
  253. impl C({}) as M where .Z = {.b = {}} {
  254. fn G() -> type {
  255. return (Self as M).Z.b;
  256. }
  257. }
  258. impl C(()) as M where .Z = {.b = ()} {
  259. fn G() -> type {
  260. return (Self as M).Z.b;
  261. }
  262. }
  263. // --- associated_int_in_array.carbon
  264. library "[[@TEST_NAME]]";
  265. interface I {
  266. let N:! i32;
  267. fn F[self: Self]() -> array(bool, N);
  268. }
  269. impl () as I where .N = 2 {
  270. fn F[unused self: Self]() -> array(bool, 2) { return (true, false); }
  271. }
  272. // --- symbolic_associated_type_in_concrete_context.carbon
  273. interface Z {
  274. let X:! type;
  275. }
  276. class C(T:! type) {}
  277. class D {}
  278. impl forall [T:! type] T as Z where .X = C(T) {}
  279. fn F() {
  280. let unused a: D.(Z.X) = {} as C(D);
  281. }
  282. // CHECK:STDOUT: --- associated_type_in_method_signature.carbon
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: constants {
  285. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  286. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  287. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  288. // CHECK:STDOUT: %assoc0.ebd: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete]
  289. // CHECK:STDOUT: %Self.as_type.9ea: type = facet_access_type %Self.8a1 [symbolic]
  290. // CHECK:STDOUT: %pattern_type.909: type = pattern_type %Self.as_type.9ea [symbolic]
  291. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  292. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  293. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  294. // CHECK:STDOUT: %.77f: Core.Form = init_form %impl.elem0.335 [symbolic]
  295. // CHECK:STDOUT: %J.WithSelf.F.type.adb: type = fn_type @J.WithSelf.F, @J.WithSelf(%Self.8a1) [symbolic]
  296. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  297. // CHECK:STDOUT: %J.WithSelf.F.569: %J.WithSelf.F.type.adb = struct_value () [symbolic]
  298. // CHECK:STDOUT: %assoc1.eeb: %J.assoc_type = assoc_entity element1, @J.WithSelf.%J.WithSelf.F.decl [concrete]
  299. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  300. // CHECK:STDOUT: %.Self.2fa: %J.type = symbolic_binding .Self [symbolic_self]
  301. // CHECK:STDOUT: %J.WithSelf.F.type.e19: type = fn_type @J.WithSelf.F, @J.WithSelf(%.Self.2fa) [symbolic_self]
  302. // CHECK:STDOUT: %J.WithSelf.F.659: %J.WithSelf.F.type.e19 = struct_value () [symbolic_self]
  303. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.2fa [symbolic_self]
  304. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self.2fa, @J [symbolic_self]
  305. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  306. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  307. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  308. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  309. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  310. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  311. // CHECK:STDOUT: %J_where.type.928: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  312. // CHECK:STDOUT: %J.impl_witness.5bf: <witness> = impl_witness @empty_tuple.type.as.J.impl.%J.impl_witness_table [concrete]
  313. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  314. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  315. // CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
  316. // CHECK:STDOUT: %empty_tuple.type.as.J.impl.F.type: type = fn_type @empty_tuple.type.as.J.impl.F [concrete]
  317. // CHECK:STDOUT: %empty_tuple.type.as.J.impl.F: %empty_tuple.type.as.J.impl.F.type = struct_value () [concrete]
  318. // CHECK:STDOUT: %J.facet.a51: %J.type = facet_value %empty_tuple.type, (%J.impl_witness.5bf) [concrete]
  319. // CHECK:STDOUT: %J.WithSelf.F.type.fd2: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.a51) [concrete]
  320. // CHECK:STDOUT: %J.WithSelf.F.497: %J.WithSelf.F.type.fd2 = struct_value () [concrete]
  321. // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
  322. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.5e6: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%N) [symbolic]
  323. // CHECK:STDOUT: %Int.as.Negate.impl.Op.7f5: %Int.as.Negate.impl.Op.type.5e6 = struct_value () [symbolic]
  324. // CHECK:STDOUT: %Negate.impl_witness.11c: <witness> = impl_witness imports.%Negate.impl_witness_table, @Int.as.Negate.impl(%int_32) [concrete]
  325. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.e60: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%int_32) [concrete]
  326. // CHECK:STDOUT: %Int.as.Negate.impl.Op.e7f: %Int.as.Negate.impl.Op.type.e60 = struct_value () [concrete]
  327. // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %i32, (%Negate.impl_witness.11c) [concrete]
  328. // CHECK:STDOUT: %Negate.WithSelf.Op.type.140: type = fn_type @Negate.WithSelf.Op, @Negate.WithSelf(%Negate.facet) [concrete]
  329. // CHECK:STDOUT: %.5dd: type = fn_type_with_self_type %Negate.WithSelf.Op.type.140, %Negate.facet [concrete]
  330. // CHECK:STDOUT: %Int.as.Negate.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Negate.impl.Op.e7f, @Int.as.Negate.impl.Op(%int_32) [concrete]
  331. // CHECK:STDOUT: %CallMethod.type: type = fn_type @CallMethod [concrete]
  332. // CHECK:STDOUT: %CallMethod: %CallMethod.type = struct_value () [concrete]
  333. // CHECK:STDOUT: %.b39: type = fn_type_with_self_type %J.WithSelf.F.type.fd2, %J.facet.a51 [concrete]
  334. // CHECK:STDOUT: %int_40.f80: Core.IntLiteral = int_value 40 [concrete]
  335. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  336. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  337. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  338. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  339. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  340. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  341. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  342. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  343. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  344. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  345. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  346. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  347. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_40.f80, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  348. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  349. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_40.f80, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  350. // CHECK:STDOUT: %int_40.518: %i32 = int_value 40 [concrete]
  351. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  352. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  353. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  354. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  355. // CHECK:STDOUT: %J_where.type.d0e: type = facet_type <@J where %impl.elem0.a58 = %C> [concrete]
  356. // CHECK:STDOUT: %J.impl_witness.00b: <witness> = impl_witness @C.as.J.impl.%J.impl_witness_table [concrete]
  357. // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete]
  358. // CHECK:STDOUT: %.a69: Core.Form = init_form %C [concrete]
  359. // CHECK:STDOUT: %C.as.J.impl.F.type: type = fn_type @C.as.J.impl.F [concrete]
  360. // CHECK:STDOUT: %C.as.J.impl.F: %C.as.J.impl.F.type = struct_value () [concrete]
  361. // CHECK:STDOUT: %J.facet.05d: %J.type = facet_value %C, (%J.impl_witness.00b) [concrete]
  362. // CHECK:STDOUT: %J.WithSelf.F.type.24e: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.05d) [concrete]
  363. // CHECK:STDOUT: %J.WithSelf.F.bd5: %J.WithSelf.F.type.24e = struct_value () [concrete]
  364. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  365. // CHECK:STDOUT: }
  366. // CHECK:STDOUT:
  367. // CHECK:STDOUT: imports {
  368. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  369. // CHECK:STDOUT: .Int = %Core.Int
  370. // CHECK:STDOUT: .Negate = %Core.Negate
  371. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  372. // CHECK:STDOUT: import Core//prelude
  373. // CHECK:STDOUT: import Core//prelude/...
  374. // CHECK:STDOUT: }
  375. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  376. // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type]
  377. // CHECK:STDOUT: %Core.import_ref.475 = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, unloaded
  378. // CHECK:STDOUT: %Core.import_ref.d40: @Int.as.Negate.impl.%Int.as.Negate.impl.Op.type (%Int.as.Negate.impl.Op.type.5e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Negate.impl.%Int.as.Negate.impl.Op (constants.%Int.as.Negate.impl.Op.7f5)]
  379. // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.475, %Core.import_ref.d40), @Int.as.Negate.impl [concrete]
  380. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  381. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  382. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  383. // CHECK:STDOUT: }
  384. // CHECK:STDOUT:
  385. // CHECK:STDOUT: file {
  386. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  387. // CHECK:STDOUT: .Core = imports.%Core
  388. // CHECK:STDOUT: .J = %J.decl
  389. // CHECK:STDOUT: .CallMethod = %CallMethod.decl
  390. // CHECK:STDOUT: .C = %C.decl
  391. // CHECK:STDOUT: }
  392. // CHECK:STDOUT: %Core.import = import Core
  393. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  394. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.J.impl [concrete] {} {
  395. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  396. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  397. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  398. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  399. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.2fa]
  400. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  401. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  402. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  403. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  404. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  405. // CHECK:STDOUT: %.loc8_14: type = where_expr [concrete = constants.%J_where.type.928] {
  406. // CHECK:STDOUT: requirement_base_facet_type %J.ref
  407. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  408. // CHECK:STDOUT: }
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT: %CallMethod.decl: %CallMethod.type = fn_decl @CallMethod [concrete = constants.%CallMethod] {
  411. // CHECK:STDOUT: %x.param_patt: %pattern_type.cb1 = value_param_pattern [concrete]
  412. // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = at_binding_pattern x, %x.param_patt [concrete]
  413. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  414. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, %i32 [concrete]
  415. // CHECK:STDOUT: } {
  416. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  417. // CHECK:STDOUT: %.loc12_25: Core.Form = init_form %i32 [concrete = constants.%.ff5]
  418. // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0
  419. // CHECK:STDOUT: %.loc12_19.1: type = splice_block %.loc12_19.3 [concrete = constants.%empty_tuple.type] {
  420. // CHECK:STDOUT: %.loc12_19.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  421. // CHECK:STDOUT: %.loc12_19.3: type = converted %.loc12_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %x.param
  424. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  425. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  428. // CHECK:STDOUT: impl_decl @C.as.J.impl [concrete] {} {
  429. // CHECK:STDOUT: %C.ref.loc21_6: type = name_ref C, file.%C.decl [concrete = constants.%C]
  430. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  431. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  432. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.2fa]
  433. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  434. // CHECK:STDOUT: %.loc21_19: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  435. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  436. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  437. // CHECK:STDOUT: %C.ref.loc21_24: type = name_ref C, file.%C.decl [concrete = constants.%C]
  438. // CHECK:STDOUT: %.loc21_13: type = where_expr [concrete = constants.%J_where.type.d0e] {
  439. // CHECK:STDOUT: requirement_base_facet_type %J.ref
  440. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.ref.loc21_24
  441. // CHECK:STDOUT: }
  442. // CHECK:STDOUT: }
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: interface @J {
  446. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  447. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  448. // CHECK:STDOUT:
  449. // CHECK:STDOUT: !with Self:
  450. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  451. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete = constants.%assoc0.ebd]
  452. // CHECK:STDOUT: }
  453. // CHECK:STDOUT: %J.WithSelf.F.decl: @J.WithSelf.%J.WithSelf.F.type (%J.WithSelf.F.type.adb) = fn_decl @J.WithSelf.F [symbolic = @J.WithSelf.%J.WithSelf.F (constants.%J.WithSelf.F.569)] {
  454. // CHECK:STDOUT: %self.param_patt: @J.WithSelf.F.%pattern_type.loc5_12 (%pattern_type.909) = value_param_pattern [concrete]
  455. // CHECK:STDOUT: %self.patt: @J.WithSelf.F.%pattern_type.loc5_12 (%pattern_type.909) = at_binding_pattern self, %self.param_patt [concrete]
  456. // CHECK:STDOUT: %u.param_patt: @J.WithSelf.F.%pattern_type.loc5_21 (%pattern_type.c1a) = value_param_pattern [concrete]
  457. // CHECK:STDOUT: %u.patt: @J.WithSelf.F.%pattern_type.loc5_21 (%pattern_type.c1a) = at_binding_pattern u, %u.param_patt [concrete]
  458. // CHECK:STDOUT: %return.param_patt: @J.WithSelf.F.%pattern_type.loc5_21 (%pattern_type.c1a) = out_param_pattern [concrete]
  459. // CHECK:STDOUT: %return.patt: @J.WithSelf.F.%pattern_type.loc5_21 (%pattern_type.c1a) = return_slot_pattern %return.param_patt, %U.ref.loc5_29 [concrete]
  460. // CHECK:STDOUT: } {
  461. // CHECK:STDOUT: %impl.elem0.loc5_29: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  462. // CHECK:STDOUT: %U.ref.loc5_29: type = name_ref U, %impl.elem0.loc5_29 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  463. // CHECK:STDOUT: %.loc5_29.2: Core.Form = init_form %U.ref.loc5_29 [symbolic = %.loc5_29.1 (constants.%.77f)]
  464. // CHECK:STDOUT: %self.param: @J.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.9ea) = value_param call_param0
  465. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.9ea)] {
  466. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self.8a1)]
  467. // 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.9ea)]
  468. // 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.9ea)]
  469. // CHECK:STDOUT: }
  470. // CHECK:STDOUT: %self: @J.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.9ea) = value_binding self, %self.param
  471. // CHECK:STDOUT: %u.param: @J.WithSelf.F.%impl.elem0.loc5_23.1 (%impl.elem0.335) = value_param call_param1
  472. // CHECK:STDOUT: %.loc5_23: type = splice_block %U.ref.loc5_23 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)] {
  473. // CHECK:STDOUT: %impl.elem0.loc5_23.2: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  474. // CHECK:STDOUT: %U.ref.loc5_23: type = name_ref U, %impl.elem0.loc5_23.2 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  475. // CHECK:STDOUT: }
  476. // CHECK:STDOUT: %u: @J.WithSelf.F.%impl.elem0.loc5_23.1 (%impl.elem0.335) = value_binding u, %u.param
  477. // CHECK:STDOUT: %return.param: ref @J.WithSelf.F.%impl.elem0.loc5_23.1 (%impl.elem0.335) = out_param call_param2
  478. // CHECK:STDOUT: %return: ref @J.WithSelf.F.%impl.elem0.loc5_23.1 (%impl.elem0.335) = return_slot %return.param
  479. // CHECK:STDOUT: }
  480. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.WithSelf.F.decl [concrete = constants.%assoc1.eeb]
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: !members:
  483. // CHECK:STDOUT: .Self = %Self
  484. // CHECK:STDOUT: .U = @U.%assoc0
  485. // CHECK:STDOUT: .F = @J.WithSelf.%assoc1
  486. // CHECK:STDOUT: witness = (@J.WithSelf.%U, @J.WithSelf.%J.WithSelf.F.decl)
  487. // CHECK:STDOUT:
  488. // CHECK:STDOUT: !requires:
  489. // CHECK:STDOUT: }
  490. // CHECK:STDOUT:
  491. // CHECK:STDOUT: impl @empty_tuple.type.as.J.impl: %.loc8_7.2 as %.loc8_14 {
  492. // CHECK:STDOUT: %empty_tuple.type.as.J.impl.F.decl: %empty_tuple.type.as.J.impl.F.type = fn_decl @empty_tuple.type.as.J.impl.F [concrete = constants.%empty_tuple.type.as.J.impl.F] {
  493. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern [concrete]
  494. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = at_binding_pattern self, %self.param_patt [concrete]
  495. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  496. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = at_binding_pattern u, %u.param_patt [concrete]
  497. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  498. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, %i32.loc9_38 [concrete]
  499. // CHECK:STDOUT: } {
  500. // CHECK:STDOUT: %i32.loc9_38: type = type_literal constants.%i32 [concrete = constants.%i32]
  501. // CHECK:STDOUT: %.loc9: Core.Form = init_form %i32.loc9_38 [concrete = constants.%.ff5]
  502. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  503. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.J.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  504. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  505. // CHECK:STDOUT: %u.param: %i32 = value_param call_param1
  506. // CHECK:STDOUT: %i32.loc9_30: type = type_literal constants.%i32 [concrete = constants.%i32]
  507. // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param
  508. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
  509. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.J.impl.F.decl), @empty_tuple.type.as.J.impl [concrete]
  512. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.5bf]
  513. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  514. // CHECK:STDOUT:
  515. // CHECK:STDOUT: !members:
  516. // CHECK:STDOUT: .F = %empty_tuple.type.as.J.impl.F.decl
  517. // CHECK:STDOUT: witness = %J.impl_witness
  518. // CHECK:STDOUT: }
  519. // CHECK:STDOUT:
  520. // CHECK:STDOUT: impl @C.as.J.impl: %C.ref.loc21_6 as %.loc21_13 {
  521. // CHECK:STDOUT: %C.as.J.impl.F.decl: %C.as.J.impl.F.type = fn_decl @C.as.J.impl.F [concrete = constants.%C.as.J.impl.F] {
  522. // CHECK:STDOUT: %self.param_patt: %pattern_type.7c7 = value_param_pattern [concrete]
  523. // CHECK:STDOUT: %self.patt: %pattern_type.7c7 = at_binding_pattern self, %self.param_patt [concrete]
  524. // CHECK:STDOUT: %u.param_patt: %pattern_type.7c7 = value_param_pattern [concrete]
  525. // CHECK:STDOUT: %u.patt: %pattern_type.7c7 = at_binding_pattern u, %u.param_patt [concrete]
  526. // CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern [concrete]
  527. // CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern %return.param_patt, %C.ref.loc22_36 [concrete]
  528. // CHECK:STDOUT: } {
  529. // CHECK:STDOUT: %C.ref.loc22_36: type = name_ref C, file.%C.decl [concrete = constants.%C]
  530. // CHECK:STDOUT: %.loc22_36: Core.Form = init_form %C.ref.loc22_36 [concrete = constants.%.a69]
  531. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  532. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.J.impl.%C.ref.loc21_6 [concrete = constants.%C]
  533. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  534. // CHECK:STDOUT: %u.param: %C = value_param call_param1
  535. // CHECK:STDOUT: %C.ref.loc22_30: type = name_ref C, file.%C.decl [concrete = constants.%C]
  536. // CHECK:STDOUT: %u: %C = value_binding u, %u.param
  537. // CHECK:STDOUT: %return.param: ref %C = out_param call_param2
  538. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  539. // CHECK:STDOUT: }
  540. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C.as.J.impl.F.decl), @C.as.J.impl [concrete]
  541. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.00b]
  542. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C]
  543. // CHECK:STDOUT:
  544. // CHECK:STDOUT: !members:
  545. // CHECK:STDOUT: .C = <poisoned>
  546. // CHECK:STDOUT: .F = %C.as.J.impl.F.decl
  547. // CHECK:STDOUT: witness = %J.impl_witness
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT:
  550. // CHECK:STDOUT: class @C {
  551. // CHECK:STDOUT: %.loc18_10: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  552. // CHECK:STDOUT: %.loc18_11: type = converted %.loc18_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  553. // CHECK:STDOUT: adapt_decl %.loc18_11 [concrete]
  554. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  555. // CHECK:STDOUT: complete_type_witness = %complete_type
  556. // CHECK:STDOUT:
  557. // CHECK:STDOUT: !members:
  558. // CHECK:STDOUT: .Self = constants.%C
  559. // CHECK:STDOUT: }
  560. // CHECK:STDOUT:
  561. // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self: %J.type) {
  562. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  563. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.9ea)]
  564. // CHECK:STDOUT: %pattern_type.loc5_12: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type.loc5_12 (constants.%pattern_type.909)]
  565. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  566. // CHECK:STDOUT: %impl.elem0.loc5_23.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  567. // CHECK:STDOUT: %pattern_type.loc5_21: type = pattern_type %impl.elem0.loc5_23.1 [symbolic = %pattern_type.loc5_21 (constants.%pattern_type.c1a)]
  568. // CHECK:STDOUT: %.loc5_29.1: Core.Form = init_form %impl.elem0.loc5_23.1 [symbolic = %.loc5_29.1 (constants.%.77f)]
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: fn(%self.param: @J.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.9ea), %u.param: @J.WithSelf.F.%impl.elem0.loc5_23.1 (%impl.elem0.335)) -> out %return.param: @J.WithSelf.F.%impl.elem0.loc5_23.1 (%impl.elem0.335);
  571. // CHECK:STDOUT: }
  572. // CHECK:STDOUT:
  573. // CHECK:STDOUT: fn @empty_tuple.type.as.J.impl.F(%self.param: %empty_tuple.type, %u.param: %i32) -> out %return.param: %i32 {
  574. // CHECK:STDOUT: !entry:
  575. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
  576. // CHECK:STDOUT: %impl.elem1: %.5dd = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f]
  577. // CHECK:STDOUT: %bound_method.loc9_51.1: <bound method> = bound_method %u.ref, %impl.elem1
  578. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem1, @Int.as.Negate.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Negate.impl.Op.specific_fn]
  579. // CHECK:STDOUT: %bound_method.loc9_51.2: <bound method> = bound_method %u.ref, %specific_fn
  580. // CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc9_51.2(%u.ref)
  581. // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call
  582. // CHECK:STDOUT: }
  583. // CHECK:STDOUT:
  584. // CHECK:STDOUT: fn @CallMethod(%x.param: %empty_tuple.type) -> out %return.param: %i32 {
  585. // CHECK:STDOUT: !entry:
  586. // CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, %x
  587. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  588. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.WithSelf.%assoc1 [concrete = constants.%assoc1.eeb]
  589. // CHECK:STDOUT: %impl.elem1: %.b39 = impl_witness_access constants.%J.impl_witness.5bf, element1 [concrete = constants.%empty_tuple.type.as.J.impl.F]
  590. // CHECK:STDOUT: %bound_method.loc13_11: <bound method> = bound_method %x.ref, %impl.elem1
  591. // CHECK:STDOUT: %int_40: Core.IntLiteral = int_value 40 [concrete = constants.%int_40.f80]
  592. // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  593. // CHECK:STDOUT: %bound_method.loc13_18.1: <bound method> = bound_method %int_40, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  594. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  595. // CHECK:STDOUT: %bound_method.loc13_18.2: <bound method> = bound_method %int_40, %specific_fn [concrete = constants.%bound_method]
  596. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_18.2(%int_40) [concrete = constants.%int_40.518]
  597. // CHECK:STDOUT: %.loc13_18.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_40.518]
  598. // CHECK:STDOUT: %.loc13_18.2: %i32 = converted %int_40, %.loc13_18.1 [concrete = constants.%int_40.518]
  599. // CHECK:STDOUT: %empty_tuple.type.as.J.impl.F.call: init %i32 = call %bound_method.loc13_11(%x.ref, %.loc13_18.2)
  600. // CHECK:STDOUT: return %empty_tuple.type.as.J.impl.F.call
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT:
  603. // CHECK:STDOUT: fn @C.as.J.impl.F(%self.param: %C, %u.param: %C) -> out %return.param: %C {
  604. // CHECK:STDOUT: !entry:
  605. // CHECK:STDOUT: %self.ref: %C = name_ref self, %self
  606. // CHECK:STDOUT: %.loc22_51.1: %empty_struct_type = as_compatible %self.ref
  607. // CHECK:STDOUT: %.loc22_51.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
  608. // CHECK:STDOUT: %.loc22_51.3: init %C = as_compatible %.loc22_51.2 [concrete = constants.%C.val]
  609. // CHECK:STDOUT: %.loc22_51.4: init %C = converted %self.ref, %.loc22_51.3 [concrete = constants.%C.val]
  610. // CHECK:STDOUT: return %.loc22_51.4
  611. // CHECK:STDOUT: }
  612. // CHECK:STDOUT:
  613. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self.8a1) {
  614. // CHECK:STDOUT: !definition:
  615. // CHECK:STDOUT: %Self => constants.%Self.8a1
  616. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.adb
  617. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.569
  618. // CHECK:STDOUT: }
  619. // CHECK:STDOUT:
  620. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self.8a1) {
  621. // CHECK:STDOUT: %Self => constants.%Self.8a1
  622. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.9ea
  623. // CHECK:STDOUT: %pattern_type.loc5_12 => constants.%pattern_type.909
  624. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  625. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.335
  626. // CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.c1a
  627. // CHECK:STDOUT: %.loc5_29.1 => constants.%.77f
  628. // CHECK:STDOUT: }
  629. // CHECK:STDOUT:
  630. // CHECK:STDOUT: specific @J.WithSelf(constants.%.Self.2fa) {
  631. // CHECK:STDOUT: !definition:
  632. // CHECK:STDOUT: %Self => constants.%.Self.2fa
  633. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.e19
  634. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.659
  635. // CHECK:STDOUT: }
  636. // CHECK:STDOUT:
  637. // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet.a51) {
  638. // CHECK:STDOUT: !definition:
  639. // CHECK:STDOUT: %Self => constants.%J.facet.a51
  640. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.fd2
  641. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.497
  642. // CHECK:STDOUT: }
  643. // CHECK:STDOUT:
  644. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet.a51) {
  645. // CHECK:STDOUT: %Self => constants.%J.facet.a51
  646. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_tuple.type
  647. // CHECK:STDOUT: %pattern_type.loc5_12 => constants.%pattern_type.cb1
  648. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness.5bf
  649. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%i32
  650. // CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.7ce
  651. // CHECK:STDOUT: %.loc5_29.1 => constants.%.ff5
  652. // CHECK:STDOUT: }
  653. // CHECK:STDOUT:
  654. // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet.05d) {
  655. // CHECK:STDOUT: !definition:
  656. // CHECK:STDOUT: %Self => constants.%J.facet.05d
  657. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.24e
  658. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.bd5
  659. // CHECK:STDOUT: }
  660. // CHECK:STDOUT:
  661. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet.05d) {
  662. // CHECK:STDOUT: %Self => constants.%J.facet.05d
  663. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%C
  664. // CHECK:STDOUT: %pattern_type.loc5_12 => constants.%pattern_type.7c7
  665. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness.00b
  666. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%C
  667. // CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.7c7
  668. // CHECK:STDOUT: %.loc5_29.1 => constants.%.a69
  669. // CHECK:STDOUT: }
  670. // CHECK:STDOUT:
  671. // CHECK:STDOUT: --- associated_type_in_function_signature.carbon
  672. // CHECK:STDOUT:
  673. // CHECK:STDOUT: constants {
  674. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  675. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  676. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  677. // CHECK:STDOUT: %assoc0.ebd: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete]
  678. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  679. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  680. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  681. // CHECK:STDOUT: %.77f: Core.Form = init_form %impl.elem0.335 [symbolic]
  682. // CHECK:STDOUT: %J.WithSelf.F.type.adb: type = fn_type @J.WithSelf.F, @J.WithSelf(%Self.8a1) [symbolic]
  683. // CHECK:STDOUT: %J.WithSelf.F.569: %J.WithSelf.F.type.adb = struct_value () [symbolic]
  684. // CHECK:STDOUT: %assoc1.eeb: %J.assoc_type = assoc_entity element1, @J.WithSelf.%J.WithSelf.F.decl [concrete]
  685. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  686. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  687. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  688. // CHECK:STDOUT: %.Self.2fa: %J.type = symbolic_binding .Self [symbolic_self]
  689. // CHECK:STDOUT: %J.WithSelf.F.type.e19: type = fn_type @J.WithSelf.F, @J.WithSelf(%.Self.2fa) [symbolic_self]
  690. // CHECK:STDOUT: %J.WithSelf.F.659: %J.WithSelf.F.type.e19 = struct_value () [symbolic_self]
  691. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.2fa [symbolic_self]
  692. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self.2fa, @J [symbolic_self]
  693. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  694. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  695. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  696. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  697. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  698. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  699. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  700. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @D.as.J.impl.%J.impl_witness_table [concrete]
  701. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  702. // CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
  703. // CHECK:STDOUT: %D.as.J.impl.F.type: type = fn_type @D.as.J.impl.F [concrete]
  704. // CHECK:STDOUT: %D.as.J.impl.F: %D.as.J.impl.F.type = struct_value () [concrete]
  705. // CHECK:STDOUT: %J.facet: %J.type = facet_value %D, (%J.impl_witness) [concrete]
  706. // CHECK:STDOUT: %J.WithSelf.F.type.7f3: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet) [concrete]
  707. // CHECK:STDOUT: %J.WithSelf.F.973: %J.WithSelf.F.type.7f3 = struct_value () [concrete]
  708. // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
  709. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.5e6: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%N) [symbolic]
  710. // CHECK:STDOUT: %Int.as.Negate.impl.Op.7f5: %Int.as.Negate.impl.Op.type.5e6 = struct_value () [symbolic]
  711. // CHECK:STDOUT: %Negate.impl_witness.11c: <witness> = impl_witness imports.%Negate.impl_witness_table, @Int.as.Negate.impl(%int_32) [concrete]
  712. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.e60: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%int_32) [concrete]
  713. // CHECK:STDOUT: %Int.as.Negate.impl.Op.e7f: %Int.as.Negate.impl.Op.type.e60 = struct_value () [concrete]
  714. // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %i32, (%Negate.impl_witness.11c) [concrete]
  715. // CHECK:STDOUT: %Negate.WithSelf.Op.type.140: type = fn_type @Negate.WithSelf.Op, @Negate.WithSelf(%Negate.facet) [concrete]
  716. // CHECK:STDOUT: %.5dd: type = fn_type_with_self_type %Negate.WithSelf.Op.type.140, %Negate.facet [concrete]
  717. // CHECK:STDOUT: %Int.as.Negate.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Negate.impl.Op.e7f, @Int.as.Negate.impl.Op(%int_32) [concrete]
  718. // CHECK:STDOUT: %CallFunction.type: type = fn_type @CallFunction [concrete]
  719. // CHECK:STDOUT: %CallFunction: %CallFunction.type = struct_value () [concrete]
  720. // CHECK:STDOUT: %.291: type = fn_type_with_self_type %J.WithSelf.F.type.7f3, %J.facet [concrete]
  721. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
  722. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  723. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  724. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  725. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  726. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  727. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  728. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  729. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  730. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  731. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  732. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  733. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  734. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  735. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  736. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  737. // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
  738. // CHECK:STDOUT: }
  739. // CHECK:STDOUT:
  740. // CHECK:STDOUT: imports {
  741. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  742. // CHECK:STDOUT: .Int = %Core.Int
  743. // CHECK:STDOUT: .Negate = %Core.Negate
  744. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  745. // CHECK:STDOUT: import Core//prelude
  746. // CHECK:STDOUT: import Core//prelude/...
  747. // CHECK:STDOUT: }
  748. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  749. // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type]
  750. // CHECK:STDOUT: %Core.import_ref.475 = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, unloaded
  751. // CHECK:STDOUT: %Core.import_ref.d40: @Int.as.Negate.impl.%Int.as.Negate.impl.Op.type (%Int.as.Negate.impl.Op.type.5e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Negate.impl.%Int.as.Negate.impl.Op (constants.%Int.as.Negate.impl.Op.7f5)]
  752. // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.475, %Core.import_ref.d40), @Int.as.Negate.impl [concrete]
  753. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  754. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  755. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: file {
  759. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  760. // CHECK:STDOUT: .Core = imports.%Core
  761. // CHECK:STDOUT: .J = %J.decl
  762. // CHECK:STDOUT: .D = %D.decl
  763. // CHECK:STDOUT: .CallFunction = %CallFunction.decl
  764. // CHECK:STDOUT: }
  765. // CHECK:STDOUT: %Core.import = import Core
  766. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  767. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  768. // CHECK:STDOUT: impl_decl @D.as.J.impl [concrete] {} {
  769. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  770. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  771. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  772. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.2fa]
  773. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  774. // CHECK:STDOUT: %.loc10_19: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  775. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  776. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  777. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  778. // CHECK:STDOUT: %.loc10_13: type = where_expr [concrete = constants.%J_where.type] {
  779. // CHECK:STDOUT: requirement_base_facet_type %J.ref
  780. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  781. // CHECK:STDOUT: }
  782. // CHECK:STDOUT: }
  783. // CHECK:STDOUT: %CallFunction.decl: %CallFunction.type = fn_decl @CallFunction [concrete = constants.%CallFunction] {
  784. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  785. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, %i32 [concrete]
  786. // CHECK:STDOUT: } {
  787. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  788. // CHECK:STDOUT: %.loc14: Core.Form = init_form %i32 [concrete = constants.%.ff5]
  789. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  790. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  791. // CHECK:STDOUT: }
  792. // CHECK:STDOUT: }
  793. // CHECK:STDOUT:
  794. // CHECK:STDOUT: interface @J {
  795. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  796. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  797. // CHECK:STDOUT:
  798. // CHECK:STDOUT: !with Self:
  799. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  800. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete = constants.%assoc0.ebd]
  801. // CHECK:STDOUT: }
  802. // CHECK:STDOUT: %J.WithSelf.F.decl: @J.WithSelf.%J.WithSelf.F.type (%J.WithSelf.F.type.adb) = fn_decl @J.WithSelf.F [symbolic = @J.WithSelf.%J.WithSelf.F (constants.%J.WithSelf.F.569)] {
  803. // CHECK:STDOUT: %u.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = value_param_pattern [concrete]
  804. // CHECK:STDOUT: %u.patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = at_binding_pattern u, %u.param_patt [concrete]
  805. // CHECK:STDOUT: %return.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = out_param_pattern [concrete]
  806. // CHECK:STDOUT: %return.patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = return_slot_pattern %return.param_patt, %U.ref.loc5_17 [concrete]
  807. // CHECK:STDOUT: } {
  808. // CHECK:STDOUT: %impl.elem0.loc5_17: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  809. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  810. // CHECK:STDOUT: %.loc5_17.2: Core.Form = init_form %U.ref.loc5_17 [symbolic = %.loc5_17.1 (constants.%.77f)]
  811. // CHECK:STDOUT: %u.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_param call_param0
  812. // CHECK:STDOUT: %.loc5_11: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)] {
  813. // CHECK:STDOUT: %impl.elem0.loc5_11.2: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  814. // CHECK:STDOUT: %U.ref.loc5_11: type = name_ref U, %impl.elem0.loc5_11.2 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  815. // CHECK:STDOUT: }
  816. // CHECK:STDOUT: %u: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_binding u, %u.param
  817. // CHECK:STDOUT: %return.param: ref @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = out_param call_param1
  818. // CHECK:STDOUT: %return: ref @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = return_slot %return.param
  819. // CHECK:STDOUT: }
  820. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.WithSelf.F.decl [concrete = constants.%assoc1.eeb]
  821. // CHECK:STDOUT:
  822. // CHECK:STDOUT: !members:
  823. // CHECK:STDOUT: .Self = %Self
  824. // CHECK:STDOUT: .U = @U.%assoc0
  825. // CHECK:STDOUT: .F = @J.WithSelf.%assoc1
  826. // CHECK:STDOUT: witness = (@J.WithSelf.%U, @J.WithSelf.%J.WithSelf.F.decl)
  827. // CHECK:STDOUT:
  828. // CHECK:STDOUT: !requires:
  829. // CHECK:STDOUT: }
  830. // CHECK:STDOUT:
  831. // CHECK:STDOUT: impl @D.as.J.impl: %D.ref as %.loc10_13 {
  832. // CHECK:STDOUT: %D.as.J.impl.F.decl: %D.as.J.impl.F.type = fn_decl @D.as.J.impl.F [concrete = constants.%D.as.J.impl.F] {
  833. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  834. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = at_binding_pattern u, %u.param_patt [concrete]
  835. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  836. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, %i32.loc11_19 [concrete]
  837. // CHECK:STDOUT: } {
  838. // CHECK:STDOUT: %i32.loc11_19: type = type_literal constants.%i32 [concrete = constants.%i32]
  839. // CHECK:STDOUT: %.loc11: Core.Form = init_form %i32.loc11_19 [concrete = constants.%.ff5]
  840. // CHECK:STDOUT: %u.param: %i32 = value_param call_param0
  841. // CHECK:STDOUT: %i32.loc11_11: type = type_literal constants.%i32 [concrete = constants.%i32]
  842. // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param
  843. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  844. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  845. // CHECK:STDOUT: }
  846. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %D.as.J.impl.F.decl), @D.as.J.impl [concrete]
  847. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  848. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  849. // CHECK:STDOUT:
  850. // CHECK:STDOUT: !members:
  851. // CHECK:STDOUT: .F = %D.as.J.impl.F.decl
  852. // CHECK:STDOUT: witness = %J.impl_witness
  853. // CHECK:STDOUT: }
  854. // CHECK:STDOUT:
  855. // CHECK:STDOUT: class @D {
  856. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  857. // CHECK:STDOUT: complete_type_witness = %complete_type
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: !members:
  860. // CHECK:STDOUT: .Self = constants.%D
  861. // CHECK:STDOUT: }
  862. // CHECK:STDOUT:
  863. // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self: %J.type) {
  864. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  865. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  866. // CHECK:STDOUT: %impl.elem0.loc5_11.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  867. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.c1a)]
  868. // CHECK:STDOUT: %.loc5_17.1: Core.Form = init_form %impl.elem0.loc5_11.1 [symbolic = %.loc5_17.1 (constants.%.77f)]
  869. // CHECK:STDOUT:
  870. // CHECK:STDOUT: fn(%u.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335)) -> out %return.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335);
  871. // CHECK:STDOUT: }
  872. // CHECK:STDOUT:
  873. // CHECK:STDOUT: fn @D.as.J.impl.F(%u.param: %i32) -> out %return.param: %i32 {
  874. // CHECK:STDOUT: !entry:
  875. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
  876. // CHECK:STDOUT: %impl.elem1: %.5dd = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f]
  877. // CHECK:STDOUT: %bound_method.loc11_32.1: <bound method> = bound_method %u.ref, %impl.elem1
  878. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem1, @Int.as.Negate.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Negate.impl.Op.specific_fn]
  879. // CHECK:STDOUT: %bound_method.loc11_32.2: <bound method> = bound_method %u.ref, %specific_fn
  880. // CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc11_32.2(%u.ref)
  881. // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call
  882. // CHECK:STDOUT: }
  883. // CHECK:STDOUT:
  884. // CHECK:STDOUT: fn @CallFunction() -> out %return.param: %i32 {
  885. // CHECK:STDOUT: !entry:
  886. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  887. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  888. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.WithSelf.%assoc1 [concrete = constants.%assoc1.eeb]
  889. // CHECK:STDOUT: %J.facet: %J.type = facet_value %D.ref, (constants.%J.impl_witness) [concrete = constants.%J.facet]
  890. // CHECK:STDOUT: %.loc15_11: %J.type = converted %D.ref, %J.facet [concrete = constants.%J.facet]
  891. // CHECK:STDOUT: %impl.elem1: %.291 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%D.as.J.impl.F]
  892. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  893. // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  894. // CHECK:STDOUT: %bound_method.loc15_18.1: <bound method> = bound_method %int_4, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  895. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  896. // CHECK:STDOUT: %bound_method.loc15_18.2: <bound method> = bound_method %int_4, %specific_fn [concrete = constants.%bound_method]
  897. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc15_18.2(%int_4) [concrete = constants.%int_4.940]
  898. // CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_4.940]
  899. // CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_4, %.loc15_18.1 [concrete = constants.%int_4.940]
  900. // CHECK:STDOUT: %D.as.J.impl.F.call: init %i32 = call %impl.elem1(%.loc15_18.2)
  901. // CHECK:STDOUT: return %D.as.J.impl.F.call
  902. // CHECK:STDOUT: }
  903. // CHECK:STDOUT:
  904. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self.8a1) {
  905. // CHECK:STDOUT: !definition:
  906. // CHECK:STDOUT: %Self => constants.%Self.8a1
  907. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.adb
  908. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.569
  909. // CHECK:STDOUT: }
  910. // CHECK:STDOUT:
  911. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self.8a1) {
  912. // CHECK:STDOUT: %Self => constants.%Self.8a1
  913. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  914. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.335
  915. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c1a
  916. // CHECK:STDOUT: %.loc5_17.1 => constants.%.77f
  917. // CHECK:STDOUT: }
  918. // CHECK:STDOUT:
  919. // CHECK:STDOUT: specific @J.WithSelf(constants.%.Self.2fa) {
  920. // CHECK:STDOUT: !definition:
  921. // CHECK:STDOUT: %Self => constants.%.Self.2fa
  922. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.e19
  923. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.659
  924. // CHECK:STDOUT: }
  925. // CHECK:STDOUT:
  926. // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet) {
  927. // CHECK:STDOUT: !definition:
  928. // CHECK:STDOUT: %Self => constants.%J.facet
  929. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.7f3
  930. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.973
  931. // CHECK:STDOUT: }
  932. // CHECK:STDOUT:
  933. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet) {
  934. // CHECK:STDOUT: %Self => constants.%J.facet
  935. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  936. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  937. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  938. // CHECK:STDOUT: %.loc5_17.1 => constants.%.ff5
  939. // CHECK:STDOUT: }
  940. // CHECK:STDOUT:
  941. // CHECK:STDOUT: --- extend_impl_with_associated_type_in_signature.carbon
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: constants {
  944. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  945. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  946. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  947. // CHECK:STDOUT: %assoc0.ebd: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete]
  948. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  949. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  950. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  951. // CHECK:STDOUT: %.77f: Core.Form = init_form %impl.elem0.335 [symbolic]
  952. // CHECK:STDOUT: %J.WithSelf.F.type.adb: type = fn_type @J.WithSelf.F, @J.WithSelf(%Self.8a1) [symbolic]
  953. // CHECK:STDOUT: %J.WithSelf.F.569: %J.WithSelf.F.type.adb = struct_value () [symbolic]
  954. // CHECK:STDOUT: %assoc1.eeb: %J.assoc_type = assoc_entity element1, @J.WithSelf.%J.WithSelf.F.decl [concrete]
  955. // CHECK:STDOUT: %Self.as_type.9ea: type = facet_access_type %Self.8a1 [symbolic]
  956. // CHECK:STDOUT: %pattern_type.909: type = pattern_type %Self.as_type.9ea [symbolic]
  957. // CHECK:STDOUT: %J.WithSelf.G.type.ace: type = fn_type @J.WithSelf.G, @J.WithSelf(%Self.8a1) [symbolic]
  958. // CHECK:STDOUT: %J.WithSelf.G.6e7: %J.WithSelf.G.type.ace = struct_value () [symbolic]
  959. // CHECK:STDOUT: %assoc2: %J.assoc_type = assoc_entity element2, @J.WithSelf.%J.WithSelf.G.decl [concrete]
  960. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  961. // CHECK:STDOUT: %.Self.2fa: %J.type = symbolic_binding .Self [symbolic_self]
  962. // CHECK:STDOUT: %J.WithSelf.F.type.e19: type = fn_type @J.WithSelf.F, @J.WithSelf(%.Self.2fa) [symbolic_self]
  963. // CHECK:STDOUT: %J.WithSelf.F.659: %J.WithSelf.F.type.e19 = struct_value () [symbolic_self]
  964. // CHECK:STDOUT: %J.WithSelf.G.type.2cf: type = fn_type @J.WithSelf.G, @J.WithSelf(%.Self.2fa) [symbolic_self]
  965. // CHECK:STDOUT: %J.WithSelf.G.4f5: %J.WithSelf.G.type.2cf = struct_value () [symbolic_self]
  966. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.2fa [symbolic_self]
  967. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self.2fa, @J [symbolic_self]
  968. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  969. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  970. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  971. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  972. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  973. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  974. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  975. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  976. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  977. // CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
  978. // CHECK:STDOUT: %E.as.J.impl.F.type: type = fn_type @E.as.J.impl.F [concrete]
  979. // CHECK:STDOUT: %E.as.J.impl.F: %E.as.J.impl.F.type = struct_value () [concrete]
  980. // CHECK:STDOUT: %pattern_type.99f: type = pattern_type %E [concrete]
  981. // CHECK:STDOUT: %E.as.J.impl.G.type: type = fn_type @E.as.J.impl.G [concrete]
  982. // CHECK:STDOUT: %E.as.J.impl.G: %E.as.J.impl.G.type = struct_value () [concrete]
  983. // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  984. // CHECK:STDOUT: %J.WithSelf.F.type.7ab: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet) [concrete]
  985. // CHECK:STDOUT: %J.WithSelf.F.ef0: %J.WithSelf.F.type.7ab = struct_value () [concrete]
  986. // CHECK:STDOUT: %J.WithSelf.G.type.caf: type = fn_type @J.WithSelf.G, @J.WithSelf(%J.facet) [concrete]
  987. // CHECK:STDOUT: %J.WithSelf.G.f88: %J.WithSelf.G.type.caf = struct_value () [concrete]
  988. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  989. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  990. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  991. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
  992. // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
  993. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.5e6: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%N) [symbolic]
  994. // CHECK:STDOUT: %Int.as.Negate.impl.Op.7f5: %Int.as.Negate.impl.Op.type.5e6 = struct_value () [symbolic]
  995. // CHECK:STDOUT: %Negate.impl_witness.11c: <witness> = impl_witness imports.%Negate.impl_witness_table, @Int.as.Negate.impl(%int_32) [concrete]
  996. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.e60: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%int_32) [concrete]
  997. // CHECK:STDOUT: %Int.as.Negate.impl.Op.e7f: %Int.as.Negate.impl.Op.type.e60 = struct_value () [concrete]
  998. // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %i32, (%Negate.impl_witness.11c) [concrete]
  999. // CHECK:STDOUT: %Negate.WithSelf.Op.type.140: type = fn_type @Negate.WithSelf.Op, @Negate.WithSelf(%Negate.facet) [concrete]
  1000. // CHECK:STDOUT: %.5dd: type = fn_type_with_self_type %Negate.WithSelf.Op.type.140, %Negate.facet [concrete]
  1001. // CHECK:STDOUT: %Int.as.Negate.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Negate.impl.Op.e7f, @Int.as.Negate.impl.Op(%int_32) [concrete]
  1002. // CHECK:STDOUT: %CallBoth.type: type = fn_type @CallBoth [concrete]
  1003. // CHECK:STDOUT: %CallBoth: %CallBoth.type = struct_value () [concrete]
  1004. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1005. // CHECK:STDOUT: %E.type.facet: %type = facet_value %E, () [concrete]
  1006. // CHECK:STDOUT: %J.WithSelf.F.type.d1c: type = fn_type @J.WithSelf.F, @J.WithSelf(%E.type.facet) [concrete]
  1007. // CHECK:STDOUT: %J.WithSelf.F.1a6: %J.WithSelf.F.type.d1c = struct_value () [concrete]
  1008. // CHECK:STDOUT: %J.WithSelf.G.type.d39: type = fn_type @J.WithSelf.G, @J.WithSelf(%E.type.facet) [concrete]
  1009. // CHECK:STDOUT: %J.WithSelf.G.a50: %J.WithSelf.G.type.d39 = struct_value () [concrete]
  1010. // CHECK:STDOUT: %.ff2: type = fn_type_with_self_type %J.WithSelf.F.type.7ab, %J.facet [concrete]
  1011. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  1012. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1013. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1014. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  1015. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  1016. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  1017. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  1018. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  1019. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  1020. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  1021. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  1022. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  1023. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  1024. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  1025. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  1026. // CHECK:STDOUT: %bound_method.646: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  1027. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  1028. // CHECK:STDOUT: %.825: type = fn_type_with_self_type %J.WithSelf.G.type.caf, %J.facet [concrete]
  1029. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  1030. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  1031. // CHECK:STDOUT: %bound_method.fa7: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  1032. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  1033. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
  1034. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  1035. // CHECK:STDOUT: %bound_method.6d7: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  1036. // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
  1037. // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
  1038. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005: <bound method> = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  1039. // CHECK:STDOUT: %bound_method.e9d: <bound method> = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  1040. // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete]
  1041. // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete]
  1042. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.502: <bound method> = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  1043. // CHECK:STDOUT: %bound_method.bc2: <bound method> = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  1044. // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete]
  1045. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  1046. // CHECK:STDOUT: %pattern_type.f76: type = pattern_type %J.type [concrete]
  1047. // CHECK:STDOUT: %T: %J.type = symbolic_binding T, 0 [symbolic]
  1048. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  1049. // CHECK:STDOUT: %pattern_type.5a3: type = pattern_type %T.as_type [symbolic]
  1050. // CHECK:STDOUT: %J.WithSelf.F.type.41f: type = fn_type @J.WithSelf.F, @J.WithSelf(%T) [symbolic]
  1051. // CHECK:STDOUT: %J.WithSelf.F.f01: %J.WithSelf.F.type.41f = struct_value () [symbolic]
  1052. // CHECK:STDOUT: %J.WithSelf.G.type.b2e: type = fn_type @J.WithSelf.G, @J.WithSelf(%T) [symbolic]
  1053. // CHECK:STDOUT: %J.WithSelf.G.310: %J.WithSelf.G.type.b2e = struct_value () [symbolic]
  1054. // CHECK:STDOUT: %J.lookup_impl_witness.264: <witness> = lookup_impl_witness %T, @J [symbolic]
  1055. // CHECK:STDOUT: %impl.elem0.560: type = impl_witness_access %J.lookup_impl_witness.264, element0 [symbolic]
  1056. // CHECK:STDOUT: %pattern_type.ad6: type = pattern_type %impl.elem0.560 [symbolic]
  1057. // CHECK:STDOUT: %.a8e: Core.Form = init_form %impl.elem0.560 [symbolic]
  1058. // CHECK:STDOUT: %GenericCallF.type: type = fn_type @GenericCallF [concrete]
  1059. // CHECK:STDOUT: %GenericCallF: %GenericCallF.type = struct_value () [concrete]
  1060. // CHECK:STDOUT: %require_complete.bee: <witness> = require_complete_type %T.as_type [symbolic]
  1061. // CHECK:STDOUT: %require_complete.06a: <witness> = require_complete_type %impl.elem0.560 [symbolic]
  1062. // CHECK:STDOUT: %.43f: type = fn_type_with_self_type %J.WithSelf.F.type.41f, %T [symbolic]
  1063. // CHECK:STDOUT: %impl.elem1: %.43f = impl_witness_access %J.lookup_impl_witness.264, element1 [symbolic]
  1064. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem1, @J.WithSelf.F(%T) [symbolic]
  1065. // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete]
  1066. // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete]
  1067. // CHECK:STDOUT: %GenericCallF.specific_fn: <specific function> = specific_function %GenericCallF, @GenericCallF(%J.facet) [concrete]
  1068. // CHECK:STDOUT: }
  1069. // CHECK:STDOUT:
  1070. // CHECK:STDOUT: imports {
  1071. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1072. // CHECK:STDOUT: .Int = %Core.Int
  1073. // CHECK:STDOUT: .Negate = %Core.Negate
  1074. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1075. // CHECK:STDOUT: import Core//prelude
  1076. // CHECK:STDOUT: import Core//prelude/...
  1077. // CHECK:STDOUT: }
  1078. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1079. // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type]
  1080. // CHECK:STDOUT: %Core.import_ref.475 = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, unloaded
  1081. // CHECK:STDOUT: %Core.import_ref.d40: @Int.as.Negate.impl.%Int.as.Negate.impl.Op.type (%Int.as.Negate.impl.Op.type.5e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Negate.impl.%Int.as.Negate.impl.Op (constants.%Int.as.Negate.impl.Op.7f5)]
  1082. // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.475, %Core.import_ref.d40), @Int.as.Negate.impl [concrete]
  1083. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1084. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  1085. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  1086. // CHECK:STDOUT: }
  1087. // CHECK:STDOUT:
  1088. // CHECK:STDOUT: file {
  1089. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1090. // CHECK:STDOUT: .Core = imports.%Core
  1091. // CHECK:STDOUT: .J = %J.decl
  1092. // CHECK:STDOUT: .E = %E.decl
  1093. // CHECK:STDOUT: .CallBoth = %CallBoth.decl
  1094. // CHECK:STDOUT: .GenericCallF = %GenericCallF.decl
  1095. // CHECK:STDOUT: .CallGeneric = %CallGeneric.decl
  1096. // CHECK:STDOUT: }
  1097. // CHECK:STDOUT: %Core.import = import Core
  1098. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1099. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  1100. // CHECK:STDOUT: %CallBoth.decl: %CallBoth.type = fn_decl @CallBoth [concrete = constants.%CallBoth] {
  1101. // CHECK:STDOUT: %e.param_patt: %pattern_type.99f = value_param_pattern [concrete]
  1102. // CHECK:STDOUT: %e.patt: %pattern_type.99f = at_binding_pattern e, %e.param_patt [concrete]
  1103. // CHECK:STDOUT: } {
  1104. // CHECK:STDOUT: %e.param: %E = value_param call_param0
  1105. // CHECK:STDOUT: %E.ref.loc20: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1106. // CHECK:STDOUT: %e: %E = value_binding e, %e.param
  1107. // CHECK:STDOUT: }
  1108. // CHECK:STDOUT: %GenericCallF.decl: %GenericCallF.type = fn_decl @GenericCallF [concrete = constants.%GenericCallF] {
  1109. // CHECK:STDOUT: %T.patt: %pattern_type.f76 = symbolic_binding_pattern T, 0 [concrete]
  1110. // CHECK:STDOUT: %t.param_patt: @GenericCallF.%pattern_type.loc28_25 (%pattern_type.5a3) = value_param_pattern [concrete]
  1111. // CHECK:STDOUT: %t.patt: @GenericCallF.%pattern_type.loc28_25 (%pattern_type.5a3) = at_binding_pattern t, %t.param_patt [concrete]
  1112. // CHECK:STDOUT: %u.param_patt: @GenericCallF.%pattern_type.loc28_31 (%pattern_type.ad6) = value_param_pattern [concrete]
  1113. // CHECK:STDOUT: %u.patt: @GenericCallF.%pattern_type.loc28_31 (%pattern_type.ad6) = at_binding_pattern u, %u.param_patt [concrete]
  1114. // CHECK:STDOUT: %return.param_patt: @GenericCallF.%pattern_type.loc28_31 (%pattern_type.ad6) = out_param_pattern [concrete]
  1115. // CHECK:STDOUT: %return.patt: @GenericCallF.%pattern_type.loc28_31 (%pattern_type.ad6) = return_slot_pattern %return.param_patt, %impl.elem0.loc28_42 [concrete]
  1116. // CHECK:STDOUT: } {
  1117. // CHECK:STDOUT: %T.ref.loc28_41: %J.type = name_ref T, %T.loc28_18.2 [symbolic = %T.loc28_18.1 (constants.%T)]
  1118. // CHECK:STDOUT: %T.as_type.loc28_42: type = facet_access_type %T.ref.loc28_41 [symbolic = %T.as_type.loc28_27.1 (constants.%T.as_type)]
  1119. // CHECK:STDOUT: %.loc28_42.3: type = converted %T.ref.loc28_41, %T.as_type.loc28_42 [symbolic = %T.as_type.loc28_27.1 (constants.%T.as_type)]
  1120. // CHECK:STDOUT: %U.ref.loc28_42: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  1121. // CHECK:STDOUT: %impl.elem0.loc28_42: type = impl_witness_access constants.%J.lookup_impl_witness.264, element0 [symbolic = %impl.elem0.loc28_34.1 (constants.%impl.elem0.560)]
  1122. // CHECK:STDOUT: %.loc28_42.4: Core.Form = init_form %impl.elem0.loc28_42 [symbolic = %.loc28_42.2 (constants.%.a8e)]
  1123. // CHECK:STDOUT: %.loc28_21: type = splice_block %J.ref [concrete = constants.%J.type] {
  1124. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  1125. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1126. // CHECK:STDOUT: }
  1127. // CHECK:STDOUT: %T.loc28_18.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc28_18.1 (constants.%T)]
  1128. // CHECK:STDOUT: %t.param: @GenericCallF.%T.as_type.loc28_27.1 (%T.as_type) = value_param call_param0
  1129. // CHECK:STDOUT: %.loc28_27.1: type = splice_block %.loc28_27.2 [symbolic = %T.as_type.loc28_27.1 (constants.%T.as_type)] {
  1130. // CHECK:STDOUT: %T.ref.loc28_27: %J.type = name_ref T, %T.loc28_18.2 [symbolic = %T.loc28_18.1 (constants.%T)]
  1131. // CHECK:STDOUT: %T.as_type.loc28_27.2: type = facet_access_type %T.ref.loc28_27 [symbolic = %T.as_type.loc28_27.1 (constants.%T.as_type)]
  1132. // CHECK:STDOUT: %.loc28_27.2: type = converted %T.ref.loc28_27, %T.as_type.loc28_27.2 [symbolic = %T.as_type.loc28_27.1 (constants.%T.as_type)]
  1133. // CHECK:STDOUT: }
  1134. // CHECK:STDOUT: %t: @GenericCallF.%T.as_type.loc28_27.1 (%T.as_type) = value_binding t, %t.param
  1135. // CHECK:STDOUT: %u.param: @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = value_param call_param1
  1136. // CHECK:STDOUT: %.loc28_34.1: type = splice_block %impl.elem0.loc28_34.2 [symbolic = %impl.elem0.loc28_34.1 (constants.%impl.elem0.560)] {
  1137. // CHECK:STDOUT: %T.ref.loc28_33: %J.type = name_ref T, %T.loc28_18.2 [symbolic = %T.loc28_18.1 (constants.%T)]
  1138. // CHECK:STDOUT: %T.as_type.loc28_34: type = facet_access_type %T.ref.loc28_33 [symbolic = %T.as_type.loc28_27.1 (constants.%T.as_type)]
  1139. // CHECK:STDOUT: %.loc28_34.2: type = converted %T.ref.loc28_33, %T.as_type.loc28_34 [symbolic = %T.as_type.loc28_27.1 (constants.%T.as_type)]
  1140. // CHECK:STDOUT: %U.ref.loc28_34: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  1141. // CHECK:STDOUT: %impl.elem0.loc28_34.2: type = impl_witness_access constants.%J.lookup_impl_witness.264, element0 [symbolic = %impl.elem0.loc28_34.1 (constants.%impl.elem0.560)]
  1142. // CHECK:STDOUT: }
  1143. // CHECK:STDOUT: %u: @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = value_binding u, %u.param
  1144. // CHECK:STDOUT: %return.param: ref @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = out_param call_param2
  1145. // CHECK:STDOUT: %return: ref @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = return_slot %return.param
  1146. // CHECK:STDOUT: }
  1147. // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] {
  1148. // CHECK:STDOUT: %e.param_patt: %pattern_type.99f = value_param_pattern [concrete]
  1149. // CHECK:STDOUT: %e.patt: %pattern_type.99f = at_binding_pattern e, %e.param_patt [concrete]
  1150. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  1151. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, %i32 [concrete]
  1152. // CHECK:STDOUT: } {
  1153. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  1154. // CHECK:STDOUT: %.loc32: Core.Form = init_form %i32 [concrete = constants.%.ff5]
  1155. // CHECK:STDOUT: %e.param: %E = value_param call_param0
  1156. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1157. // CHECK:STDOUT: %e: %E = value_binding e, %e.param
  1158. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1159. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1160. // CHECK:STDOUT: }
  1161. // CHECK:STDOUT: }
  1162. // CHECK:STDOUT:
  1163. // CHECK:STDOUT: interface @J {
  1164. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  1165. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  1166. // CHECK:STDOUT:
  1167. // CHECK:STDOUT: !with Self:
  1168. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1169. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete = constants.%assoc0.ebd]
  1170. // CHECK:STDOUT: }
  1171. // CHECK:STDOUT: %J.WithSelf.F.decl: @J.WithSelf.%J.WithSelf.F.type (%J.WithSelf.F.type.adb) = fn_decl @J.WithSelf.F [symbolic = @J.WithSelf.%J.WithSelf.F (constants.%J.WithSelf.F.569)] {
  1172. // CHECK:STDOUT: %u.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = value_param_pattern [concrete]
  1173. // CHECK:STDOUT: %u.patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = at_binding_pattern u, %u.param_patt [concrete]
  1174. // CHECK:STDOUT: %return.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = out_param_pattern [concrete]
  1175. // CHECK:STDOUT: %return.patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = return_slot_pattern %return.param_patt, %U.ref.loc5_17 [concrete]
  1176. // CHECK:STDOUT: } {
  1177. // CHECK:STDOUT: %impl.elem0.loc5_17: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  1178. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  1179. // CHECK:STDOUT: %.loc5_17.2: Core.Form = init_form %U.ref.loc5_17 [symbolic = %.loc5_17.1 (constants.%.77f)]
  1180. // CHECK:STDOUT: %u.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_param call_param0
  1181. // CHECK:STDOUT: %.loc5_11: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)] {
  1182. // CHECK:STDOUT: %impl.elem0.loc5_11.2: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  1183. // CHECK:STDOUT: %U.ref.loc5_11: type = name_ref U, %impl.elem0.loc5_11.2 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  1184. // CHECK:STDOUT: }
  1185. // CHECK:STDOUT: %u: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_binding u, %u.param
  1186. // CHECK:STDOUT: %return.param: ref @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = out_param call_param1
  1187. // CHECK:STDOUT: %return: ref @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = return_slot %return.param
  1188. // CHECK:STDOUT: }
  1189. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.WithSelf.F.decl [concrete = constants.%assoc1.eeb]
  1190. // CHECK:STDOUT: %J.WithSelf.G.decl: @J.WithSelf.%J.WithSelf.G.type (%J.WithSelf.G.type.ace) = fn_decl @J.WithSelf.G [symbolic = @J.WithSelf.%J.WithSelf.G (constants.%J.WithSelf.G.6e7)] {
  1191. // CHECK:STDOUT: %self.param_patt: @J.WithSelf.G.%pattern_type.loc6_12 (%pattern_type.909) = value_param_pattern [concrete]
  1192. // CHECK:STDOUT: %self.patt: @J.WithSelf.G.%pattern_type.loc6_12 (%pattern_type.909) = at_binding_pattern self, %self.param_patt [concrete]
  1193. // CHECK:STDOUT: %v.param_patt: @J.WithSelf.G.%pattern_type.loc6_21 (%pattern_type.c1a) = value_param_pattern [concrete]
  1194. // CHECK:STDOUT: %v.patt: @J.WithSelf.G.%pattern_type.loc6_21 (%pattern_type.c1a) = at_binding_pattern v, %v.param_patt [concrete]
  1195. // CHECK:STDOUT: %return.param_patt: @J.WithSelf.G.%pattern_type.loc6_21 (%pattern_type.c1a) = out_param_pattern [concrete]
  1196. // CHECK:STDOUT: %return.patt: @J.WithSelf.G.%pattern_type.loc6_21 (%pattern_type.c1a) = return_slot_pattern %return.param_patt, %U.ref.loc6_29 [concrete]
  1197. // CHECK:STDOUT: } {
  1198. // CHECK:STDOUT: %impl.elem0.loc6_29: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.335)]
  1199. // CHECK:STDOUT: %U.ref.loc6_29: type = name_ref U, %impl.elem0.loc6_29 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.335)]
  1200. // CHECK:STDOUT: %.loc6_29.2: Core.Form = init_form %U.ref.loc6_29 [symbolic = %.loc6_29.1 (constants.%.77f)]
  1201. // CHECK:STDOUT: %self.param: @J.WithSelf.G.%Self.as_type.loc6_14.1 (%Self.as_type.9ea) = value_param call_param0
  1202. // CHECK:STDOUT: %.loc6_14.1: type = splice_block %.loc6_14.2 [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.9ea)] {
  1203. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self.8a1)]
  1204. // CHECK:STDOUT: %Self.as_type.loc6_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.9ea)]
  1205. // CHECK:STDOUT: %.loc6_14.2: type = converted %Self.ref, %Self.as_type.loc6_14.2 [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.9ea)]
  1206. // CHECK:STDOUT: }
  1207. // CHECK:STDOUT: %self: @J.WithSelf.G.%Self.as_type.loc6_14.1 (%Self.as_type.9ea) = value_binding self, %self.param
  1208. // CHECK:STDOUT: %v.param: @J.WithSelf.G.%impl.elem0.loc6_23.1 (%impl.elem0.335) = value_param call_param1
  1209. // CHECK:STDOUT: %.loc6_23: type = splice_block %U.ref.loc6_23 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.335)] {
  1210. // CHECK:STDOUT: %impl.elem0.loc6_23.2: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.335)]
  1211. // CHECK:STDOUT: %U.ref.loc6_23: type = name_ref U, %impl.elem0.loc6_23.2 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.335)]
  1212. // CHECK:STDOUT: }
  1213. // CHECK:STDOUT: %v: @J.WithSelf.G.%impl.elem0.loc6_23.1 (%impl.elem0.335) = value_binding v, %v.param
  1214. // CHECK:STDOUT: %return.param: ref @J.WithSelf.G.%impl.elem0.loc6_23.1 (%impl.elem0.335) = out_param call_param2
  1215. // CHECK:STDOUT: %return: ref @J.WithSelf.G.%impl.elem0.loc6_23.1 (%impl.elem0.335) = return_slot %return.param
  1216. // CHECK:STDOUT: }
  1217. // CHECK:STDOUT: %assoc2: %J.assoc_type = assoc_entity element2, %J.WithSelf.G.decl [concrete = constants.%assoc2]
  1218. // CHECK:STDOUT:
  1219. // CHECK:STDOUT: !members:
  1220. // CHECK:STDOUT: .Self = %Self
  1221. // CHECK:STDOUT: .U = @U.%assoc0
  1222. // CHECK:STDOUT: .F = @J.WithSelf.%assoc1
  1223. // CHECK:STDOUT: .G = @J.WithSelf.%assoc2
  1224. // CHECK:STDOUT: witness = (@J.WithSelf.%U, @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.%J.WithSelf.G.decl)
  1225. // CHECK:STDOUT:
  1226. // CHECK:STDOUT: !requires:
  1227. // CHECK:STDOUT: }
  1228. // CHECK:STDOUT:
  1229. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %.loc10_20 {
  1230. // CHECK:STDOUT: %E.as.J.impl.F.decl: %E.as.J.impl.F.type = fn_decl @E.as.J.impl.F [concrete = constants.%E.as.J.impl.F] {
  1231. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  1232. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = at_binding_pattern u, %u.param_patt [concrete]
  1233. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  1234. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, %i32.loc11_21 [concrete]
  1235. // CHECK:STDOUT: } {
  1236. // CHECK:STDOUT: %i32.loc11_21: type = type_literal constants.%i32 [concrete = constants.%i32]
  1237. // CHECK:STDOUT: %.loc11: Core.Form = init_form %i32.loc11_21 [concrete = constants.%.ff5]
  1238. // CHECK:STDOUT: %u.param: %i32 = value_param call_param0
  1239. // CHECK:STDOUT: %i32.loc11_13: type = type_literal constants.%i32 [concrete = constants.%i32]
  1240. // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param
  1241. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1242. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1243. // CHECK:STDOUT: }
  1244. // CHECK:STDOUT: %E.as.J.impl.G.decl: %E.as.J.impl.G.type = fn_decl @E.as.J.impl.G [concrete = constants.%E.as.J.impl.G] {
  1245. // CHECK:STDOUT: %self.param_patt: %pattern_type.99f = value_param_pattern [concrete]
  1246. // CHECK:STDOUT: %self.patt: %pattern_type.99f = at_binding_pattern self, %self.param_patt [concrete]
  1247. // CHECK:STDOUT: %v.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  1248. // CHECK:STDOUT: %v.patt: %pattern_type.7ce = at_binding_pattern v, %v.param_patt [concrete]
  1249. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  1250. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, %i32.loc14_40 [concrete]
  1251. // CHECK:STDOUT: } {
  1252. // CHECK:STDOUT: %i32.loc14_40: type = type_literal constants.%i32 [concrete = constants.%i32]
  1253. // CHECK:STDOUT: %.loc14: Core.Form = init_form %i32.loc14_40 [concrete = constants.%.ff5]
  1254. // CHECK:STDOUT: %self.param: %E = value_param call_param0
  1255. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  1256. // CHECK:STDOUT: %self: %E = value_binding self, %self.param
  1257. // CHECK:STDOUT: %v.param: %i32 = value_param call_param1
  1258. // CHECK:STDOUT: %i32.loc14_32: type = type_literal constants.%i32 [concrete = constants.%i32]
  1259. // CHECK:STDOUT: %v: %i32 = value_binding v, %v.param
  1260. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
  1261. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1262. // CHECK:STDOUT: }
  1263. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %E.as.J.impl.F.decl, %E.as.J.impl.G.decl), @E.as.J.impl [concrete]
  1264. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  1265. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  1266. // CHECK:STDOUT:
  1267. // CHECK:STDOUT: !members:
  1268. // CHECK:STDOUT: .F = %E.as.J.impl.F.decl
  1269. // CHECK:STDOUT: .G = %E.as.J.impl.G.decl
  1270. // CHECK:STDOUT: witness = %J.impl_witness
  1271. // CHECK:STDOUT: }
  1272. // CHECK:STDOUT:
  1273. // CHECK:STDOUT: class @E {
  1274. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  1275. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  1276. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1277. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  1278. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.2fa]
  1279. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  1280. // CHECK:STDOUT: %.loc10_26: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  1281. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  1282. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  1283. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  1284. // CHECK:STDOUT: %.loc10_20: type = where_expr [concrete = constants.%J_where.type] {
  1285. // CHECK:STDOUT: requirement_base_facet_type %J.ref
  1286. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  1287. // CHECK:STDOUT: }
  1288. // CHECK:STDOUT: }
  1289. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1290. // CHECK:STDOUT: complete_type_witness = %complete_type
  1291. // CHECK:STDOUT:
  1292. // CHECK:STDOUT: !members:
  1293. // CHECK:STDOUT: .Self = constants.%E
  1294. // CHECK:STDOUT: .J = <poisoned>
  1295. // CHECK:STDOUT: .F = <poisoned>
  1296. // CHECK:STDOUT: .G = <poisoned>
  1297. // CHECK:STDOUT: extend @E.as.J.impl.%.loc10_20
  1298. // CHECK:STDOUT: }
  1299. // CHECK:STDOUT:
  1300. // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self: %J.type) {
  1301. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  1302. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  1303. // CHECK:STDOUT: %impl.elem0.loc5_11.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  1304. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.c1a)]
  1305. // CHECK:STDOUT: %.loc5_17.1: Core.Form = init_form %impl.elem0.loc5_11.1 [symbolic = %.loc5_17.1 (constants.%.77f)]
  1306. // CHECK:STDOUT:
  1307. // CHECK:STDOUT: fn(%u.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335)) -> out %return.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335);
  1308. // CHECK:STDOUT: }
  1309. // CHECK:STDOUT:
  1310. // CHECK:STDOUT: generic fn @J.WithSelf.G(@J.%Self: %J.type) {
  1311. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  1312. // CHECK:STDOUT: %Self.as_type.loc6_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.9ea)]
  1313. // CHECK:STDOUT: %pattern_type.loc6_12: type = pattern_type %Self.as_type.loc6_14.1 [symbolic = %pattern_type.loc6_12 (constants.%pattern_type.909)]
  1314. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  1315. // CHECK:STDOUT: %impl.elem0.loc6_23.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.335)]
  1316. // CHECK:STDOUT: %pattern_type.loc6_21: type = pattern_type %impl.elem0.loc6_23.1 [symbolic = %pattern_type.loc6_21 (constants.%pattern_type.c1a)]
  1317. // CHECK:STDOUT: %.loc6_29.1: Core.Form = init_form %impl.elem0.loc6_23.1 [symbolic = %.loc6_29.1 (constants.%.77f)]
  1318. // CHECK:STDOUT:
  1319. // CHECK:STDOUT: fn(%self.param: @J.WithSelf.G.%Self.as_type.loc6_14.1 (%Self.as_type.9ea), %v.param: @J.WithSelf.G.%impl.elem0.loc6_23.1 (%impl.elem0.335)) -> out %return.param: @J.WithSelf.G.%impl.elem0.loc6_23.1 (%impl.elem0.335);
  1320. // CHECK:STDOUT: }
  1321. // CHECK:STDOUT:
  1322. // CHECK:STDOUT: fn @E.as.J.impl.F(%u.param: %i32) -> out %return.param: %i32 {
  1323. // CHECK:STDOUT: !entry:
  1324. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
  1325. // CHECK:STDOUT: %impl.elem1: %.5dd = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f]
  1326. // CHECK:STDOUT: %bound_method.loc12_14.1: <bound method> = bound_method %u.ref, %impl.elem1
  1327. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem1, @Int.as.Negate.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Negate.impl.Op.specific_fn]
  1328. // CHECK:STDOUT: %bound_method.loc12_14.2: <bound method> = bound_method %u.ref, %specific_fn
  1329. // CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc12_14.2(%u.ref)
  1330. // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call
  1331. // CHECK:STDOUT: }
  1332. // CHECK:STDOUT:
  1333. // CHECK:STDOUT: fn @E.as.J.impl.G(%self.param: %E, %v.param: %i32) -> out %return.param: %i32 {
  1334. // CHECK:STDOUT: !entry:
  1335. // CHECK:STDOUT: %v.ref: %i32 = name_ref v, %v
  1336. // CHECK:STDOUT: %impl.elem1: %.5dd = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f]
  1337. // CHECK:STDOUT: %bound_method.loc15_14.1: <bound method> = bound_method %v.ref, %impl.elem1
  1338. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem1, @Int.as.Negate.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Negate.impl.Op.specific_fn]
  1339. // CHECK:STDOUT: %bound_method.loc15_14.2: <bound method> = bound_method %v.ref, %specific_fn
  1340. // CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc15_14.2(%v.ref)
  1341. // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call
  1342. // CHECK:STDOUT: }
  1343. // CHECK:STDOUT:
  1344. // CHECK:STDOUT: fn @CallBoth(%e.param: %E) {
  1345. // CHECK:STDOUT: !entry:
  1346. // CHECK:STDOUT: name_binding_decl {
  1347. // CHECK:STDOUT: %e1.patt: %pattern_type.7ce = value_binding_pattern e1 [concrete]
  1348. // CHECK:STDOUT: }
  1349. // CHECK:STDOUT: %e.ref.loc21: %E = name_ref e, %e
  1350. // CHECK:STDOUT: %F.ref.loc21: %J.assoc_type = name_ref F, @J.WithSelf.%assoc1 [concrete = constants.%assoc1.eeb]
  1351. // CHECK:STDOUT: %impl.elem1.loc21: %.ff2 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%E.as.J.impl.F]
  1352. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  1353. // CHECK:STDOUT: %impl.elem0.loc21: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1354. // CHECK:STDOUT: %bound_method.loc21_28.1: <bound method> = bound_method %int_2, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  1355. // CHECK:STDOUT: %specific_fn.loc21: <specific function> = specific_function %impl.elem0.loc21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1356. // CHECK:STDOUT: %bound_method.loc21_28.2: <bound method> = bound_method %int_2, %specific_fn.loc21 [concrete = constants.%bound_method.646]
  1357. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_28.2(%int_2) [concrete = constants.%int_2.ef8]
  1358. // CHECK:STDOUT: %.loc21_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_2.ef8]
  1359. // CHECK:STDOUT: %.loc21_28.2: %i32 = converted %int_2, %.loc21_28.1 [concrete = constants.%int_2.ef8]
  1360. // CHECK:STDOUT: %E.as.J.impl.F.call.loc21: init %i32 = call %impl.elem1.loc21(%.loc21_28.2)
  1361. // CHECK:STDOUT: %i32.loc21: type = type_literal constants.%i32 [concrete = constants.%i32]
  1362. // CHECK:STDOUT: %.loc21_29.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc21
  1363. // CHECK:STDOUT: %.loc21_29.2: %i32 = converted %E.as.J.impl.F.call.loc21, %.loc21_29.1
  1364. // CHECK:STDOUT: %e1: %i32 = value_binding e1, %.loc21_29.2
  1365. // CHECK:STDOUT: name_binding_decl {
  1366. // CHECK:STDOUT: %e2.patt: %pattern_type.7ce = value_binding_pattern e2 [concrete]
  1367. // CHECK:STDOUT: }
  1368. // CHECK:STDOUT: %e.ref.loc22: %E = name_ref e, %e
  1369. // CHECK:STDOUT: %G.ref.loc22: %J.assoc_type = name_ref G, @J.WithSelf.%assoc2 [concrete = constants.%assoc2]
  1370. // CHECK:STDOUT: %impl.elem2.loc22: %.825 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G]
  1371. // CHECK:STDOUT: %bound_method.loc22_25: <bound method> = bound_method %e.ref.loc22, %impl.elem2.loc22
  1372. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  1373. // CHECK:STDOUT: %impl.elem0.loc22: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1374. // CHECK:STDOUT: %bound_method.loc22_28.1: <bound method> = bound_method %int_3, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
  1375. // CHECK:STDOUT: %specific_fn.loc22: <specific function> = specific_function %impl.elem0.loc22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1376. // CHECK:STDOUT: %bound_method.loc22_28.2: <bound method> = bound_method %int_3, %specific_fn.loc22 [concrete = constants.%bound_method.fa7]
  1377. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_28.2(%int_3) [concrete = constants.%int_3.822]
  1378. // CHECK:STDOUT: %.loc22_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822]
  1379. // CHECK:STDOUT: %.loc22_28.2: %i32 = converted %int_3, %.loc22_28.1 [concrete = constants.%int_3.822]
  1380. // CHECK:STDOUT: %E.as.J.impl.G.call.loc22: init %i32 = call %bound_method.loc22_25(%e.ref.loc22, %.loc22_28.2)
  1381. // CHECK:STDOUT: %i32.loc22: type = type_literal constants.%i32 [concrete = constants.%i32]
  1382. // CHECK:STDOUT: %.loc22_29.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc22
  1383. // CHECK:STDOUT: %.loc22_29.2: %i32 = converted %E.as.J.impl.G.call.loc22, %.loc22_29.1
  1384. // CHECK:STDOUT: %e2: %i32 = value_binding e2, %.loc22_29.2
  1385. // CHECK:STDOUT: name_binding_decl {
  1386. // CHECK:STDOUT: %e3.patt: %pattern_type.7ce = value_binding_pattern e3 [concrete]
  1387. // CHECK:STDOUT: }
  1388. // CHECK:STDOUT: %E.ref.loc23: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1389. // CHECK:STDOUT: %F.ref.loc23: %J.assoc_type = name_ref F, @J.WithSelf.%assoc1 [concrete = constants.%assoc1.eeb]
  1390. // CHECK:STDOUT: %impl.elem1.loc23: %.ff2 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%E.as.J.impl.F]
  1391. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  1392. // CHECK:STDOUT: %impl.elem0.loc23: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1393. // CHECK:STDOUT: %bound_method.loc23_28.1: <bound method> = bound_method %int_4, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c]
  1394. // CHECK:STDOUT: %specific_fn.loc23: <specific function> = specific_function %impl.elem0.loc23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1395. // CHECK:STDOUT: %bound_method.loc23_28.2: <bound method> = bound_method %int_4, %specific_fn.loc23 [concrete = constants.%bound_method.6d7]
  1396. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_28.2(%int_4) [concrete = constants.%int_4.940]
  1397. // CHECK:STDOUT: %.loc23_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_4.940]
  1398. // CHECK:STDOUT: %.loc23_28.2: %i32 = converted %int_4, %.loc23_28.1 [concrete = constants.%int_4.940]
  1399. // CHECK:STDOUT: %E.as.J.impl.F.call.loc23: init %i32 = call %impl.elem1.loc23(%.loc23_28.2)
  1400. // CHECK:STDOUT: %i32.loc23: type = type_literal constants.%i32 [concrete = constants.%i32]
  1401. // CHECK:STDOUT: %.loc23_29.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc23
  1402. // CHECK:STDOUT: %.loc23_29.2: %i32 = converted %E.as.J.impl.F.call.loc23, %.loc23_29.1
  1403. // CHECK:STDOUT: %e3: %i32 = value_binding e3, %.loc23_29.2
  1404. // CHECK:STDOUT: name_binding_decl {
  1405. // CHECK:STDOUT: %e4.patt: %pattern_type.7ce = value_binding_pattern e4 [concrete]
  1406. // CHECK:STDOUT: }
  1407. // CHECK:STDOUT: %e.ref.loc24: %E = name_ref e, %e
  1408. // CHECK:STDOUT: %E.ref.loc24: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1409. // CHECK:STDOUT: %G.ref.loc24: %J.assoc_type = name_ref G, @J.WithSelf.%assoc2 [concrete = constants.%assoc2]
  1410. // CHECK:STDOUT: %impl.elem2.loc24: %.825 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G]
  1411. // CHECK:STDOUT: %bound_method.loc24_25: <bound method> = bound_method %e.ref.loc24, %impl.elem2.loc24
  1412. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
  1413. // CHECK:STDOUT: %impl.elem0.loc24: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1414. // CHECK:STDOUT: %bound_method.loc24_32.1: <bound method> = bound_method %int_5, %impl.elem0.loc24 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005]
  1415. // CHECK:STDOUT: %specific_fn.loc24: <specific function> = specific_function %impl.elem0.loc24, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1416. // CHECK:STDOUT: %bound_method.loc24_32.2: <bound method> = bound_method %int_5, %specific_fn.loc24 [concrete = constants.%bound_method.e9d]
  1417. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24: init %i32 = call %bound_method.loc24_32.2(%int_5) [concrete = constants.%int_5.0f6]
  1418. // CHECK:STDOUT: %.loc24_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_5.0f6]
  1419. // CHECK:STDOUT: %.loc24_32.2: %i32 = converted %int_5, %.loc24_32.1 [concrete = constants.%int_5.0f6]
  1420. // CHECK:STDOUT: %E.as.J.impl.G.call.loc24: init %i32 = call %bound_method.loc24_25(%e.ref.loc24, %.loc24_32.2)
  1421. // CHECK:STDOUT: %i32.loc24: type = type_literal constants.%i32 [concrete = constants.%i32]
  1422. // CHECK:STDOUT: %.loc24_33.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc24
  1423. // CHECK:STDOUT: %.loc24_33.2: %i32 = converted %E.as.J.impl.G.call.loc24, %.loc24_33.1
  1424. // CHECK:STDOUT: %e4: %i32 = value_binding e4, %.loc24_33.2
  1425. // CHECK:STDOUT: name_binding_decl {
  1426. // CHECK:STDOUT: %e5.patt: %pattern_type.7ce = value_binding_pattern e5 [concrete]
  1427. // CHECK:STDOUT: }
  1428. // CHECK:STDOUT: %e.ref.loc25: %E = name_ref e, %e
  1429. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1430. // CHECK:STDOUT: %G.ref.loc25: %J.assoc_type = name_ref G, @J.WithSelf.%assoc2 [concrete = constants.%assoc2]
  1431. // CHECK:STDOUT: %impl.elem2.loc25: %.825 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G]
  1432. // CHECK:STDOUT: %bound_method.loc25_25: <bound method> = bound_method %e.ref.loc25, %impl.elem2.loc25
  1433. // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462]
  1434. // CHECK:STDOUT: %impl.elem0.loc25: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1435. // CHECK:STDOUT: %bound_method.loc25_32.1: <bound method> = bound_method %int_6, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.502]
  1436. // CHECK:STDOUT: %specific_fn.loc25: <specific function> = specific_function %impl.elem0.loc25, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1437. // CHECK:STDOUT: %bound_method.loc25_32.2: <bound method> = bound_method %int_6, %specific_fn.loc25 [concrete = constants.%bound_method.bc2]
  1438. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i32 = call %bound_method.loc25_32.2(%int_6) [concrete = constants.%int_6.e56]
  1439. // CHECK:STDOUT: %.loc25_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_6.e56]
  1440. // CHECK:STDOUT: %.loc25_32.2: %i32 = converted %int_6, %.loc25_32.1 [concrete = constants.%int_6.e56]
  1441. // CHECK:STDOUT: %E.as.J.impl.G.call.loc25: init %i32 = call %bound_method.loc25_25(%e.ref.loc25, %.loc25_32.2)
  1442. // CHECK:STDOUT: %i32.loc25: type = type_literal constants.%i32 [concrete = constants.%i32]
  1443. // CHECK:STDOUT: %.loc25_33.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc25
  1444. // CHECK:STDOUT: %.loc25_33.2: %i32 = converted %E.as.J.impl.G.call.loc25, %.loc25_33.1
  1445. // CHECK:STDOUT: %e5: %i32 = value_binding e5, %.loc25_33.2
  1446. // CHECK:STDOUT: return
  1447. // CHECK:STDOUT: }
  1448. // CHECK:STDOUT:
  1449. // CHECK:STDOUT: generic fn @GenericCallF(%T.loc28_18.2: %J.type) {
  1450. // CHECK:STDOUT: %T.loc28_18.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc28_18.1 (constants.%T)]
  1451. // CHECK:STDOUT: %T.as_type.loc28_27.1: type = facet_access_type %T.loc28_18.1 [symbolic = %T.as_type.loc28_27.1 (constants.%T.as_type)]
  1452. // CHECK:STDOUT: %pattern_type.loc28_25: type = pattern_type %T.as_type.loc28_27.1 [symbolic = %pattern_type.loc28_25 (constants.%pattern_type.5a3)]
  1453. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc28_18.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264)]
  1454. // CHECK:STDOUT: %impl.elem0.loc28_34.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_34.1 (constants.%impl.elem0.560)]
  1455. // CHECK:STDOUT: %pattern_type.loc28_31: type = pattern_type %impl.elem0.loc28_34.1 [symbolic = %pattern_type.loc28_31 (constants.%pattern_type.ad6)]
  1456. // CHECK:STDOUT: %.loc28_42.2: Core.Form = init_form %impl.elem0.loc28_34.1 [symbolic = %.loc28_42.2 (constants.%.a8e)]
  1457. // CHECK:STDOUT:
  1458. // CHECK:STDOUT: !definition:
  1459. // CHECK:STDOUT: %require_complete.loc28_25: <witness> = require_complete_type %T.as_type.loc28_27.1 [symbolic = %require_complete.loc28_25 (constants.%require_complete.bee)]
  1460. // CHECK:STDOUT: %require_complete.loc28_31: <witness> = require_complete_type %impl.elem0.loc28_34.1 [symbolic = %require_complete.loc28_31 (constants.%require_complete.06a)]
  1461. // CHECK:STDOUT: %J.WithSelf.F.type: type = fn_type @J.WithSelf.F, @J.WithSelf(%T.loc28_18.1) [symbolic = %J.WithSelf.F.type (constants.%J.WithSelf.F.type.41f)]
  1462. // CHECK:STDOUT: %.loc29: type = fn_type_with_self_type %J.WithSelf.F.type, %T.loc28_18.1 [symbolic = %.loc29 (constants.%.43f)]
  1463. // CHECK:STDOUT: %impl.elem1.loc29_11.2: @GenericCallF.%.loc29 (%.43f) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc29_11.2 (constants.%impl.elem1)]
  1464. // CHECK:STDOUT: %specific_impl_fn.loc29_11.2: <specific function> = specific_impl_function %impl.elem1.loc29_11.2, @J.WithSelf.F(%T.loc28_18.1) [symbolic = %specific_impl_fn.loc29_11.2 (constants.%specific_impl_fn)]
  1465. // CHECK:STDOUT:
  1466. // CHECK:STDOUT: fn(%t.param: @GenericCallF.%T.as_type.loc28_27.1 (%T.as_type), %u.param: @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560)) -> out %return.param: @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) {
  1467. // CHECK:STDOUT: !entry:
  1468. // CHECK:STDOUT: %t.ref: @GenericCallF.%T.as_type.loc28_27.1 (%T.as_type) = name_ref t, %t
  1469. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.WithSelf.%assoc1 [concrete = constants.%assoc1.eeb]
  1470. // CHECK:STDOUT: %impl.elem1.loc29_11.1: @GenericCallF.%.loc29 (%.43f) = impl_witness_access constants.%J.lookup_impl_witness.264, element1 [symbolic = %impl.elem1.loc29_11.2 (constants.%impl.elem1)]
  1471. // CHECK:STDOUT: %u.ref: @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = name_ref u, %u
  1472. // CHECK:STDOUT: %specific_impl_fn.loc29_11.1: <specific function> = specific_impl_function %impl.elem1.loc29_11.1, @J.WithSelf.F(constants.%T) [symbolic = %specific_impl_fn.loc29_11.2 (constants.%specific_impl_fn)]
  1473. // CHECK:STDOUT: %.loc28_42.1: ref @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = splice_block %return.param {}
  1474. // CHECK:STDOUT: %J.WithSelf.F.call: init @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) to %.loc28_42.1 = call %specific_impl_fn.loc29_11.1(%u.ref)
  1475. // CHECK:STDOUT: return %J.WithSelf.F.call to %return.param
  1476. // CHECK:STDOUT: }
  1477. // CHECK:STDOUT: }
  1478. // CHECK:STDOUT:
  1479. // CHECK:STDOUT: fn @CallGeneric(%e.param: %E) -> out %return.param: %i32 {
  1480. // CHECK:STDOUT: !entry:
  1481. // CHECK:STDOUT: %GenericCallF.ref: %GenericCallF.type = name_ref GenericCallF, file.%GenericCallF.decl [concrete = constants.%GenericCallF]
  1482. // CHECK:STDOUT: %e.ref: %E = name_ref e, %e
  1483. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  1484. // CHECK:STDOUT: %J.facet: %J.type = facet_value constants.%E, (constants.%J.impl_witness) [concrete = constants.%J.facet]
  1485. // CHECK:STDOUT: %.loc33_27: %J.type = converted constants.%E, %J.facet [concrete = constants.%J.facet]
  1486. // CHECK:STDOUT: %GenericCallF.specific_fn: <specific function> = specific_function %GenericCallF.ref, @GenericCallF(constants.%J.facet) [concrete = constants.%GenericCallF.specific_fn]
  1487. // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1488. // CHECK:STDOUT: %bound_method.loc33_26.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  1489. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1490. // CHECK:STDOUT: %bound_method.loc33_26.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.646]
  1491. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc33_26.2(%int_2) [concrete = constants.%int_2.ef8]
  1492. // CHECK:STDOUT: %.loc33_26.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_2.ef8]
  1493. // CHECK:STDOUT: %.loc33_26.2: %i32 = converted %int_2, %.loc33_26.1 [concrete = constants.%int_2.ef8]
  1494. // CHECK:STDOUT: %GenericCallF.call: init %i32 = call %GenericCallF.specific_fn(%e.ref, %.loc33_26.2)
  1495. // CHECK:STDOUT: return %GenericCallF.call
  1496. // CHECK:STDOUT: }
  1497. // CHECK:STDOUT:
  1498. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self.8a1) {
  1499. // CHECK:STDOUT: !definition:
  1500. // CHECK:STDOUT: %Self => constants.%Self.8a1
  1501. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.adb
  1502. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.569
  1503. // CHECK:STDOUT: %J.WithSelf.G.type => constants.%J.WithSelf.G.type.ace
  1504. // CHECK:STDOUT: %J.WithSelf.G => constants.%J.WithSelf.G.6e7
  1505. // CHECK:STDOUT: }
  1506. // CHECK:STDOUT:
  1507. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self.8a1) {
  1508. // CHECK:STDOUT: %Self => constants.%Self.8a1
  1509. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  1510. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.335
  1511. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c1a
  1512. // CHECK:STDOUT: %.loc5_17.1 => constants.%.77f
  1513. // CHECK:STDOUT: }
  1514. // CHECK:STDOUT:
  1515. // CHECK:STDOUT: specific @J.WithSelf.G(constants.%Self.8a1) {
  1516. // CHECK:STDOUT: %Self => constants.%Self.8a1
  1517. // CHECK:STDOUT: %Self.as_type.loc6_14.1 => constants.%Self.as_type.9ea
  1518. // CHECK:STDOUT: %pattern_type.loc6_12 => constants.%pattern_type.909
  1519. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  1520. // CHECK:STDOUT: %impl.elem0.loc6_23.1 => constants.%impl.elem0.335
  1521. // CHECK:STDOUT: %pattern_type.loc6_21 => constants.%pattern_type.c1a
  1522. // CHECK:STDOUT: %.loc6_29.1 => constants.%.77f
  1523. // CHECK:STDOUT: }
  1524. // CHECK:STDOUT:
  1525. // CHECK:STDOUT: specific @J.WithSelf(constants.%.Self.2fa) {
  1526. // CHECK:STDOUT: !definition:
  1527. // CHECK:STDOUT: %Self => constants.%.Self.2fa
  1528. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.e19
  1529. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.659
  1530. // CHECK:STDOUT: %J.WithSelf.G.type => constants.%J.WithSelf.G.type.2cf
  1531. // CHECK:STDOUT: %J.WithSelf.G => constants.%J.WithSelf.G.4f5
  1532. // CHECK:STDOUT: }
  1533. // CHECK:STDOUT:
  1534. // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet) {
  1535. // CHECK:STDOUT: !definition:
  1536. // CHECK:STDOUT: %Self => constants.%J.facet
  1537. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.7ab
  1538. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.ef0
  1539. // CHECK:STDOUT: %J.WithSelf.G.type => constants.%J.WithSelf.G.type.caf
  1540. // CHECK:STDOUT: %J.WithSelf.G => constants.%J.WithSelf.G.f88
  1541. // CHECK:STDOUT: }
  1542. // CHECK:STDOUT:
  1543. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet) {
  1544. // CHECK:STDOUT: %Self => constants.%J.facet
  1545. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  1546. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  1547. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  1548. // CHECK:STDOUT: %.loc5_17.1 => constants.%.ff5
  1549. // CHECK:STDOUT: }
  1550. // CHECK:STDOUT:
  1551. // CHECK:STDOUT: specific @J.WithSelf.G(constants.%J.facet) {
  1552. // CHECK:STDOUT: %Self => constants.%J.facet
  1553. // CHECK:STDOUT: %Self.as_type.loc6_14.1 => constants.%E
  1554. // CHECK:STDOUT: %pattern_type.loc6_12 => constants.%pattern_type.99f
  1555. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  1556. // CHECK:STDOUT: %impl.elem0.loc6_23.1 => constants.%i32
  1557. // CHECK:STDOUT: %pattern_type.loc6_21 => constants.%pattern_type.7ce
  1558. // CHECK:STDOUT: %.loc6_29.1 => constants.%.ff5
  1559. // CHECK:STDOUT: }
  1560. // CHECK:STDOUT:
  1561. // CHECK:STDOUT: specific @J.WithSelf(constants.%E.type.facet) {
  1562. // CHECK:STDOUT: !definition:
  1563. // CHECK:STDOUT: %Self => constants.%E.type.facet
  1564. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.d1c
  1565. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.1a6
  1566. // CHECK:STDOUT: %J.WithSelf.G.type => constants.%J.WithSelf.G.type.d39
  1567. // CHECK:STDOUT: %J.WithSelf.G => constants.%J.WithSelf.G.a50
  1568. // CHECK:STDOUT: }
  1569. // CHECK:STDOUT:
  1570. // CHECK:STDOUT: specific @J.WithSelf(constants.%T) {
  1571. // CHECK:STDOUT: !definition:
  1572. // CHECK:STDOUT: %Self => constants.%T
  1573. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.41f
  1574. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.f01
  1575. // CHECK:STDOUT: %J.WithSelf.G.type => constants.%J.WithSelf.G.type.b2e
  1576. // CHECK:STDOUT: %J.WithSelf.G => constants.%J.WithSelf.G.310
  1577. // CHECK:STDOUT: }
  1578. // CHECK:STDOUT:
  1579. // CHECK:STDOUT: specific @GenericCallF(constants.%T) {
  1580. // CHECK:STDOUT: %T.loc28_18.1 => constants.%T
  1581. // CHECK:STDOUT: %T.as_type.loc28_27.1 => constants.%T.as_type
  1582. // CHECK:STDOUT: %pattern_type.loc28_25 => constants.%pattern_type.5a3
  1583. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  1584. // CHECK:STDOUT: %impl.elem0.loc28_34.1 => constants.%impl.elem0.560
  1585. // CHECK:STDOUT: %pattern_type.loc28_31 => constants.%pattern_type.ad6
  1586. // CHECK:STDOUT: %.loc28_42.2 => constants.%.a8e
  1587. // CHECK:STDOUT: }
  1588. // CHECK:STDOUT:
  1589. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%T) {
  1590. // CHECK:STDOUT: %Self => constants.%T
  1591. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  1592. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.560
  1593. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad6
  1594. // CHECK:STDOUT: %.loc5_17.1 => constants.%.a8e
  1595. // CHECK:STDOUT: }
  1596. // CHECK:STDOUT:
  1597. // CHECK:STDOUT: specific @GenericCallF(constants.%J.facet) {
  1598. // CHECK:STDOUT: %T.loc28_18.1 => constants.%J.facet
  1599. // CHECK:STDOUT: %T.as_type.loc28_27.1 => constants.%E
  1600. // CHECK:STDOUT: %pattern_type.loc28_25 => constants.%pattern_type.99f
  1601. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  1602. // CHECK:STDOUT: %impl.elem0.loc28_34.1 => constants.%i32
  1603. // CHECK:STDOUT: %pattern_type.loc28_31 => constants.%pattern_type.7ce
  1604. // CHECK:STDOUT: %.loc28_42.2 => constants.%.ff5
  1605. // CHECK:STDOUT:
  1606. // CHECK:STDOUT: !definition:
  1607. // CHECK:STDOUT: %require_complete.loc28_25 => constants.%complete_type.357
  1608. // CHECK:STDOUT: %require_complete.loc28_31 => constants.%complete_type.f8a
  1609. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.7ab
  1610. // CHECK:STDOUT: %.loc29 => constants.%.ff2
  1611. // CHECK:STDOUT: %impl.elem1.loc29_11.2 => constants.%E.as.J.impl.F
  1612. // CHECK:STDOUT: %specific_impl_fn.loc29_11.2 => constants.%E.as.J.impl.F
  1613. // CHECK:STDOUT: }
  1614. // CHECK:STDOUT:
  1615. // CHECK:STDOUT: --- use_constraint_on_associated_type.carbon
  1616. // CHECK:STDOUT:
  1617. // CHECK:STDOUT: constants {
  1618. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1619. // CHECK:STDOUT: %Self.ab9: %I.type = symbolic_binding Self, 0 [symbolic]
  1620. // CHECK:STDOUT: %Self.as_type.a26: type = facet_access_type %Self.ab9 [symbolic]
  1621. // CHECK:STDOUT: %pattern_type.965: type = pattern_type %Self.as_type.a26 [symbolic]
  1622. // CHECK:STDOUT: %.eb0: Core.Form = init_form %Self.as_type.a26 [symbolic]
  1623. // CHECK:STDOUT: %I.WithSelf.Op.type.71c: type = fn_type @I.WithSelf.Op, @I.WithSelf(%Self.ab9) [symbolic]
  1624. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1625. // CHECK:STDOUT: %I.WithSelf.Op.ae1: %I.WithSelf.Op.type.71c = struct_value () [symbolic]
  1626. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1627. // CHECK:STDOUT: %assoc0.aa8: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.Op.decl [concrete]
  1628. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  1629. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  1630. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1631. // CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete]
  1632. // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete]
  1633. // CHECK:STDOUT: %facet_type: type = facet_type <@I & @Destroy> [concrete]
  1634. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  1635. // CHECK:STDOUT: %assoc0.445: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete]
  1636. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  1637. // CHECK:STDOUT: %impl.elem0.193: %facet_type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  1638. // CHECK:STDOUT: %as_type.d83: type = facet_access_type %impl.elem0.193 [symbolic]
  1639. // CHECK:STDOUT: %pattern_type.d76: type = pattern_type %as_type.d83 [symbolic]
  1640. // CHECK:STDOUT: %.3f9: Core.Form = init_form %as_type.d83 [symbolic]
  1641. // CHECK:STDOUT: %J.WithSelf.F.type.adb: type = fn_type @J.WithSelf.F, @J.WithSelf(%Self.8a1) [symbolic]
  1642. // CHECK:STDOUT: %J.WithSelf.F.569: %J.WithSelf.F.type.adb = struct_value () [symbolic]
  1643. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.WithSelf.%J.WithSelf.F.decl [concrete]
  1644. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1645. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1646. // CHECK:STDOUT: %pattern_type.f76: type = pattern_type %J.type [concrete]
  1647. // CHECK:STDOUT: %T: %J.type = symbolic_binding T, 0 [symbolic]
  1648. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  1649. // CHECK:STDOUT: %pattern_type.5a3: type = pattern_type %T.as_type [symbolic]
  1650. // CHECK:STDOUT: %J.WithSelf.F.type.41f: type = fn_type @J.WithSelf.F, @J.WithSelf(%T) [symbolic]
  1651. // CHECK:STDOUT: %J.WithSelf.F.f01: %J.WithSelf.F.type.41f = struct_value () [symbolic]
  1652. // CHECK:STDOUT: %J.lookup_impl_witness.264: <witness> = lookup_impl_witness %T, @J [symbolic]
  1653. // CHECK:STDOUT: %impl.elem0.397: %facet_type = impl_witness_access %J.lookup_impl_witness.264, element0 [symbolic]
  1654. // CHECK:STDOUT: %as_type.baf: type = facet_access_type %impl.elem0.397 [symbolic]
  1655. // CHECK:STDOUT: %pattern_type.bba: type = pattern_type %as_type.baf [symbolic]
  1656. // CHECK:STDOUT: %.076: Core.Form = init_form %as_type.baf [symbolic]
  1657. // CHECK:STDOUT: %GenericResult.type: type = fn_type @GenericResult [concrete]
  1658. // CHECK:STDOUT: %GenericResult: %GenericResult.type = struct_value () [concrete]
  1659. // CHECK:STDOUT: %require_complete.bee: <witness> = require_complete_type %T.as_type [symbolic]
  1660. // CHECK:STDOUT: %require_complete.9b3: <witness> = require_complete_type %as_type.baf [symbolic]
  1661. // CHECK:STDOUT: %.43f: type = fn_type_with_self_type %J.WithSelf.F.type.41f, %T [symbolic]
  1662. // CHECK:STDOUT: %impl.elem1: %.43f = impl_witness_access %J.lookup_impl_witness.264, element1 [symbolic]
  1663. // CHECK:STDOUT: %specific_impl_fn.a64: <specific function> = specific_impl_function %impl.elem1, @J.WithSelf.F(%T) [symbolic]
  1664. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.397, @I [symbolic]
  1665. // CHECK:STDOUT: %I.facet: %I.type = facet_value %as_type.baf, (%I.lookup_impl_witness) [symbolic]
  1666. // CHECK:STDOUT: %I.WithSelf.Op.type.25c: type = fn_type @I.WithSelf.Op, @I.WithSelf(%I.facet) [symbolic]
  1667. // CHECK:STDOUT: %I.WithSelf.Op.fdc: %I.WithSelf.Op.type.25c = struct_value () [symbolic]
  1668. // CHECK:STDOUT: %.73b: type = fn_type_with_self_type %I.WithSelf.Op.type.25c, %I.facet [symbolic]
  1669. // CHECK:STDOUT: %impl.elem0.d74: %.73b = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
  1670. // CHECK:STDOUT: %specific_impl_fn.b45: <specific function> = specific_impl_function %impl.elem0.d74, @I.WithSelf.Op(%I.facet) [symbolic]
  1671. // CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.397, @Destroy [symbolic]
  1672. // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %as_type.baf, (%Destroy.lookup_impl_witness) [symbolic]
  1673. // CHECK:STDOUT: %Destroy.WithSelf.Op.type.077: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic]
  1674. // CHECK:STDOUT: %.0e3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.077, %Destroy.facet [symbolic]
  1675. // CHECK:STDOUT: %impl.elem0.4a3: %.0e3 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic]
  1676. // CHECK:STDOUT: %specific_impl_fn.86e: <specific function> = specific_impl_function %impl.elem0.4a3, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic]
  1677. // CHECK:STDOUT: }
  1678. // CHECK:STDOUT:
  1679. // CHECK:STDOUT: imports {
  1680. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1681. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1682. // CHECK:STDOUT: .BitAndWith = %Core.BitAndWith
  1683. // CHECK:STDOUT: import Core//prelude
  1684. // CHECK:STDOUT: import Core//prelude/...
  1685. // CHECK:STDOUT: }
  1686. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1687. // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic]
  1688. // CHECK:STDOUT: }
  1689. // CHECK:STDOUT:
  1690. // CHECK:STDOUT: file {
  1691. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1692. // CHECK:STDOUT: .Core = imports.%Core
  1693. // CHECK:STDOUT: .I = %I.decl
  1694. // CHECK:STDOUT: .J = %J.decl
  1695. // CHECK:STDOUT: .GenericResult = %GenericResult.decl
  1696. // CHECK:STDOUT: }
  1697. // CHECK:STDOUT: %Core.import = import Core
  1698. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1699. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1700. // CHECK:STDOUT: %GenericResult.decl: %GenericResult.type = fn_decl @GenericResult [concrete = constants.%GenericResult] {
  1701. // CHECK:STDOUT: %T.patt: %pattern_type.f76 = symbolic_binding_pattern T, 0 [concrete]
  1702. // CHECK:STDOUT: %t.param_patt: @GenericResult.%pattern_type.loc12_26 (%pattern_type.5a3) = value_param_pattern [concrete]
  1703. // CHECK:STDOUT: %t.patt: @GenericResult.%pattern_type.loc12_26 (%pattern_type.5a3) = at_binding_pattern t, %t.param_patt [concrete]
  1704. // CHECK:STDOUT: %u.param_patt: @GenericResult.%pattern_type.loc12_32 (%pattern_type.bba) = value_param_pattern [concrete]
  1705. // CHECK:STDOUT: %u.patt: @GenericResult.%pattern_type.loc12_32 (%pattern_type.bba) = at_binding_pattern u, %u.param_patt [concrete]
  1706. // CHECK:STDOUT: %return.param_patt: @GenericResult.%pattern_type.loc12_32 (%pattern_type.bba) = out_param_pattern [concrete]
  1707. // CHECK:STDOUT: %return.patt: @GenericResult.%pattern_type.loc12_32 (%pattern_type.bba) = return_slot_pattern %return.param_patt, %.loc12_43.4 [concrete]
  1708. // CHECK:STDOUT: } {
  1709. // CHECK:STDOUT: %T.ref.loc12_42: %J.type = name_ref T, %T.loc12_19.2 [symbolic = %T.loc12_19.1 (constants.%T)]
  1710. // CHECK:STDOUT: %T.as_type.loc12_43: type = facet_access_type %T.ref.loc12_42 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)]
  1711. // CHECK:STDOUT: %.loc12_43.3: type = converted %T.ref.loc12_42, %T.as_type.loc12_43 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)]
  1712. // CHECK:STDOUT: %U.ref.loc12_43: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.445]
  1713. // CHECK:STDOUT: %impl.elem0.loc12_43: %facet_type = impl_witness_access constants.%J.lookup_impl_witness.264, element0 [symbolic = %impl.elem0.loc12_35.1 (constants.%impl.elem0.397)]
  1714. // CHECK:STDOUT: %as_type.loc12_43: type = facet_access_type %impl.elem0.loc12_43 [symbolic = %as_type.loc12_35.1 (constants.%as_type.baf)]
  1715. // CHECK:STDOUT: %.loc12_43.4: type = converted %impl.elem0.loc12_43, %as_type.loc12_43 [symbolic = %as_type.loc12_35.1 (constants.%as_type.baf)]
  1716. // CHECK:STDOUT: %.loc12_43.5: Core.Form = init_form %.loc12_43.4 [symbolic = %.loc12_43.2 (constants.%.076)]
  1717. // CHECK:STDOUT: %.loc12_22: type = splice_block %J.ref [concrete = constants.%J.type] {
  1718. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1719. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1720. // CHECK:STDOUT: }
  1721. // CHECK:STDOUT: %T.loc12_19.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc12_19.1 (constants.%T)]
  1722. // CHECK:STDOUT: %t.param: @GenericResult.%T.as_type.loc12_28.1 (%T.as_type) = value_param call_param0
  1723. // CHECK:STDOUT: %.loc12_28.1: type = splice_block %.loc12_28.2 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)] {
  1724. // CHECK:STDOUT: %T.ref.loc12_28: %J.type = name_ref T, %T.loc12_19.2 [symbolic = %T.loc12_19.1 (constants.%T)]
  1725. // CHECK:STDOUT: %T.as_type.loc12_28.2: type = facet_access_type %T.ref.loc12_28 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)]
  1726. // CHECK:STDOUT: %.loc12_28.2: type = converted %T.ref.loc12_28, %T.as_type.loc12_28.2 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)]
  1727. // CHECK:STDOUT: }
  1728. // CHECK:STDOUT: %t: @GenericResult.%T.as_type.loc12_28.1 (%T.as_type) = value_binding t, %t.param
  1729. // CHECK:STDOUT: %u.param: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = value_param call_param1
  1730. // CHECK:STDOUT: %.loc12_35.1: type = splice_block %.loc12_35.3 [symbolic = %as_type.loc12_35.1 (constants.%as_type.baf)] {
  1731. // CHECK:STDOUT: %T.ref.loc12_34: %J.type = name_ref T, %T.loc12_19.2 [symbolic = %T.loc12_19.1 (constants.%T)]
  1732. // CHECK:STDOUT: %T.as_type.loc12_35: type = facet_access_type %T.ref.loc12_34 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)]
  1733. // CHECK:STDOUT: %.loc12_35.2: type = converted %T.ref.loc12_34, %T.as_type.loc12_35 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)]
  1734. // CHECK:STDOUT: %U.ref.loc12_35: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.445]
  1735. // CHECK:STDOUT: %impl.elem0.loc12_35.2: %facet_type = impl_witness_access constants.%J.lookup_impl_witness.264, element0 [symbolic = %impl.elem0.loc12_35.1 (constants.%impl.elem0.397)]
  1736. // CHECK:STDOUT: %as_type.loc12_35.2: type = facet_access_type %impl.elem0.loc12_35.2 [symbolic = %as_type.loc12_35.1 (constants.%as_type.baf)]
  1737. // CHECK:STDOUT: %.loc12_35.3: type = converted %impl.elem0.loc12_35.2, %as_type.loc12_35.2 [symbolic = %as_type.loc12_35.1 (constants.%as_type.baf)]
  1738. // CHECK:STDOUT: }
  1739. // CHECK:STDOUT: %u: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = value_binding u, %u.param
  1740. // CHECK:STDOUT: %return.param: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = out_param call_param2
  1741. // CHECK:STDOUT: %return: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = return_slot %return.param
  1742. // CHECK:STDOUT: }
  1743. // CHECK:STDOUT: }
  1744. // CHECK:STDOUT:
  1745. // CHECK:STDOUT: interface @I {
  1746. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.ab9]
  1747. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  1748. // CHECK:STDOUT:
  1749. // CHECK:STDOUT: !with Self:
  1750. // CHECK:STDOUT: %I.WithSelf.Op.decl: @I.WithSelf.%I.WithSelf.Op.type (%I.WithSelf.Op.type.71c) = fn_decl @I.WithSelf.Op [symbolic = @I.WithSelf.%I.WithSelf.Op (constants.%I.WithSelf.Op.ae1)] {
  1751. // CHECK:STDOUT: %self.param_patt: @I.WithSelf.Op.%pattern_type (%pattern_type.965) = value_param_pattern [concrete]
  1752. // CHECK:STDOUT: %self.patt: @I.WithSelf.Op.%pattern_type (%pattern_type.965) = at_binding_pattern self, %self.param_patt [concrete]
  1753. // CHECK:STDOUT: %b.param_patt: @I.WithSelf.Op.%pattern_type (%pattern_type.965) = value_param_pattern [concrete]
  1754. // CHECK:STDOUT: %b.patt: @I.WithSelf.Op.%pattern_type (%pattern_type.965) = at_binding_pattern b, %b.param_patt [concrete]
  1755. // CHECK:STDOUT: %return.param_patt: @I.WithSelf.Op.%pattern_type (%pattern_type.965) = out_param_pattern [concrete]
  1756. // CHECK:STDOUT: %return.patt: @I.WithSelf.Op.%pattern_type (%pattern_type.965) = return_slot_pattern %return.param_patt, %.loc4_33.2 [concrete]
  1757. // CHECK:STDOUT: } {
  1758. // CHECK:STDOUT: %Self.ref.loc4_33: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.ab9)]
  1759. // CHECK:STDOUT: %Self.as_type.loc4_33: type = facet_access_type %Self.ref.loc4_33 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.a26)]
  1760. // CHECK:STDOUT: %.loc4_33.2: type = converted %Self.ref.loc4_33, %Self.as_type.loc4_33 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.a26)]
  1761. // CHECK:STDOUT: %.loc4_33.3: Core.Form = init_form %.loc4_33.2 [symbolic = %.loc4_33.1 (constants.%.eb0)]
  1762. // CHECK:STDOUT: %self.param: @I.WithSelf.Op.%Self.as_type.loc4_15.1 (%Self.as_type.a26) = value_param call_param0
  1763. // CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.a26)] {
  1764. // CHECK:STDOUT: %Self.ref.loc4_15: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.ab9)]
  1765. // CHECK:STDOUT: %Self.as_type.loc4_15.2: type = facet_access_type %Self.ref.loc4_15 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.a26)]
  1766. // CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref.loc4_15, %Self.as_type.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.a26)]
  1767. // CHECK:STDOUT: }
  1768. // CHECK:STDOUT: %self: @I.WithSelf.Op.%Self.as_type.loc4_15.1 (%Self.as_type.a26) = value_binding self, %self.param
  1769. // CHECK:STDOUT: %b.param: @I.WithSelf.Op.%Self.as_type.loc4_15.1 (%Self.as_type.a26) = value_param call_param1
  1770. // CHECK:STDOUT: %.loc4_24.1: type = splice_block %.loc4_24.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.a26)] {
  1771. // CHECK:STDOUT: %Self.ref.loc4_24: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.ab9)]
  1772. // CHECK:STDOUT: %Self.as_type.loc4_24: type = facet_access_type %Self.ref.loc4_24 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.a26)]
  1773. // CHECK:STDOUT: %.loc4_24.2: type = converted %Self.ref.loc4_24, %Self.as_type.loc4_24 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.a26)]
  1774. // CHECK:STDOUT: }
  1775. // CHECK:STDOUT: %b: @I.WithSelf.Op.%Self.as_type.loc4_15.1 (%Self.as_type.a26) = value_binding b, %b.param
  1776. // CHECK:STDOUT: %return.param: ref @I.WithSelf.Op.%Self.as_type.loc4_15.1 (%Self.as_type.a26) = out_param call_param2
  1777. // CHECK:STDOUT: %return: ref @I.WithSelf.Op.%Self.as_type.loc4_15.1 (%Self.as_type.a26) = return_slot %return.param
  1778. // CHECK:STDOUT: }
  1779. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.Op.decl [concrete = constants.%assoc0.aa8]
  1780. // CHECK:STDOUT:
  1781. // CHECK:STDOUT: !members:
  1782. // CHECK:STDOUT: .Self = %Self
  1783. // CHECK:STDOUT: .Op = @I.WithSelf.%assoc0
  1784. // CHECK:STDOUT: witness = (@I.WithSelf.%I.WithSelf.Op.decl)
  1785. // CHECK:STDOUT:
  1786. // CHECK:STDOUT: !requires:
  1787. // CHECK:STDOUT: }
  1788. // CHECK:STDOUT:
  1789. // CHECK:STDOUT: interface @J {
  1790. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  1791. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  1792. // CHECK:STDOUT:
  1793. // CHECK:STDOUT: !with Self:
  1794. // CHECK:STDOUT: %U: %facet_type = assoc_const_decl @U [concrete] {
  1795. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete = constants.%assoc0.445]
  1796. // CHECK:STDOUT: }
  1797. // CHECK:STDOUT: %J.WithSelf.F.decl: @J.WithSelf.%J.WithSelf.F.type (%J.WithSelf.F.type.adb) = fn_decl @J.WithSelf.F [symbolic = @J.WithSelf.%J.WithSelf.F (constants.%J.WithSelf.F.569)] {
  1798. // CHECK:STDOUT: %u.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.d76) = value_param_pattern [concrete]
  1799. // CHECK:STDOUT: %u.patt: @J.WithSelf.F.%pattern_type (%pattern_type.d76) = at_binding_pattern u, %u.param_patt [concrete]
  1800. // CHECK:STDOUT: %return.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.d76) = out_param_pattern [concrete]
  1801. // CHECK:STDOUT: %return.patt: @J.WithSelf.F.%pattern_type (%pattern_type.d76) = return_slot_pattern %return.param_patt, %.loc9_17.2 [concrete]
  1802. // CHECK:STDOUT: } {
  1803. // CHECK:STDOUT: %impl.elem0.loc9_17: %facet_type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.193)]
  1804. // CHECK:STDOUT: %U.ref.loc9_17: %facet_type = name_ref U, %impl.elem0.loc9_17 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.193)]
  1805. // CHECK:STDOUT: %U.as_type.loc9_17: type = facet_access_type %U.ref.loc9_17 [symbolic = %as_type (constants.%as_type.d83)]
  1806. // CHECK:STDOUT: %.loc9_17.2: type = converted %U.ref.loc9_17, %U.as_type.loc9_17 [symbolic = %as_type (constants.%as_type.d83)]
  1807. // CHECK:STDOUT: %.loc9_17.3: Core.Form = init_form %.loc9_17.2 [symbolic = %.loc9_17.1 (constants.%.3f9)]
  1808. // CHECK:STDOUT: %u.param: @J.WithSelf.F.%as_type (%as_type.d83) = value_param call_param0
  1809. // CHECK:STDOUT: %.loc9_11.1: type = splice_block %.loc9_11.2 [symbolic = %as_type (constants.%as_type.d83)] {
  1810. // CHECK:STDOUT: %impl.elem0.loc9_11.2: %facet_type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.193)]
  1811. // CHECK:STDOUT: %U.ref.loc9_11: %facet_type = name_ref U, %impl.elem0.loc9_11.2 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.193)]
  1812. // CHECK:STDOUT: %U.as_type.loc9_11: type = facet_access_type %U.ref.loc9_11 [symbolic = %as_type (constants.%as_type.d83)]
  1813. // CHECK:STDOUT: %.loc9_11.2: type = converted %U.ref.loc9_11, %U.as_type.loc9_11 [symbolic = %as_type (constants.%as_type.d83)]
  1814. // CHECK:STDOUT: }
  1815. // CHECK:STDOUT: %u: @J.WithSelf.F.%as_type (%as_type.d83) = value_binding u, %u.param
  1816. // CHECK:STDOUT: %return.param: ref @J.WithSelf.F.%as_type (%as_type.d83) = out_param call_param1
  1817. // CHECK:STDOUT: %return: ref @J.WithSelf.F.%as_type (%as_type.d83) = return_slot %return.param
  1818. // CHECK:STDOUT: }
  1819. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.WithSelf.F.decl [concrete = constants.%assoc1]
  1820. // CHECK:STDOUT:
  1821. // CHECK:STDOUT: !members:
  1822. // CHECK:STDOUT: .Self = %Self
  1823. // CHECK:STDOUT: .I = <poisoned>
  1824. // CHECK:STDOUT: .I = <poisoned>
  1825. // CHECK:STDOUT: .U = @U.%assoc0
  1826. // CHECK:STDOUT: .F = @J.WithSelf.%assoc1
  1827. // CHECK:STDOUT: witness = (@J.WithSelf.%U, @J.WithSelf.%J.WithSelf.F.decl)
  1828. // CHECK:STDOUT:
  1829. // CHECK:STDOUT: !requires:
  1830. // CHECK:STDOUT: }
  1831. // CHECK:STDOUT:
  1832. // CHECK:STDOUT: generic fn @I.WithSelf.Op(@I.%Self: %I.type) {
  1833. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.ab9)]
  1834. // CHECK:STDOUT: %Self.as_type.loc4_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.a26)]
  1835. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_15.1 [symbolic = %pattern_type (constants.%pattern_type.965)]
  1836. // CHECK:STDOUT: %.loc4_33.1: Core.Form = init_form %Self.as_type.loc4_15.1 [symbolic = %.loc4_33.1 (constants.%.eb0)]
  1837. // CHECK:STDOUT:
  1838. // CHECK:STDOUT: fn(%self.param: @I.WithSelf.Op.%Self.as_type.loc4_15.1 (%Self.as_type.a26), %b.param: @I.WithSelf.Op.%Self.as_type.loc4_15.1 (%Self.as_type.a26)) -> out %return.param: @I.WithSelf.Op.%Self.as_type.loc4_15.1 (%Self.as_type.a26);
  1839. // CHECK:STDOUT: }
  1840. // CHECK:STDOUT:
  1841. // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self: %J.type) {
  1842. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  1843. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  1844. // CHECK:STDOUT: %impl.elem0.loc9_11.1: %facet_type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.193)]
  1845. // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.loc9_11.1 [symbolic = %as_type (constants.%as_type.d83)]
  1846. // CHECK:STDOUT: %pattern_type: type = pattern_type %as_type [symbolic = %pattern_type (constants.%pattern_type.d76)]
  1847. // CHECK:STDOUT: %.loc9_17.1: Core.Form = init_form %as_type [symbolic = %.loc9_17.1 (constants.%.3f9)]
  1848. // CHECK:STDOUT:
  1849. // CHECK:STDOUT: fn(%u.param: @J.WithSelf.F.%as_type (%as_type.d83)) -> out %return.param: @J.WithSelf.F.%as_type (%as_type.d83);
  1850. // CHECK:STDOUT: }
  1851. // CHECK:STDOUT:
  1852. // CHECK:STDOUT: generic fn @GenericResult(%T.loc12_19.2: %J.type) {
  1853. // CHECK:STDOUT: %T.loc12_19.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc12_19.1 (constants.%T)]
  1854. // CHECK:STDOUT: %T.as_type.loc12_28.1: type = facet_access_type %T.loc12_19.1 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)]
  1855. // CHECK:STDOUT: %pattern_type.loc12_26: type = pattern_type %T.as_type.loc12_28.1 [symbolic = %pattern_type.loc12_26 (constants.%pattern_type.5a3)]
  1856. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc12_19.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264)]
  1857. // CHECK:STDOUT: %impl.elem0.loc12_35.1: %facet_type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_35.1 (constants.%impl.elem0.397)]
  1858. // CHECK:STDOUT: %as_type.loc12_35.1: type = facet_access_type %impl.elem0.loc12_35.1 [symbolic = %as_type.loc12_35.1 (constants.%as_type.baf)]
  1859. // CHECK:STDOUT: %pattern_type.loc12_32: type = pattern_type %as_type.loc12_35.1 [symbolic = %pattern_type.loc12_32 (constants.%pattern_type.bba)]
  1860. // CHECK:STDOUT: %.loc12_43.2: Core.Form = init_form %as_type.loc12_35.1 [symbolic = %.loc12_43.2 (constants.%.076)]
  1861. // CHECK:STDOUT:
  1862. // CHECK:STDOUT: !definition:
  1863. // CHECK:STDOUT: %require_complete.loc12_26: <witness> = require_complete_type %T.as_type.loc12_28.1 [symbolic = %require_complete.loc12_26 (constants.%require_complete.bee)]
  1864. // CHECK:STDOUT: %require_complete.loc12_32: <witness> = require_complete_type %as_type.loc12_35.1 [symbolic = %require_complete.loc12_32 (constants.%require_complete.9b3)]
  1865. // CHECK:STDOUT: %J.WithSelf.F.type: type = fn_type @J.WithSelf.F, @J.WithSelf(%T.loc12_19.1) [symbolic = %J.WithSelf.F.type (constants.%J.WithSelf.F.type.41f)]
  1866. // CHECK:STDOUT: %.loc13_11: type = fn_type_with_self_type %J.WithSelf.F.type, %T.loc12_19.1 [symbolic = %.loc13_11 (constants.%.43f)]
  1867. // CHECK:STDOUT: %impl.elem1.loc13_11.2: @GenericResult.%.loc13_11 (%.43f) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc13_11.2 (constants.%impl.elem1)]
  1868. // CHECK:STDOUT: %specific_impl_fn.loc13_11.2: <specific function> = specific_impl_function %impl.elem1.loc13_11.2, @J.WithSelf.F(%T.loc12_19.1) [symbolic = %specific_impl_fn.loc13_11.2 (constants.%specific_impl_fn.a64)]
  1869. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.loc12_35.1, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
  1870. // CHECK:STDOUT: %I.facet.loc13_16: %I.type = facet_value %as_type.loc12_35.1, (%I.lookup_impl_witness) [symbolic = %I.facet.loc13_16 (constants.%I.facet)]
  1871. // CHECK:STDOUT: %I.WithSelf.Op.type: type = fn_type @I.WithSelf.Op, @I.WithSelf(%I.facet.loc13_16) [symbolic = %I.WithSelf.Op.type (constants.%I.WithSelf.Op.type.25c)]
  1872. // CHECK:STDOUT: %.loc13_16: type = fn_type_with_self_type %I.WithSelf.Op.type, %I.facet.loc13_16 [symbolic = %.loc13_16 (constants.%.73b)]
  1873. // CHECK:STDOUT: %impl.elem0.loc13_16.2: @GenericResult.%.loc13_16 (%.73b) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_16.2 (constants.%impl.elem0.d74)]
  1874. // CHECK:STDOUT: %specific_impl_fn.loc13_16.2: <specific function> = specific_impl_function %impl.elem0.loc13_16.2, @I.WithSelf.Op(%I.facet.loc13_16) [symbolic = %specific_impl_fn.loc13_16.2 (constants.%specific_impl_fn.b45)]
  1875. // CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.loc12_35.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)]
  1876. // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %as_type.loc12_35.1, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)]
  1877. // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.077)]
  1878. // CHECK:STDOUT: %.loc13_29.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc13_29.5 (constants.%.0e3)]
  1879. // CHECK:STDOUT: %impl.elem0.loc13_29.2: @GenericResult.%.loc13_29.5 (%.0e3) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_29.2 (constants.%impl.elem0.4a3)]
  1880. // CHECK:STDOUT: %specific_impl_fn.loc13_29.2: <specific function> = specific_impl_function %impl.elem0.loc13_29.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc13_29.2 (constants.%specific_impl_fn.86e)]
  1881. // CHECK:STDOUT:
  1882. // CHECK:STDOUT: fn(%t.param: @GenericResult.%T.as_type.loc12_28.1 (%T.as_type), %u.param: @GenericResult.%as_type.loc12_35.1 (%as_type.baf)) -> out %return.param: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) {
  1883. // CHECK:STDOUT: !entry:
  1884. // CHECK:STDOUT: %t.ref: @GenericResult.%T.as_type.loc12_28.1 (%T.as_type) = name_ref t, %t
  1885. // CHECK:STDOUT: %F.ref.loc13_11: %J.assoc_type = name_ref F, @J.WithSelf.%assoc1 [concrete = constants.%assoc1]
  1886. // CHECK:STDOUT: %impl.elem1.loc13_11.1: @GenericResult.%.loc13_11 (%.43f) = impl_witness_access constants.%J.lookup_impl_witness.264, element1 [symbolic = %impl.elem1.loc13_11.2 (constants.%impl.elem1)]
  1887. // CHECK:STDOUT: %u.ref.loc13_14: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = name_ref u, %u
  1888. // CHECK:STDOUT: %.loc13_15.1: %facet_type = converted constants.%as_type.baf, constants.%impl.elem0.397 [symbolic = %impl.elem0.loc12_35.1 (constants.%impl.elem0.397)]
  1889. // CHECK:STDOUT: %specific_impl_fn.loc13_11.1: <specific function> = specific_impl_function %impl.elem1.loc13_11.1, @J.WithSelf.F(constants.%T) [symbolic = %specific_impl_fn.loc13_11.2 (constants.%specific_impl_fn.a64)]
  1890. // CHECK:STDOUT: %.loc13_15.2: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = temporary_storage
  1891. // CHECK:STDOUT: %J.WithSelf.F.call.loc13_15: init @GenericResult.%as_type.loc12_35.1 (%as_type.baf) to %.loc13_15.2 = call %specific_impl_fn.loc13_11.1(%u.ref.loc13_14)
  1892. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1893. // CHECK:STDOUT: %Op.ref: %I.assoc_type = name_ref Op, @I.WithSelf.%assoc0 [concrete = constants.%assoc0.aa8]
  1894. // CHECK:STDOUT: %impl.elem0.loc13_16.1: @GenericResult.%.loc13_16 (%.73b) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_16.2 (constants.%impl.elem0.d74)]
  1895. // CHECK:STDOUT: %bound_method.loc13_16: <bound method> = bound_method %J.WithSelf.F.call.loc13_15, %impl.elem0.loc13_16.1
  1896. // CHECK:STDOUT: %T.ref.loc13: %J.type = name_ref T, %T.loc12_19.2 [symbolic = %T.loc12_19.1 (constants.%T)]
  1897. // CHECK:STDOUT: %T.as_type.loc13: type = facet_access_type %T.ref.loc13 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)]
  1898. // CHECK:STDOUT: %.loc13_25: type = converted %T.ref.loc13, %T.as_type.loc13 [symbolic = %T.as_type.loc12_28.1 (constants.%T.as_type)]
  1899. // CHECK:STDOUT: %F.ref.loc13_25: %J.assoc_type = name_ref F, @J.WithSelf.%assoc1 [concrete = constants.%assoc1]
  1900. // CHECK:STDOUT: %impl.elem1.loc13_25: @GenericResult.%.loc13_11 (%.43f) = impl_witness_access constants.%J.lookup_impl_witness.264, element1 [symbolic = %impl.elem1.loc13_11.2 (constants.%impl.elem1)]
  1901. // CHECK:STDOUT: %u.ref.loc13_28: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = name_ref u, %u
  1902. // CHECK:STDOUT: %.loc13_29.1: %facet_type = converted constants.%as_type.baf, constants.%impl.elem0.397 [symbolic = %impl.elem0.loc12_35.1 (constants.%impl.elem0.397)]
  1903. // CHECK:STDOUT: %specific_impl_fn.loc13_25: <specific function> = specific_impl_function %impl.elem1.loc13_25, @J.WithSelf.F(constants.%T) [symbolic = %specific_impl_fn.loc13_11.2 (constants.%specific_impl_fn.a64)]
  1904. // CHECK:STDOUT: %.loc13_29.2: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = temporary_storage
  1905. // CHECK:STDOUT: %J.WithSelf.F.call.loc13_29: init @GenericResult.%as_type.loc12_35.1 (%as_type.baf) to %.loc13_29.2 = call %specific_impl_fn.loc13_25(%u.ref.loc13_28)
  1906. // CHECK:STDOUT: %I.facet.loc13_30: %I.type = facet_value constants.%as_type.baf, (constants.%I.lookup_impl_witness) [symbolic = %I.facet.loc13_16 (constants.%I.facet)]
  1907. // CHECK:STDOUT: %.loc13_30: %I.type = converted constants.%as_type.baf, %I.facet.loc13_30 [symbolic = %I.facet.loc13_16 (constants.%I.facet)]
  1908. // CHECK:STDOUT: %specific_impl_fn.loc13_16.1: <specific function> = specific_impl_function %impl.elem0.loc13_16.1, @I.WithSelf.Op(constants.%I.facet) [symbolic = %specific_impl_fn.loc13_16.2 (constants.%specific_impl_fn.b45)]
  1909. // CHECK:STDOUT: %bound_method.loc13_30: <bound method> = bound_method %J.WithSelf.F.call.loc13_15, %specific_impl_fn.loc13_16.1
  1910. // CHECK:STDOUT: %.loc12_43.1: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = splice_block %return.param {}
  1911. // CHECK:STDOUT: %.loc13_15.3: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = temporary %.loc13_15.2, %J.WithSelf.F.call.loc13_15
  1912. // CHECK:STDOUT: %.loc13_15.4: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = acquire_value %.loc13_15.3
  1913. // CHECK:STDOUT: %.loc13_29.3: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = temporary %.loc13_29.2, %J.WithSelf.F.call.loc13_29
  1914. // CHECK:STDOUT: %.loc13_29.4: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = acquire_value %.loc13_29.3
  1915. // CHECK:STDOUT: %I.WithSelf.Op.call: init @GenericResult.%as_type.loc12_35.1 (%as_type.baf) to %.loc12_43.1 = call %bound_method.loc13_30(%.loc13_15.4, %.loc13_29.4)
  1916. // CHECK:STDOUT: %impl.elem0.loc13_29.1: @GenericResult.%.loc13_29.5 (%.0e3) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_29.2 (constants.%impl.elem0.4a3)]
  1917. // CHECK:STDOUT: %bound_method.loc13_29.1: <bound method> = bound_method %.loc13_29.3, %impl.elem0.loc13_29.1
  1918. // CHECK:STDOUT: %specific_impl_fn.loc13_29.1: <specific function> = specific_impl_function %impl.elem0.loc13_29.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc13_29.2 (constants.%specific_impl_fn.86e)]
  1919. // CHECK:STDOUT: %bound_method.loc13_29.2: <bound method> = bound_method %.loc13_29.3, %specific_impl_fn.loc13_29.1
  1920. // CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13_29: init %empty_tuple.type = call %bound_method.loc13_29.2(%.loc13_29.3)
  1921. // CHECK:STDOUT: %impl.elem0.loc13_15: @GenericResult.%.loc13_29.5 (%.0e3) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_29.2 (constants.%impl.elem0.4a3)]
  1922. // CHECK:STDOUT: %bound_method.loc13_15.1: <bound method> = bound_method %.loc13_15.3, %impl.elem0.loc13_15
  1923. // CHECK:STDOUT: %specific_impl_fn.loc13_15: <specific function> = specific_impl_function %impl.elem0.loc13_15, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc13_29.2 (constants.%specific_impl_fn.86e)]
  1924. // CHECK:STDOUT: %bound_method.loc13_15.2: <bound method> = bound_method %.loc13_15.3, %specific_impl_fn.loc13_15
  1925. // CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13_15: init %empty_tuple.type = call %bound_method.loc13_15.2(%.loc13_15.3)
  1926. // CHECK:STDOUT: return %I.WithSelf.Op.call to %return.param
  1927. // CHECK:STDOUT: }
  1928. // CHECK:STDOUT: }
  1929. // CHECK:STDOUT:
  1930. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self.ab9) {
  1931. // CHECK:STDOUT: !definition:
  1932. // CHECK:STDOUT: %Self => constants.%Self.ab9
  1933. // CHECK:STDOUT: %I.WithSelf.Op.type => constants.%I.WithSelf.Op.type.71c
  1934. // CHECK:STDOUT: %I.WithSelf.Op => constants.%I.WithSelf.Op.ae1
  1935. // CHECK:STDOUT: }
  1936. // CHECK:STDOUT:
  1937. // CHECK:STDOUT: specific @I.WithSelf.Op(constants.%Self.ab9) {
  1938. // CHECK:STDOUT: %Self => constants.%Self.ab9
  1939. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%Self.as_type.a26
  1940. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.965
  1941. // CHECK:STDOUT: %.loc4_33.1 => constants.%.eb0
  1942. // CHECK:STDOUT: }
  1943. // CHECK:STDOUT:
  1944. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self.8a1) {
  1945. // CHECK:STDOUT: !definition:
  1946. // CHECK:STDOUT: %Self => constants.%Self.8a1
  1947. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.adb
  1948. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.569
  1949. // CHECK:STDOUT: }
  1950. // CHECK:STDOUT:
  1951. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self.8a1) {
  1952. // CHECK:STDOUT: %Self => constants.%Self.8a1
  1953. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  1954. // CHECK:STDOUT: %impl.elem0.loc9_11.1 => constants.%impl.elem0.193
  1955. // CHECK:STDOUT: %as_type => constants.%as_type.d83
  1956. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.d76
  1957. // CHECK:STDOUT: %.loc9_17.1 => constants.%.3f9
  1958. // CHECK:STDOUT: }
  1959. // CHECK:STDOUT:
  1960. // CHECK:STDOUT: specific @J.WithSelf(constants.%T) {
  1961. // CHECK:STDOUT: !definition:
  1962. // CHECK:STDOUT: %Self => constants.%T
  1963. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.41f
  1964. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.f01
  1965. // CHECK:STDOUT: }
  1966. // CHECK:STDOUT:
  1967. // CHECK:STDOUT: specific @GenericResult(constants.%T) {
  1968. // CHECK:STDOUT: %T.loc12_19.1 => constants.%T
  1969. // CHECK:STDOUT: %T.as_type.loc12_28.1 => constants.%T.as_type
  1970. // CHECK:STDOUT: %pattern_type.loc12_26 => constants.%pattern_type.5a3
  1971. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  1972. // CHECK:STDOUT: %impl.elem0.loc12_35.1 => constants.%impl.elem0.397
  1973. // CHECK:STDOUT: %as_type.loc12_35.1 => constants.%as_type.baf
  1974. // CHECK:STDOUT: %pattern_type.loc12_32 => constants.%pattern_type.bba
  1975. // CHECK:STDOUT: %.loc12_43.2 => constants.%.076
  1976. // CHECK:STDOUT: }
  1977. // CHECK:STDOUT:
  1978. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%T) {
  1979. // CHECK:STDOUT: %Self => constants.%T
  1980. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  1981. // CHECK:STDOUT: %impl.elem0.loc9_11.1 => constants.%impl.elem0.397
  1982. // CHECK:STDOUT: %as_type => constants.%as_type.baf
  1983. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.bba
  1984. // CHECK:STDOUT: %.loc9_17.1 => constants.%.076
  1985. // CHECK:STDOUT: }
  1986. // CHECK:STDOUT:
  1987. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  1988. // CHECK:STDOUT: !definition:
  1989. // CHECK:STDOUT: %Self => constants.%I.facet
  1990. // CHECK:STDOUT: %I.WithSelf.Op.type => constants.%I.WithSelf.Op.type.25c
  1991. // CHECK:STDOUT: %I.WithSelf.Op => constants.%I.WithSelf.Op.fdc
  1992. // CHECK:STDOUT: }
  1993. // CHECK:STDOUT:
  1994. // CHECK:STDOUT: specific @I.WithSelf.Op(constants.%I.facet) {
  1995. // CHECK:STDOUT: %Self => constants.%I.facet
  1996. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%as_type.baf
  1997. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.bba
  1998. // CHECK:STDOUT: %.loc4_33.1 => constants.%.076
  1999. // CHECK:STDOUT: }
  2000. // CHECK:STDOUT:
  2001. // CHECK:STDOUT: --- interface_qualified.carbon
  2002. // CHECK:STDOUT:
  2003. // CHECK:STDOUT: constants {
  2004. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2005. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic]
  2006. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2007. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete]
  2008. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  2009. // CHECK:STDOUT: %pattern_type.909: type = pattern_type %Self.as_type [symbolic]
  2010. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self, @J [symbolic]
  2011. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  2012. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  2013. // CHECK:STDOUT: %.77f: Core.Form = init_form %impl.elem0.335 [symbolic]
  2014. // CHECK:STDOUT: %J.WithSelf.G.type.ace: type = fn_type @J.WithSelf.G, @J.WithSelf(%Self) [symbolic]
  2015. // CHECK:STDOUT: %J.WithSelf.G.6e7: %J.WithSelf.G.type.ace = struct_value () [symbolic]
  2016. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.WithSelf.%J.WithSelf.G.decl [concrete]
  2017. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  2018. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  2019. // CHECK:STDOUT: %pattern_type.f76: type = pattern_type %J.type [concrete]
  2020. // CHECK:STDOUT: %T: %J.type = symbolic_binding T, 0 [symbolic]
  2021. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  2022. // CHECK:STDOUT: %pattern_type.5a3: type = pattern_type %T.as_type [symbolic]
  2023. // CHECK:STDOUT: %J.WithSelf.G.type.b2e: type = fn_type @J.WithSelf.G, @J.WithSelf(%T) [symbolic]
  2024. // CHECK:STDOUT: %J.WithSelf.G.310: %J.WithSelf.G.type.b2e = struct_value () [symbolic]
  2025. // CHECK:STDOUT: %J.lookup_impl_witness.264: <witness> = lookup_impl_witness %T, @J [symbolic]
  2026. // CHECK:STDOUT: %impl.elem0.560: type = impl_witness_access %J.lookup_impl_witness.264, element0 [symbolic]
  2027. // CHECK:STDOUT: %pattern_type.ad6: type = pattern_type %impl.elem0.560 [symbolic]
  2028. // CHECK:STDOUT: %.a8e: Core.Form = init_form %impl.elem0.560 [symbolic]
  2029. // CHECK:STDOUT: %GenericCallInterfaceQualified.type: type = fn_type @GenericCallInterfaceQualified [concrete]
  2030. // CHECK:STDOUT: %GenericCallInterfaceQualified: %GenericCallInterfaceQualified.type = struct_value () [concrete]
  2031. // CHECK:STDOUT: %require_complete.bee: <witness> = require_complete_type %T.as_type [symbolic]
  2032. // CHECK:STDOUT: %require_complete.06a: <witness> = require_complete_type %impl.elem0.560 [symbolic]
  2033. // CHECK:STDOUT: %.298: type = fn_type_with_self_type %J.WithSelf.G.type.b2e, %T [symbolic]
  2034. // CHECK:STDOUT: %impl.elem1: %.298 = impl_witness_access %J.lookup_impl_witness.264, element1 [symbolic]
  2035. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem1, @J.WithSelf.G(%T) [symbolic]
  2036. // CHECK:STDOUT: }
  2037. // CHECK:STDOUT:
  2038. // CHECK:STDOUT: imports {
  2039. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2040. // CHECK:STDOUT: import Core//prelude
  2041. // CHECK:STDOUT: import Core//prelude/...
  2042. // CHECK:STDOUT: }
  2043. // CHECK:STDOUT: }
  2044. // CHECK:STDOUT:
  2045. // CHECK:STDOUT: file {
  2046. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2047. // CHECK:STDOUT: .Core = imports.%Core
  2048. // CHECK:STDOUT: .J = %J.decl
  2049. // CHECK:STDOUT: .GenericCallInterfaceQualified = %GenericCallInterfaceQualified.decl
  2050. // CHECK:STDOUT: }
  2051. // CHECK:STDOUT: %Core.import = import Core
  2052. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2053. // CHECK:STDOUT: %GenericCallInterfaceQualified.decl: %GenericCallInterfaceQualified.type = fn_decl @GenericCallInterfaceQualified [concrete = constants.%GenericCallInterfaceQualified] {
  2054. // CHECK:STDOUT: %T.patt: %pattern_type.f76 = symbolic_binding_pattern T, 0 [concrete]
  2055. // CHECK:STDOUT: %t.param_patt: @GenericCallInterfaceQualified.%pattern_type.loc8_42 (%pattern_type.5a3) = value_param_pattern [concrete]
  2056. // CHECK:STDOUT: %t.patt: @GenericCallInterfaceQualified.%pattern_type.loc8_42 (%pattern_type.5a3) = at_binding_pattern t, %t.param_patt [concrete]
  2057. // CHECK:STDOUT: %u.param_patt: @GenericCallInterfaceQualified.%pattern_type.loc8_48 (%pattern_type.ad6) = value_param_pattern [concrete]
  2058. // CHECK:STDOUT: %u.patt: @GenericCallInterfaceQualified.%pattern_type.loc8_48 (%pattern_type.ad6) = at_binding_pattern u, %u.param_patt [concrete]
  2059. // CHECK:STDOUT: %return.param_patt: @GenericCallInterfaceQualified.%pattern_type.loc8_48 (%pattern_type.ad6) = out_param_pattern [concrete]
  2060. // CHECK:STDOUT: %return.patt: @GenericCallInterfaceQualified.%pattern_type.loc8_48 (%pattern_type.ad6) = return_slot_pattern %return.param_patt, %impl.elem0.loc8_59 [concrete]
  2061. // CHECK:STDOUT: } {
  2062. // CHECK:STDOUT: %T.ref.loc8_58: %J.type = name_ref T, %T.loc8_35.2 [symbolic = %T.loc8_35.1 (constants.%T)]
  2063. // CHECK:STDOUT: %T.as_type.loc8_59: type = facet_access_type %T.ref.loc8_58 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)]
  2064. // CHECK:STDOUT: %.loc8_59.3: type = converted %T.ref.loc8_58, %T.as_type.loc8_59 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)]
  2065. // CHECK:STDOUT: %U.ref.loc8_59: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  2066. // CHECK:STDOUT: %impl.elem0.loc8_59: type = impl_witness_access constants.%J.lookup_impl_witness.264, element0 [symbolic = %impl.elem0.loc8_51.1 (constants.%impl.elem0.560)]
  2067. // CHECK:STDOUT: %.loc8_59.4: Core.Form = init_form %impl.elem0.loc8_59 [symbolic = %.loc8_59.2 (constants.%.a8e)]
  2068. // CHECK:STDOUT: %.loc8_38: type = splice_block %J.ref.loc8 [concrete = constants.%J.type] {
  2069. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  2070. // CHECK:STDOUT: %J.ref.loc8: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2071. // CHECK:STDOUT: }
  2072. // CHECK:STDOUT: %T.loc8_35.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc8_35.1 (constants.%T)]
  2073. // CHECK:STDOUT: %t.param: @GenericCallInterfaceQualified.%T.as_type.loc8_44.1 (%T.as_type) = value_param call_param0
  2074. // CHECK:STDOUT: %.loc8_44.1: type = splice_block %.loc8_44.2 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)] {
  2075. // CHECK:STDOUT: %T.ref.loc8_44: %J.type = name_ref T, %T.loc8_35.2 [symbolic = %T.loc8_35.1 (constants.%T)]
  2076. // CHECK:STDOUT: %T.as_type.loc8_44.2: type = facet_access_type %T.ref.loc8_44 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)]
  2077. // CHECK:STDOUT: %.loc8_44.2: type = converted %T.ref.loc8_44, %T.as_type.loc8_44.2 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)]
  2078. // CHECK:STDOUT: }
  2079. // CHECK:STDOUT: %t: @GenericCallInterfaceQualified.%T.as_type.loc8_44.1 (%T.as_type) = value_binding t, %t.param
  2080. // CHECK:STDOUT: %u.param: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = value_param call_param1
  2081. // CHECK:STDOUT: %.loc8_51.1: type = splice_block %impl.elem0.loc8_51.2 [symbolic = %impl.elem0.loc8_51.1 (constants.%impl.elem0.560)] {
  2082. // CHECK:STDOUT: %T.ref.loc8_50: %J.type = name_ref T, %T.loc8_35.2 [symbolic = %T.loc8_35.1 (constants.%T)]
  2083. // CHECK:STDOUT: %T.as_type.loc8_51: type = facet_access_type %T.ref.loc8_50 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)]
  2084. // CHECK:STDOUT: %.loc8_51.2: type = converted %T.ref.loc8_50, %T.as_type.loc8_51 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)]
  2085. // CHECK:STDOUT: %U.ref.loc8_51: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  2086. // CHECK:STDOUT: %impl.elem0.loc8_51.2: type = impl_witness_access constants.%J.lookup_impl_witness.264, element0 [symbolic = %impl.elem0.loc8_51.1 (constants.%impl.elem0.560)]
  2087. // CHECK:STDOUT: }
  2088. // CHECK:STDOUT: %u: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = value_binding u, %u.param
  2089. // CHECK:STDOUT: %return.param: ref @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = out_param call_param2
  2090. // CHECK:STDOUT: %return: ref @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = return_slot %return.param
  2091. // CHECK:STDOUT: }
  2092. // CHECK:STDOUT: }
  2093. // CHECK:STDOUT:
  2094. // CHECK:STDOUT: interface @J {
  2095. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  2096. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  2097. // CHECK:STDOUT:
  2098. // CHECK:STDOUT: !with Self:
  2099. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  2100. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete = constants.%assoc0]
  2101. // CHECK:STDOUT: }
  2102. // CHECK:STDOUT: %J.WithSelf.G.decl: @J.WithSelf.%J.WithSelf.G.type (%J.WithSelf.G.type.ace) = fn_decl @J.WithSelf.G [symbolic = @J.WithSelf.%J.WithSelf.G (constants.%J.WithSelf.G.6e7)] {
  2103. // CHECK:STDOUT: %self.param_patt: @J.WithSelf.G.%pattern_type.loc5_12 (%pattern_type.909) = value_param_pattern [concrete]
  2104. // CHECK:STDOUT: %self.patt: @J.WithSelf.G.%pattern_type.loc5_12 (%pattern_type.909) = at_binding_pattern self, %self.param_patt [concrete]
  2105. // CHECK:STDOUT: %v.param_patt: @J.WithSelf.G.%pattern_type.loc5_21 (%pattern_type.c1a) = value_param_pattern [concrete]
  2106. // CHECK:STDOUT: %v.patt: @J.WithSelf.G.%pattern_type.loc5_21 (%pattern_type.c1a) = at_binding_pattern v, %v.param_patt [concrete]
  2107. // CHECK:STDOUT: %return.param_patt: @J.WithSelf.G.%pattern_type.loc5_21 (%pattern_type.c1a) = out_param_pattern [concrete]
  2108. // CHECK:STDOUT: %return.patt: @J.WithSelf.G.%pattern_type.loc5_21 (%pattern_type.c1a) = return_slot_pattern %return.param_patt, %U.ref.loc5_29 [concrete]
  2109. // CHECK:STDOUT: } {
  2110. // CHECK:STDOUT: %impl.elem0.loc5_29: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  2111. // CHECK:STDOUT: %U.ref.loc5_29: type = name_ref U, %impl.elem0.loc5_29 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  2112. // CHECK:STDOUT: %.loc5_29.2: Core.Form = init_form %U.ref.loc5_29 [symbolic = %.loc5_29.1 (constants.%.77f)]
  2113. // CHECK:STDOUT: %self.param: @J.WithSelf.G.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0
  2114. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] {
  2115. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self)]
  2116. // 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)]
  2117. // 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)]
  2118. // CHECK:STDOUT: }
  2119. // CHECK:STDOUT: %self: @J.WithSelf.G.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param
  2120. // CHECK:STDOUT: %v.param: @J.WithSelf.G.%impl.elem0.loc5_23.1 (%impl.elem0.335) = value_param call_param1
  2121. // CHECK:STDOUT: %.loc5_23: type = splice_block %U.ref.loc5_23 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)] {
  2122. // CHECK:STDOUT: %impl.elem0.loc5_23.2: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  2123. // CHECK:STDOUT: %U.ref.loc5_23: type = name_ref U, %impl.elem0.loc5_23.2 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  2124. // CHECK:STDOUT: }
  2125. // CHECK:STDOUT: %v: @J.WithSelf.G.%impl.elem0.loc5_23.1 (%impl.elem0.335) = value_binding v, %v.param
  2126. // CHECK:STDOUT: %return.param: ref @J.WithSelf.G.%impl.elem0.loc5_23.1 (%impl.elem0.335) = out_param call_param2
  2127. // CHECK:STDOUT: %return: ref @J.WithSelf.G.%impl.elem0.loc5_23.1 (%impl.elem0.335) = return_slot %return.param
  2128. // CHECK:STDOUT: }
  2129. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.WithSelf.G.decl [concrete = constants.%assoc1]
  2130. // CHECK:STDOUT:
  2131. // CHECK:STDOUT: !members:
  2132. // CHECK:STDOUT: .Self = %Self
  2133. // CHECK:STDOUT: .U = @U.%assoc0
  2134. // CHECK:STDOUT: .G = @J.WithSelf.%assoc1
  2135. // CHECK:STDOUT: witness = (@J.WithSelf.%U, @J.WithSelf.%J.WithSelf.G.decl)
  2136. // CHECK:STDOUT:
  2137. // CHECK:STDOUT: !requires:
  2138. // CHECK:STDOUT: }
  2139. // CHECK:STDOUT:
  2140. // CHECK:STDOUT: generic fn @J.WithSelf.G(@J.%Self: %J.type) {
  2141. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  2142. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  2143. // CHECK:STDOUT: %pattern_type.loc5_12: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type.loc5_12 (constants.%pattern_type.909)]
  2144. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  2145. // CHECK:STDOUT: %impl.elem0.loc5_23.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  2146. // CHECK:STDOUT: %pattern_type.loc5_21: type = pattern_type %impl.elem0.loc5_23.1 [symbolic = %pattern_type.loc5_21 (constants.%pattern_type.c1a)]
  2147. // CHECK:STDOUT: %.loc5_29.1: Core.Form = init_form %impl.elem0.loc5_23.1 [symbolic = %.loc5_29.1 (constants.%.77f)]
  2148. // CHECK:STDOUT:
  2149. // CHECK:STDOUT: fn(%self.param: @J.WithSelf.G.%Self.as_type.loc5_14.1 (%Self.as_type), %v.param: @J.WithSelf.G.%impl.elem0.loc5_23.1 (%impl.elem0.335)) -> out %return.param: @J.WithSelf.G.%impl.elem0.loc5_23.1 (%impl.elem0.335);
  2150. // CHECK:STDOUT: }
  2151. // CHECK:STDOUT:
  2152. // CHECK:STDOUT: generic fn @GenericCallInterfaceQualified(%T.loc8_35.2: %J.type) {
  2153. // CHECK:STDOUT: %T.loc8_35.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc8_35.1 (constants.%T)]
  2154. // CHECK:STDOUT: %T.as_type.loc8_44.1: type = facet_access_type %T.loc8_35.1 [symbolic = %T.as_type.loc8_44.1 (constants.%T.as_type)]
  2155. // CHECK:STDOUT: %pattern_type.loc8_42: type = pattern_type %T.as_type.loc8_44.1 [symbolic = %pattern_type.loc8_42 (constants.%pattern_type.5a3)]
  2156. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_35.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264)]
  2157. // CHECK:STDOUT: %impl.elem0.loc8_51.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_51.1 (constants.%impl.elem0.560)]
  2158. // CHECK:STDOUT: %pattern_type.loc8_48: type = pattern_type %impl.elem0.loc8_51.1 [symbolic = %pattern_type.loc8_48 (constants.%pattern_type.ad6)]
  2159. // CHECK:STDOUT: %.loc8_59.2: Core.Form = init_form %impl.elem0.loc8_51.1 [symbolic = %.loc8_59.2 (constants.%.a8e)]
  2160. // CHECK:STDOUT:
  2161. // CHECK:STDOUT: !definition:
  2162. // CHECK:STDOUT: %require_complete.loc8_42: <witness> = require_complete_type %T.as_type.loc8_44.1 [symbolic = %require_complete.loc8_42 (constants.%require_complete.bee)]
  2163. // CHECK:STDOUT: %require_complete.loc8_48: <witness> = require_complete_type %impl.elem0.loc8_51.1 [symbolic = %require_complete.loc8_48 (constants.%require_complete.06a)]
  2164. // CHECK:STDOUT: %J.WithSelf.G.type: type = fn_type @J.WithSelf.G, @J.WithSelf(%T.loc8_35.1) [symbolic = %J.WithSelf.G.type (constants.%J.WithSelf.G.type.b2e)]
  2165. // CHECK:STDOUT: %.loc9: type = fn_type_with_self_type %J.WithSelf.G.type, %T.loc8_35.1 [symbolic = %.loc9 (constants.%.298)]
  2166. // CHECK:STDOUT: %impl.elem1.loc9_11.2: @GenericCallInterfaceQualified.%.loc9 (%.298) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2167. // CHECK:STDOUT: %specific_impl_fn.loc9_11.2: <specific function> = specific_impl_function %impl.elem1.loc9_11.2, @J.WithSelf.G(%T.loc8_35.1) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2168. // CHECK:STDOUT:
  2169. // CHECK:STDOUT: fn(%t.param: @GenericCallInterfaceQualified.%T.as_type.loc8_44.1 (%T.as_type), %u.param: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560)) -> out %return.param: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) {
  2170. // CHECK:STDOUT: !entry:
  2171. // CHECK:STDOUT: %t.ref: @GenericCallInterfaceQualified.%T.as_type.loc8_44.1 (%T.as_type) = name_ref t, %t
  2172. // CHECK:STDOUT: %J.ref.loc9: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2173. // CHECK:STDOUT: %G.ref: %J.assoc_type = name_ref G, @J.WithSelf.%assoc1 [concrete = constants.%assoc1]
  2174. // CHECK:STDOUT: %impl.elem1.loc9_11.1: @GenericCallInterfaceQualified.%.loc9 (%.298) = impl_witness_access constants.%J.lookup_impl_witness.264, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2175. // CHECK:STDOUT: %bound_method.loc9_11: <bound method> = bound_method %t.ref, %impl.elem1.loc9_11.1
  2176. // CHECK:STDOUT: %u.ref: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = name_ref u, %u
  2177. // CHECK:STDOUT: %specific_impl_fn.loc9_11.1: <specific function> = specific_impl_function %impl.elem1.loc9_11.1, @J.WithSelf.G(constants.%T) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2178. // CHECK:STDOUT: %bound_method.loc9_19: <bound method> = bound_method %t.ref, %specific_impl_fn.loc9_11.1
  2179. // CHECK:STDOUT: %.loc8_59.1: ref @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = splice_block %return.param {}
  2180. // CHECK:STDOUT: %J.WithSelf.G.call: init @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) to %.loc8_59.1 = call %bound_method.loc9_19(%t.ref, %u.ref)
  2181. // CHECK:STDOUT: return %J.WithSelf.G.call to %return.param
  2182. // CHECK:STDOUT: }
  2183. // CHECK:STDOUT: }
  2184. // CHECK:STDOUT:
  2185. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self) {
  2186. // CHECK:STDOUT: !definition:
  2187. // CHECK:STDOUT: %Self => constants.%Self
  2188. // CHECK:STDOUT: %J.WithSelf.G.type => constants.%J.WithSelf.G.type.ace
  2189. // CHECK:STDOUT: %J.WithSelf.G => constants.%J.WithSelf.G.6e7
  2190. // CHECK:STDOUT: }
  2191. // CHECK:STDOUT:
  2192. // CHECK:STDOUT: specific @J.WithSelf.G(constants.%Self) {
  2193. // CHECK:STDOUT: %Self => constants.%Self
  2194. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type
  2195. // CHECK:STDOUT: %pattern_type.loc5_12 => constants.%pattern_type.909
  2196. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  2197. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.335
  2198. // CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.c1a
  2199. // CHECK:STDOUT: %.loc5_29.1 => constants.%.77f
  2200. // CHECK:STDOUT: }
  2201. // CHECK:STDOUT:
  2202. // CHECK:STDOUT: specific @J.WithSelf(constants.%T) {
  2203. // CHECK:STDOUT: !definition:
  2204. // CHECK:STDOUT: %Self => constants.%T
  2205. // CHECK:STDOUT: %J.WithSelf.G.type => constants.%J.WithSelf.G.type.b2e
  2206. // CHECK:STDOUT: %J.WithSelf.G => constants.%J.WithSelf.G.310
  2207. // CHECK:STDOUT: }
  2208. // CHECK:STDOUT:
  2209. // CHECK:STDOUT: specific @GenericCallInterfaceQualified(constants.%T) {
  2210. // CHECK:STDOUT: %T.loc8_35.1 => constants.%T
  2211. // CHECK:STDOUT: %T.as_type.loc8_44.1 => constants.%T.as_type
  2212. // CHECK:STDOUT: %pattern_type.loc8_42 => constants.%pattern_type.5a3
  2213. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  2214. // CHECK:STDOUT: %impl.elem0.loc8_51.1 => constants.%impl.elem0.560
  2215. // CHECK:STDOUT: %pattern_type.loc8_48 => constants.%pattern_type.ad6
  2216. // CHECK:STDOUT: %.loc8_59.2 => constants.%.a8e
  2217. // CHECK:STDOUT: }
  2218. // CHECK:STDOUT:
  2219. // CHECK:STDOUT: specific @J.WithSelf.G(constants.%T) {
  2220. // CHECK:STDOUT: %Self => constants.%T
  2221. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T.as_type
  2222. // CHECK:STDOUT: %pattern_type.loc5_12 => constants.%pattern_type.5a3
  2223. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  2224. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.560
  2225. // CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.ad6
  2226. // CHECK:STDOUT: %.loc5_29.1 => constants.%.a8e
  2227. // CHECK:STDOUT: }
  2228. // CHECK:STDOUT:
  2229. // CHECK:STDOUT: --- use_where.carbon
  2230. // CHECK:STDOUT:
  2231. // CHECK:STDOUT: constants {
  2232. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2233. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  2234. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2235. // CHECK:STDOUT: %assoc0.ebd: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete]
  2236. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  2237. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  2238. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  2239. // CHECK:STDOUT: %.77f: Core.Form = init_form %impl.elem0.335 [symbolic]
  2240. // CHECK:STDOUT: %J.WithSelf.F.type.adb: type = fn_type @J.WithSelf.F, @J.WithSelf(%Self.8a1) [symbolic]
  2241. // CHECK:STDOUT: %J.WithSelf.F.569: %J.WithSelf.F.type.adb = struct_value () [symbolic]
  2242. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.WithSelf.%J.WithSelf.F.decl [concrete]
  2243. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  2244. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  2245. // CHECK:STDOUT: %.Self.2fa: %J.type = symbolic_binding .Self [symbolic_self]
  2246. // CHECK:STDOUT: %J.WithSelf.F.type.e19: type = fn_type @J.WithSelf.F, @J.WithSelf(%.Self.2fa) [symbolic_self]
  2247. // CHECK:STDOUT: %J.WithSelf.F.659: %J.WithSelf.F.type.e19 = struct_value () [symbolic_self]
  2248. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.2fa [symbolic_self]
  2249. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self.2fa, @J [symbolic_self]
  2250. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  2251. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  2252. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  2253. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  2254. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  2255. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  2256. // CHECK:STDOUT: %pattern_type.6f0: type = pattern_type %J_where.type [concrete]
  2257. // CHECK:STDOUT: %T: %J_where.type = symbolic_binding T, 0 [symbolic]
  2258. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  2259. // CHECK:STDOUT: %pattern_type.703: type = pattern_type %T.as_type [symbolic]
  2260. // CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
  2261. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  2262. // CHECK:STDOUT: %GenericCallFI32.type: type = fn_type @GenericCallFI32 [concrete]
  2263. // CHECK:STDOUT: %GenericCallFI32: %GenericCallFI32.type = struct_value () [concrete]
  2264. // CHECK:STDOUT: %require_complete.f6c: <witness> = require_complete_type %T.as_type [symbolic]
  2265. // CHECK:STDOUT: %J.WithSelf.F.type.4bb: type = fn_type @J.WithSelf.F, @J.WithSelf(%T) [symbolic]
  2266. // CHECK:STDOUT: %J.WithSelf.F.3c9: %J.WithSelf.F.type.4bb = struct_value () [symbolic]
  2267. // CHECK:STDOUT: %J.lookup_impl_witness.74d: <witness> = lookup_impl_witness %T, @J [symbolic]
  2268. // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type, (%J.lookup_impl_witness.74d) [symbolic]
  2269. // CHECK:STDOUT: %J.WithSelf.F.type.082: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet) [symbolic]
  2270. // CHECK:STDOUT: %J.WithSelf.F.efc: %J.WithSelf.F.type.082 = struct_value () [symbolic]
  2271. // CHECK:STDOUT: %.075: type = fn_type_with_self_type %J.WithSelf.F.type.082, %J.facet [symbolic]
  2272. // CHECK:STDOUT: %impl.elem1: %.075 = impl_witness_access %J.lookup_impl_witness.74d, element1 [symbolic]
  2273. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  2274. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem1, @J.WithSelf.F(%J.facet) [symbolic]
  2275. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  2276. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  2277. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  2278. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  2279. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  2280. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  2281. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  2282. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  2283. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  2284. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  2285. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  2286. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  2287. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  2288. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  2289. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  2290. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  2291. // CHECK:STDOUT: }
  2292. // CHECK:STDOUT:
  2293. // CHECK:STDOUT: imports {
  2294. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2295. // CHECK:STDOUT: .Int = %Core.Int
  2296. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  2297. // CHECK:STDOUT: import Core//prelude
  2298. // CHECK:STDOUT: import Core//prelude/...
  2299. // CHECK:STDOUT: }
  2300. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  2301. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  2302. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  2303. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  2304. // CHECK:STDOUT: }
  2305. // CHECK:STDOUT:
  2306. // CHECK:STDOUT: file {
  2307. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2308. // CHECK:STDOUT: .Core = imports.%Core
  2309. // CHECK:STDOUT: .J = %J.decl
  2310. // CHECK:STDOUT: .GenericCallFI32 = %GenericCallFI32.decl
  2311. // CHECK:STDOUT: }
  2312. // CHECK:STDOUT: %Core.import = import Core
  2313. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2314. // CHECK:STDOUT: %GenericCallFI32.decl: %GenericCallFI32.type = fn_decl @GenericCallFI32 [concrete = constants.%GenericCallFI32] {
  2315. // CHECK:STDOUT: %T.patt: %pattern_type.6f0 = symbolic_binding_pattern T, 0 [concrete]
  2316. // CHECK:STDOUT: %t.param_patt: @GenericCallFI32.%pattern_type (%pattern_type.703) = value_param_pattern [concrete]
  2317. // CHECK:STDOUT: %t.patt: @GenericCallFI32.%pattern_type (%pattern_type.703) = at_binding_pattern t, %t.param_patt [concrete]
  2318. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  2319. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, %i32.loc8_51 [concrete]
  2320. // CHECK:STDOUT: } {
  2321. // CHECK:STDOUT: %i32.loc8_51: type = type_literal constants.%i32 [concrete = constants.%i32]
  2322. // CHECK:STDOUT: %.loc8_51: Core.Form = init_form %i32.loc8_51 [concrete = constants.%.ff5]
  2323. // CHECK:STDOUT: %.loc8_26.1: type = splice_block %.loc8_26.2 [concrete = constants.%J_where.type] {
  2324. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  2325. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2326. // CHECK:STDOUT: %.Self.2: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  2327. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.2fa]
  2328. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  2329. // CHECK:STDOUT: %.loc8_32: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  2330. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  2331. // CHECK:STDOUT: %impl.elem0.loc8: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  2332. // CHECK:STDOUT: %i32.loc8_37: type = type_literal constants.%i32 [concrete = constants.%i32]
  2333. // CHECK:STDOUT: %.loc8_26.2: type = where_expr [concrete = constants.%J_where.type] {
  2334. // CHECK:STDOUT: requirement_base_facet_type %J.ref
  2335. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %i32.loc8_37
  2336. // CHECK:STDOUT: }
  2337. // CHECK:STDOUT: }
  2338. // CHECK:STDOUT: %T.loc8_21.2: %J_where.type = symbolic_binding T, 0 [symbolic = %T.loc8_21.1 (constants.%T)]
  2339. // CHECK:STDOUT: %t.param: @GenericCallFI32.%T.as_type.loc8_45.1 (%T.as_type) = value_param call_param0
  2340. // CHECK:STDOUT: %.loc8_45.1: type = splice_block %.loc8_45.2 [symbolic = %T.as_type.loc8_45.1 (constants.%T.as_type)] {
  2341. // CHECK:STDOUT: %T.ref: %J_where.type = name_ref T, %T.loc8_21.2 [symbolic = %T.loc8_21.1 (constants.%T)]
  2342. // CHECK:STDOUT: %T.as_type.loc8_45.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc8_45.1 (constants.%T.as_type)]
  2343. // CHECK:STDOUT: %.loc8_45.2: type = converted %T.ref, %T.as_type.loc8_45.2 [symbolic = %T.as_type.loc8_45.1 (constants.%T.as_type)]
  2344. // CHECK:STDOUT: }
  2345. // CHECK:STDOUT: %t: @GenericCallFI32.%T.as_type.loc8_45.1 (%T.as_type) = value_binding t, %t.param
  2346. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  2347. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  2348. // CHECK:STDOUT: }
  2349. // CHECK:STDOUT: }
  2350. // CHECK:STDOUT:
  2351. // CHECK:STDOUT: interface @J {
  2352. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  2353. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  2354. // CHECK:STDOUT:
  2355. // CHECK:STDOUT: !with Self:
  2356. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  2357. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete = constants.%assoc0.ebd]
  2358. // CHECK:STDOUT: }
  2359. // CHECK:STDOUT: %J.WithSelf.F.decl: @J.WithSelf.%J.WithSelf.F.type (%J.WithSelf.F.type.adb) = fn_decl @J.WithSelf.F [symbolic = @J.WithSelf.%J.WithSelf.F (constants.%J.WithSelf.F.569)] {
  2360. // CHECK:STDOUT: %u.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = value_param_pattern [concrete]
  2361. // CHECK:STDOUT: %u.patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = at_binding_pattern u, %u.param_patt [concrete]
  2362. // CHECK:STDOUT: %return.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = out_param_pattern [concrete]
  2363. // CHECK:STDOUT: %return.patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = return_slot_pattern %return.param_patt, %U.ref.loc5_17 [concrete]
  2364. // CHECK:STDOUT: } {
  2365. // CHECK:STDOUT: %impl.elem0.loc5_17: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2366. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2367. // CHECK:STDOUT: %.loc5_17.2: Core.Form = init_form %U.ref.loc5_17 [symbolic = %.loc5_17.1 (constants.%.77f)]
  2368. // CHECK:STDOUT: %u.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_param call_param0
  2369. // CHECK:STDOUT: %.loc5_11: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)] {
  2370. // CHECK:STDOUT: %impl.elem0.loc5_11.2: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2371. // CHECK:STDOUT: %U.ref.loc5_11: type = name_ref U, %impl.elem0.loc5_11.2 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2372. // CHECK:STDOUT: }
  2373. // CHECK:STDOUT: %u: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_binding u, %u.param
  2374. // CHECK:STDOUT: %return.param: ref @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = out_param call_param1
  2375. // CHECK:STDOUT: %return: ref @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = return_slot %return.param
  2376. // CHECK:STDOUT: }
  2377. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.WithSelf.F.decl [concrete = constants.%assoc1]
  2378. // CHECK:STDOUT:
  2379. // CHECK:STDOUT: !members:
  2380. // CHECK:STDOUT: .Self = %Self
  2381. // CHECK:STDOUT: .U = @U.%assoc0
  2382. // CHECK:STDOUT: .F = @J.WithSelf.%assoc1
  2383. // CHECK:STDOUT: witness = (@J.WithSelf.%U, @J.WithSelf.%J.WithSelf.F.decl)
  2384. // CHECK:STDOUT:
  2385. // CHECK:STDOUT: !requires:
  2386. // CHECK:STDOUT: }
  2387. // CHECK:STDOUT:
  2388. // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self: %J.type) {
  2389. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  2390. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  2391. // CHECK:STDOUT: %impl.elem0.loc5_11.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2392. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.c1a)]
  2393. // CHECK:STDOUT: %.loc5_17.1: Core.Form = init_form %impl.elem0.loc5_11.1 [symbolic = %.loc5_17.1 (constants.%.77f)]
  2394. // CHECK:STDOUT:
  2395. // CHECK:STDOUT: fn(%u.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335)) -> out %return.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335);
  2396. // CHECK:STDOUT: }
  2397. // CHECK:STDOUT:
  2398. // CHECK:STDOUT: generic fn @GenericCallFI32(%T.loc8_21.2: %J_where.type) {
  2399. // CHECK:STDOUT: %T.loc8_21.1: %J_where.type = symbolic_binding T, 0 [symbolic = %T.loc8_21.1 (constants.%T)]
  2400. // CHECK:STDOUT: %T.as_type.loc8_45.1: type = facet_access_type %T.loc8_21.1 [symbolic = %T.as_type.loc8_45.1 (constants.%T.as_type)]
  2401. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc8_45.1 [symbolic = %pattern_type (constants.%pattern_type.703)]
  2402. // CHECK:STDOUT:
  2403. // CHECK:STDOUT: !definition:
  2404. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc8_45.1 [symbolic = %require_complete (constants.%require_complete.f6c)]
  2405. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_21.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.74d)]
  2406. // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc8_45.1, (%J.lookup_impl_witness) [symbolic = %J.facet (constants.%J.facet)]
  2407. // CHECK:STDOUT: %J.WithSelf.F.type: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet) [symbolic = %J.WithSelf.F.type (constants.%J.WithSelf.F.type.082)]
  2408. // CHECK:STDOUT: %.loc9_11: type = fn_type_with_self_type %J.WithSelf.F.type, %J.facet [symbolic = %.loc9_11 (constants.%.075)]
  2409. // CHECK:STDOUT: %impl.elem1.loc9_11.2: @GenericCallFI32.%.loc9_11 (%.075) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2410. // CHECK:STDOUT: %specific_impl_fn.loc9_11.2: <specific function> = specific_impl_function %impl.elem1.loc9_11.2, @J.WithSelf.F(%J.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2411. // CHECK:STDOUT:
  2412. // CHECK:STDOUT: fn(%t.param: @GenericCallFI32.%T.as_type.loc8_45.1 (%T.as_type)) -> out %return.param: %i32 {
  2413. // CHECK:STDOUT: !entry:
  2414. // CHECK:STDOUT: %t.ref: @GenericCallFI32.%T.as_type.loc8_45.1 (%T.as_type) = name_ref t, %t
  2415. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.WithSelf.%assoc1 [concrete = constants.%assoc1]
  2416. // CHECK:STDOUT: %impl.elem1.loc9_11.1: @GenericCallFI32.%.loc9_11 (%.075) = impl_witness_access constants.%J.lookup_impl_witness.74d, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2417. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  2418. // CHECK:STDOUT: %specific_impl_fn.loc9_11.1: <specific function> = specific_impl_function %impl.elem1.loc9_11.1, @J.WithSelf.F(constants.%J.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2419. // CHECK:STDOUT: %impl.elem0.loc9: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  2420. // CHECK:STDOUT: %bound_method.loc9_14.1: <bound method> = bound_method %int_2, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  2421. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc9, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  2422. // CHECK:STDOUT: %bound_method.loc9_14.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
  2423. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc9_14.2(%int_2) [concrete = constants.%int_2.ef8]
  2424. // CHECK:STDOUT: %.loc9_14.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_2.ef8]
  2425. // CHECK:STDOUT: %.loc9_14.2: %i32 = converted %int_2, %.loc9_14.1 [concrete = constants.%int_2.ef8]
  2426. // CHECK:STDOUT: %J.WithSelf.F.call: init %i32 = call %specific_impl_fn.loc9_11.1(%.loc9_14.2)
  2427. // CHECK:STDOUT: return %J.WithSelf.F.call
  2428. // CHECK:STDOUT: }
  2429. // CHECK:STDOUT: }
  2430. // CHECK:STDOUT:
  2431. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self.8a1) {
  2432. // CHECK:STDOUT: !definition:
  2433. // CHECK:STDOUT: %Self => constants.%Self.8a1
  2434. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.adb
  2435. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.569
  2436. // CHECK:STDOUT: }
  2437. // CHECK:STDOUT:
  2438. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self.8a1) {
  2439. // CHECK:STDOUT: %Self => constants.%Self.8a1
  2440. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  2441. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.335
  2442. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c1a
  2443. // CHECK:STDOUT: %.loc5_17.1 => constants.%.77f
  2444. // CHECK:STDOUT: }
  2445. // CHECK:STDOUT:
  2446. // CHECK:STDOUT: specific @J.WithSelf(constants.%.Self.2fa) {
  2447. // CHECK:STDOUT: !definition:
  2448. // CHECK:STDOUT: %Self => constants.%.Self.2fa
  2449. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.e19
  2450. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.659
  2451. // CHECK:STDOUT: }
  2452. // CHECK:STDOUT:
  2453. // CHECK:STDOUT: specific @GenericCallFI32(constants.%T) {
  2454. // CHECK:STDOUT: %T.loc8_21.1 => constants.%T
  2455. // CHECK:STDOUT: %T.as_type.loc8_45.1 => constants.%T.as_type
  2456. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.703
  2457. // CHECK:STDOUT: }
  2458. // CHECK:STDOUT:
  2459. // CHECK:STDOUT: specific @J.WithSelf(constants.%T) {
  2460. // CHECK:STDOUT: !definition:
  2461. // CHECK:STDOUT: %Self => constants.%T
  2462. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.4bb
  2463. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.3c9
  2464. // CHECK:STDOUT: }
  2465. // CHECK:STDOUT:
  2466. // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet) {
  2467. // CHECK:STDOUT: !definition:
  2468. // CHECK:STDOUT: %Self => constants.%J.facet
  2469. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.082
  2470. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.efc
  2471. // CHECK:STDOUT: }
  2472. // CHECK:STDOUT:
  2473. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet) {
  2474. // CHECK:STDOUT: %Self => constants.%J.facet
  2475. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.74d
  2476. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  2477. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  2478. // CHECK:STDOUT: %.loc5_17.1 => constants.%.ff5
  2479. // CHECK:STDOUT: }
  2480. // CHECK:STDOUT:
  2481. // CHECK:STDOUT: --- fail_todo_use_associated_constant_in_impl.carbon
  2482. // CHECK:STDOUT:
  2483. // CHECK:STDOUT: constants {
  2484. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2485. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  2486. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2487. // CHECK:STDOUT: %assoc0.ebd: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete]
  2488. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  2489. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  2490. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  2491. // CHECK:STDOUT: %.77f: Core.Form = init_form %impl.elem0.335 [symbolic]
  2492. // CHECK:STDOUT: %J.WithSelf.F.type.adb: type = fn_type @J.WithSelf.F, @J.WithSelf(%Self.8a1) [symbolic]
  2493. // CHECK:STDOUT: %J.WithSelf.F.569: %J.WithSelf.F.type.adb = struct_value () [symbolic]
  2494. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.WithSelf.%J.WithSelf.F.decl [concrete]
  2495. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  2496. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self]
  2497. // CHECK:STDOUT: %J.WithSelf.F.type.e19: type = fn_type @J.WithSelf.F, @J.WithSelf(%.Self) [symbolic_self]
  2498. // CHECK:STDOUT: %J.WithSelf.F.659: %J.WithSelf.F.type.e19 = struct_value () [symbolic_self]
  2499. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  2500. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self, @J [symbolic_self]
  2501. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  2502. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  2503. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  2504. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  2505. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  2506. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  2507. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  2508. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  2509. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  2510. // CHECK:STDOUT: %E.as.J.impl.F.type.4b5c2a.1: type = fn_type @E.as.J.impl.F.loc27_21.1 [concrete]
  2511. // CHECK:STDOUT: %E.as.J.impl.F.b4e6ab.1: %E.as.J.impl.F.type.4b5c2a.1 = struct_value () [concrete]
  2512. // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  2513. // CHECK:STDOUT: %J.WithSelf.F.type.a23: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet) [concrete]
  2514. // CHECK:STDOUT: %J.WithSelf.F.4a4: %J.WithSelf.F.type.a23 = struct_value () [concrete]
  2515. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  2516. // CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
  2517. // CHECK:STDOUT: %E.as.J.impl.F.type.4b5c2a.2: type = fn_type @E.as.J.impl.F.loc27_21.2 [concrete]
  2518. // CHECK:STDOUT: %E.as.J.impl.F.b4e6ab.2: %E.as.J.impl.F.type.4b5c2a.2 = struct_value () [concrete]
  2519. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2520. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  2521. // CHECK:STDOUT: }
  2522. // CHECK:STDOUT:
  2523. // CHECK:STDOUT: imports {
  2524. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2525. // CHECK:STDOUT: .Int = %Core.Int
  2526. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  2527. // CHECK:STDOUT: import Core//prelude
  2528. // CHECK:STDOUT: import Core//prelude/...
  2529. // CHECK:STDOUT: }
  2530. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  2531. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  2532. // CHECK:STDOUT: }
  2533. // CHECK:STDOUT:
  2534. // CHECK:STDOUT: file {
  2535. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2536. // CHECK:STDOUT: .Core = imports.%Core
  2537. // CHECK:STDOUT: .J = %J.decl
  2538. // CHECK:STDOUT: .E = %E.decl
  2539. // CHECK:STDOUT: }
  2540. // CHECK:STDOUT: %Core.import = import Core
  2541. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2542. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  2543. // CHECK:STDOUT: }
  2544. // CHECK:STDOUT:
  2545. // CHECK:STDOUT: interface @J {
  2546. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  2547. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  2548. // CHECK:STDOUT:
  2549. // CHECK:STDOUT: !with Self:
  2550. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  2551. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%U [concrete = constants.%assoc0.ebd]
  2552. // CHECK:STDOUT: }
  2553. // CHECK:STDOUT: %J.WithSelf.F.decl: @J.WithSelf.%J.WithSelf.F.type (%J.WithSelf.F.type.adb) = fn_decl @J.WithSelf.F [symbolic = @J.WithSelf.%J.WithSelf.F (constants.%J.WithSelf.F.569)] {
  2554. // CHECK:STDOUT: %u.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = value_param_pattern [concrete]
  2555. // CHECK:STDOUT: %u.patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = at_binding_pattern u, %u.param_patt [concrete]
  2556. // CHECK:STDOUT: %return.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = out_param_pattern [concrete]
  2557. // CHECK:STDOUT: %return.patt: @J.WithSelf.F.%pattern_type (%pattern_type.c1a) = return_slot_pattern %return.param_patt, %U.ref.loc5_17 [concrete]
  2558. // CHECK:STDOUT: } {
  2559. // CHECK:STDOUT: %impl.elem0.loc5_17: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2560. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2561. // CHECK:STDOUT: %.loc5_17.2: Core.Form = init_form %U.ref.loc5_17 [symbolic = %.loc5_17.1 (constants.%.77f)]
  2562. // CHECK:STDOUT: %u.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_param call_param0
  2563. // CHECK:STDOUT: %.loc5_11: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)] {
  2564. // CHECK:STDOUT: %impl.elem0.loc5_11.2: type = impl_witness_access constants.%J.lookup_impl_witness.89e, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2565. // CHECK:STDOUT: %U.ref.loc5_11: type = name_ref U, %impl.elem0.loc5_11.2 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2566. // CHECK:STDOUT: }
  2567. // CHECK:STDOUT: %u: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_binding u, %u.param
  2568. // CHECK:STDOUT: %return.param: ref @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = out_param call_param1
  2569. // CHECK:STDOUT: %return: ref @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = return_slot %return.param
  2570. // CHECK:STDOUT: }
  2571. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.WithSelf.F.decl [concrete = constants.%assoc1]
  2572. // CHECK:STDOUT:
  2573. // CHECK:STDOUT: !members:
  2574. // CHECK:STDOUT: .Self = %Self
  2575. // CHECK:STDOUT: .U = @U.%assoc0
  2576. // CHECK:STDOUT: .F = @J.WithSelf.%assoc1
  2577. // CHECK:STDOUT: witness = (@J.WithSelf.%U, @J.WithSelf.%J.WithSelf.F.decl)
  2578. // CHECK:STDOUT:
  2579. // CHECK:STDOUT: !requires:
  2580. // CHECK:STDOUT: }
  2581. // CHECK:STDOUT:
  2582. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %.loc9_20 {
  2583. // CHECK:STDOUT: %E.as.J.impl.F.decl.loc27_21.1: %E.as.J.impl.F.type.4b5c2a.1 = fn_decl @E.as.J.impl.F.loc27_21.1 [concrete = constants.%E.as.J.impl.F.b4e6ab.1] {
  2584. // CHECK:STDOUT: %u.param_patt: <error> = value_param_pattern [concrete]
  2585. // CHECK:STDOUT: %u.patt: <error> = at_binding_pattern u, %u.param_patt [concrete]
  2586. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern <error>, <error> [concrete]
  2587. // CHECK:STDOUT: } {
  2588. // CHECK:STDOUT: %U.ref.loc27_19: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  2589. // CHECK:STDOUT: %.loc27_19: type = converted %U.ref.loc27_19, <error> [concrete = <error>]
  2590. // CHECK:STDOUT: %u.param: <error> = value_param call_param0
  2591. // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
  2592. // CHECK:STDOUT: %U.ref.loc27_13: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  2593. // CHECK:STDOUT: %.loc27_13: type = converted %U.ref.loc27_13, <error> [concrete = <error>]
  2594. // CHECK:STDOUT: }
  2595. // CHECK:STDOUT: %u: <error> = value_binding u, <error> [concrete = <error>]
  2596. // CHECK:STDOUT: %return: <error> = return_slot <error>
  2597. // CHECK:STDOUT: }
  2598. // CHECK:STDOUT: %.loc5_17.1: type = specific_constant @J.WithSelf.F.%U.ref.loc5_17, @J.WithSelf.F(constants.%J.facet) [concrete = constants.%i32]
  2599. // CHECK:STDOUT: %.loc5_17.2: type = specific_constant @J.WithSelf.F.%.loc5_17.2, @J.WithSelf.F(constants.%J.facet) [concrete = constants.%.ff5]
  2600. // CHECK:STDOUT: %E.as.J.impl.F.decl.loc27_21.2: %E.as.J.impl.F.type.4b5c2a.2 = fn_decl @E.as.J.impl.F.loc27_21.2 [concrete = constants.%E.as.J.impl.F.b4e6ab.2] {
  2601. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  2602. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = at_binding_pattern u, %u.param_patt [concrete]
  2603. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  2604. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, invalid [concrete]
  2605. // CHECK:STDOUT: } {
  2606. // CHECK:STDOUT: %u.param: %i32 = value_param call_param0
  2607. // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param
  2608. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  2609. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  2610. // CHECK:STDOUT: }
  2611. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %E.as.J.impl.F.decl.loc27_21.2), @E.as.J.impl [concrete]
  2612. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  2613. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  2614. // CHECK:STDOUT:
  2615. // CHECK:STDOUT: !members:
  2616. // CHECK:STDOUT: .U = <poisoned>
  2617. // CHECK:STDOUT: .F = %E.as.J.impl.F.decl.loc27_21.1
  2618. // CHECK:STDOUT: witness = %J.impl_witness
  2619. // CHECK:STDOUT: }
  2620. // CHECK:STDOUT:
  2621. // CHECK:STDOUT: class @E {
  2622. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  2623. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2624. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2625. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  2626. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  2627. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  2628. // CHECK:STDOUT: %.loc9_26: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  2629. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.ebd]
  2630. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  2631. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  2632. // CHECK:STDOUT: %.loc9_20: type = where_expr [concrete = constants.%J_where.type] {
  2633. // CHECK:STDOUT: requirement_base_facet_type %J.ref
  2634. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  2635. // CHECK:STDOUT: }
  2636. // CHECK:STDOUT: }
  2637. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  2638. // CHECK:STDOUT: complete_type_witness = %complete_type
  2639. // CHECK:STDOUT:
  2640. // CHECK:STDOUT: !members:
  2641. // CHECK:STDOUT: .Self = constants.%E
  2642. // CHECK:STDOUT: .J = <poisoned>
  2643. // CHECK:STDOUT: .U = <poisoned>
  2644. // CHECK:STDOUT: extend @E.as.J.impl.%.loc9_20
  2645. // CHECK:STDOUT: }
  2646. // CHECK:STDOUT:
  2647. // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self: %J.type) {
  2648. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  2649. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  2650. // CHECK:STDOUT: %impl.elem0.loc5_11.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2651. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.c1a)]
  2652. // CHECK:STDOUT: %.loc5_17.1: Core.Form = init_form %impl.elem0.loc5_11.1 [symbolic = %.loc5_17.1 (constants.%.77f)]
  2653. // CHECK:STDOUT:
  2654. // CHECK:STDOUT: fn(%u.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335)) -> out %return.param: @J.WithSelf.F.%impl.elem0.loc5_11.1 (%impl.elem0.335);
  2655. // CHECK:STDOUT: }
  2656. // CHECK:STDOUT:
  2657. // CHECK:STDOUT: fn @E.as.J.impl.F.loc27_21.1(%u.param: <error>) -> <error> {
  2658. // CHECK:STDOUT: !entry:
  2659. // CHECK:STDOUT: %u.ref: <error> = name_ref u, %u [concrete = <error>]
  2660. // CHECK:STDOUT: return <error>
  2661. // CHECK:STDOUT: }
  2662. // CHECK:STDOUT:
  2663. // CHECK:STDOUT: fn @E.as.J.impl.F.loc27_21.2(%u.param: %i32) -> out %return.param: %i32 [thunk @E.as.J.impl.%E.as.J.impl.F.decl.loc27_21.1] {
  2664. // CHECK:STDOUT: !entry:
  2665. // CHECK:STDOUT: %F.ref: %E.as.J.impl.F.type.4b5c2a.1 = name_ref F, @E.as.J.impl.%E.as.J.impl.F.decl.loc27_21.1 [concrete = constants.%E.as.J.impl.F.b4e6ab.1]
  2666. // CHECK:STDOUT: %E.as.J.impl.F.call: <error> = call %F.ref(<error>)
  2667. // CHECK:STDOUT: return <error>
  2668. // CHECK:STDOUT: }
  2669. // CHECK:STDOUT:
  2670. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self.8a1) {
  2671. // CHECK:STDOUT: !definition:
  2672. // CHECK:STDOUT: %Self => constants.%Self.8a1
  2673. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.adb
  2674. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.569
  2675. // CHECK:STDOUT: }
  2676. // CHECK:STDOUT:
  2677. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self.8a1) {
  2678. // CHECK:STDOUT: %Self => constants.%Self.8a1
  2679. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  2680. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.335
  2681. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c1a
  2682. // CHECK:STDOUT: %.loc5_17.1 => constants.%.77f
  2683. // CHECK:STDOUT: }
  2684. // CHECK:STDOUT:
  2685. // CHECK:STDOUT: specific @J.WithSelf(constants.%.Self) {
  2686. // CHECK:STDOUT: !definition:
  2687. // CHECK:STDOUT: %Self => constants.%.Self
  2688. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.e19
  2689. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.659
  2690. // CHECK:STDOUT: }
  2691. // CHECK:STDOUT:
  2692. // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet) {
  2693. // CHECK:STDOUT: !definition:
  2694. // CHECK:STDOUT: %Self => constants.%J.facet
  2695. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.a23
  2696. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.4a4
  2697. // CHECK:STDOUT: }
  2698. // CHECK:STDOUT:
  2699. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet) {
  2700. // CHECK:STDOUT: %Self => constants.%J.facet
  2701. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  2702. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  2703. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  2704. // CHECK:STDOUT: %.loc5_17.1 => constants.%.ff5
  2705. // CHECK:STDOUT: }
  2706. // CHECK:STDOUT:
  2707. // CHECK:STDOUT: --- fail_todo_call_extend_fn.carbon
  2708. // CHECK:STDOUT:
  2709. // CHECK:STDOUT: constants {
  2710. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2711. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic]
  2712. // CHECK:STDOUT: %J.WithSelf.F.type.adb: type = fn_type @J.WithSelf.F, @J.WithSelf(%Self) [symbolic]
  2713. // CHECK:STDOUT: %J.WithSelf.F.569: %J.WithSelf.F.type.adb = struct_value () [symbolic]
  2714. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2715. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%J.WithSelf.F.decl [concrete]
  2716. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  2717. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  2718. // CHECK:STDOUT: %E.as.J.impl.F.type: type = fn_type @E.as.J.impl.F [concrete]
  2719. // CHECK:STDOUT: %E.as.J.impl.F: %E.as.J.impl.F.type = struct_value () [concrete]
  2720. // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  2721. // CHECK:STDOUT: %J.WithSelf.F.type.59e: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet) [concrete]
  2722. // CHECK:STDOUT: %J.WithSelf.F.d37: %J.WithSelf.F.type.59e = struct_value () [concrete]
  2723. // CHECK:STDOUT: %E.G.type: type = fn_type @E.G [concrete]
  2724. // CHECK:STDOUT: %E.G: %E.G.type = struct_value () [concrete]
  2725. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2726. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2727. // CHECK:STDOUT: }
  2728. // CHECK:STDOUT:
  2729. // CHECK:STDOUT: imports {
  2730. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2731. // CHECK:STDOUT: import Core//prelude
  2732. // CHECK:STDOUT: import Core//prelude/...
  2733. // CHECK:STDOUT: }
  2734. // CHECK:STDOUT: }
  2735. // CHECK:STDOUT:
  2736. // CHECK:STDOUT: file {
  2737. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2738. // CHECK:STDOUT: .Core = imports.%Core
  2739. // CHECK:STDOUT: .J = %J.decl
  2740. // CHECK:STDOUT: .E = %E.decl
  2741. // CHECK:STDOUT: }
  2742. // CHECK:STDOUT: %Core.import = import Core
  2743. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2744. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  2745. // CHECK:STDOUT: }
  2746. // CHECK:STDOUT:
  2747. // CHECK:STDOUT: interface @J {
  2748. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  2749. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  2750. // CHECK:STDOUT:
  2751. // CHECK:STDOUT: !with Self:
  2752. // CHECK:STDOUT: %J.WithSelf.F.decl: @J.WithSelf.%J.WithSelf.F.type (%J.WithSelf.F.type.adb) = fn_decl @J.WithSelf.F [symbolic = @J.WithSelf.%J.WithSelf.F (constants.%J.WithSelf.F.569)] {} {}
  2753. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, %J.WithSelf.F.decl [concrete = constants.%assoc0]
  2754. // CHECK:STDOUT:
  2755. // CHECK:STDOUT: !members:
  2756. // CHECK:STDOUT: .Self = %Self
  2757. // CHECK:STDOUT: .F = @J.WithSelf.%assoc0
  2758. // CHECK:STDOUT: witness = (@J.WithSelf.%J.WithSelf.F.decl)
  2759. // CHECK:STDOUT:
  2760. // CHECK:STDOUT: !requires:
  2761. // CHECK:STDOUT: }
  2762. // CHECK:STDOUT:
  2763. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %J.ref {
  2764. // CHECK:STDOUT: %E.as.J.impl.F.decl: %E.as.J.impl.F.type = fn_decl @E.as.J.impl.F [concrete = constants.%E.as.J.impl.F] {} {}
  2765. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%E.as.J.impl.F.decl), @E.as.J.impl [concrete]
  2766. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  2767. // CHECK:STDOUT:
  2768. // CHECK:STDOUT: !members:
  2769. // CHECK:STDOUT: .F = %E.as.J.impl.F.decl
  2770. // CHECK:STDOUT: witness = %J.impl_witness
  2771. // CHECK:STDOUT: }
  2772. // CHECK:STDOUT:
  2773. // CHECK:STDOUT: class @E {
  2774. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  2775. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2776. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2777. // CHECK:STDOUT: }
  2778. // CHECK:STDOUT: %E.G.decl: %E.G.type = fn_decl @E.G [concrete = constants.%E.G] {} {}
  2779. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2780. // CHECK:STDOUT: complete_type_witness = %complete_type
  2781. // CHECK:STDOUT:
  2782. // CHECK:STDOUT: !members:
  2783. // CHECK:STDOUT: .Self = constants.%E
  2784. // CHECK:STDOUT: .J = <poisoned>
  2785. // CHECK:STDOUT: .G = %E.G.decl
  2786. // CHECK:STDOUT: .F = <poisoned>
  2787. // CHECK:STDOUT: extend @E.as.J.impl.%J.ref
  2788. // CHECK:STDOUT: }
  2789. // CHECK:STDOUT:
  2790. // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self: %J.type) {
  2791. // CHECK:STDOUT: !definition:
  2792. // CHECK:STDOUT:
  2793. // CHECK:STDOUT: fn() {
  2794. // CHECK:STDOUT: !entry:
  2795. // CHECK:STDOUT: return
  2796. // CHECK:STDOUT: }
  2797. // CHECK:STDOUT: }
  2798. // CHECK:STDOUT:
  2799. // CHECK:STDOUT: fn @E.as.J.impl.F() {
  2800. // CHECK:STDOUT: !entry:
  2801. // CHECK:STDOUT: return
  2802. // CHECK:STDOUT: }
  2803. // CHECK:STDOUT:
  2804. // CHECK:STDOUT: fn @E.G() {
  2805. // CHECK:STDOUT: !entry:
  2806. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.WithSelf.%assoc0 [concrete = constants.%assoc0]
  2807. // CHECK:STDOUT: return
  2808. // CHECK:STDOUT: }
  2809. // CHECK:STDOUT:
  2810. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self) {
  2811. // CHECK:STDOUT: !definition:
  2812. // CHECK:STDOUT: %Self => constants.%Self
  2813. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.adb
  2814. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.569
  2815. // CHECK:STDOUT: }
  2816. // CHECK:STDOUT:
  2817. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self) {}
  2818. // CHECK:STDOUT:
  2819. // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet) {
  2820. // CHECK:STDOUT: !definition:
  2821. // CHECK:STDOUT: %Self => constants.%J.facet
  2822. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.59e
  2823. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.d37
  2824. // CHECK:STDOUT: }
  2825. // CHECK:STDOUT:
  2826. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet) {}
  2827. // CHECK:STDOUT:
  2828. // CHECK:STDOUT: --- call_extend_method.carbon
  2829. // CHECK:STDOUT:
  2830. // CHECK:STDOUT: constants {
  2831. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2832. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic]
  2833. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  2834. // CHECK:STDOUT: %pattern_type.909: type = pattern_type %Self.as_type [symbolic]
  2835. // CHECK:STDOUT: %J.WithSelf.F.type.adb: type = fn_type @J.WithSelf.F, @J.WithSelf(%Self) [symbolic]
  2836. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2837. // CHECK:STDOUT: %J.WithSelf.F.569: %J.WithSelf.F.type.adb = struct_value () [symbolic]
  2838. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2839. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%J.WithSelf.F.decl [concrete]
  2840. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic]
  2841. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  2842. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  2843. // CHECK:STDOUT: %pattern_type.99f: type = pattern_type %E [concrete]
  2844. // CHECK:STDOUT: %E.as.J.impl.F.type: type = fn_type @E.as.J.impl.F [concrete]
  2845. // CHECK:STDOUT: %E.as.J.impl.F: %E.as.J.impl.F.type = struct_value () [concrete]
  2846. // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  2847. // CHECK:STDOUT: %J.WithSelf.F.type.59e: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet) [concrete]
  2848. // CHECK:STDOUT: %J.WithSelf.F.d37: %J.WithSelf.F.type.59e = struct_value () [concrete]
  2849. // CHECK:STDOUT: %E.G.type: type = fn_type @E.G [concrete]
  2850. // CHECK:STDOUT: %E.G: %E.G.type = struct_value () [concrete]
  2851. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2852. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2853. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  2854. // CHECK:STDOUT: %E.type.facet: %type = facet_value %E, () [concrete]
  2855. // CHECK:STDOUT: %J.WithSelf.F.type.d1c: type = fn_type @J.WithSelf.F, @J.WithSelf(%E.type.facet) [concrete]
  2856. // CHECK:STDOUT: %J.WithSelf.F.1a6: %J.WithSelf.F.type.d1c = struct_value () [concrete]
  2857. // CHECK:STDOUT: %.8de: type = fn_type_with_self_type %J.WithSelf.F.type.59e, %J.facet [concrete]
  2858. // CHECK:STDOUT: }
  2859. // CHECK:STDOUT:
  2860. // CHECK:STDOUT: imports {
  2861. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2862. // CHECK:STDOUT: import Core//prelude
  2863. // CHECK:STDOUT: import Core//prelude/...
  2864. // CHECK:STDOUT: }
  2865. // CHECK:STDOUT: }
  2866. // CHECK:STDOUT:
  2867. // CHECK:STDOUT: file {
  2868. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2869. // CHECK:STDOUT: .Core = imports.%Core
  2870. // CHECK:STDOUT: .J = %J.decl
  2871. // CHECK:STDOUT: .E = %E.decl
  2872. // CHECK:STDOUT: }
  2873. // CHECK:STDOUT: %Core.import = import Core
  2874. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2875. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  2876. // CHECK:STDOUT: }
  2877. // CHECK:STDOUT:
  2878. // CHECK:STDOUT: interface @J {
  2879. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  2880. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  2881. // CHECK:STDOUT:
  2882. // CHECK:STDOUT: !with Self:
  2883. // CHECK:STDOUT: %J.WithSelf.F.decl: @J.WithSelf.%J.WithSelf.F.type (%J.WithSelf.F.type.adb) = fn_decl @J.WithSelf.F [symbolic = @J.WithSelf.%J.WithSelf.F (constants.%J.WithSelf.F.569)] {
  2884. // CHECK:STDOUT: %self.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.909) = value_param_pattern [concrete]
  2885. // CHECK:STDOUT: %self.patt: @J.WithSelf.F.%pattern_type (%pattern_type.909) = at_binding_pattern self, %self.param_patt [concrete]
  2886. // CHECK:STDOUT: } {
  2887. // CHECK:STDOUT: %self.param: @J.WithSelf.F.%Self.as_type.loc4_21.1 (%Self.as_type) = value_param call_param0
  2888. // CHECK:STDOUT: %.loc4_21.1: type = splice_block %.loc4_21.2 [symbolic = %Self.as_type.loc4_21.1 (constants.%Self.as_type)] {
  2889. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self)]
  2890. // CHECK:STDOUT: %Self.as_type.loc4_21.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_21.1 (constants.%Self.as_type)]
  2891. // CHECK:STDOUT: %.loc4_21.2: type = converted %Self.ref, %Self.as_type.loc4_21.2 [symbolic = %Self.as_type.loc4_21.1 (constants.%Self.as_type)]
  2892. // CHECK:STDOUT: }
  2893. // CHECK:STDOUT: %self: @J.WithSelf.F.%Self.as_type.loc4_21.1 (%Self.as_type) = value_binding self, %self.param
  2894. // CHECK:STDOUT: }
  2895. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, %J.WithSelf.F.decl [concrete = constants.%assoc0]
  2896. // CHECK:STDOUT:
  2897. // CHECK:STDOUT: !members:
  2898. // CHECK:STDOUT: .Self = %Self
  2899. // CHECK:STDOUT: .F = @J.WithSelf.%assoc0
  2900. // CHECK:STDOUT: witness = (@J.WithSelf.%J.WithSelf.F.decl)
  2901. // CHECK:STDOUT:
  2902. // CHECK:STDOUT: !requires:
  2903. // CHECK:STDOUT: }
  2904. // CHECK:STDOUT:
  2905. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %J.ref {
  2906. // CHECK:STDOUT: %E.as.J.impl.F.decl: %E.as.J.impl.F.type = fn_decl @E.as.J.impl.F [concrete = constants.%E.as.J.impl.F] {
  2907. // CHECK:STDOUT: %self.param_patt: %pattern_type.99f = value_param_pattern [concrete]
  2908. // CHECK:STDOUT: %self.patt: %pattern_type.99f = at_binding_pattern self, %self.param_patt [concrete]
  2909. // CHECK:STDOUT: } {
  2910. // CHECK:STDOUT: %self.param: %E = value_param call_param0
  2911. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2912. // CHECK:STDOUT: %self: %E = value_binding self, %self.param
  2913. // CHECK:STDOUT: }
  2914. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%E.as.J.impl.F.decl), @E.as.J.impl [concrete]
  2915. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  2916. // CHECK:STDOUT:
  2917. // CHECK:STDOUT: !members:
  2918. // CHECK:STDOUT: .F = %E.as.J.impl.F.decl
  2919. // CHECK:STDOUT: witness = %J.impl_witness
  2920. // CHECK:STDOUT: }
  2921. // CHECK:STDOUT:
  2922. // CHECK:STDOUT: class @E {
  2923. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  2924. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2925. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2926. // CHECK:STDOUT: }
  2927. // CHECK:STDOUT: %E.G.decl: %E.G.type = fn_decl @E.G [concrete = constants.%E.G] {
  2928. // CHECK:STDOUT: %self.param_patt: %pattern_type.99f = value_param_pattern [concrete]
  2929. // CHECK:STDOUT: %self.patt: %pattern_type.99f = at_binding_pattern self, %self.param_patt [concrete]
  2930. // CHECK:STDOUT: } {
  2931. // CHECK:STDOUT: %self.param: %E = value_param call_param0
  2932. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2933. // CHECK:STDOUT: %self: %E = value_binding self, %self.param
  2934. // CHECK:STDOUT: }
  2935. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2936. // CHECK:STDOUT: complete_type_witness = %complete_type
  2937. // CHECK:STDOUT:
  2938. // CHECK:STDOUT: !members:
  2939. // CHECK:STDOUT: .Self = constants.%E
  2940. // CHECK:STDOUT: .J = <poisoned>
  2941. // CHECK:STDOUT: .G = %E.G.decl
  2942. // CHECK:STDOUT: .F = <poisoned>
  2943. // CHECK:STDOUT: extend @E.as.J.impl.%J.ref
  2944. // CHECK:STDOUT: }
  2945. // CHECK:STDOUT:
  2946. // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self: %J.type) {
  2947. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  2948. // CHECK:STDOUT: %Self.as_type.loc4_21.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_21.1 (constants.%Self.as_type)]
  2949. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_21.1 [symbolic = %pattern_type (constants.%pattern_type.909)]
  2950. // CHECK:STDOUT:
  2951. // CHECK:STDOUT: !definition:
  2952. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type.loc4_21.1 [symbolic = %require_complete (constants.%require_complete)]
  2953. // CHECK:STDOUT:
  2954. // CHECK:STDOUT: fn(%self.param: @J.WithSelf.F.%Self.as_type.loc4_21.1 (%Self.as_type)) {
  2955. // CHECK:STDOUT: !entry:
  2956. // CHECK:STDOUT: return
  2957. // CHECK:STDOUT: }
  2958. // CHECK:STDOUT: }
  2959. // CHECK:STDOUT:
  2960. // CHECK:STDOUT: fn @E.as.J.impl.F(%self.param: %E) {
  2961. // CHECK:STDOUT: !entry:
  2962. // CHECK:STDOUT: return
  2963. // CHECK:STDOUT: }
  2964. // CHECK:STDOUT:
  2965. // CHECK:STDOUT: fn @E.G(%self.param: %E) {
  2966. // CHECK:STDOUT: !entry:
  2967. // CHECK:STDOUT: %self.ref: %E = name_ref self, %self
  2968. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.WithSelf.%assoc0 [concrete = constants.%assoc0]
  2969. // CHECK:STDOUT: %impl.elem0: %.8de = impl_witness_access constants.%J.impl_witness, element0 [concrete = constants.%E.as.J.impl.F]
  2970. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %self.ref, %impl.elem0
  2971. // CHECK:STDOUT: %E.as.J.impl.F.call: init %empty_tuple.type = call %bound_method(%self.ref)
  2972. // CHECK:STDOUT: return
  2973. // CHECK:STDOUT: }
  2974. // CHECK:STDOUT:
  2975. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self) {
  2976. // CHECK:STDOUT: !definition:
  2977. // CHECK:STDOUT: %Self => constants.%Self
  2978. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.adb
  2979. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.569
  2980. // CHECK:STDOUT: }
  2981. // CHECK:STDOUT:
  2982. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self) {
  2983. // CHECK:STDOUT: %Self => constants.%Self
  2984. // CHECK:STDOUT: %Self.as_type.loc4_21.1 => constants.%Self.as_type
  2985. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.909
  2986. // CHECK:STDOUT: }
  2987. // CHECK:STDOUT:
  2988. // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet) {
  2989. // CHECK:STDOUT: !definition:
  2990. // CHECK:STDOUT: %Self => constants.%J.facet
  2991. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.59e
  2992. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.d37
  2993. // CHECK:STDOUT: }
  2994. // CHECK:STDOUT:
  2995. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet) {
  2996. // CHECK:STDOUT: %Self => constants.%J.facet
  2997. // CHECK:STDOUT: %Self.as_type.loc4_21.1 => constants.%E
  2998. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.99f
  2999. // CHECK:STDOUT: }
  3000. // CHECK:STDOUT:
  3001. // CHECK:STDOUT: specific @J.WithSelf(constants.%E.type.facet) {
  3002. // CHECK:STDOUT: !definition:
  3003. // CHECK:STDOUT: %Self => constants.%E.type.facet
  3004. // CHECK:STDOUT: %J.WithSelf.F.type => constants.%J.WithSelf.F.type.d1c
  3005. // CHECK:STDOUT: %J.WithSelf.F => constants.%J.WithSelf.F.1a6
  3006. // CHECK:STDOUT: }
  3007. // CHECK:STDOUT:
  3008. // CHECK:STDOUT: --- fail_todo_use_extend_constant.carbon
  3009. // CHECK:STDOUT:
  3010. // CHECK:STDOUT: constants {
  3011. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  3012. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  3013. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  3014. // CHECK:STDOUT: %assoc0.df0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%X [concrete]
  3015. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  3016. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self]
  3017. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  3018. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @J [symbolic_self]
  3019. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic_self]
  3020. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3021. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  3022. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0 = %empty_tuple.type> [concrete]
  3023. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  3024. // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  3025. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  3026. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  3027. // CHECK:STDOUT: %E.G.type: type = fn_type @E.G [concrete]
  3028. // CHECK:STDOUT: %E.G: %E.G.type = struct_value () [concrete]
  3029. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3030. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  3031. // CHECK:STDOUT: }
  3032. // CHECK:STDOUT:
  3033. // CHECK:STDOUT: imports {
  3034. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3035. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  3036. // CHECK:STDOUT: import Core//prelude
  3037. // CHECK:STDOUT: import Core//prelude/...
  3038. // CHECK:STDOUT: }
  3039. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  3040. // CHECK:STDOUT: }
  3041. // CHECK:STDOUT:
  3042. // CHECK:STDOUT: file {
  3043. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3044. // CHECK:STDOUT: .Core = imports.%Core
  3045. // CHECK:STDOUT: .J = %J.decl
  3046. // CHECK:STDOUT: .E = %E.decl
  3047. // CHECK:STDOUT: }
  3048. // CHECK:STDOUT: %Core.import = import Core
  3049. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  3050. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  3051. // CHECK:STDOUT: }
  3052. // CHECK:STDOUT:
  3053. // CHECK:STDOUT: interface @J {
  3054. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  3055. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  3056. // CHECK:STDOUT:
  3057. // CHECK:STDOUT: !with Self:
  3058. // CHECK:STDOUT: %X: type = assoc_const_decl @X [concrete] {
  3059. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%X [concrete = constants.%assoc0.df0]
  3060. // CHECK:STDOUT: }
  3061. // CHECK:STDOUT:
  3062. // CHECK:STDOUT: !members:
  3063. // CHECK:STDOUT: .Self = %Self
  3064. // CHECK:STDOUT: .X = @X.%assoc0
  3065. // CHECK:STDOUT: witness = (@J.WithSelf.%X)
  3066. // CHECK:STDOUT:
  3067. // CHECK:STDOUT: !requires:
  3068. // CHECK:STDOUT: }
  3069. // CHECK:STDOUT:
  3070. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %.loc8_20 {
  3071. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @E.as.J.impl [concrete]
  3072. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  3073. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3074. // CHECK:STDOUT:
  3075. // CHECK:STDOUT: !members:
  3076. // CHECK:STDOUT: witness = %J.impl_witness
  3077. // CHECK:STDOUT: }
  3078. // CHECK:STDOUT:
  3079. // CHECK:STDOUT: class @E {
  3080. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  3081. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  3082. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  3083. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  3084. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3085. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3086. // CHECK:STDOUT: %.loc8_26: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3087. // CHECK:STDOUT: %X.ref: %J.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.df0]
  3088. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3089. // CHECK:STDOUT: %.loc8_32.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3090. // CHECK:STDOUT: %.loc8_32.2: type = converted %.loc8_32.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3091. // CHECK:STDOUT: %.loc8_20: type = where_expr [concrete = constants.%J_where.type] {
  3092. // CHECK:STDOUT: requirement_base_facet_type %J.ref
  3093. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_32.2
  3094. // CHECK:STDOUT: }
  3095. // CHECK:STDOUT: }
  3096. // CHECK:STDOUT: %E.G.decl: %E.G.type = fn_decl @E.G [concrete = constants.%E.G] {
  3097. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern <error>, <error> [concrete]
  3098. // CHECK:STDOUT: } {
  3099. // CHECK:STDOUT: %X.ref: %J.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.df0]
  3100. // CHECK:STDOUT: %.loc18_13: type = converted %X.ref, <error> [concrete = <error>]
  3101. // CHECK:STDOUT: %return: <error> = return_slot <error>
  3102. // CHECK:STDOUT: }
  3103. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  3104. // CHECK:STDOUT: complete_type_witness = %complete_type
  3105. // CHECK:STDOUT:
  3106. // CHECK:STDOUT: !members:
  3107. // CHECK:STDOUT: .Self = constants.%E
  3108. // CHECK:STDOUT: .J = <poisoned>
  3109. // CHECK:STDOUT: .X = <poisoned>
  3110. // CHECK:STDOUT: .G = %E.G.decl
  3111. // CHECK:STDOUT: extend @E.as.J.impl.%.loc8_20
  3112. // CHECK:STDOUT: }
  3113. // CHECK:STDOUT:
  3114. // CHECK:STDOUT: fn @E.G() -> <error> {
  3115. // CHECK:STDOUT: !entry:
  3116. // CHECK:STDOUT: %.loc18_25: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3117. // CHECK:STDOUT: return <error>
  3118. // CHECK:STDOUT: }
  3119. // CHECK:STDOUT:
  3120. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self.8a1) {
  3121. // CHECK:STDOUT: !definition:
  3122. // CHECK:STDOUT: }
  3123. // CHECK:STDOUT:
  3124. // CHECK:STDOUT: specific @J.WithSelf(constants.%.Self) {
  3125. // CHECK:STDOUT: !definition:
  3126. // CHECK:STDOUT: }
  3127. // CHECK:STDOUT:
  3128. // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet) {
  3129. // CHECK:STDOUT: !definition:
  3130. // CHECK:STDOUT: }
  3131. // CHECK:STDOUT:
  3132. // CHECK:STDOUT: --- fail_todo_self_period_associated_type.carbon
  3133. // CHECK:STDOUT:
  3134. // CHECK:STDOUT: constants {
  3135. // CHECK:STDOUT: %J2.type: type = facet_type <@J2> [concrete]
  3136. // CHECK:STDOUT: %Self: %J2.type = symbolic_binding Self, 0 [symbolic]
  3137. // CHECK:STDOUT: %J2.assoc_type: type = assoc_entity_type @J2 [concrete]
  3138. // CHECK:STDOUT: %assoc0: %J2.assoc_type = assoc_entity element0, @J2.WithSelf.%U2 [concrete]
  3139. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  3140. // CHECK:STDOUT: %pattern_type.307: type = pattern_type %Self.as_type [symbolic]
  3141. // CHECK:STDOUT: %J2.WithSelf.F.type.68c: type = fn_type @J2.WithSelf.F, @J2.WithSelf(%Self) [symbolic]
  3142. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3143. // CHECK:STDOUT: %J2.WithSelf.F.643: %J2.WithSelf.F.type.68c = struct_value () [symbolic]
  3144. // CHECK:STDOUT: %assoc1: %J2.assoc_type = assoc_entity element1, @J2.WithSelf.%J2.WithSelf.F.decl [concrete]
  3145. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  3146. // CHECK:STDOUT: %.Self: %J2.type = symbolic_binding .Self [symbolic_self]
  3147. // CHECK:STDOUT: %J2.WithSelf.F.type.30c: type = fn_type @J2.WithSelf.F, @J2.WithSelf(%.Self) [symbolic_self]
  3148. // CHECK:STDOUT: %J2.WithSelf.F.99a: %J2.WithSelf.F.type.30c = struct_value () [symbolic_self]
  3149. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  3150. // CHECK:STDOUT: %J2.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @J2 [symbolic_self]
  3151. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J2.lookup_impl_witness, element0 [symbolic_self]
  3152. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3153. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  3154. // CHECK:STDOUT: %J2_where.type.1ad: type = facet_type <@J2 where %impl.elem0 = %empty_struct_type> [concrete]
  3155. // CHECK:STDOUT: %J2.impl_witness.941: <witness> = impl_witness @empty_tuple.type.as.J2.impl.%J2.impl_witness_table [concrete]
  3156. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  3157. // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
  3158. // CHECK:STDOUT: %.469: Core.Form = init_form %empty_struct_type [concrete]
  3159. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_40.1 [concrete]
  3160. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.7b8679.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = struct_value () [concrete]
  3161. // CHECK:STDOUT: %J2.facet.6c9: %J2.type = facet_value %empty_tuple.type, (%J2.impl_witness.941) [concrete]
  3162. // CHECK:STDOUT: %J2.WithSelf.F.type.43a: type = fn_type @J2.WithSelf.F, @J2.WithSelf(%J2.facet.6c9) [concrete]
  3163. // CHECK:STDOUT: %J2.WithSelf.F.2bb: %J2.WithSelf.F.type.43a = struct_value () [concrete]
  3164. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_40.2 [concrete]
  3165. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.7b8679.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = struct_value () [concrete]
  3166. // CHECK:STDOUT: %C2: type = class_type @C2 [concrete]
  3167. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  3168. // CHECK:STDOUT: %J2_where.type.de0: type = facet_type <@J2 where %impl.elem0 = %C2> [concrete]
  3169. // CHECK:STDOUT: %J2.impl_witness.30f: <witness> = impl_witness @C2.as.J2.impl.%J2.impl_witness_table [concrete]
  3170. // CHECK:STDOUT: %pattern_type.8df: type = pattern_type %C2 [concrete]
  3171. // CHECK:STDOUT: %.d4c: Core.Form = init_form %C2 [concrete]
  3172. // CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.1: type = fn_type @C2.as.J2.impl.F.loc32_40.1 [concrete]
  3173. // CHECK:STDOUT: %C2.as.J2.impl.F.720bb2.1: %C2.as.J2.impl.F.type.d2a210.1 = struct_value () [concrete]
  3174. // CHECK:STDOUT: %J2.facet.f19: %J2.type = facet_value %C2, (%J2.impl_witness.30f) [concrete]
  3175. // CHECK:STDOUT: %J2.WithSelf.F.type.3cd: type = fn_type @J2.WithSelf.F, @J2.WithSelf(%J2.facet.f19) [concrete]
  3176. // CHECK:STDOUT: %J2.WithSelf.F.06e: %J2.WithSelf.F.type.3cd = struct_value () [concrete]
  3177. // CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.2: type = fn_type @C2.as.J2.impl.F.loc32_40.2 [concrete]
  3178. // CHECK:STDOUT: %C2.as.J2.impl.F.720bb2.2: %C2.as.J2.impl.F.type.d2a210.2 = struct_value () [concrete]
  3179. // CHECK:STDOUT: %C2.val: %C2 = struct_value () [concrete]
  3180. // CHECK:STDOUT: }
  3181. // CHECK:STDOUT:
  3182. // CHECK:STDOUT: imports {
  3183. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3184. // CHECK:STDOUT: import Core//prelude
  3185. // CHECK:STDOUT: import Core//prelude/...
  3186. // CHECK:STDOUT: }
  3187. // CHECK:STDOUT: }
  3188. // CHECK:STDOUT:
  3189. // CHECK:STDOUT: file {
  3190. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3191. // CHECK:STDOUT: .Core = imports.%Core
  3192. // CHECK:STDOUT: .J2 = %J2.decl
  3193. // CHECK:STDOUT: .C2 = %C2.decl
  3194. // CHECK:STDOUT: }
  3195. // CHECK:STDOUT: %Core.import = import Core
  3196. // CHECK:STDOUT: %J2.decl: type = interface_decl @J2 [concrete = constants.%J2.type] {} {}
  3197. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.J2.impl [concrete] {} {
  3198. // CHECK:STDOUT: %.loc22_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3199. // CHECK:STDOUT: %.loc22_7.2: type = converted %.loc22_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3200. // CHECK:STDOUT: %J2.ref: type = name_ref J2, file.%J2.decl [concrete = constants.%J2.type]
  3201. // CHECK:STDOUT: %.Self: %J2.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  3202. // CHECK:STDOUT: %.Self.ref: %J2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3203. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3204. // CHECK:STDOUT: %.loc22_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3205. // CHECK:STDOUT: %U2.ref: %J2.assoc_type = name_ref U2, @U2.%assoc0 [concrete = constants.%assoc0]
  3206. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3207. // CHECK:STDOUT: %.loc22_28.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3208. // CHECK:STDOUT: %.loc22_28.2: type = converted %.loc22_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3209. // CHECK:STDOUT: %.loc22_15: type = where_expr [concrete = constants.%J2_where.type.1ad] {
  3210. // CHECK:STDOUT: requirement_base_facet_type %J2.ref
  3211. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc22_28.2
  3212. // CHECK:STDOUT: }
  3213. // CHECK:STDOUT: }
  3214. // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [concrete = constants.%C2] {} {}
  3215. // CHECK:STDOUT: impl_decl @C2.as.J2.impl [concrete] {} {
  3216. // CHECK:STDOUT: %C2.ref.loc31_6: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  3217. // CHECK:STDOUT: %J2.ref: type = name_ref J2, file.%J2.decl [concrete = constants.%J2.type]
  3218. // CHECK:STDOUT: %.Self: %J2.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  3219. // CHECK:STDOUT: %.Self.ref: %J2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3220. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3221. // CHECK:STDOUT: %.loc31_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3222. // CHECK:STDOUT: %U2.ref: %J2.assoc_type = name_ref U2, @U2.%assoc0 [concrete = constants.%assoc0]
  3223. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3224. // CHECK:STDOUT: %C2.ref.loc31_27: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  3225. // CHECK:STDOUT: %.loc31_15: type = where_expr [concrete = constants.%J2_where.type.de0] {
  3226. // CHECK:STDOUT: requirement_base_facet_type %J2.ref
  3227. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C2.ref.loc31_27
  3228. // CHECK:STDOUT: }
  3229. // CHECK:STDOUT: }
  3230. // CHECK:STDOUT: }
  3231. // CHECK:STDOUT:
  3232. // CHECK:STDOUT: interface @J2 {
  3233. // CHECK:STDOUT: %Self: %J2.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  3234. // CHECK:STDOUT: %J2.WithSelf.decl = interface_with_self_decl @J2 [concrete]
  3235. // CHECK:STDOUT:
  3236. // CHECK:STDOUT: !with Self:
  3237. // CHECK:STDOUT: %U2: type = assoc_const_decl @U2 [concrete] {
  3238. // CHECK:STDOUT: %assoc0: %J2.assoc_type = assoc_entity element0, @J2.WithSelf.%U2 [concrete = constants.%assoc0]
  3239. // CHECK:STDOUT: }
  3240. // CHECK:STDOUT: %J2.WithSelf.F.decl: @J2.WithSelf.%J2.WithSelf.F.type (%J2.WithSelf.F.type.68c) = fn_decl @J2.WithSelf.F [symbolic = @J2.WithSelf.%J2.WithSelf.F (constants.%J2.WithSelf.F.643)] {
  3241. // CHECK:STDOUT: %self.param_patt: @J2.WithSelf.F.%pattern_type (%pattern_type.307) = value_param_pattern [concrete]
  3242. // CHECK:STDOUT: %self.patt: @J2.WithSelf.F.%pattern_type (%pattern_type.307) = at_binding_pattern self, %self.param_patt [concrete]
  3243. // CHECK:STDOUT: %z.param_patt: <error> = value_param_pattern [concrete]
  3244. // CHECK:STDOUT: %z.patt: <error> = at_binding_pattern z, %z.param_patt [concrete]
  3245. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern <error>, <error> [concrete]
  3246. // CHECK:STDOUT: } {
  3247. // CHECK:STDOUT: %Self.ref.loc19_35: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)]
  3248. // CHECK:STDOUT: %Self.as_type.loc19_39: type = facet_access_type %Self.ref.loc19_35 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  3249. // CHECK:STDOUT: %.loc19_39: type = converted %Self.ref.loc19_35, %Self.as_type.loc19_39 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  3250. // CHECK:STDOUT: %U2.ref.loc19_39: <error> = name_ref U2, <error> [concrete = <error>]
  3251. // CHECK:STDOUT: %self.param: @J2.WithSelf.F.%Self.as_type.loc19_14.1 (%Self.as_type) = value_param call_param0
  3252. // CHECK:STDOUT: %.loc19_14.1: type = splice_block %.loc19_14.2 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)] {
  3253. // CHECK:STDOUT: %Self.ref.loc19_14: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)]
  3254. // CHECK:STDOUT: %Self.as_type.loc19_14.2: type = facet_access_type %Self.ref.loc19_14 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  3255. // CHECK:STDOUT: %.loc19_14.2: type = converted %Self.ref.loc19_14, %Self.as_type.loc19_14.2 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  3256. // CHECK:STDOUT: }
  3257. // CHECK:STDOUT: %self: @J2.WithSelf.F.%Self.as_type.loc19_14.1 (%Self.as_type) = value_binding self, %self.param
  3258. // CHECK:STDOUT: %z.param: <error> = value_param call_param1
  3259. // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
  3260. // CHECK:STDOUT: %Self.ref.loc19_23: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)]
  3261. // CHECK:STDOUT: %Self.as_type.loc19_27: type = facet_access_type %Self.ref.loc19_23 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  3262. // CHECK:STDOUT: %.loc19_27: type = converted %Self.ref.loc19_23, %Self.as_type.loc19_27 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  3263. // CHECK:STDOUT: %U2.ref.loc19_27: <error> = name_ref U2, <error> [concrete = <error>]
  3264. // CHECK:STDOUT: }
  3265. // CHECK:STDOUT: %z: <error> = value_binding z, <error> [concrete = <error>]
  3266. // CHECK:STDOUT: %return: <error> = return_slot <error>
  3267. // CHECK:STDOUT: }
  3268. // CHECK:STDOUT: %assoc1: %J2.assoc_type = assoc_entity element1, %J2.WithSelf.F.decl [concrete = constants.%assoc1]
  3269. // CHECK:STDOUT:
  3270. // CHECK:STDOUT: !members:
  3271. // CHECK:STDOUT: .Self = %Self
  3272. // CHECK:STDOUT: .U2 = @U2.%assoc0
  3273. // CHECK:STDOUT: .F = @J2.WithSelf.%assoc1
  3274. // CHECK:STDOUT: witness = (@J2.WithSelf.%U2, @J2.WithSelf.%J2.WithSelf.F.decl)
  3275. // CHECK:STDOUT:
  3276. // CHECK:STDOUT: !requires:
  3277. // CHECK:STDOUT: }
  3278. // CHECK:STDOUT:
  3279. // CHECK:STDOUT: impl @empty_tuple.type.as.J2.impl: %.loc22_7.2 as %.loc22_15 {
  3280. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_40.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_40.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1] {
  3281. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern [concrete]
  3282. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = at_binding_pattern self, %self.param_patt [concrete]
  3283. // CHECK:STDOUT: %z.param_patt: %pattern_type.a96 = value_param_pattern [concrete]
  3284. // CHECK:STDOUT: %z.patt: %pattern_type.a96 = at_binding_pattern z, %z.param_patt [concrete]
  3285. // CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern [concrete]
  3286. // CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern %return.param_patt, %.loc23_38.2 [concrete]
  3287. // CHECK:STDOUT: } {
  3288. // CHECK:STDOUT: %.loc23_38.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3289. // CHECK:STDOUT: %.loc23_38.2: type = converted %.loc23_38.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3290. // CHECK:STDOUT: %.loc23_38.3: Core.Form = init_form %.loc23_38.2 [concrete = constants.%.469]
  3291. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  3292. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.J2.impl.%.loc22_7.2 [concrete = constants.%empty_tuple.type]
  3293. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  3294. // CHECK:STDOUT: %z.param: %empty_struct_type = value_param call_param1
  3295. // CHECK:STDOUT: %.loc23_31.1: type = splice_block %.loc23_31.3 [concrete = constants.%empty_struct_type] {
  3296. // CHECK:STDOUT: %.loc23_31.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3297. // CHECK:STDOUT: %.loc23_31.3: type = converted %.loc23_31.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3298. // CHECK:STDOUT: }
  3299. // CHECK:STDOUT: %z: %empty_struct_type = value_binding z, %z.param
  3300. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param2
  3301. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  3302. // CHECK:STDOUT: }
  3303. // CHECK:STDOUT: %.1: type = specific_constant <error>, @J2.WithSelf.F(constants.%J2.facet.6c9) [concrete = <error>]
  3304. // CHECK:STDOUT: %.2: type = specific_constant <error>, @J2.WithSelf.F(constants.%J2.facet.6c9) [concrete = <error>]
  3305. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_40.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_40.2 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.2] {
  3306. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern [concrete]
  3307. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = at_binding_pattern self, %self.param_patt [concrete]
  3308. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern <error>, invalid [concrete]
  3309. // CHECK:STDOUT: } {
  3310. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  3311. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  3312. // CHECK:STDOUT: %return: <error> = return_slot <error>
  3313. // CHECK:STDOUT: }
  3314. // CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.J2.impl.F.decl.loc23_40.2), @empty_tuple.type.as.J2.impl [concrete]
  3315. // CHECK:STDOUT: %J2.impl_witness: <witness> = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.941]
  3316. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3317. // CHECK:STDOUT:
  3318. // CHECK:STDOUT: !members:
  3319. // CHECK:STDOUT: .F = %empty_tuple.type.as.J2.impl.F.decl.loc23_40.1
  3320. // CHECK:STDOUT: witness = %J2.impl_witness
  3321. // CHECK:STDOUT: }
  3322. // CHECK:STDOUT:
  3323. // CHECK:STDOUT: impl @C2.as.J2.impl: %C2.ref.loc31_6 as %.loc31_15 {
  3324. // CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_40.1: %C2.as.J2.impl.F.type.d2a210.1 = fn_decl @C2.as.J2.impl.F.loc32_40.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1] {
  3325. // CHECK:STDOUT: %self.param_patt: %pattern_type.8df = value_param_pattern [concrete]
  3326. // CHECK:STDOUT: %self.patt: %pattern_type.8df = at_binding_pattern self, %self.param_patt [concrete]
  3327. // CHECK:STDOUT: %z.param_patt: %pattern_type.8df = value_param_pattern [concrete]
  3328. // CHECK:STDOUT: %z.patt: %pattern_type.8df = at_binding_pattern z, %z.param_patt [concrete]
  3329. // CHECK:STDOUT: %return.param_patt: %pattern_type.8df = out_param_pattern [concrete]
  3330. // CHECK:STDOUT: %return.patt: %pattern_type.8df = return_slot_pattern %return.param_patt, %C2.ref.loc32_37 [concrete]
  3331. // CHECK:STDOUT: } {
  3332. // CHECK:STDOUT: %C2.ref.loc32_37: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  3333. // CHECK:STDOUT: %.loc32_37: Core.Form = init_form %C2.ref.loc32_37 [concrete = constants.%.d4c]
  3334. // CHECK:STDOUT: %self.param: %C2 = value_param call_param0
  3335. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C2.as.J2.impl.%C2.ref.loc31_6 [concrete = constants.%C2]
  3336. // CHECK:STDOUT: %self: %C2 = value_binding self, %self.param
  3337. // CHECK:STDOUT: %z.param: %C2 = value_param call_param1
  3338. // CHECK:STDOUT: %C2.ref.loc32_30: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  3339. // CHECK:STDOUT: %z: %C2 = value_binding z, %z.param
  3340. // CHECK:STDOUT: %return.param: ref %C2 = out_param call_param2
  3341. // CHECK:STDOUT: %return: ref %C2 = return_slot %return.param
  3342. // CHECK:STDOUT: }
  3343. // CHECK:STDOUT: %.1: type = specific_constant <error>, @J2.WithSelf.F(constants.%J2.facet.f19) [concrete = <error>]
  3344. // CHECK:STDOUT: %.2: type = specific_constant <error>, @J2.WithSelf.F(constants.%J2.facet.f19) [concrete = <error>]
  3345. // CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_40.2: %C2.as.J2.impl.F.type.d2a210.2 = fn_decl @C2.as.J2.impl.F.loc32_40.2 [concrete = constants.%C2.as.J2.impl.F.720bb2.2] {
  3346. // CHECK:STDOUT: %self.param_patt: %pattern_type.8df = value_param_pattern [concrete]
  3347. // CHECK:STDOUT: %self.patt: %pattern_type.8df = at_binding_pattern self, %self.param_patt [concrete]
  3348. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern <error>, invalid [concrete]
  3349. // CHECK:STDOUT: } {
  3350. // CHECK:STDOUT: %self.param: %C2 = value_param call_param0
  3351. // CHECK:STDOUT: %self: %C2 = value_binding self, %self.param
  3352. // CHECK:STDOUT: %return: <error> = return_slot <error>
  3353. // CHECK:STDOUT: }
  3354. // CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C2.as.J2.impl.F.decl.loc32_40.2), @C2.as.J2.impl [concrete]
  3355. // CHECK:STDOUT: %J2.impl_witness: <witness> = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.30f]
  3356. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C2 [concrete = constants.%C2]
  3357. // CHECK:STDOUT:
  3358. // CHECK:STDOUT: !members:
  3359. // CHECK:STDOUT: .C2 = <poisoned>
  3360. // CHECK:STDOUT: .F = %C2.as.J2.impl.F.decl.loc32_40.1
  3361. // CHECK:STDOUT: witness = %J2.impl_witness
  3362. // CHECK:STDOUT: }
  3363. // CHECK:STDOUT:
  3364. // CHECK:STDOUT: class @C2 {
  3365. // CHECK:STDOUT: %.loc28_10: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3366. // CHECK:STDOUT: %.loc28_11: type = converted %.loc28_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3367. // CHECK:STDOUT: adapt_decl %.loc28_11 [concrete]
  3368. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  3369. // CHECK:STDOUT: complete_type_witness = %complete_type
  3370. // CHECK:STDOUT:
  3371. // CHECK:STDOUT: !members:
  3372. // CHECK:STDOUT: .Self = constants.%C2
  3373. // CHECK:STDOUT: }
  3374. // CHECK:STDOUT:
  3375. // CHECK:STDOUT: generic fn @J2.WithSelf.F(@J2.%Self: %J2.type) {
  3376. // CHECK:STDOUT: %Self: %J2.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  3377. // CHECK:STDOUT: %Self.as_type.loc19_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  3378. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc19_14.1 [symbolic = %pattern_type (constants.%pattern_type.307)]
  3379. // CHECK:STDOUT:
  3380. // CHECK:STDOUT: fn(%self.param: @J2.WithSelf.F.%Self.as_type.loc19_14.1 (%Self.as_type), %z.param: <error>) -> <error>;
  3381. // CHECK:STDOUT: }
  3382. // CHECK:STDOUT:
  3383. // CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_40.1(%self.param: %empty_tuple.type, %z.param: %empty_struct_type) -> out %return.param: %empty_struct_type {
  3384. // CHECK:STDOUT: !entry:
  3385. // CHECK:STDOUT: %z.ref: %empty_struct_type = name_ref z, %z
  3386. // CHECK:STDOUT: %.loc23_49: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
  3387. // CHECK:STDOUT: %.loc23_50: init %empty_struct_type = converted %z.ref, %.loc23_49 [concrete = constants.%empty_struct]
  3388. // CHECK:STDOUT: return %.loc23_50
  3389. // CHECK:STDOUT: }
  3390. // CHECK:STDOUT:
  3391. // CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_40.2(%self.param: %empty_tuple.type) -> <error> [thunk @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_40.1] {
  3392. // CHECK:STDOUT: !entry:
  3393. // CHECK:STDOUT: %F.ref: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = name_ref F, @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_40.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1]
  3394. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
  3395. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.call: init %empty_struct_type = call %empty_tuple.type.as.J2.impl.F.bound(%self.param, <error>)
  3396. // CHECK:STDOUT: return <error>
  3397. // CHECK:STDOUT: }
  3398. // CHECK:STDOUT:
  3399. // CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_40.1(%self.param: %C2, %z.param: %C2) -> out %return.param: %C2 {
  3400. // CHECK:STDOUT: !entry:
  3401. // CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self
  3402. // CHECK:STDOUT: %.loc32_53.1: %empty_struct_type = as_compatible %self.ref
  3403. // CHECK:STDOUT: %.loc32_53.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
  3404. // CHECK:STDOUT: %.loc32_53.3: init %C2 = as_compatible %.loc32_53.2 [concrete = constants.%C2.val]
  3405. // CHECK:STDOUT: %.loc32_53.4: init %C2 = converted %self.ref, %.loc32_53.3 [concrete = constants.%C2.val]
  3406. // CHECK:STDOUT: return %.loc32_53.4
  3407. // CHECK:STDOUT: }
  3408. // CHECK:STDOUT:
  3409. // CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_40.2(%self.param: %C2) -> <error> [thunk @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_40.1] {
  3410. // CHECK:STDOUT: !entry:
  3411. // CHECK:STDOUT: %F.ref: %C2.as.J2.impl.F.type.d2a210.1 = name_ref F, @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_40.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1]
  3412. // CHECK:STDOUT: %C2.as.J2.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
  3413. // CHECK:STDOUT: %C2.as.J2.impl.F.call: init %C2 = call %C2.as.J2.impl.F.bound(%self.param, <error>)
  3414. // CHECK:STDOUT: return <error>
  3415. // CHECK:STDOUT: }
  3416. // CHECK:STDOUT:
  3417. // CHECK:STDOUT: specific @J2.WithSelf(constants.%Self) {
  3418. // CHECK:STDOUT: !definition:
  3419. // CHECK:STDOUT: %Self => constants.%Self
  3420. // CHECK:STDOUT: %J2.WithSelf.F.type => constants.%J2.WithSelf.F.type.68c
  3421. // CHECK:STDOUT: %J2.WithSelf.F => constants.%J2.WithSelf.F.643
  3422. // CHECK:STDOUT: }
  3423. // CHECK:STDOUT:
  3424. // CHECK:STDOUT: specific @J2.WithSelf.F(constants.%Self) {
  3425. // CHECK:STDOUT: %Self => constants.%Self
  3426. // CHECK:STDOUT: %Self.as_type.loc19_14.1 => constants.%Self.as_type
  3427. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.307
  3428. // CHECK:STDOUT: }
  3429. // CHECK:STDOUT:
  3430. // CHECK:STDOUT: specific @J2.WithSelf(constants.%.Self) {
  3431. // CHECK:STDOUT: !definition:
  3432. // CHECK:STDOUT: %Self => constants.%.Self
  3433. // CHECK:STDOUT: %J2.WithSelf.F.type => constants.%J2.WithSelf.F.type.30c
  3434. // CHECK:STDOUT: %J2.WithSelf.F => constants.%J2.WithSelf.F.99a
  3435. // CHECK:STDOUT: }
  3436. // CHECK:STDOUT:
  3437. // CHECK:STDOUT: specific @J2.WithSelf(constants.%J2.facet.6c9) {
  3438. // CHECK:STDOUT: !definition:
  3439. // CHECK:STDOUT: %Self => constants.%J2.facet.6c9
  3440. // CHECK:STDOUT: %J2.WithSelf.F.type => constants.%J2.WithSelf.F.type.43a
  3441. // CHECK:STDOUT: %J2.WithSelf.F => constants.%J2.WithSelf.F.2bb
  3442. // CHECK:STDOUT: }
  3443. // CHECK:STDOUT:
  3444. // CHECK:STDOUT: specific @J2.WithSelf.F(constants.%J2.facet.6c9) {
  3445. // CHECK:STDOUT: %Self => constants.%J2.facet.6c9
  3446. // CHECK:STDOUT: %Self.as_type.loc19_14.1 => constants.%empty_tuple.type
  3447. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb1
  3448. // CHECK:STDOUT: }
  3449. // CHECK:STDOUT:
  3450. // CHECK:STDOUT: specific @J2.WithSelf(constants.%J2.facet.f19) {
  3451. // CHECK:STDOUT: !definition:
  3452. // CHECK:STDOUT: %Self => constants.%J2.facet.f19
  3453. // CHECK:STDOUT: %J2.WithSelf.F.type => constants.%J2.WithSelf.F.type.3cd
  3454. // CHECK:STDOUT: %J2.WithSelf.F => constants.%J2.WithSelf.F.06e
  3455. // CHECK:STDOUT: }
  3456. // CHECK:STDOUT:
  3457. // CHECK:STDOUT: specific @J2.WithSelf.F(constants.%J2.facet.f19) {
  3458. // CHECK:STDOUT: %Self => constants.%J2.facet.f19
  3459. // CHECK:STDOUT: %Self.as_type.loc19_14.1 => constants.%C2
  3460. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.8df
  3461. // CHECK:STDOUT: }
  3462. // CHECK:STDOUT:
  3463. // CHECK:STDOUT: --- fail_associated_type_in_signature_mismatch.carbon
  3464. // CHECK:STDOUT:
  3465. // CHECK:STDOUT: constants {
  3466. // CHECK:STDOUT: %K.type: type = facet_type <@K> [concrete]
  3467. // CHECK:STDOUT: %Self.44d: %K.type = symbolic_binding Self, 0 [symbolic]
  3468. // CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type @K [concrete]
  3469. // CHECK:STDOUT: %assoc0.6cb: %K.assoc_type = assoc_entity element0, @K.WithSelf.%V [concrete]
  3470. // CHECK:STDOUT: %Self.as_type.6f5: type = facet_access_type %Self.44d [symbolic]
  3471. // CHECK:STDOUT: %pattern_type.c8b: type = pattern_type %Self.as_type.6f5 [symbolic]
  3472. // CHECK:STDOUT: %K.lookup_impl_witness.a24: <witness> = lookup_impl_witness %Self.44d, @K [symbolic]
  3473. // CHECK:STDOUT: %impl.elem0.c23: type = impl_witness_access %K.lookup_impl_witness.a24, element0 [symbolic]
  3474. // CHECK:STDOUT: %pattern_type.9fa: type = pattern_type %impl.elem0.c23 [symbolic]
  3475. // CHECK:STDOUT: %.c1a: Core.Form = init_form %impl.elem0.c23 [symbolic]
  3476. // CHECK:STDOUT: %K.WithSelf.F.type.d74: type = fn_type @K.WithSelf.F, @K.WithSelf(%Self.44d) [symbolic]
  3477. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3478. // CHECK:STDOUT: %K.WithSelf.F.f53: %K.WithSelf.F.type.d74 = struct_value () [symbolic]
  3479. // CHECK:STDOUT: %assoc1: %K.assoc_type = assoc_entity element1, @K.WithSelf.%K.WithSelf.F.decl [concrete]
  3480. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  3481. // CHECK:STDOUT: %.Self: %K.type = symbolic_binding .Self [symbolic_self]
  3482. // CHECK:STDOUT: %K.WithSelf.F.type.262: type = fn_type @K.WithSelf.F, @K.WithSelf(%.Self) [symbolic_self]
  3483. // CHECK:STDOUT: %K.WithSelf.F.40c: %K.WithSelf.F.type.262 = struct_value () [symbolic_self]
  3484. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  3485. // CHECK:STDOUT: %K.lookup_impl_witness.28c: <witness> = lookup_impl_witness %.Self, @K [symbolic_self]
  3486. // CHECK:STDOUT: %impl.elem0.afd: type = impl_witness_access %K.lookup_impl_witness.28c, element0 [symbolic_self]
  3487. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete]
  3488. // CHECK:STDOUT: %K_where.type: type = facet_type <@K where %impl.elem0.afd = %struct_type.a> [concrete]
  3489. // CHECK:STDOUT: %K.impl_witness: <witness> = impl_witness @empty_tuple.type.as.K.impl.%K.impl_witness_table [concrete]
  3490. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  3491. // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
  3492. // CHECK:STDOUT: %pattern_type.414: type = pattern_type %struct_type.x [concrete]
  3493. // CHECK:STDOUT: %.a89: Core.Form = init_form %struct_type.x [concrete]
  3494. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.1: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_52.1 [concrete]
  3495. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.907e52.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = struct_value () [concrete]
  3496. // CHECK:STDOUT: %K.facet: %K.type = facet_value %empty_tuple.type, (%K.impl_witness) [concrete]
  3497. // CHECK:STDOUT: %K.WithSelf.F.type.aac: type = fn_type @K.WithSelf.F, @K.WithSelf(%K.facet) [concrete]
  3498. // CHECK:STDOUT: %K.WithSelf.F.e22: %K.WithSelf.F.type.aac = struct_value () [concrete]
  3499. // CHECK:STDOUT: %pattern_type.e85: type = pattern_type %struct_type.a [concrete]
  3500. // CHECK:STDOUT: %.4f9: Core.Form = init_form %struct_type.a [concrete]
  3501. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.2: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_52.2 [concrete]
  3502. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.907e52.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = struct_value () [concrete]
  3503. // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
  3504. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  3505. // CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc26_52.2 [concrete]
  3506. // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete]
  3507. // CHECK:STDOUT: }
  3508. // CHECK:STDOUT:
  3509. // CHECK:STDOUT: imports {
  3510. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3511. // CHECK:STDOUT: .Destroy = %Core.Destroy
  3512. // CHECK:STDOUT: import Core//prelude
  3513. // CHECK:STDOUT: import Core//prelude/...
  3514. // CHECK:STDOUT: }
  3515. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  3516. // CHECK:STDOUT: }
  3517. // CHECK:STDOUT:
  3518. // CHECK:STDOUT: file {
  3519. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3520. // CHECK:STDOUT: .Core = imports.%Core
  3521. // CHECK:STDOUT: .K = %K.decl
  3522. // CHECK:STDOUT: }
  3523. // CHECK:STDOUT: %Core.import = import Core
  3524. // CHECK:STDOUT: %K.decl: type = interface_decl @K [concrete = constants.%K.type] {} {}
  3525. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.K.impl [concrete] {} {
  3526. // CHECK:STDOUT: %.loc11_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3527. // CHECK:STDOUT: %.loc11_7.2: type = converted %.loc11_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3528. // CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [concrete = constants.%K.type]
  3529. // CHECK:STDOUT: %.Self: %K.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  3530. // CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3531. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3532. // CHECK:STDOUT: %.loc11_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3533. // CHECK:STDOUT: %V.ref: %K.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.6cb]
  3534. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%K.lookup_impl_witness.28c, element0 [symbolic_self = constants.%impl.elem0.afd]
  3535. // CHECK:STDOUT: %.loc11_31.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3536. // CHECK:STDOUT: %.loc11_31.2: type = converted %.loc11_31.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3537. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete = constants.%struct_type.a]
  3538. // CHECK:STDOUT: %.loc11_14: type = where_expr [concrete = constants.%K_where.type] {
  3539. // CHECK:STDOUT: requirement_base_facet_type %K.ref
  3540. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %struct_type.a
  3541. // CHECK:STDOUT: }
  3542. // CHECK:STDOUT: }
  3543. // CHECK:STDOUT: }
  3544. // CHECK:STDOUT:
  3545. // CHECK:STDOUT: interface @K {
  3546. // CHECK:STDOUT: %Self: %K.type = symbolic_binding Self, 0 [symbolic = constants.%Self.44d]
  3547. // CHECK:STDOUT: %K.WithSelf.decl = interface_with_self_decl @K [concrete]
  3548. // CHECK:STDOUT:
  3549. // CHECK:STDOUT: !with Self:
  3550. // CHECK:STDOUT: %V: type = assoc_const_decl @V [concrete] {
  3551. // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.WithSelf.%V [concrete = constants.%assoc0.6cb]
  3552. // CHECK:STDOUT: }
  3553. // CHECK:STDOUT: %K.WithSelf.F.decl: @K.WithSelf.%K.WithSelf.F.type (%K.WithSelf.F.type.d74) = fn_decl @K.WithSelf.F [symbolic = @K.WithSelf.%K.WithSelf.F (constants.%K.WithSelf.F.f53)] {
  3554. // CHECK:STDOUT: %self.param_patt: @K.WithSelf.F.%pattern_type.loc8_12 (%pattern_type.c8b) = value_param_pattern [concrete]
  3555. // CHECK:STDOUT: %self.patt: @K.WithSelf.F.%pattern_type.loc8_12 (%pattern_type.c8b) = at_binding_pattern self, %self.param_patt [concrete]
  3556. // CHECK:STDOUT: %v.param_patt: @K.WithSelf.F.%pattern_type.loc8_21 (%pattern_type.9fa) = value_param_pattern [concrete]
  3557. // CHECK:STDOUT: %v.patt: @K.WithSelf.F.%pattern_type.loc8_21 (%pattern_type.9fa) = at_binding_pattern v, %v.param_patt [concrete]
  3558. // CHECK:STDOUT: %return.param_patt: @K.WithSelf.F.%pattern_type.loc8_21 (%pattern_type.9fa) = out_param_pattern [concrete]
  3559. // CHECK:STDOUT: %return.patt: @K.WithSelf.F.%pattern_type.loc8_21 (%pattern_type.9fa) = return_slot_pattern %return.param_patt, %V.ref.loc8_29 [concrete]
  3560. // CHECK:STDOUT: } {
  3561. // CHECK:STDOUT: %impl.elem0.loc8_29: type = impl_witness_access constants.%K.lookup_impl_witness.a24, element0 [symbolic = %impl.elem0.loc8_23.1 (constants.%impl.elem0.c23)]
  3562. // CHECK:STDOUT: %V.ref.loc8_29: type = name_ref V, %impl.elem0.loc8_29 [symbolic = %impl.elem0.loc8_23.1 (constants.%impl.elem0.c23)]
  3563. // CHECK:STDOUT: %.loc8_29.2: Core.Form = init_form %V.ref.loc8_29 [symbolic = %.loc8_29.1 (constants.%.c1a)]
  3564. // CHECK:STDOUT: %self.param: @K.WithSelf.F.%Self.as_type.loc8_14.1 (%Self.as_type.6f5) = value_param call_param0
  3565. // CHECK:STDOUT: %.loc8_14.1: type = splice_block %.loc8_14.2 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type.6f5)] {
  3566. // CHECK:STDOUT: %Self.ref: %K.type = name_ref Self, @K.%Self [symbolic = %Self (constants.%Self.44d)]
  3567. // CHECK:STDOUT: %Self.as_type.loc8_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type.6f5)]
  3568. // CHECK:STDOUT: %.loc8_14.2: type = converted %Self.ref, %Self.as_type.loc8_14.2 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type.6f5)]
  3569. // CHECK:STDOUT: }
  3570. // CHECK:STDOUT: %self: @K.WithSelf.F.%Self.as_type.loc8_14.1 (%Self.as_type.6f5) = value_binding self, %self.param
  3571. // CHECK:STDOUT: %v.param: @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23) = value_param call_param1
  3572. // CHECK:STDOUT: %.loc8_23: type = splice_block %V.ref.loc8_23 [symbolic = %impl.elem0.loc8_23.1 (constants.%impl.elem0.c23)] {
  3573. // CHECK:STDOUT: %impl.elem0.loc8_23.2: type = impl_witness_access constants.%K.lookup_impl_witness.a24, element0 [symbolic = %impl.elem0.loc8_23.1 (constants.%impl.elem0.c23)]
  3574. // CHECK:STDOUT: %V.ref.loc8_23: type = name_ref V, %impl.elem0.loc8_23.2 [symbolic = %impl.elem0.loc8_23.1 (constants.%impl.elem0.c23)]
  3575. // CHECK:STDOUT: }
  3576. // CHECK:STDOUT: %v: @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23) = value_binding v, %v.param
  3577. // CHECK:STDOUT: %return.param: ref @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23) = out_param call_param2
  3578. // CHECK:STDOUT: %return: ref @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23) = return_slot %return.param
  3579. // CHECK:STDOUT: }
  3580. // CHECK:STDOUT: %assoc1: %K.assoc_type = assoc_entity element1, %K.WithSelf.F.decl [concrete = constants.%assoc1]
  3581. // CHECK:STDOUT:
  3582. // CHECK:STDOUT: !members:
  3583. // CHECK:STDOUT: .Self = %Self
  3584. // CHECK:STDOUT: .V = @V.%assoc0
  3585. // CHECK:STDOUT: .F = @K.WithSelf.%assoc1
  3586. // CHECK:STDOUT: witness = (@K.WithSelf.%V, @K.WithSelf.%K.WithSelf.F.decl)
  3587. // CHECK:STDOUT:
  3588. // CHECK:STDOUT: !requires:
  3589. // CHECK:STDOUT: }
  3590. // CHECK:STDOUT:
  3591. // CHECK:STDOUT: impl @empty_tuple.type.as.K.impl: %.loc11_7.2 as %.loc11_14 {
  3592. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_52.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_52.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1] {
  3593. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern [concrete]
  3594. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = at_binding_pattern self, %self.param_patt [concrete]
  3595. // CHECK:STDOUT: %v.param_patt: %pattern_type.414 = value_param_pattern [concrete]
  3596. // CHECK:STDOUT: %v.patt: %pattern_type.414 = at_binding_pattern v, %v.param_patt [concrete]
  3597. // CHECK:STDOUT: %return.param_patt: %pattern_type.414 = out_param_pattern [concrete]
  3598. // CHECK:STDOUT: %return.patt: %pattern_type.414 = return_slot_pattern %return.param_patt, %struct_type.x.loc26_50 [concrete]
  3599. // CHECK:STDOUT: } {
  3600. // CHECK:STDOUT: %.loc26_49.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3601. // CHECK:STDOUT: %.loc26_49.2: type = converted %.loc26_49.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3602. // CHECK:STDOUT: %struct_type.x.loc26_50: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
  3603. // CHECK:STDOUT: %.loc26_50: Core.Form = init_form %struct_type.x.loc26_50 [concrete = constants.%.a89]
  3604. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  3605. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.K.impl.%.loc11_7.2 [concrete = constants.%empty_tuple.type]
  3606. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  3607. // CHECK:STDOUT: %v.param: %struct_type.x = value_param call_param1
  3608. // CHECK:STDOUT: %.loc26_37: type = splice_block %struct_type.x.loc26_37 [concrete = constants.%struct_type.x] {
  3609. // CHECK:STDOUT: %.loc26_36.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3610. // CHECK:STDOUT: %.loc26_36.2: type = converted %.loc26_36.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3611. // CHECK:STDOUT: %struct_type.x.loc26_37: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
  3612. // CHECK:STDOUT: }
  3613. // CHECK:STDOUT: %v: %struct_type.x = value_binding v, %v.param
  3614. // CHECK:STDOUT: %return.param: ref %struct_type.x = out_param call_param2
  3615. // CHECK:STDOUT: %return: ref %struct_type.x = return_slot %return.param
  3616. // CHECK:STDOUT: }
  3617. // CHECK:STDOUT: %.loc8_29.1: type = specific_constant @K.WithSelf.F.%V.ref.loc8_29, @K.WithSelf.F(constants.%K.facet) [concrete = constants.%struct_type.a]
  3618. // CHECK:STDOUT: %.loc8_29.2: type = specific_constant @K.WithSelf.F.%.loc8_29.2, @K.WithSelf.F(constants.%K.facet) [concrete = constants.%.4f9]
  3619. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_52.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_52.2 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.2] {
  3620. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern [concrete]
  3621. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = at_binding_pattern self, %self.param_patt [concrete]
  3622. // CHECK:STDOUT: %v.param_patt: %pattern_type.e85 = value_param_pattern [concrete]
  3623. // CHECK:STDOUT: %v.patt: %pattern_type.e85 = at_binding_pattern v, %v.param_patt [concrete]
  3624. // CHECK:STDOUT: %return.param_patt: %pattern_type.e85 = out_param_pattern [concrete]
  3625. // CHECK:STDOUT: %return.patt: %pattern_type.e85 = return_slot_pattern %return.param_patt, invalid [concrete]
  3626. // CHECK:STDOUT: } {
  3627. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  3628. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  3629. // CHECK:STDOUT: %v.param: %struct_type.a = value_param call_param1
  3630. // CHECK:STDOUT: %v: %struct_type.a = value_binding v, %v.param
  3631. // CHECK:STDOUT: %return.param: ref %struct_type.a = out_param call_param2
  3632. // CHECK:STDOUT: %return: ref %struct_type.a = return_slot %return.param
  3633. // CHECK:STDOUT: }
  3634. // CHECK:STDOUT: %K.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.K.impl.F.decl.loc26_52.2), @empty_tuple.type.as.K.impl [concrete]
  3635. // CHECK:STDOUT: %K.impl_witness: <witness> = impl_witness %K.impl_witness_table [concrete = constants.%K.impl_witness]
  3636. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%struct_type.a [concrete = constants.%struct_type.a]
  3637. // CHECK:STDOUT:
  3638. // CHECK:STDOUT: !members:
  3639. // CHECK:STDOUT: .F = %empty_tuple.type.as.K.impl.F.decl.loc26_52.1
  3640. // CHECK:STDOUT: witness = %K.impl_witness
  3641. // CHECK:STDOUT: }
  3642. // CHECK:STDOUT:
  3643. // CHECK:STDOUT: generic fn @K.WithSelf.F(@K.%Self: %K.type) {
  3644. // CHECK:STDOUT: %Self: %K.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.44d)]
  3645. // CHECK:STDOUT: %Self.as_type.loc8_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type.6f5)]
  3646. // CHECK:STDOUT: %pattern_type.loc8_12: type = pattern_type %Self.as_type.loc8_14.1 [symbolic = %pattern_type.loc8_12 (constants.%pattern_type.c8b)]
  3647. // CHECK:STDOUT: %K.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @K [symbolic = %K.lookup_impl_witness (constants.%K.lookup_impl_witness.a24)]
  3648. // CHECK:STDOUT: %impl.elem0.loc8_23.1: type = impl_witness_access %K.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_23.1 (constants.%impl.elem0.c23)]
  3649. // CHECK:STDOUT: %pattern_type.loc8_21: type = pattern_type %impl.elem0.loc8_23.1 [symbolic = %pattern_type.loc8_21 (constants.%pattern_type.9fa)]
  3650. // CHECK:STDOUT: %.loc8_29.1: Core.Form = init_form %impl.elem0.loc8_23.1 [symbolic = %.loc8_29.1 (constants.%.c1a)]
  3651. // CHECK:STDOUT:
  3652. // CHECK:STDOUT: fn(%self.param: @K.WithSelf.F.%Self.as_type.loc8_14.1 (%Self.as_type.6f5), %v.param: @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23)) -> out %return.param: @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23);
  3653. // CHECK:STDOUT: }
  3654. // CHECK:STDOUT:
  3655. // CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_52.1(%self.param: %empty_tuple.type, %v.param: %struct_type.x) -> out %return.param: %struct_type.x {
  3656. // CHECK:STDOUT: !entry:
  3657. // CHECK:STDOUT: %v.ref: %struct_type.x = name_ref v, %v
  3658. // CHECK:STDOUT: %.loc26_61.1: %empty_tuple.type = struct_access %v.ref, element0
  3659. // CHECK:STDOUT: %.loc26_61.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
  3660. // CHECK:STDOUT: %.loc26_61.3: init %empty_tuple.type = converted %.loc26_61.1, %.loc26_61.2 [concrete = constants.%empty_tuple]
  3661. // CHECK:STDOUT: %.loc26_61.4: init %struct_type.x = struct_init (%.loc26_61.3) [concrete = constants.%struct]
  3662. // CHECK:STDOUT: %.loc26_62: init %struct_type.x = converted %v.ref, %.loc26_61.4 [concrete = constants.%struct]
  3663. // CHECK:STDOUT: return %.loc26_62
  3664. // CHECK:STDOUT: }
  3665. // CHECK:STDOUT:
  3666. // CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_52.2(%self.param: %empty_tuple.type, %v.param: %struct_type.a) -> out %return.param: %struct_type.a [thunk @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_52.1] {
  3667. // CHECK:STDOUT: !entry:
  3668. // CHECK:STDOUT: %F.ref: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = name_ref F, @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_52.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1]
  3669. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.bound: <bound method> = bound_method %self.param, %F.ref
  3670. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.call: init %struct_type.x = call %empty_tuple.type.as.K.impl.F.bound(%self.param, <error>)
  3671. // CHECK:STDOUT: %.loc26_52.1: ref %struct_type.x = temporary_storage
  3672. // CHECK:STDOUT: %.loc26_52.2: ref %struct_type.x = temporary %.loc26_52.1, %empty_tuple.type.as.K.impl.F.call
  3673. // CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc26_52.2, constants.%Destroy.Op.651ba6.2
  3674. // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc26_52.2)
  3675. // CHECK:STDOUT: return <error>
  3676. // CHECK:STDOUT: }
  3677. // CHECK:STDOUT:
  3678. // CHECK:STDOUT: fn @Destroy.Op.loc26_52.1(%self.param: ref %empty_tuple.type) = "no_op";
  3679. // CHECK:STDOUT:
  3680. // CHECK:STDOUT: fn @Destroy.Op.loc26_52.2(%self.param: ref %struct_type.x) {
  3681. // CHECK:STDOUT: !entry:
  3682. // CHECK:STDOUT: return
  3683. // CHECK:STDOUT: }
  3684. // CHECK:STDOUT:
  3685. // CHECK:STDOUT: specific @K.WithSelf(constants.%Self.44d) {
  3686. // CHECK:STDOUT: !definition:
  3687. // CHECK:STDOUT: %Self => constants.%Self.44d
  3688. // CHECK:STDOUT: %K.WithSelf.F.type => constants.%K.WithSelf.F.type.d74
  3689. // CHECK:STDOUT: %K.WithSelf.F => constants.%K.WithSelf.F.f53
  3690. // CHECK:STDOUT: }
  3691. // CHECK:STDOUT:
  3692. // CHECK:STDOUT: specific @K.WithSelf.F(constants.%Self.44d) {
  3693. // CHECK:STDOUT: %Self => constants.%Self.44d
  3694. // CHECK:STDOUT: %Self.as_type.loc8_14.1 => constants.%Self.as_type.6f5
  3695. // CHECK:STDOUT: %pattern_type.loc8_12 => constants.%pattern_type.c8b
  3696. // CHECK:STDOUT: %K.lookup_impl_witness => constants.%K.lookup_impl_witness.a24
  3697. // CHECK:STDOUT: %impl.elem0.loc8_23.1 => constants.%impl.elem0.c23
  3698. // CHECK:STDOUT: %pattern_type.loc8_21 => constants.%pattern_type.9fa
  3699. // CHECK:STDOUT: %.loc8_29.1 => constants.%.c1a
  3700. // CHECK:STDOUT: }
  3701. // CHECK:STDOUT:
  3702. // CHECK:STDOUT: specific @K.WithSelf(constants.%.Self) {
  3703. // CHECK:STDOUT: !definition:
  3704. // CHECK:STDOUT: %Self => constants.%.Self
  3705. // CHECK:STDOUT: %K.WithSelf.F.type => constants.%K.WithSelf.F.type.262
  3706. // CHECK:STDOUT: %K.WithSelf.F => constants.%K.WithSelf.F.40c
  3707. // CHECK:STDOUT: }
  3708. // CHECK:STDOUT:
  3709. // CHECK:STDOUT: specific @K.WithSelf(constants.%K.facet) {
  3710. // CHECK:STDOUT: !definition:
  3711. // CHECK:STDOUT: %Self => constants.%K.facet
  3712. // CHECK:STDOUT: %K.WithSelf.F.type => constants.%K.WithSelf.F.type.aac
  3713. // CHECK:STDOUT: %K.WithSelf.F => constants.%K.WithSelf.F.e22
  3714. // CHECK:STDOUT: }
  3715. // CHECK:STDOUT:
  3716. // CHECK:STDOUT: specific @K.WithSelf.F(constants.%K.facet) {
  3717. // CHECK:STDOUT: %Self => constants.%K.facet
  3718. // CHECK:STDOUT: %Self.as_type.loc8_14.1 => constants.%empty_tuple.type
  3719. // CHECK:STDOUT: %pattern_type.loc8_12 => constants.%pattern_type.cb1
  3720. // CHECK:STDOUT: %K.lookup_impl_witness => constants.%K.impl_witness
  3721. // CHECK:STDOUT: %impl.elem0.loc8_23.1 => constants.%struct_type.a
  3722. // CHECK:STDOUT: %pattern_type.loc8_21 => constants.%pattern_type.e85
  3723. // CHECK:STDOUT: %.loc8_29.1 => constants.%.4f9
  3724. // CHECK:STDOUT: }
  3725. // CHECK:STDOUT:
  3726. // CHECK:STDOUT: --- use_non-type_in_function.carbon
  3727. // CHECK:STDOUT:
  3728. // CHECK:STDOUT: constants {
  3729. // CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete]
  3730. // CHECK:STDOUT: %Self: %M.type = symbolic_binding Self, 0 [symbolic]
  3731. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3732. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  3733. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3734. // CHECK:STDOUT: %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
  3735. // CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type @M [concrete]
  3736. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.WithSelf.%Z [concrete]
  3737. // CHECK:STDOUT: %.469: Core.Form = init_form %empty_struct_type [concrete]
  3738. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_struct_type [concrete]
  3739. // CHECK:STDOUT: %M.WithSelf.G.type.e2f: type = fn_type @M.WithSelf.G, @M.WithSelf(%Self) [symbolic]
  3740. // CHECK:STDOUT: %M.WithSelf.G.020: %M.WithSelf.G.type.e2f = struct_value () [symbolic]
  3741. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, @M.WithSelf.%M.WithSelf.G.decl [concrete]
  3742. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  3743. // CHECK:STDOUT: %.Self: %M.type = symbolic_binding .Self [symbolic_self]
  3744. // CHECK:STDOUT: %M.WithSelf.G.type.a84: type = fn_type @M.WithSelf.G, @M.WithSelf(%.Self) [symbolic_self]
  3745. // CHECK:STDOUT: %M.WithSelf.G.6c7: %M.WithSelf.G.type.a84 = struct_value () [symbolic_self]
  3746. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  3747. // CHECK:STDOUT: %M.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @M [symbolic_self]
  3748. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self]
  3749. // CHECK:STDOUT: %struct: %struct_type.b.347 = struct_value (%empty_struct) [concrete]
  3750. // CHECK:STDOUT: %M_where.type: type = facet_type <@M where %impl.elem0 = %struct> [concrete]
  3751. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness @empty_tuple.type.as.M.impl.%M.impl_witness_table [concrete]
  3752. // CHECK:STDOUT: %empty_tuple.type.as.M.impl.G.type: type = fn_type @empty_tuple.type.as.M.impl.G [concrete]
  3753. // CHECK:STDOUT: %empty_tuple.type.as.M.impl.G: %empty_tuple.type.as.M.impl.G.type = struct_value () [concrete]
  3754. // CHECK:STDOUT: %M.facet: %M.type = facet_value %empty_tuple.type, (%M.impl_witness) [concrete]
  3755. // CHECK:STDOUT: %M.WithSelf.G.type.5a0: type = fn_type @M.WithSelf.G, @M.WithSelf(%M.facet) [concrete]
  3756. // CHECK:STDOUT: %M.WithSelf.G.986: %M.WithSelf.G.type.5a0 = struct_value () [concrete]
  3757. // CHECK:STDOUT: }
  3758. // CHECK:STDOUT:
  3759. // CHECK:STDOUT: imports {
  3760. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3761. // CHECK:STDOUT: import Core//prelude
  3762. // CHECK:STDOUT: import Core//prelude/...
  3763. // CHECK:STDOUT: }
  3764. // CHECK:STDOUT: }
  3765. // CHECK:STDOUT:
  3766. // CHECK:STDOUT: file {
  3767. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3768. // CHECK:STDOUT: .Core = imports.%Core
  3769. // CHECK:STDOUT: .M = %M.decl
  3770. // CHECK:STDOUT: }
  3771. // CHECK:STDOUT: %Core.import = import Core
  3772. // CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {}
  3773. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.M.impl [concrete] {} {
  3774. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3775. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3776. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3777. // CHECK:STDOUT: %.Self: %M.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  3778. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3779. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3780. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3781. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3782. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3783. // CHECK:STDOUT: %.loc8_32: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3784. // CHECK:STDOUT: %.loc8_33.1: %struct_type.b.347 = struct_literal (%.loc8_32) [concrete = constants.%struct]
  3785. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  3786. // CHECK:STDOUT: %.loc8_33.2: %empty_struct_type = converted %.loc8_32, %empty_struct [concrete = constants.%empty_struct]
  3787. // CHECK:STDOUT: %struct: %struct_type.b.347 = struct_value (%.loc8_33.2) [concrete = constants.%struct]
  3788. // CHECK:STDOUT: %.loc8_33.3: %struct_type.b.347 = converted %.loc8_33.1, %struct [concrete = constants.%struct]
  3789. // CHECK:STDOUT: %.loc8_14: type = where_expr [concrete = constants.%M_where.type] {
  3790. // CHECK:STDOUT: requirement_base_facet_type %M.ref
  3791. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_33.3
  3792. // CHECK:STDOUT: }
  3793. // CHECK:STDOUT: }
  3794. // CHECK:STDOUT: }
  3795. // CHECK:STDOUT:
  3796. // CHECK:STDOUT: interface @M {
  3797. // CHECK:STDOUT: %Self: %M.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  3798. // CHECK:STDOUT: %M.WithSelf.decl = interface_with_self_decl @M [concrete]
  3799. // CHECK:STDOUT:
  3800. // CHECK:STDOUT: !with Self:
  3801. // CHECK:STDOUT: %Z: %struct_type.b.347 = assoc_const_decl @Z [concrete] {
  3802. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.WithSelf.%Z [concrete = constants.%assoc0]
  3803. // CHECK:STDOUT: }
  3804. // CHECK:STDOUT: %M.WithSelf.G.decl: @M.WithSelf.%M.WithSelf.G.type (%M.WithSelf.G.type.e2f) = fn_decl @M.WithSelf.G [symbolic = @M.WithSelf.%M.WithSelf.G (constants.%M.WithSelf.G.020)] {
  3805. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete]
  3806. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %.loc5_14.2 [concrete]
  3807. // CHECK:STDOUT: } {
  3808. // CHECK:STDOUT: %.loc5_14.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3809. // CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3810. // CHECK:STDOUT: %.loc5_14.3: Core.Form = init_form %.loc5_14.2 [concrete = constants.%.469]
  3811. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
  3812. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  3813. // CHECK:STDOUT: }
  3814. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, %M.WithSelf.G.decl [concrete = constants.%assoc1]
  3815. // CHECK:STDOUT:
  3816. // CHECK:STDOUT: !members:
  3817. // CHECK:STDOUT: .Self = %Self
  3818. // CHECK:STDOUT: .Z = @Z.%assoc0
  3819. // CHECK:STDOUT: .G = @M.WithSelf.%assoc1
  3820. // CHECK:STDOUT: witness = (@M.WithSelf.%Z, @M.WithSelf.%M.WithSelf.G.decl)
  3821. // CHECK:STDOUT:
  3822. // CHECK:STDOUT: !requires:
  3823. // CHECK:STDOUT: }
  3824. // CHECK:STDOUT:
  3825. // CHECK:STDOUT: impl @empty_tuple.type.as.M.impl: %.loc8_7.2 as %.loc8_14 {
  3826. // CHECK:STDOUT: %empty_tuple.type.as.M.impl.G.decl: %empty_tuple.type.as.M.impl.G.type = fn_decl @empty_tuple.type.as.M.impl.G [concrete = constants.%empty_tuple.type.as.M.impl.G] {
  3827. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete]
  3828. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %.loc9_14.2 [concrete]
  3829. // CHECK:STDOUT: } {
  3830. // CHECK:STDOUT: %.loc9_14.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3831. // CHECK:STDOUT: %.loc9_14.2: type = converted %.loc9_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3832. // CHECK:STDOUT: %.loc9_14.3: Core.Form = init_form %.loc9_14.2 [concrete = constants.%.469]
  3833. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
  3834. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  3835. // CHECK:STDOUT: }
  3836. // CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.M.impl.G.decl), @empty_tuple.type.as.M.impl [concrete]
  3837. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness]
  3838. // CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.347 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct]
  3839. // CHECK:STDOUT:
  3840. // CHECK:STDOUT: !members:
  3841. // CHECK:STDOUT: .G = %empty_tuple.type.as.M.impl.G.decl
  3842. // CHECK:STDOUT: .M = <poisoned>
  3843. // CHECK:STDOUT: witness = %M.impl_witness
  3844. // CHECK:STDOUT: }
  3845. // CHECK:STDOUT:
  3846. // CHECK:STDOUT: generic fn @M.WithSelf.G(@M.%Self: %M.type) {
  3847. // CHECK:STDOUT: fn() -> out %return.param: %empty_struct_type;
  3848. // CHECK:STDOUT: }
  3849. // CHECK:STDOUT:
  3850. // CHECK:STDOUT: fn @empty_tuple.type.as.M.impl.G() -> out %return.param: %empty_struct_type {
  3851. // CHECK:STDOUT: !entry:
  3852. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.M.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  3853. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3854. // CHECK:STDOUT: %M.facet: %M.type = facet_value %Self.ref, (constants.%M.impl_witness) [concrete = constants.%M.facet]
  3855. // CHECK:STDOUT: %.loc10_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet]
  3856. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc10_18 [concrete = constants.%empty_tuple.type]
  3857. // CHECK:STDOUT: %.loc10_23: type = converted %.loc10_18, %as_type [concrete = constants.%empty_tuple.type]
  3858. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3859. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access constants.%M.impl_witness, element0 [concrete = constants.%struct]
  3860. // CHECK:STDOUT: %.loc10_25.1: %empty_struct_type = struct_access %impl.elem0, element0 [concrete = constants.%empty_struct]
  3861. // CHECK:STDOUT: %.loc10_25.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
  3862. // CHECK:STDOUT: %.loc10_27: init %empty_struct_type = converted %.loc10_25.1, %.loc10_25.2 [concrete = constants.%empty_struct]
  3863. // CHECK:STDOUT: return %.loc10_27
  3864. // CHECK:STDOUT: }
  3865. // CHECK:STDOUT:
  3866. // CHECK:STDOUT: specific @M.WithSelf(constants.%Self) {
  3867. // CHECK:STDOUT: !definition:
  3868. // CHECK:STDOUT: %Self => constants.%Self
  3869. // CHECK:STDOUT: %M.WithSelf.G.type => constants.%M.WithSelf.G.type.e2f
  3870. // CHECK:STDOUT: %M.WithSelf.G => constants.%M.WithSelf.G.020
  3871. // CHECK:STDOUT: }
  3872. // CHECK:STDOUT:
  3873. // CHECK:STDOUT: specific @M.WithSelf.G(constants.%Self) {}
  3874. // CHECK:STDOUT:
  3875. // CHECK:STDOUT: specific @M.WithSelf(constants.%.Self) {
  3876. // CHECK:STDOUT: !definition:
  3877. // CHECK:STDOUT: %Self => constants.%.Self
  3878. // CHECK:STDOUT: %M.WithSelf.G.type => constants.%M.WithSelf.G.type.a84
  3879. // CHECK:STDOUT: %M.WithSelf.G => constants.%M.WithSelf.G.6c7
  3880. // CHECK:STDOUT: }
  3881. // CHECK:STDOUT:
  3882. // CHECK:STDOUT: specific @M.WithSelf(constants.%M.facet) {
  3883. // CHECK:STDOUT: !definition:
  3884. // CHECK:STDOUT: %Self => constants.%M.facet
  3885. // CHECK:STDOUT: %M.WithSelf.G.type => constants.%M.WithSelf.G.type.5a0
  3886. // CHECK:STDOUT: %M.WithSelf.G => constants.%M.WithSelf.G.986
  3887. // CHECK:STDOUT: }
  3888. // CHECK:STDOUT:
  3889. // CHECK:STDOUT: specific @M.WithSelf.G(constants.%M.facet) {}
  3890. // CHECK:STDOUT:
  3891. // CHECK:STDOUT: --- self_as_uses_correct_rewrite_constraint.carbon
  3892. // CHECK:STDOUT:
  3893. // CHECK:STDOUT: constants {
  3894. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  3895. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  3896. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  3897. // CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic]
  3898. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  3899. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3900. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  3901. // CHECK:STDOUT: %C.5a3: type = class_type @C, @C(%T.67d) [symbolic]
  3902. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3903. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  3904. // CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete]
  3905. // CHECK:STDOUT: %Self.0c7: %M.type = symbolic_binding Self, 0 [symbolic]
  3906. // CHECK:STDOUT: %struct_type.b.86f: type = struct_type {.b: type} [concrete]
  3907. // CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type @M [concrete]
  3908. // CHECK:STDOUT: %assoc0.ed2: %M.assoc_type = assoc_entity element0, @M.WithSelf.%Z [concrete]
  3909. // CHECK:STDOUT: %.805: Core.Form = init_form type [concrete]
  3910. // CHECK:STDOUT: %M.WithSelf.G.type.e2f: type = fn_type @M.WithSelf.G, @M.WithSelf(%Self.0c7) [symbolic]
  3911. // CHECK:STDOUT: %M.WithSelf.G.020: %M.WithSelf.G.type.e2f = struct_value () [symbolic]
  3912. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, @M.WithSelf.%M.WithSelf.G.decl [concrete]
  3913. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  3914. // CHECK:STDOUT: %C.850: type = class_type @C, @C(%empty_struct_type) [concrete]
  3915. // CHECK:STDOUT: %.Self.b4d: %M.type = symbolic_binding .Self [symbolic_self]
  3916. // CHECK:STDOUT: %M.WithSelf.G.type.a84: type = fn_type @M.WithSelf.G, @M.WithSelf(%.Self.b4d) [symbolic_self]
  3917. // CHECK:STDOUT: %M.WithSelf.G.6c7: %M.WithSelf.G.type.a84 = struct_value () [symbolic_self]
  3918. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.b4d [symbolic_self]
  3919. // CHECK:STDOUT: %M.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.b4d, @M [symbolic_self]
  3920. // CHECK:STDOUT: %impl.elem0.47b: %struct_type.b.86f = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self]
  3921. // CHECK:STDOUT: %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
  3922. // CHECK:STDOUT: %struct.692: %struct_type.b.347 = struct_value (%empty_struct) [concrete]
  3923. // CHECK:STDOUT: %struct_type.b.161: type = struct_type {.b: %empty_tuple.type} [concrete]
  3924. // CHECK:STDOUT: %struct.0f3: %struct_type.b.86f = struct_value (%empty_struct_type) [concrete]
  3925. // CHECK:STDOUT: %M_where.type.2ad: type = facet_type <@M where %impl.elem0.47b = %struct.0f3> [concrete]
  3926. // CHECK:STDOUT: %M.impl_witness.9de: <witness> = impl_witness @C.as.M.impl.20d.%M.impl_witness_table [concrete]
  3927. // CHECK:STDOUT: %C.as.M.impl.G.type.107: type = fn_type @C.as.M.impl.G.loc11 [concrete]
  3928. // CHECK:STDOUT: %C.as.M.impl.G.eb6: %C.as.M.impl.G.type.107 = struct_value () [concrete]
  3929. // CHECK:STDOUT: %M.facet.9e0: %M.type = facet_value %C.850, (%M.impl_witness.9de) [concrete]
  3930. // CHECK:STDOUT: %M.WithSelf.G.type.563: type = fn_type @M.WithSelf.G, @M.WithSelf(%M.facet.9e0) [concrete]
  3931. // CHECK:STDOUT: %M.WithSelf.G.897: %M.WithSelf.G.type.563 = struct_value () [concrete]
  3932. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  3933. // CHECK:STDOUT: %Copy.impl_witness.b47: <witness> = impl_witness imports.%Copy.impl_witness_table.b1c [concrete]
  3934. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value type, (%Copy.impl_witness.b47) [concrete]
  3935. // CHECK:STDOUT: %Copy.WithSelf.Op.type.a4f: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
  3936. // CHECK:STDOUT: %.070: type = fn_type_with_self_type %Copy.WithSelf.Op.type.a4f, %Copy.facet [concrete]
  3937. // CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete]
  3938. // CHECK:STDOUT: %type.as.Copy.impl.Op: %type.as.Copy.impl.Op.type = struct_value () [concrete]
  3939. // CHECK:STDOUT: %type.as.Copy.impl.Op.bound.bca: <bound method> = bound_method %empty_struct_type, %type.as.Copy.impl.Op [concrete]
  3940. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  3941. // CHECK:STDOUT: %C.e8f: type = class_type @C, @C(%empty_tuple.type) [concrete]
  3942. // CHECK:STDOUT: %struct.63c: %struct_type.b.161 = struct_value (%empty_tuple) [concrete]
  3943. // CHECK:STDOUT: %struct.c94: %struct_type.b.86f = struct_value (%empty_tuple.type) [concrete]
  3944. // CHECK:STDOUT: %M_where.type.bf5: type = facet_type <@M where %impl.elem0.47b = %struct.c94> [concrete]
  3945. // CHECK:STDOUT: %M.impl_witness.a5c: <witness> = impl_witness @C.as.M.impl.243.%M.impl_witness_table [concrete]
  3946. // CHECK:STDOUT: %C.as.M.impl.G.type.52d: type = fn_type @C.as.M.impl.G.loc17 [concrete]
  3947. // CHECK:STDOUT: %C.as.M.impl.G.973: %C.as.M.impl.G.type.52d = struct_value () [concrete]
  3948. // CHECK:STDOUT: %M.facet.586: %M.type = facet_value %C.e8f, (%M.impl_witness.a5c) [concrete]
  3949. // CHECK:STDOUT: %M.WithSelf.G.type.5ab: type = fn_type @M.WithSelf.G, @M.WithSelf(%M.facet.586) [concrete]
  3950. // CHECK:STDOUT: %M.WithSelf.G.bdc: %M.WithSelf.G.type.5ab = struct_value () [concrete]
  3951. // CHECK:STDOUT: %type.as.Copy.impl.Op.bound.f05: <bound method> = bound_method %empty_tuple.type, %type.as.Copy.impl.Op [concrete]
  3952. // CHECK:STDOUT: }
  3953. // CHECK:STDOUT:
  3954. // CHECK:STDOUT: imports {
  3955. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3956. // CHECK:STDOUT: .Copy = %Core.Copy
  3957. // CHECK:STDOUT: import Core//prelude
  3958. // CHECK:STDOUT: import Core//prelude/...
  3959. // CHECK:STDOUT: }
  3960. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  3961. // CHECK:STDOUT: %Core.import_ref.1a7: %type.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.Copy.impl.Op]
  3962. // CHECK:STDOUT: %Copy.impl_witness_table.b1c = impl_witness_table (%Core.import_ref.1a7), @type.as.Copy.impl [concrete]
  3963. // CHECK:STDOUT: }
  3964. // CHECK:STDOUT:
  3965. // CHECK:STDOUT: file {
  3966. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3967. // CHECK:STDOUT: .Core = imports.%Core
  3968. // CHECK:STDOUT: .C = %C.decl
  3969. // CHECK:STDOUT: .M = %M.decl
  3970. // CHECK:STDOUT: }
  3971. // CHECK:STDOUT: %Core.import = import Core
  3972. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  3973. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  3974. // CHECK:STDOUT: } {
  3975. // CHECK:STDOUT: %.loc3_13.1: type = splice_block %.loc3_13.2 [concrete = type] {
  3976. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  3977. // CHECK:STDOUT: %.loc3_13.2: type = type_literal type [concrete = type]
  3978. // CHECK:STDOUT: }
  3979. // CHECK:STDOUT: %T.loc3_10.2: type = symbolic_binding T, 0 [symbolic = %T.loc3_10.1 (constants.%T.67d)]
  3980. // CHECK:STDOUT: }
  3981. // CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {}
  3982. // CHECK:STDOUT: impl_decl @C.as.M.impl.20d [concrete] {} {
  3983. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  3984. // CHECK:STDOUT: %.loc10_9: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3985. // CHECK:STDOUT: %.loc10_10: type = converted %.loc10_9, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3986. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type) [concrete = constants.%C.850]
  3987. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3988. // CHECK:STDOUT: %.Self: %M.type = symbolic_binding .Self [symbolic_self = constants.%.Self.b4d]
  3989. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.b4d]
  3990. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3991. // CHECK:STDOUT: %.loc10_23: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3992. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0.ed2]
  3993. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0.47b]
  3994. // CHECK:STDOUT: %.loc10_35: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3995. // CHECK:STDOUT: %.loc10_36.1: %struct_type.b.347 = struct_literal (%.loc10_35) [concrete = constants.%struct.692]
  3996. // CHECK:STDOUT: %.loc10_36.2: type = converted %.loc10_35, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3997. // CHECK:STDOUT: %struct: %struct_type.b.86f = struct_value (%.loc10_36.2) [concrete = constants.%struct.0f3]
  3998. // CHECK:STDOUT: %.loc10_36.3: %struct_type.b.86f = converted %.loc10_36.1, %struct [concrete = constants.%struct.0f3]
  3999. // CHECK:STDOUT: %.loc10_17: type = where_expr [concrete = constants.%M_where.type.2ad] {
  4000. // CHECK:STDOUT: requirement_base_facet_type %M.ref
  4001. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_36.3
  4002. // CHECK:STDOUT: }
  4003. // CHECK:STDOUT: }
  4004. // CHECK:STDOUT: impl_decl @C.as.M.impl.243 [concrete] {} {
  4005. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  4006. // CHECK:STDOUT: %.loc16_9: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  4007. // CHECK:STDOUT: %.loc16_10: type = converted %.loc16_9, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  4008. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_tuple.type) [concrete = constants.%C.e8f]
  4009. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  4010. // CHECK:STDOUT: %.Self: %M.type = symbolic_binding .Self [symbolic_self = constants.%.Self.b4d]
  4011. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.b4d]
  4012. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  4013. // CHECK:STDOUT: %.loc16_23: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  4014. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0.ed2]
  4015. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0.47b]
  4016. // CHECK:STDOUT: %.loc16_35: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  4017. // CHECK:STDOUT: %.loc16_36.1: %struct_type.b.161 = struct_literal (%.loc16_35) [concrete = constants.%struct.63c]
  4018. // CHECK:STDOUT: %.loc16_36.2: type = converted %.loc16_35, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  4019. // CHECK:STDOUT: %struct: %struct_type.b.86f = struct_value (%.loc16_36.2) [concrete = constants.%struct.c94]
  4020. // CHECK:STDOUT: %.loc16_36.3: %struct_type.b.86f = converted %.loc16_36.1, %struct [concrete = constants.%struct.c94]
  4021. // CHECK:STDOUT: %.loc16_17: type = where_expr [concrete = constants.%M_where.type.bf5] {
  4022. // CHECK:STDOUT: requirement_base_facet_type %M.ref
  4023. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc16_36.3
  4024. // CHECK:STDOUT: }
  4025. // CHECK:STDOUT: }
  4026. // CHECK:STDOUT: }
  4027. // CHECK:STDOUT:
  4028. // CHECK:STDOUT: interface @M {
  4029. // CHECK:STDOUT: %Self: %M.type = symbolic_binding Self, 0 [symbolic = constants.%Self.0c7]
  4030. // CHECK:STDOUT: %M.WithSelf.decl = interface_with_self_decl @M [concrete]
  4031. // CHECK:STDOUT:
  4032. // CHECK:STDOUT: !with Self:
  4033. // CHECK:STDOUT: %Z: %struct_type.b.86f = assoc_const_decl @Z [concrete] {
  4034. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.WithSelf.%Z [concrete = constants.%assoc0.ed2]
  4035. // CHECK:STDOUT: }
  4036. // CHECK:STDOUT: %M.WithSelf.G.decl: @M.WithSelf.%M.WithSelf.G.type (%M.WithSelf.G.type.e2f) = fn_decl @M.WithSelf.G [symbolic = @M.WithSelf.%M.WithSelf.G (constants.%M.WithSelf.G.020)] {
  4037. // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete]
  4038. // CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc7_13.1 [concrete]
  4039. // CHECK:STDOUT: } {
  4040. // CHECK:STDOUT: %.loc7_13.1: type = type_literal type [concrete = type]
  4041. // CHECK:STDOUT: %.loc7_13.2: Core.Form = init_form %.loc7_13.1 [concrete = constants.%.805]
  4042. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  4043. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  4044. // CHECK:STDOUT: }
  4045. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, %M.WithSelf.G.decl [concrete = constants.%assoc1]
  4046. // CHECK:STDOUT:
  4047. // CHECK:STDOUT: !members:
  4048. // CHECK:STDOUT: .Self = %Self
  4049. // CHECK:STDOUT: .Z = @Z.%assoc0
  4050. // CHECK:STDOUT: .G = @M.WithSelf.%assoc1
  4051. // CHECK:STDOUT: witness = (@M.WithSelf.%Z, @M.WithSelf.%M.WithSelf.G.decl)
  4052. // CHECK:STDOUT:
  4053. // CHECK:STDOUT: !requires:
  4054. // CHECK:STDOUT: }
  4055. // CHECK:STDOUT:
  4056. // CHECK:STDOUT: impl @C.as.M.impl.20d: %C as %.loc10_17 {
  4057. // CHECK:STDOUT: %C.as.M.impl.G.decl: %C.as.M.impl.G.type.107 = fn_decl @C.as.M.impl.G.loc11 [concrete = constants.%C.as.M.impl.G.eb6] {
  4058. // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete]
  4059. // CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc11_13.1 [concrete]
  4060. // CHECK:STDOUT: } {
  4061. // CHECK:STDOUT: %.loc11_13.1: type = type_literal type [concrete = type]
  4062. // CHECK:STDOUT: %.loc11_13.2: Core.Form = init_form %.loc11_13.1 [concrete = constants.%.805]
  4063. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  4064. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  4065. // CHECK:STDOUT: }
  4066. // CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C.as.M.impl.G.decl), @C.as.M.impl.20d [concrete]
  4067. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness.9de]
  4068. // CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.0f3 [concrete = constants.%struct.0f3]
  4069. // CHECK:STDOUT:
  4070. // CHECK:STDOUT: !members:
  4071. // CHECK:STDOUT: .G = %C.as.M.impl.G.decl
  4072. // CHECK:STDOUT: .M = <poisoned>
  4073. // CHECK:STDOUT: witness = %M.impl_witness
  4074. // CHECK:STDOUT: }
  4075. // CHECK:STDOUT:
  4076. // CHECK:STDOUT: impl @C.as.M.impl.243: %C as %.loc16_17 {
  4077. // CHECK:STDOUT: %C.as.M.impl.G.decl: %C.as.M.impl.G.type.52d = fn_decl @C.as.M.impl.G.loc17 [concrete = constants.%C.as.M.impl.G.973] {
  4078. // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete]
  4079. // CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc17_13.1 [concrete]
  4080. // CHECK:STDOUT: } {
  4081. // CHECK:STDOUT: %.loc17_13.1: type = type_literal type [concrete = type]
  4082. // CHECK:STDOUT: %.loc17_13.2: Core.Form = init_form %.loc17_13.1 [concrete = constants.%.805]
  4083. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  4084. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  4085. // CHECK:STDOUT: }
  4086. // CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C.as.M.impl.G.decl), @C.as.M.impl.243 [concrete]
  4087. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness.a5c]
  4088. // CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.c94 [concrete = constants.%struct.c94]
  4089. // CHECK:STDOUT:
  4090. // CHECK:STDOUT: !members:
  4091. // CHECK:STDOUT: .G = %C.as.M.impl.G.decl
  4092. // CHECK:STDOUT: .M = <poisoned>
  4093. // CHECK:STDOUT: witness = %M.impl_witness
  4094. // CHECK:STDOUT: }
  4095. // CHECK:STDOUT:
  4096. // CHECK:STDOUT: generic class @C(%T.loc3_10.2: type) {
  4097. // CHECK:STDOUT: %T.loc3_10.1: type = symbolic_binding T, 0 [symbolic = %T.loc3_10.1 (constants.%T.67d)]
  4098. // CHECK:STDOUT:
  4099. // CHECK:STDOUT: !definition:
  4100. // CHECK:STDOUT:
  4101. // CHECK:STDOUT: class {
  4102. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  4103. // CHECK:STDOUT: complete_type_witness = %complete_type
  4104. // CHECK:STDOUT:
  4105. // CHECK:STDOUT: !members:
  4106. // CHECK:STDOUT: .Self = constants.%C.5a3
  4107. // CHECK:STDOUT: }
  4108. // CHECK:STDOUT: }
  4109. // CHECK:STDOUT:
  4110. // CHECK:STDOUT: generic fn @M.WithSelf.G(@M.%Self: %M.type) {
  4111. // CHECK:STDOUT: fn() -> out %return.param: type;
  4112. // CHECK:STDOUT: }
  4113. // CHECK:STDOUT:
  4114. // CHECK:STDOUT: fn @C.as.M.impl.G.loc11() -> out %return.param: type {
  4115. // CHECK:STDOUT: !entry:
  4116. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.M.impl.20d.%C [concrete = constants.%C.850]
  4117. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  4118. // CHECK:STDOUT: %M.facet: %M.type = facet_value %Self.ref, (constants.%M.impl_witness.9de) [concrete = constants.%M.facet.9e0]
  4119. // CHECK:STDOUT: %.loc12_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.9e0]
  4120. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc12_18 [concrete = constants.%C.850]
  4121. // CHECK:STDOUT: %.loc12_23: type = converted %.loc12_18, %as_type [concrete = constants.%C.850]
  4122. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0.ed2]
  4123. // CHECK:STDOUT: %impl.elem0.loc12_23: %struct_type.b.86f = impl_witness_access constants.%M.impl_witness.9de, element0 [concrete = constants.%struct.0f3]
  4124. // CHECK:STDOUT: %.loc12_25: type = struct_access %impl.elem0.loc12_23, element0 [concrete = constants.%empty_struct_type]
  4125. // CHECK:STDOUT: %impl.elem0.loc12_25: %.070 = impl_witness_access constants.%Copy.impl_witness.b47, element0 [concrete = constants.%type.as.Copy.impl.Op]
  4126. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc12_25, %impl.elem0.loc12_25 [concrete = constants.%type.as.Copy.impl.Op.bound.bca]
  4127. // CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%.loc12_25) [concrete = constants.%empty_struct_type]
  4128. // CHECK:STDOUT: return %type.as.Copy.impl.Op.call
  4129. // CHECK:STDOUT: }
  4130. // CHECK:STDOUT:
  4131. // CHECK:STDOUT: fn @C.as.M.impl.G.loc17() -> out %return.param: type {
  4132. // CHECK:STDOUT: !entry:
  4133. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.M.impl.243.%C [concrete = constants.%C.e8f]
  4134. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  4135. // CHECK:STDOUT: %M.facet: %M.type = facet_value %Self.ref, (constants.%M.impl_witness.a5c) [concrete = constants.%M.facet.586]
  4136. // CHECK:STDOUT: %.loc18_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.586]
  4137. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc18_18 [concrete = constants.%C.e8f]
  4138. // CHECK:STDOUT: %.loc18_23: type = converted %.loc18_18, %as_type [concrete = constants.%C.e8f]
  4139. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0.ed2]
  4140. // CHECK:STDOUT: %impl.elem0.loc18_23: %struct_type.b.86f = impl_witness_access constants.%M.impl_witness.a5c, element0 [concrete = constants.%struct.c94]
  4141. // CHECK:STDOUT: %.loc18_25: type = struct_access %impl.elem0.loc18_23, element0 [concrete = constants.%empty_tuple.type]
  4142. // CHECK:STDOUT: %impl.elem0.loc18_25: %.070 = impl_witness_access constants.%Copy.impl_witness.b47, element0 [concrete = constants.%type.as.Copy.impl.Op]
  4143. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc18_25, %impl.elem0.loc18_25 [concrete = constants.%type.as.Copy.impl.Op.bound.f05]
  4144. // CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%.loc18_25) [concrete = constants.%empty_tuple.type]
  4145. // CHECK:STDOUT: return %type.as.Copy.impl.Op.call
  4146. // CHECK:STDOUT: }
  4147. // CHECK:STDOUT:
  4148. // CHECK:STDOUT: specific @C(constants.%T.67d) {
  4149. // CHECK:STDOUT: %T.loc3_10.1 => constants.%T.67d
  4150. // CHECK:STDOUT: }
  4151. // CHECK:STDOUT:
  4152. // CHECK:STDOUT: specific @M.WithSelf(constants.%Self.0c7) {
  4153. // CHECK:STDOUT: !definition:
  4154. // CHECK:STDOUT: %Self => constants.%Self.0c7
  4155. // CHECK:STDOUT: %M.WithSelf.G.type => constants.%M.WithSelf.G.type.e2f
  4156. // CHECK:STDOUT: %M.WithSelf.G => constants.%M.WithSelf.G.020
  4157. // CHECK:STDOUT: }
  4158. // CHECK:STDOUT:
  4159. // CHECK:STDOUT: specific @M.WithSelf.G(constants.%Self.0c7) {}
  4160. // CHECK:STDOUT:
  4161. // CHECK:STDOUT: specific @C(constants.%empty_struct_type) {
  4162. // CHECK:STDOUT: %T.loc3_10.1 => constants.%empty_struct_type
  4163. // CHECK:STDOUT: }
  4164. // CHECK:STDOUT:
  4165. // CHECK:STDOUT: specific @M.WithSelf(constants.%.Self.b4d) {
  4166. // CHECK:STDOUT: !definition:
  4167. // CHECK:STDOUT: %Self => constants.%.Self.b4d
  4168. // CHECK:STDOUT: %M.WithSelf.G.type => constants.%M.WithSelf.G.type.a84
  4169. // CHECK:STDOUT: %M.WithSelf.G => constants.%M.WithSelf.G.6c7
  4170. // CHECK:STDOUT: }
  4171. // CHECK:STDOUT:
  4172. // CHECK:STDOUT: specific @M.WithSelf(constants.%M.facet.9e0) {
  4173. // CHECK:STDOUT: !definition:
  4174. // CHECK:STDOUT: %Self => constants.%M.facet.9e0
  4175. // CHECK:STDOUT: %M.WithSelf.G.type => constants.%M.WithSelf.G.type.563
  4176. // CHECK:STDOUT: %M.WithSelf.G => constants.%M.WithSelf.G.897
  4177. // CHECK:STDOUT: }
  4178. // CHECK:STDOUT:
  4179. // CHECK:STDOUT: specific @M.WithSelf.G(constants.%M.facet.9e0) {}
  4180. // CHECK:STDOUT:
  4181. // CHECK:STDOUT: specific @C(constants.%empty_tuple.type) {
  4182. // CHECK:STDOUT: %T.loc3_10.1 => constants.%empty_tuple.type
  4183. // CHECK:STDOUT: }
  4184. // CHECK:STDOUT:
  4185. // CHECK:STDOUT: specific @M.WithSelf(constants.%M.facet.586) {
  4186. // CHECK:STDOUT: !definition:
  4187. // CHECK:STDOUT: %Self => constants.%M.facet.586
  4188. // CHECK:STDOUT: %M.WithSelf.G.type => constants.%M.WithSelf.G.type.5ab
  4189. // CHECK:STDOUT: %M.WithSelf.G => constants.%M.WithSelf.G.bdc
  4190. // CHECK:STDOUT: }
  4191. // CHECK:STDOUT:
  4192. // CHECK:STDOUT: specific @M.WithSelf.G(constants.%M.facet.586) {}
  4193. // CHECK:STDOUT:
  4194. // CHECK:STDOUT: --- associated_int_in_array.carbon
  4195. // CHECK:STDOUT:
  4196. // CHECK:STDOUT: constants {
  4197. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  4198. // CHECK:STDOUT: %Self.ab9: %I.type = symbolic_binding Self, 0 [symbolic]
  4199. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  4200. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  4201. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  4202. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  4203. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  4204. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  4205. // CHECK:STDOUT: %assoc0.d72: %I.assoc_type = assoc_entity element0, @I.WithSelf.%N [concrete]
  4206. // CHECK:STDOUT: %Self.as_type.a26: type = facet_access_type %Self.ab9 [symbolic]
  4207. // CHECK:STDOUT: %pattern_type.965: type = pattern_type %Self.as_type.a26 [symbolic]
  4208. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  4209. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  4210. // CHECK:STDOUT: %I.lookup_impl_witness.3ae: <witness> = lookup_impl_witness %Self.ab9, @I [symbolic]
  4211. // CHECK:STDOUT: %impl.elem0.f83: %i32 = impl_witness_access %I.lookup_impl_witness.3ae, element0 [symbolic]
  4212. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  4213. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  4214. // CHECK:STDOUT: %ImplicitAs.type.139: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  4215. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  4216. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  4217. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  4218. // CHECK:STDOUT: %From: Core.IntLiteral = symbolic_binding From, 0 [symbolic]
  4219. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.2ed: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic]
  4220. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.d29: %Int.as.ImplicitAs.impl.Convert.type.2ed = struct_value () [symbolic]
  4221. // CHECK:STDOUT: %ImplicitAs.impl_witness.640: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.ea2, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  4222. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.240: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  4223. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.dd4: %Int.as.ImplicitAs.impl.Convert.type.240 = struct_value () [concrete]
  4224. // CHECK:STDOUT: %ImplicitAs.facet.290: %ImplicitAs.type.139 = facet_value %i32, (%ImplicitAs.impl_witness.640) [concrete]
  4225. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.462: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(Core.IntLiteral, %ImplicitAs.facet.290) [concrete]
  4226. // CHECK:STDOUT: %.0a7: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.462, %ImplicitAs.facet.290 [concrete]
  4227. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound.0e7: <bound method> = bound_method %impl.elem0.f83, %Int.as.ImplicitAs.impl.Convert.dd4 [symbolic]
  4228. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Int.as.ImplicitAs.impl.Convert.dd4, @Int.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  4229. // CHECK:STDOUT: %bound_method.2a2: <bound method> = bound_method %impl.elem0.f83, %Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  4230. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.2a2(%impl.elem0.f83) [symbolic]
  4231. // CHECK:STDOUT: %array_type.d35: type = array_type %Int.as.ImplicitAs.impl.Convert.call, bool [symbolic]
  4232. // CHECK:STDOUT: %.c07: Core.Form = init_form %array_type.d35 [symbolic]
  4233. // CHECK:STDOUT: %pattern_type.3e2: type = pattern_type %array_type.d35 [symbolic]
  4234. // CHECK:STDOUT: %I.WithSelf.F.type.08c: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self.ab9) [symbolic]
  4235. // CHECK:STDOUT: %I.WithSelf.F.705: %I.WithSelf.F.type.08c = struct_value () [symbolic]
  4236. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.WithSelf.%I.WithSelf.F.decl [concrete]
  4237. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  4238. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  4239. // CHECK:STDOUT: %I.WithSelf.F.type.29d: type = fn_type @I.WithSelf.F, @I.WithSelf(%.Self) [symbolic_self]
  4240. // CHECK:STDOUT: %I.WithSelf.F.8ec: %I.WithSelf.F.type.29d = struct_value () [symbolic_self]
  4241. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  4242. // CHECK:STDOUT: %I.lookup_impl_witness.c4b: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  4243. // CHECK:STDOUT: %impl.elem0.667: %i32 = impl_witness_access %I.lookup_impl_witness.c4b, element0 [symbolic_self]
  4244. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  4245. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  4246. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  4247. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  4248. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  4249. // CHECK:STDOUT: %ImplicitAs.facet.b94: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  4250. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet.b94) [concrete]
  4251. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet.b94 [concrete]
  4252. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  4253. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  4254. // CHECK:STDOUT: %bound_method.646: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  4255. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  4256. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0.667 = %int_2.ef8> [concrete]
  4257. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete]
  4258. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  4259. // CHECK:STDOUT: %array_type.c9b: type = array_type %int_2.ecc, bool [concrete]
  4260. // CHECK:STDOUT: %.8b3: Core.Form = init_form %array_type.c9b [concrete]
  4261. // CHECK:STDOUT: %pattern_type.5d5: type = pattern_type %array_type.c9b [concrete]
  4262. // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type: type = fn_type @empty_tuple.type.as.I.impl.F [concrete]
  4263. // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F: %empty_tuple.type.as.I.impl.F.type = struct_value () [concrete]
  4264. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_tuple.type, (%I.impl_witness) [concrete]
  4265. // CHECK:STDOUT: %I.WithSelf.F.type.7ea: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet) [concrete]
  4266. // CHECK:STDOUT: %I.WithSelf.F.755: %I.WithSelf.F.type.7ea = struct_value () [concrete]
  4267. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound.075: <bound method> = bound_method %int_2.ef8, %Int.as.ImplicitAs.impl.Convert.dd4 [concrete]
  4268. // CHECK:STDOUT: %bound_method.bea: <bound method> = bound_method %int_2.ef8, %Int.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  4269. // CHECK:STDOUT: %true: bool = bool_literal true [concrete]
  4270. // CHECK:STDOUT: %false: bool = bool_literal false [concrete]
  4271. // CHECK:STDOUT: %tuple.type.784: type = tuple_type (bool, bool) [concrete]
  4272. // CHECK:STDOUT: %tuple.a9a: %tuple.type.784 = tuple_value (%true, %false) [concrete]
  4273. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  4274. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  4275. // CHECK:STDOUT: %Copy.impl_witness.348: <witness> = impl_witness imports.%Copy.impl_witness_table.3cc [concrete]
  4276. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value bool, (%Copy.impl_witness.348) [concrete]
  4277. // CHECK:STDOUT: %Copy.WithSelf.Op.type.6dd: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
  4278. // CHECK:STDOUT: %.86d: type = fn_type_with_self_type %Copy.WithSelf.Op.type.6dd, %Copy.facet [concrete]
  4279. // CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete]
  4280. // CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete]
  4281. // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound.12b: <bound method> = bound_method %true, %bool.as.Copy.impl.Op [concrete]
  4282. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  4283. // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound.082: <bound method> = bound_method %false, %bool.as.Copy.impl.Op [concrete]
  4284. // CHECK:STDOUT: %array: %array_type.c9b = tuple_value (%true, %false) [concrete]
  4285. // CHECK:STDOUT: }
  4286. // CHECK:STDOUT:
  4287. // CHECK:STDOUT: imports {
  4288. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  4289. // CHECK:STDOUT: .Int = %Core.Int
  4290. // CHECK:STDOUT: .Bool = %Core.Bool
  4291. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  4292. // CHECK:STDOUT: .Copy = %Core.Copy
  4293. // CHECK:STDOUT: import Core//prelude
  4294. // CHECK:STDOUT: import Core//prelude/...
  4295. // CHECK:STDOUT: }
  4296. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  4297. // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool]
  4298. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  4299. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  4300. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  4301. // CHECK:STDOUT: %Core.import_ref.0bc: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.2ed) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.d29)]
  4302. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.ea2 = impl_witness_table (%Core.import_ref.0bc), @Int.as.ImplicitAs.impl [concrete]
  4303. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  4304. // CHECK:STDOUT: %Core.import_ref.595: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%bool.as.Copy.impl.Op]
  4305. // CHECK:STDOUT: %Copy.impl_witness_table.3cc = impl_witness_table (%Core.import_ref.595), @bool.as.Copy.impl [concrete]
  4306. // CHECK:STDOUT: }
  4307. // CHECK:STDOUT:
  4308. // CHECK:STDOUT: file {
  4309. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  4310. // CHECK:STDOUT: .Core = imports.%Core
  4311. // CHECK:STDOUT: .I = %I.decl
  4312. // CHECK:STDOUT: }
  4313. // CHECK:STDOUT: %Core.import = import Core
  4314. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  4315. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.I.impl [concrete] {} {
  4316. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  4317. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  4318. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  4319. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  4320. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  4321. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  4322. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  4323. // CHECK:STDOUT: %N.ref: %I.assoc_type = name_ref N, @N.%assoc0 [concrete = constants.%assoc0.d72]
  4324. // CHECK:STDOUT: %impl.elem0.loc8_20: %i32 = impl_witness_access constants.%I.lookup_impl_witness.c4b, element0 [symbolic_self = constants.%impl.elem0.667]
  4325. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  4326. // CHECK:STDOUT: %impl.elem0.loc8_25: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  4327. // CHECK:STDOUT: %bound_method.loc8_25.1: <bound method> = bound_method %int_2, %impl.elem0.loc8_25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  4328. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc8_25, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  4329. // CHECK:STDOUT: %bound_method.loc8_25.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.646]
  4330. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_25.2(%int_2) [concrete = constants.%int_2.ef8]
  4331. // CHECK:STDOUT: %.loc8_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_2.ef8]
  4332. // CHECK:STDOUT: %.loc8_25.2: %i32 = converted %int_2, %.loc8_25.1 [concrete = constants.%int_2.ef8]
  4333. // CHECK:STDOUT: %.loc8_14: type = where_expr [concrete = constants.%I_where.type] {
  4334. // CHECK:STDOUT: requirement_base_facet_type %I.ref
  4335. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8_20, %.loc8_25.2
  4336. // CHECK:STDOUT: }
  4337. // CHECK:STDOUT: }
  4338. // CHECK:STDOUT: }
  4339. // CHECK:STDOUT:
  4340. // CHECK:STDOUT: interface @I {
  4341. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.ab9]
  4342. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  4343. // CHECK:STDOUT:
  4344. // CHECK:STDOUT: !with Self:
  4345. // CHECK:STDOUT: %N: %i32 = assoc_const_decl @N [concrete] {
  4346. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%N [concrete = constants.%assoc0.d72]
  4347. // CHECK:STDOUT: }
  4348. // CHECK:STDOUT: %I.WithSelf.F.decl: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.08c) = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.705)] {
  4349. // CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type.loc5_12 (%pattern_type.965) = value_param_pattern [concrete]
  4350. // CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type.loc5_12 (%pattern_type.965) = at_binding_pattern self, %self.param_patt [concrete]
  4351. // CHECK:STDOUT: %return.param_patt: @I.WithSelf.F.%pattern_type.loc5_38 (%pattern_type.3e2) = out_param_pattern [concrete]
  4352. // CHECK:STDOUT: %return.patt: @I.WithSelf.F.%pattern_type.loc5_38 (%pattern_type.3e2) = return_slot_pattern %return.param_patt, %array_type.loc5_38.2 [concrete]
  4353. // CHECK:STDOUT: } {
  4354. // CHECK:STDOUT: %.loc5_31: type = type_literal bool [concrete = bool]
  4355. // CHECK:STDOUT: %impl.elem0.loc5_37.2: %i32 = impl_witness_access constants.%I.lookup_impl_witness.3ae, element0 [symbolic = %impl.elem0.loc5_37.1 (constants.%impl.elem0.f83)]
  4356. // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %impl.elem0.loc5_37.2 [symbolic = %impl.elem0.loc5_37.1 (constants.%impl.elem0.f83)]
  4357. // CHECK:STDOUT: %impl.elem0.loc5_37.3: %.0a7 = impl_witness_access constants.%ImplicitAs.impl_witness.640, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.dd4]
  4358. // CHECK:STDOUT: %bound_method.loc5_37.2: <bound method> = bound_method %N.ref, %impl.elem0.loc5_37.3 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound.0e7)]
  4359. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc5_37.3, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn]
  4360. // CHECK:STDOUT: %bound_method.loc5_37.3: <bound method> = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc5_37.1 (constants.%bound_method.2a2)]
  4361. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_37.2: init Core.IntLiteral = call %bound_method.loc5_37.3(%N.ref) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  4362. // CHECK:STDOUT: %.loc5_37.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc5_37.2 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  4363. // CHECK:STDOUT: %.loc5_37.2: Core.IntLiteral = converted %N.ref, %.loc5_37.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  4364. // CHECK:STDOUT: %array_type.loc5_38.2: type = array_type %.loc5_37.2, %.loc5_31 [symbolic = %array_type.loc5_38.1 (constants.%array_type.d35)]
  4365. // CHECK:STDOUT: %.loc5_38.2: Core.Form = init_form %array_type.loc5_38.2 [symbolic = %.loc5_38.1 (constants.%.c07)]
  4366. // CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.a26) = value_param call_param0
  4367. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.a26)] {
  4368. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.ab9)]
  4369. // 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.a26)]
  4370. // 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.a26)]
  4371. // CHECK:STDOUT: }
  4372. // CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.a26) = value_binding self, %self.param
  4373. // CHECK:STDOUT: %return.param: ref @I.WithSelf.F.%array_type.loc5_38.1 (%array_type.d35) = out_param call_param1
  4374. // CHECK:STDOUT: %return: ref @I.WithSelf.F.%array_type.loc5_38.1 (%array_type.d35) = return_slot %return.param
  4375. // CHECK:STDOUT: }
  4376. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %I.WithSelf.F.decl [concrete = constants.%assoc1]
  4377. // CHECK:STDOUT:
  4378. // CHECK:STDOUT: !members:
  4379. // CHECK:STDOUT: .Self = %Self
  4380. // CHECK:STDOUT: .N = @N.%assoc0
  4381. // CHECK:STDOUT: .F = @I.WithSelf.%assoc1
  4382. // CHECK:STDOUT: witness = (@I.WithSelf.%N, @I.WithSelf.%I.WithSelf.F.decl)
  4383. // CHECK:STDOUT:
  4384. // CHECK:STDOUT: !requires:
  4385. // CHECK:STDOUT: }
  4386. // CHECK:STDOUT:
  4387. // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc8_7.2 as %.loc8_14 {
  4388. // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.decl: %empty_tuple.type.as.I.impl.F.type = fn_decl @empty_tuple.type.as.I.impl.F [concrete = constants.%empty_tuple.type.as.I.impl.F] {
  4389. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern [concrete]
  4390. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = at_binding_pattern self, %self.param_patt [concrete]
  4391. // CHECK:STDOUT: %return.param_patt: %pattern_type.5d5 = out_param_pattern [concrete]
  4392. // CHECK:STDOUT: %return.patt: %pattern_type.5d5 = return_slot_pattern %return.param_patt, %array_type [concrete]
  4393. // CHECK:STDOUT: } {
  4394. // CHECK:STDOUT: %.loc9_38: type = type_literal bool [concrete = bool]
  4395. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  4396. // CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc9_38 [concrete = constants.%array_type.c9b]
  4397. // CHECK:STDOUT: %.loc9_45: Core.Form = init_form %array_type [concrete = constants.%.8b3]
  4398. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  4399. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.I.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  4400. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  4401. // CHECK:STDOUT: %return.param: ref %array_type.c9b = out_param call_param1
  4402. // CHECK:STDOUT: %return: ref %array_type.c9b = return_slot %return.param
  4403. // CHECK:STDOUT: }
  4404. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.I.impl.F.decl), @empty_tuple.type.as.I.impl [concrete]
  4405. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  4406. // CHECK:STDOUT: %impl_witness_assoc_constant: %i32 = impl_witness_assoc_constant constants.%int_2.ef8 [concrete = constants.%int_2.ef8]
  4407. // CHECK:STDOUT:
  4408. // CHECK:STDOUT: !members:
  4409. // CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl
  4410. // CHECK:STDOUT: witness = %I.impl_witness
  4411. // CHECK:STDOUT: }
  4412. // CHECK:STDOUT:
  4413. // CHECK:STDOUT: generic fn @I.WithSelf.F(@I.%Self: %I.type) {
  4414. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.ab9)]
  4415. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.a26)]
  4416. // CHECK:STDOUT: %pattern_type.loc5_12: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type.loc5_12 (constants.%pattern_type.965)]
  4417. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness.3ae)]
  4418. // CHECK:STDOUT: %impl.elem0.loc5_37.1: %i32 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_37.1 (constants.%impl.elem0.f83)]
  4419. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %impl.elem0.loc5_37.1, constants.%Int.as.ImplicitAs.impl.Convert.dd4 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound.0e7)]
  4420. // CHECK:STDOUT: %bound_method.loc5_37.1: <bound method> = bound_method %impl.elem0.loc5_37.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc5_37.1 (constants.%bound_method.2a2)]
  4421. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1: init Core.IntLiteral = call %bound_method.loc5_37.1(%impl.elem0.loc5_37.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  4422. // CHECK:STDOUT: %array_type.loc5_38.1: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1, bool [symbolic = %array_type.loc5_38.1 (constants.%array_type.d35)]
  4423. // CHECK:STDOUT: %.loc5_38.1: Core.Form = init_form %array_type.loc5_38.1 [symbolic = %.loc5_38.1 (constants.%.c07)]
  4424. // CHECK:STDOUT: %pattern_type.loc5_38: type = pattern_type %array_type.loc5_38.1 [symbolic = %pattern_type.loc5_38 (constants.%pattern_type.3e2)]
  4425. // CHECK:STDOUT:
  4426. // CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.a26)) -> out %return.param: @I.WithSelf.F.%array_type.loc5_38.1 (%array_type.d35);
  4427. // CHECK:STDOUT: }
  4428. // CHECK:STDOUT:
  4429. // CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F(%self.param: %empty_tuple.type) -> out %return.param: %array_type.c9b {
  4430. // CHECK:STDOUT: !entry:
  4431. // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
  4432. // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false]
  4433. // CHECK:STDOUT: %.loc9_68.1: %tuple.type.784 = tuple_literal (%true, %false) [concrete = constants.%tuple.a9a]
  4434. // CHECK:STDOUT: %impl.elem0.loc9_57: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op]
  4435. // CHECK:STDOUT: %bound_method.loc9_57: <bound method> = bound_method %true, %impl.elem0.loc9_57 [concrete = constants.%bool.as.Copy.impl.Op.bound.12b]
  4436. // CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_57: init bool = call %bound_method.loc9_57(%true) [concrete = constants.%true]
  4437. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  4438. // CHECK:STDOUT: %.loc9_68.2: ref bool = array_index %return.param, %int_0
  4439. // CHECK:STDOUT: %.loc9_68.3: init bool to %.loc9_68.2 = in_place_init %bool.as.Copy.impl.Op.call.loc9_57 [concrete = constants.%true]
  4440. // CHECK:STDOUT: %impl.elem0.loc9_63: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op]
  4441. // CHECK:STDOUT: %bound_method.loc9_63: <bound method> = bound_method %false, %impl.elem0.loc9_63 [concrete = constants.%bool.as.Copy.impl.Op.bound.082]
  4442. // CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_63: init bool = call %bound_method.loc9_63(%false) [concrete = constants.%false]
  4443. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  4444. // CHECK:STDOUT: %.loc9_68.4: ref bool = array_index %return.param, %int_1
  4445. // CHECK:STDOUT: %.loc9_68.5: init bool to %.loc9_68.4 = in_place_init %bool.as.Copy.impl.Op.call.loc9_63 [concrete = constants.%false]
  4446. // CHECK:STDOUT: %.loc9_68.6: init %array_type.c9b to %return.param = array_init (%.loc9_68.3, %.loc9_68.5) [concrete = constants.%array]
  4447. // CHECK:STDOUT: %.loc9_69: init %array_type.c9b = converted %.loc9_68.1, %.loc9_68.6 [concrete = constants.%array]
  4448. // CHECK:STDOUT: return %.loc9_69 to %return.param
  4449. // CHECK:STDOUT: }
  4450. // CHECK:STDOUT:
  4451. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self.ab9) {
  4452. // CHECK:STDOUT: !definition:
  4453. // CHECK:STDOUT: %Self => constants.%Self.ab9
  4454. // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.08c
  4455. // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.705
  4456. // CHECK:STDOUT: }
  4457. // CHECK:STDOUT:
  4458. // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self.ab9) {
  4459. // CHECK:STDOUT: %Self => constants.%Self.ab9
  4460. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.a26
  4461. // CHECK:STDOUT: %pattern_type.loc5_12 => constants.%pattern_type.965
  4462. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness.3ae
  4463. // CHECK:STDOUT: %impl.elem0.loc5_37.1 => constants.%impl.elem0.f83
  4464. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound.0e7
  4465. // CHECK:STDOUT: %bound_method.loc5_37.1 => constants.%bound_method.2a2
  4466. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1 => constants.%Int.as.ImplicitAs.impl.Convert.call
  4467. // CHECK:STDOUT: %array_type.loc5_38.1 => constants.%array_type.d35
  4468. // CHECK:STDOUT: %.loc5_38.1 => constants.%.c07
  4469. // CHECK:STDOUT: %pattern_type.loc5_38 => constants.%pattern_type.3e2
  4470. // CHECK:STDOUT: }
  4471. // CHECK:STDOUT:
  4472. // CHECK:STDOUT: specific @I.WithSelf(constants.%.Self) {
  4473. // CHECK:STDOUT: !definition:
  4474. // CHECK:STDOUT: %Self => constants.%.Self
  4475. // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.29d
  4476. // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.8ec
  4477. // CHECK:STDOUT: }
  4478. // CHECK:STDOUT:
  4479. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  4480. // CHECK:STDOUT: !definition:
  4481. // CHECK:STDOUT: %Self => constants.%I.facet
  4482. // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.7ea
  4483. // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.755
  4484. // CHECK:STDOUT: }
  4485. // CHECK:STDOUT:
  4486. // CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet) {
  4487. // CHECK:STDOUT: %Self => constants.%I.facet
  4488. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_tuple.type
  4489. // CHECK:STDOUT: %pattern_type.loc5_12 => constants.%pattern_type.cb1
  4490. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.impl_witness
  4491. // CHECK:STDOUT: %impl.elem0.loc5_37.1 => constants.%int_2.ef8
  4492. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound.075
  4493. // CHECK:STDOUT: %bound_method.loc5_37.1 => constants.%bound_method.bea
  4494. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1 => constants.%int_2.ecc
  4495. // CHECK:STDOUT: %array_type.loc5_38.1 => constants.%array_type.c9b
  4496. // CHECK:STDOUT: %.loc5_38.1 => constants.%.8b3
  4497. // CHECK:STDOUT: %pattern_type.loc5_38 => constants.%pattern_type.5d5
  4498. // CHECK:STDOUT: }
  4499. // CHECK:STDOUT:
  4500. // CHECK:STDOUT: --- symbolic_associated_type_in_concrete_context.carbon
  4501. // CHECK:STDOUT:
  4502. // CHECK:STDOUT: constants {
  4503. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  4504. // CHECK:STDOUT: %Self.c59: %Z.type = symbolic_binding Self, 0 [symbolic]
  4505. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  4506. // CHECK:STDOUT: %assoc0.cdf: %Z.assoc_type = assoc_entity element0, @Z.WithSelf.%X [concrete]
  4507. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  4508. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  4509. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  4510. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  4511. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  4512. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  4513. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  4514. // CHECK:STDOUT: %C.5a3: type = class_type @C, @C(%T) [symbolic]
  4515. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  4516. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  4517. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  4518. // CHECK:STDOUT: %.Self.aac: %Z.type = symbolic_binding .Self [symbolic_self]
  4519. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.aac [symbolic_self]
  4520. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.aac, @Z [symbolic_self]
  4521. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic_self]
  4522. // CHECK:STDOUT: %Z_where.type.ea1: type = facet_type <@Z where %impl.elem0 = %C.5a3> [symbolic]
  4523. // CHECK:STDOUT: %Z.impl_witness.8d2: <witness> = impl_witness @T.as.Z.impl.%Z.impl_witness_table, @T.as.Z.impl(%T) [symbolic]
  4524. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Z_where.type.ea1 [symbolic]
  4525. // CHECK:STDOUT: %Z.facet.49c: %Z.type = facet_value %T, (%Z.impl_witness.8d2) [symbolic]
  4526. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  4527. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  4528. // CHECK:STDOUT: %C.302: type = class_type @C, @C(%D) [concrete]
  4529. // CHECK:STDOUT: %Z_where.type.4e0: type = facet_type <@Z where %impl.elem0 = %C.302> [concrete]
  4530. // CHECK:STDOUT: %Z.impl_witness.63b: <witness> = impl_witness @T.as.Z.impl.%Z.impl_witness_table, @T.as.Z.impl(%D) [concrete]
  4531. // CHECK:STDOUT: %complete_type.9a2: <witness> = complete_type_witness %Z_where.type.4e0 [concrete]
  4532. // CHECK:STDOUT: %Z.facet.59e: %Z.type = facet_value %D, (%Z.impl_witness.63b) [concrete]
  4533. // CHECK:STDOUT: %pattern_type.a7e: type = pattern_type %C.302 [concrete]
  4534. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  4535. // CHECK:STDOUT: %C.val: %C.302 = struct_value () [concrete]
  4536. // CHECK:STDOUT: %.cdd: ref %C.302 = temporary invalid, %C.val [concrete]
  4537. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  4538. // CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc12_30.2 [concrete]
  4539. // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete]
  4540. // CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.cdd, %Destroy.Op.651ba6.2 [concrete]
  4541. // CHECK:STDOUT: }
  4542. // CHECK:STDOUT:
  4543. // CHECK:STDOUT: imports {
  4544. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  4545. // CHECK:STDOUT: .Destroy = %Core.Destroy
  4546. // CHECK:STDOUT: import Core//prelude
  4547. // CHECK:STDOUT: import Core//prelude/...
  4548. // CHECK:STDOUT: }
  4549. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  4550. // CHECK:STDOUT: }
  4551. // CHECK:STDOUT:
  4552. // CHECK:STDOUT: file {
  4553. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  4554. // CHECK:STDOUT: .Core = imports.%Core
  4555. // CHECK:STDOUT: .Z = %Z.decl
  4556. // CHECK:STDOUT: .C = %C.decl
  4557. // CHECK:STDOUT: .D = %D.decl
  4558. // CHECK:STDOUT: .F = %F.decl
  4559. // CHECK:STDOUT: }
  4560. // CHECK:STDOUT: %Core.import = import Core
  4561. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  4562. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  4563. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  4564. // CHECK:STDOUT: } {
  4565. // CHECK:STDOUT: %.loc6_13.1: type = splice_block %.loc6_13.2 [concrete = type] {
  4566. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  4567. // CHECK:STDOUT: %.loc6_13.2: type = type_literal type [concrete = type]
  4568. // CHECK:STDOUT: }
  4569. // CHECK:STDOUT: %T.loc6_10.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_10.1 (constants.%T)]
  4570. // CHECK:STDOUT: }
  4571. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  4572. // CHECK:STDOUT: impl_decl @T.as.Z.impl [concrete] {
  4573. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  4574. // CHECK:STDOUT: } {
  4575. // CHECK:STDOUT: %T.ref.loc9_24: type = name_ref T, %T.loc9_15.1 [symbolic = %T.loc9_15.2 (constants.%T)]
  4576. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  4577. // CHECK:STDOUT: %.Self.1: %Z.type = symbolic_binding .Self [symbolic_self = constants.%.Self.aac]
  4578. // CHECK:STDOUT: %.Self.ref: %Z.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self.aac]
  4579. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  4580. // CHECK:STDOUT: %.loc9_37: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  4581. // CHECK:STDOUT: %X.ref: %Z.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.cdf]
  4582. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  4583. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  4584. // CHECK:STDOUT: %T.ref.loc9_44: type = name_ref T, %T.loc9_15.1 [symbolic = %T.loc9_15.2 (constants.%T)]
  4585. // CHECK:STDOUT: %C.loc9_45.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc9_45.2 (constants.%C.5a3)]
  4586. // CHECK:STDOUT: %.loc9_31: type = where_expr [symbolic = %Z_where.type (constants.%Z_where.type.ea1)] {
  4587. // CHECK:STDOUT: requirement_base_facet_type %Z.ref
  4588. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.loc9_45.1
  4589. // CHECK:STDOUT: }
  4590. // CHECK:STDOUT: %.loc9_18.1: type = splice_block %.loc9_18.2 [concrete = type] {
  4591. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  4592. // CHECK:STDOUT: %.loc9_18.2: type = type_literal type [concrete = type]
  4593. // CHECK:STDOUT: }
  4594. // CHECK:STDOUT: %T.loc9_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc9_15.2 (constants.%T)]
  4595. // CHECK:STDOUT: }
  4596. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  4597. // CHECK:STDOUT: }
  4598. // CHECK:STDOUT:
  4599. // CHECK:STDOUT: interface @Z {
  4600. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.c59]
  4601. // CHECK:STDOUT: %Z.WithSelf.decl = interface_with_self_decl @Z [concrete]
  4602. // CHECK:STDOUT:
  4603. // CHECK:STDOUT: !with Self:
  4604. // CHECK:STDOUT: %X: type = assoc_const_decl @X [concrete] {
  4605. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, @Z.WithSelf.%X [concrete = constants.%assoc0.cdf]
  4606. // CHECK:STDOUT: }
  4607. // CHECK:STDOUT:
  4608. // CHECK:STDOUT: !members:
  4609. // CHECK:STDOUT: .Self = %Self
  4610. // CHECK:STDOUT: .X = @X.%assoc0
  4611. // CHECK:STDOUT: witness = (@Z.WithSelf.%X)
  4612. // CHECK:STDOUT:
  4613. // CHECK:STDOUT: !requires:
  4614. // CHECK:STDOUT: }
  4615. // CHECK:STDOUT:
  4616. // CHECK:STDOUT: generic impl @T.as.Z.impl(%T.loc9_15.1: type) {
  4617. // CHECK:STDOUT: %T.loc9_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc9_15.2 (constants.%T)]
  4618. // CHECK:STDOUT: %C.loc9_45.2: type = class_type @C, @C(%T.loc9_15.2) [symbolic = %C.loc9_45.2 (constants.%C.5a3)]
  4619. // CHECK:STDOUT: %Z_where.type: type = facet_type <@Z where constants.%impl.elem0 = %C.loc9_45.2> [symbolic = %Z_where.type (constants.%Z_where.type.ea1)]
  4620. // CHECK:STDOUT: %Z.impl_witness.loc9_47.2: <witness> = impl_witness %Z.impl_witness_table, @T.as.Z.impl(%T.loc9_15.2) [symbolic = %Z.impl_witness.loc9_47.2 (constants.%Z.impl_witness.8d2)]
  4621. // CHECK:STDOUT:
  4622. // CHECK:STDOUT: !definition:
  4623. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete)]
  4624. // CHECK:STDOUT:
  4625. // CHECK:STDOUT: impl: %T.ref.loc9_24 as %.loc9_31 {
  4626. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @T.as.Z.impl [concrete]
  4627. // CHECK:STDOUT: %Z.impl_witness.loc9_47.1: <witness> = impl_witness %Z.impl_witness_table, @T.as.Z.impl(constants.%T) [symbolic = %Z.impl_witness.loc9_47.2 (constants.%Z.impl_witness.8d2)]
  4628. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C.5a3 [symbolic = %C.loc9_45.2 (constants.%C.5a3)]
  4629. // CHECK:STDOUT:
  4630. // CHECK:STDOUT: !members:
  4631. // CHECK:STDOUT: witness = %Z.impl_witness.loc9_47.1
  4632. // CHECK:STDOUT: }
  4633. // CHECK:STDOUT: }
  4634. // CHECK:STDOUT:
  4635. // CHECK:STDOUT: generic class @C(%T.loc6_10.2: type) {
  4636. // CHECK:STDOUT: %T.loc6_10.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_10.1 (constants.%T)]
  4637. // CHECK:STDOUT:
  4638. // CHECK:STDOUT: !definition:
  4639. // CHECK:STDOUT:
  4640. // CHECK:STDOUT: class {
  4641. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  4642. // CHECK:STDOUT: complete_type_witness = %complete_type
  4643. // CHECK:STDOUT:
  4644. // CHECK:STDOUT: !members:
  4645. // CHECK:STDOUT: .Self = constants.%C.5a3
  4646. // CHECK:STDOUT: }
  4647. // CHECK:STDOUT: }
  4648. // CHECK:STDOUT:
  4649. // CHECK:STDOUT: class @D {
  4650. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  4651. // CHECK:STDOUT: complete_type_witness = %complete_type
  4652. // CHECK:STDOUT:
  4653. // CHECK:STDOUT: !members:
  4654. // CHECK:STDOUT: .Self = constants.%D
  4655. // CHECK:STDOUT: }
  4656. // CHECK:STDOUT:
  4657. // CHECK:STDOUT: fn @F() {
  4658. // CHECK:STDOUT: !entry:
  4659. // CHECK:STDOUT: name_binding_decl {
  4660. // CHECK:STDOUT: %a.patt: %pattern_type.a7e = value_binding_pattern a [concrete]
  4661. // CHECK:STDOUT: }
  4662. // CHECK:STDOUT: %.loc12_28.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  4663. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  4664. // CHECK:STDOUT: %D.ref.loc12_35: type = name_ref D, file.%D.decl [concrete = constants.%D]
  4665. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%D) [concrete = constants.%C.302]
  4666. // CHECK:STDOUT: %.loc12_28.2: ref %C.302 = temporary_storage
  4667. // CHECK:STDOUT: %.loc12_28.3: init %C.302 to %.loc12_28.2 = class_init () [concrete = constants.%C.val]
  4668. // CHECK:STDOUT: %.loc12_30.1: init %C.302 = converted %.loc12_28.1, %.loc12_28.3 [concrete = constants.%C.val]
  4669. // CHECK:STDOUT: %.loc12_18.1: type = splice_block %impl.elem0 [concrete = constants.%C.302] {
  4670. // CHECK:STDOUT: %D.ref.loc12_17: type = name_ref D, file.%D.decl [concrete = constants.%D]
  4671. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  4672. // CHECK:STDOUT: %X.ref: %Z.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.cdf]
  4673. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %D.ref.loc12_17, (constants.%Z.impl_witness.63b) [concrete = constants.%Z.facet.59e]
  4674. // CHECK:STDOUT: %.loc12_18.2: %Z.type = converted %D.ref.loc12_17, %Z.facet [concrete = constants.%Z.facet.59e]
  4675. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.impl_witness.63b, element0 [concrete = constants.%C.302]
  4676. // CHECK:STDOUT: }
  4677. // CHECK:STDOUT: %.loc12_30.2: ref %C.302 = temporary %.loc12_28.2, %.loc12_30.1 [concrete = constants.%.cdd]
  4678. // CHECK:STDOUT: %.loc12_30.3: %C.302 = acquire_value %.loc12_30.2 [concrete = constants.%C.val]
  4679. // CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_30.3
  4680. // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.cdd)
  4681. // CHECK:STDOUT: return
  4682. // CHECK:STDOUT: }
  4683. // CHECK:STDOUT:
  4684. // CHECK:STDOUT: fn @Destroy.Op.loc12_30.1(%self.param: ref %empty_struct_type) = "no_op";
  4685. // CHECK:STDOUT:
  4686. // CHECK:STDOUT: fn @Destroy.Op.loc12_30.2(%self.param: ref %C.302) {
  4687. // CHECK:STDOUT: !entry:
  4688. // CHECK:STDOUT: return
  4689. // CHECK:STDOUT: }
  4690. // CHECK:STDOUT:
  4691. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Self.c59) {
  4692. // CHECK:STDOUT: !definition:
  4693. // CHECK:STDOUT: }
  4694. // CHECK:STDOUT:
  4695. // CHECK:STDOUT: specific @C(constants.%T) {
  4696. // CHECK:STDOUT: %T.loc6_10.1 => constants.%T
  4697. // CHECK:STDOUT: }
  4698. // CHECK:STDOUT:
  4699. // CHECK:STDOUT: specific @Z.WithSelf(constants.%.Self.aac) {
  4700. // CHECK:STDOUT: !definition:
  4701. // CHECK:STDOUT: }
  4702. // CHECK:STDOUT:
  4703. // CHECK:STDOUT: specific @T.as.Z.impl(constants.%T) {
  4704. // CHECK:STDOUT: %T.loc9_15.2 => constants.%T
  4705. // CHECK:STDOUT: %C.loc9_45.2 => constants.%C.5a3
  4706. // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.ea1
  4707. // CHECK:STDOUT: %Z.impl_witness.loc9_47.2 => constants.%Z.impl_witness.8d2
  4708. // CHECK:STDOUT: }
  4709. // CHECK:STDOUT:
  4710. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Z.facet.49c) {
  4711. // CHECK:STDOUT: !definition:
  4712. // CHECK:STDOUT: }
  4713. // CHECK:STDOUT:
  4714. // CHECK:STDOUT: specific @T.as.Z.impl(constants.%D) {
  4715. // CHECK:STDOUT: %T.loc9_15.2 => constants.%D
  4716. // CHECK:STDOUT: %C.loc9_45.2 => constants.%C.302
  4717. // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.4e0
  4718. // CHECK:STDOUT: %Z.impl_witness.loc9_47.2 => constants.%Z.impl_witness.63b
  4719. // CHECK:STDOUT:
  4720. // CHECK:STDOUT: !definition:
  4721. // CHECK:STDOUT: %require_complete => constants.%complete_type.9a2
  4722. // CHECK:STDOUT: }
  4723. // CHECK:STDOUT:
  4724. // CHECK:STDOUT: specific @C(constants.%D) {
  4725. // CHECK:STDOUT: %T.loc6_10.1 => constants.%D
  4726. // CHECK:STDOUT:
  4727. // CHECK:STDOUT: !definition:
  4728. // CHECK:STDOUT: }
  4729. // CHECK:STDOUT:
  4730. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Z.facet.59e) {
  4731. // CHECK:STDOUT: !definition:
  4732. // CHECK:STDOUT: }
  4733. // CHECK:STDOUT: