use_assoc_entity.carbon 330 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448
  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[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](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[self: Self](v: i32) -> i32 {
  59. return -v;
  60. }
  61. }
  62. }
  63. fn CallBoth(e: E) {
  64. let e1: i32 = e.F(2);
  65. let e2: i32 = e.G(3);
  66. let e3: i32 = E.F(4);
  67. let e4: i32 = e.(E.G)(5);
  68. let 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)` [MissingImplInMemberAccessNote]
  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)` [MissingImplInMemberAccessNote]
  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[self: Self]() {}
  155. }
  156. class E {
  157. extend impl as J {
  158. fn F[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)` [MissingImplInMemberAccessNote]
  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[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](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]]:20: note: initializing function parameter [InCallToFunctionParam]
  220. // CHECK:STDERR: fn F[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[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[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[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 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.d5c: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  289. // CHECK:STDOUT: %Self.binding.as_type.ed8: type = symbolic_binding_type Self, 0, %Self.8a1 [symbolic]
  290. // CHECK:STDOUT: %pattern_type.832: type = pattern_type %Self.binding.as_type.ed8 [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: %.f80: form = init_form %impl.elem0.335, call_param2 [symbolic]
  295. // CHECK:STDOUT: %J.F.type: type = fn_type @J.F [concrete]
  296. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  297. // CHECK:STDOUT: %J.F: %J.F.type = struct_value () [concrete]
  298. // CHECK:STDOUT: %assoc1.a57: %J.assoc_type = assoc_entity element1, @J.%J.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: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.2fa [symbolic_self]
  302. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self.2fa, @J [symbolic_self]
  303. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  304. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  305. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  306. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  307. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  308. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  309. // CHECK:STDOUT: %J_where.type.928: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  310. // CHECK:STDOUT: %J.impl_witness.5bf: <witness> = impl_witness @empty_tuple.type.as.J.impl.%J.impl_witness_table [concrete]
  311. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  312. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  313. // CHECK:STDOUT: %.88a: form = init_form %i32, call_param2 [concrete]
  314. // CHECK:STDOUT: %empty_tuple.type.as.J.impl.F.type: type = fn_type @empty_tuple.type.as.J.impl.F [concrete]
  315. // CHECK:STDOUT: %empty_tuple.type.as.J.impl.F: %empty_tuple.type.as.J.impl.F.type = struct_value () [concrete]
  316. // CHECK:STDOUT: %J.facet.a51: %J.type = facet_value %empty_tuple.type, (%J.impl_witness.5bf) [concrete]
  317. // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
  318. // CHECK:STDOUT: %Negate.Op.type: type = fn_type @Negate.Op [concrete]
  319. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.5e6: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%N) [symbolic]
  320. // CHECK:STDOUT: %Int.as.Negate.impl.Op.7f5: %Int.as.Negate.impl.Op.type.5e6 = struct_value () [symbolic]
  321. // CHECK:STDOUT: %Negate.impl_witness.11c: <witness> = impl_witness imports.%Negate.impl_witness_table, @Int.as.Negate.impl(%int_32) [concrete]
  322. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.e60: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%int_32) [concrete]
  323. // CHECK:STDOUT: %Int.as.Negate.impl.Op.e7f: %Int.as.Negate.impl.Op.type.e60 = struct_value () [concrete]
  324. // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %i32, (%Negate.impl_witness.11c) [concrete]
  325. // CHECK:STDOUT: %.dd4: type = fn_type_with_self_type %Negate.Op.type, %Negate.facet [concrete]
  326. // CHECK:STDOUT: %.4d5: form = init_form %i32, call_param1 [concrete]
  327. // 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]
  328. // CHECK:STDOUT: %CallMethod.type: type = fn_type @CallMethod [concrete]
  329. // CHECK:STDOUT: %CallMethod: %CallMethod.type = struct_value () [concrete]
  330. // CHECK:STDOUT: %.91f: type = fn_type_with_self_type %J.F.type, %J.facet.a51 [concrete]
  331. // CHECK:STDOUT: %int_40.f80: Core.IntLiteral = int_value 40 [concrete]
  332. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  333. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  334. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  335. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  336. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  337. // 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]
  338. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  339. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  340. // 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]
  341. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  342. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  343. // CHECK:STDOUT: %.863: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  344. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_40.f80, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  345. // 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]
  346. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_40.f80, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  347. // CHECK:STDOUT: %int_40.518: %i32 = int_value 40 [concrete]
  348. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  349. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  350. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  351. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  352. // CHECK:STDOUT: %J_where.type.d0e: type = facet_type <@J where %impl.elem0.a58 = %C> [concrete]
  353. // CHECK:STDOUT: %J.impl_witness.00b: <witness> = impl_witness @C.as.J.impl.%J.impl_witness_table [concrete]
  354. // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete]
  355. // CHECK:STDOUT: %.355: form = init_form %C, call_param2 [concrete]
  356. // CHECK:STDOUT: %C.as.J.impl.F.type: type = fn_type @C.as.J.impl.F [concrete]
  357. // CHECK:STDOUT: %C.as.J.impl.F: %C.as.J.impl.F.type = struct_value () [concrete]
  358. // CHECK:STDOUT: %J.facet.05d: %J.type = facet_value %C, (%J.impl_witness.00b) [concrete]
  359. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: imports {
  363. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  364. // CHECK:STDOUT: .Int = %Core.Int
  365. // CHECK:STDOUT: .Negate = %Core.Negate
  366. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  367. // CHECK:STDOUT: import Core//prelude
  368. // CHECK:STDOUT: import Core//prelude/...
  369. // CHECK:STDOUT: }
  370. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  371. // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type]
  372. // CHECK:STDOUT: %Core.import_ref.475 = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, unloaded
  373. // 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)]
  374. // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.475, %Core.import_ref.d40), @Int.as.Negate.impl [concrete]
  375. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  376. // 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)]
  377. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  378. // CHECK:STDOUT: }
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: file {
  381. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  382. // CHECK:STDOUT: .Core = imports.%Core
  383. // CHECK:STDOUT: .J = %J.decl
  384. // CHECK:STDOUT: .CallMethod = %CallMethod.decl
  385. // CHECK:STDOUT: .C = %C.decl
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT: %Core.import = import Core
  388. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  389. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.J.impl [concrete] {} {
  390. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  391. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  392. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  393. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  394. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.2fa]
  395. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  396. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  397. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  398. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  399. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  400. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  401. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [concrete = constants.%J_where.type.928] {
  402. // CHECK:STDOUT: requirement_base_facet_type constants.%J.type
  403. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  404. // CHECK:STDOUT: }
  405. // CHECK:STDOUT: }
  406. // CHECK:STDOUT: %CallMethod.decl: %CallMethod.type = fn_decl @CallMethod [concrete = constants.%CallMethod] {
  407. // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = value_binding_pattern x [concrete]
  408. // CHECK:STDOUT: %x.param_patt: %pattern_type.cb1 = value_param_pattern %x.patt, call_param0 [concrete]
  409. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  410. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  411. // CHECK:STDOUT: } {
  412. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  413. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  414. // CHECK:STDOUT: %.loc12_25: form = init_form %i32, call_param1 [concrete = constants.%.4d5]
  415. // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0
  416. // CHECK:STDOUT: %.loc12_19.1: type = splice_block %.loc12_19.3 [concrete = constants.%empty_tuple.type] {
  417. // CHECK:STDOUT: %.loc12_19.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  418. // CHECK:STDOUT: %.loc12_19.3: type = converted %.loc12_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  419. // CHECK:STDOUT: }
  420. // CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %x.param
  421. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  422. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  423. // CHECK:STDOUT: }
  424. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  425. // CHECK:STDOUT: impl_decl @C.as.J.impl [concrete] {} {
  426. // CHECK:STDOUT: %C.ref.loc21_6: type = name_ref C, file.%C.decl [concrete = constants.%C]
  427. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  428. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  429. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.2fa]
  430. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  431. // CHECK:STDOUT: %.loc21_19: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  432. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  433. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  434. // CHECK:STDOUT: %C.ref.loc21_24: type = name_ref C, file.%C.decl [concrete = constants.%C]
  435. // CHECK:STDOUT: %.loc21_13: type = where_expr %.Self [concrete = constants.%J_where.type.d0e] {
  436. // CHECK:STDOUT: requirement_base_facet_type constants.%J.type
  437. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.ref.loc21_24
  438. // CHECK:STDOUT: }
  439. // CHECK:STDOUT: }
  440. // CHECK:STDOUT: }
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: interface @J {
  443. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  444. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  445. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.d5c]
  446. // CHECK:STDOUT: }
  447. // CHECK:STDOUT: %J.F.decl: %J.F.type = fn_decl @J.F [concrete = constants.%J.F] {
  448. // CHECK:STDOUT: %self.patt: @J.F.%pattern_type.loc5_8 (%pattern_type.832) = value_binding_pattern self [concrete]
  449. // CHECK:STDOUT: %self.param_patt: @J.F.%pattern_type.loc5_8 (%pattern_type.832) = value_param_pattern %self.patt, call_param0 [concrete]
  450. // CHECK:STDOUT: %u.patt: @J.F.%pattern_type.loc5_20 (%pattern_type.c1a) = value_binding_pattern u [concrete]
  451. // CHECK:STDOUT: %u.param_patt: @J.F.%pattern_type.loc5_20 (%pattern_type.c1a) = value_param_pattern %u.patt, call_param1 [concrete]
  452. // CHECK:STDOUT: %return.patt: @J.F.%pattern_type.loc5_20 (%pattern_type.c1a) = return_slot_pattern [concrete]
  453. // CHECK:STDOUT: %return.param_patt: @J.F.%pattern_type.loc5_20 (%pattern_type.c1a) = out_param_pattern %return.patt, call_param2 [concrete]
  454. // CHECK:STDOUT: } {
  455. // 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)]
  456. // CHECK:STDOUT: %U.ref.loc5_29: type = name_ref U, %impl.elem0.loc5_29 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  457. // CHECK:STDOUT: %.loc5_29.2: form = init_form %U.ref.loc5_29, call_param2 [symbolic = %.loc5_29.1 (constants.%.f80)]
  458. // CHECK:STDOUT: %self.param: @J.F.%Self.binding.as_type (%Self.binding.as_type.ed8) = value_param call_param0
  459. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.ed8)] {
  460. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self.8a1)]
  461. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.ed8)]
  462. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.ed8)]
  463. // CHECK:STDOUT: }
  464. // CHECK:STDOUT: %self: @J.F.%Self.binding.as_type (%Self.binding.as_type.ed8) = value_binding self, %self.param
  465. // CHECK:STDOUT: %u.param: @J.F.%impl.elem0.loc5_23.1 (%impl.elem0.335) = value_param call_param1
  466. // CHECK:STDOUT: %.loc5_23: type = splice_block %U.ref.loc5_23 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)] {
  467. // 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)]
  468. // 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)]
  469. // CHECK:STDOUT: }
  470. // CHECK:STDOUT: %u: @J.F.%impl.elem0.loc5_23.1 (%impl.elem0.335) = value_binding u, %u.param
  471. // CHECK:STDOUT: %return.param: ref @J.F.%impl.elem0.loc5_23.1 (%impl.elem0.335) = out_param call_param2
  472. // CHECK:STDOUT: %return: ref @J.F.%impl.elem0.loc5_23.1 (%impl.elem0.335) = return_slot %return.param
  473. // CHECK:STDOUT: }
  474. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.F.decl [concrete = constants.%assoc1.a57]
  475. // CHECK:STDOUT:
  476. // CHECK:STDOUT: !members:
  477. // CHECK:STDOUT: .Self = %Self
  478. // CHECK:STDOUT: .U = @U.%assoc0
  479. // CHECK:STDOUT: .F = %assoc1
  480. // CHECK:STDOUT: witness = (%U, %J.F.decl)
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: !requires:
  483. // CHECK:STDOUT: }
  484. // CHECK:STDOUT:
  485. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  486. // CHECK:STDOUT: assoc_const U:! type;
  487. // CHECK:STDOUT: }
  488. // CHECK:STDOUT:
  489. // CHECK:STDOUT: impl @empty_tuple.type.as.J.impl: %.loc8_7.2 as %.loc8_14 {
  490. // 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] {
  491. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
  492. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  493. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = value_binding_pattern u [concrete]
  494. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern %u.patt, call_param1 [concrete]
  495. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  496. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete]
  497. // CHECK:STDOUT: } {
  498. // CHECK:STDOUT: %int_32.loc9_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  499. // CHECK:STDOUT: %i32.loc9_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  500. // CHECK:STDOUT: %.loc9_31: form = init_form %i32.loc9_31, call_param2 [concrete = constants.%.88a]
  501. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  502. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.J.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  503. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  504. // CHECK:STDOUT: %u.param: %i32 = value_param call_param1
  505. // CHECK:STDOUT: %.loc9_23: type = splice_block %i32.loc9_23 [concrete = constants.%i32] {
  506. // CHECK:STDOUT: %int_32.loc9_23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  507. // CHECK:STDOUT: %i32.loc9_23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  508. // CHECK:STDOUT: }
  509. // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param
  510. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
  511. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  512. // CHECK:STDOUT: }
  513. // 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]
  514. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.5bf]
  515. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  516. // CHECK:STDOUT:
  517. // CHECK:STDOUT: !members:
  518. // CHECK:STDOUT: .F = %empty_tuple.type.as.J.impl.F.decl
  519. // CHECK:STDOUT: witness = %J.impl_witness
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT:
  522. // CHECK:STDOUT: impl @C.as.J.impl: %C.ref.loc21_6 as %.loc21_13 {
  523. // 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] {
  524. // CHECK:STDOUT: %self.patt: %pattern_type.7c7 = value_binding_pattern self [concrete]
  525. // CHECK:STDOUT: %self.param_patt: %pattern_type.7c7 = value_param_pattern %self.patt, call_param0 [concrete]
  526. // CHECK:STDOUT: %u.patt: %pattern_type.7c7 = value_binding_pattern u [concrete]
  527. // CHECK:STDOUT: %u.param_patt: %pattern_type.7c7 = value_param_pattern %u.patt, call_param1 [concrete]
  528. // CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern [concrete]
  529. // CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param2 [concrete]
  530. // CHECK:STDOUT: } {
  531. // CHECK:STDOUT: %C.ref.loc22_29: type = name_ref C, file.%C.decl [concrete = constants.%C]
  532. // CHECK:STDOUT: %.loc22_29: form = init_form %C.ref.loc22_29, call_param2 [concrete = constants.%.355]
  533. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  534. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.J.impl.%C.ref.loc21_6 [concrete = constants.%C]
  535. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  536. // CHECK:STDOUT: %u.param: %C = value_param call_param1
  537. // CHECK:STDOUT: %C.ref.loc22_23: type = name_ref C, file.%C.decl [concrete = constants.%C]
  538. // CHECK:STDOUT: %u: %C = value_binding u, %u.param
  539. // CHECK:STDOUT: %return.param: ref %C = out_param call_param2
  540. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  541. // CHECK:STDOUT: }
  542. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C.as.J.impl.F.decl), @C.as.J.impl [concrete]
  543. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.00b]
  544. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C]
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: !members:
  547. // CHECK:STDOUT: .C = <poisoned>
  548. // CHECK:STDOUT: .F = %C.as.J.impl.F.decl
  549. // CHECK:STDOUT: witness = %J.impl_witness
  550. // CHECK:STDOUT: }
  551. // CHECK:STDOUT:
  552. // CHECK:STDOUT: class @C {
  553. // CHECK:STDOUT: %.loc18_10: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  554. // CHECK:STDOUT: %.loc18_11: type = converted %.loc18_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  555. // CHECK:STDOUT: adapt_decl %.loc18_11 [concrete]
  556. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  557. // CHECK:STDOUT: complete_type_witness = %complete_type
  558. // CHECK:STDOUT:
  559. // CHECK:STDOUT: !members:
  560. // CHECK:STDOUT: .Self = constants.%C
  561. // CHECK:STDOUT: }
  562. // CHECK:STDOUT:
  563. // CHECK:STDOUT: generic fn @J.F(@J.%Self: %J.type) {
  564. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  565. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.ed8)]
  566. // CHECK:STDOUT: %pattern_type.loc5_8: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.loc5_8 (constants.%pattern_type.832)]
  567. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  568. // 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)]
  569. // CHECK:STDOUT: %pattern_type.loc5_20: type = pattern_type %impl.elem0.loc5_23.1 [symbolic = %pattern_type.loc5_20 (constants.%pattern_type.c1a)]
  570. // CHECK:STDOUT: %.loc5_29.1: form = init_form %impl.elem0.loc5_23.1, call_param2 [symbolic = %.loc5_29.1 (constants.%.f80)]
  571. // CHECK:STDOUT:
  572. // CHECK:STDOUT: fn(%self.param: @J.F.%Self.binding.as_type (%Self.binding.as_type.ed8), %u.param: @J.F.%impl.elem0.loc5_23.1 (%impl.elem0.335)) -> out %return.param: @J.F.%impl.elem0.loc5_23.1 (%impl.elem0.335);
  573. // CHECK:STDOUT: }
  574. // CHECK:STDOUT:
  575. // CHECK:STDOUT: fn @empty_tuple.type.as.J.impl.F(%self.param: %empty_tuple.type, %u.param: %i32) -> out %return.param: %i32 {
  576. // CHECK:STDOUT: !entry:
  577. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
  578. // CHECK:STDOUT: %impl.elem1: %.dd4 = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f]
  579. // CHECK:STDOUT: %bound_method.loc9_44.1: <bound method> = bound_method %u.ref, %impl.elem1
  580. // 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]
  581. // CHECK:STDOUT: %bound_method.loc9_44.2: <bound method> = bound_method %u.ref, %specific_fn
  582. // CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc9_44.2(%u.ref)
  583. // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call
  584. // CHECK:STDOUT: }
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: fn @CallMethod(%x.param: %empty_tuple.type) -> out %return.param: %i32 {
  587. // CHECK:STDOUT: !entry:
  588. // CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, %x
  589. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  590. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.a57]
  591. // CHECK:STDOUT: %impl.elem1: %.91f = impl_witness_access constants.%J.impl_witness.5bf, element1 [concrete = constants.%empty_tuple.type.as.J.impl.F]
  592. // CHECK:STDOUT: %bound_method.loc13_11: <bound method> = bound_method %x.ref, %impl.elem1
  593. // CHECK:STDOUT: %int_40: Core.IntLiteral = int_value 40 [concrete = constants.%int_40.f80]
  594. // CHECK:STDOUT: %impl.elem0: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  595. // CHECK:STDOUT: %bound_method.loc13_18.1: <bound method> = bound_method %int_40, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  596. // 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]
  597. // CHECK:STDOUT: %bound_method.loc13_18.2: <bound method> = bound_method %int_40, %specific_fn [concrete = constants.%bound_method]
  598. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_18.2(%int_40) [concrete = constants.%int_40.518]
  599. // CHECK:STDOUT: %.loc13_18.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_40.518]
  600. // CHECK:STDOUT: %.loc13_18.2: %i32 = converted %int_40, %.loc13_18.1 [concrete = constants.%int_40.518]
  601. // CHECK:STDOUT: %empty_tuple.type.as.J.impl.F.call: init %i32 = call %bound_method.loc13_11(%x.ref, %.loc13_18.2)
  602. // CHECK:STDOUT: return %empty_tuple.type.as.J.impl.F.call
  603. // CHECK:STDOUT: }
  604. // CHECK:STDOUT:
  605. // CHECK:STDOUT: fn @C.as.J.impl.F(%self.param: %C, %u.param: %C) -> out %return.param: %C {
  606. // CHECK:STDOUT: !entry:
  607. // CHECK:STDOUT: %self.ref: %C = name_ref self, %self
  608. // CHECK:STDOUT: %.loc22_44.1: %empty_struct_type = as_compatible %self.ref
  609. // CHECK:STDOUT: %.loc22_44.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
  610. // CHECK:STDOUT: %.loc22_44.3: init %C = as_compatible %.loc22_44.2 [concrete = constants.%C.val]
  611. // CHECK:STDOUT: %.loc22_44.4: init %C = converted %self.ref, %.loc22_44.3 [concrete = constants.%C.val]
  612. // CHECK:STDOUT: return %.loc22_44.4
  613. // CHECK:STDOUT: }
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: specific @U(constants.%Self.8a1) {}
  616. // CHECK:STDOUT:
  617. // CHECK:STDOUT: specific @J.F(constants.%Self.8a1) {
  618. // CHECK:STDOUT: %Self => constants.%Self.8a1
  619. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.ed8
  620. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.832
  621. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  622. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.335
  623. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.c1a
  624. // CHECK:STDOUT: %.loc5_29.1 => constants.%.f80
  625. // CHECK:STDOUT: }
  626. // CHECK:STDOUT:
  627. // CHECK:STDOUT: specific @U(constants.%.Self.2fa) {}
  628. // CHECK:STDOUT:
  629. // CHECK:STDOUT: specific @J.F(constants.%J.facet.a51) {
  630. // CHECK:STDOUT: %Self => constants.%J.facet.a51
  631. // CHECK:STDOUT: %Self.binding.as_type => constants.%empty_tuple.type
  632. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.cb1
  633. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness.5bf
  634. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%i32
  635. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.7ce
  636. // CHECK:STDOUT: %.loc5_29.1 => constants.%.88a
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT:
  639. // CHECK:STDOUT: specific @J.F(constants.%J.facet.05d) {
  640. // CHECK:STDOUT: %Self => constants.%J.facet.05d
  641. // CHECK:STDOUT: %Self.binding.as_type => constants.%C
  642. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.7c7
  643. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness.00b
  644. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%C
  645. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.7c7
  646. // CHECK:STDOUT: %.loc5_29.1 => constants.%.355
  647. // CHECK:STDOUT: }
  648. // CHECK:STDOUT:
  649. // CHECK:STDOUT: --- associated_type_in_function_signature.carbon
  650. // CHECK:STDOUT:
  651. // CHECK:STDOUT: constants {
  652. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  653. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  654. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  655. // CHECK:STDOUT: %assoc0.d5c: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  656. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  657. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  658. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  659. // CHECK:STDOUT: %.eaf: form = init_form %impl.elem0.335, call_param1 [symbolic]
  660. // CHECK:STDOUT: %J.F.type: type = fn_type @J.F [concrete]
  661. // CHECK:STDOUT: %J.F: %J.F.type = struct_value () [concrete]
  662. // CHECK:STDOUT: %assoc1.a57: %J.assoc_type = assoc_entity element1, @J.%J.F.decl [concrete]
  663. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  664. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  665. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  666. // CHECK:STDOUT: %.Self.2fa: %J.type = symbolic_binding .Self [symbolic_self]
  667. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.2fa [symbolic_self]
  668. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self.2fa, @J [symbolic_self]
  669. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  670. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  671. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  672. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  673. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  674. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  675. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  676. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @D.as.J.impl.%J.impl_witness_table [concrete]
  677. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  678. // CHECK:STDOUT: %.4d5: form = init_form %i32, call_param1 [concrete]
  679. // CHECK:STDOUT: %D.as.J.impl.F.type: type = fn_type @D.as.J.impl.F [concrete]
  680. // CHECK:STDOUT: %D.as.J.impl.F: %D.as.J.impl.F.type = struct_value () [concrete]
  681. // CHECK:STDOUT: %J.facet: %J.type = facet_value %D, (%J.impl_witness) [concrete]
  682. // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
  683. // CHECK:STDOUT: %Negate.Op.type: type = fn_type @Negate.Op [concrete]
  684. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.5e6: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%N) [symbolic]
  685. // CHECK:STDOUT: %Int.as.Negate.impl.Op.7f5: %Int.as.Negate.impl.Op.type.5e6 = struct_value () [symbolic]
  686. // CHECK:STDOUT: %Negate.impl_witness.11c: <witness> = impl_witness imports.%Negate.impl_witness_table, @Int.as.Negate.impl(%int_32) [concrete]
  687. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.e60: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%int_32) [concrete]
  688. // CHECK:STDOUT: %Int.as.Negate.impl.Op.e7f: %Int.as.Negate.impl.Op.type.e60 = struct_value () [concrete]
  689. // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %i32, (%Negate.impl_witness.11c) [concrete]
  690. // CHECK:STDOUT: %.dd4: type = fn_type_with_self_type %Negate.Op.type, %Negate.facet [concrete]
  691. // 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]
  692. // CHECK:STDOUT: %.941: form = init_form %i32, call_param0 [concrete]
  693. // CHECK:STDOUT: %CallFunction.type: type = fn_type @CallFunction [concrete]
  694. // CHECK:STDOUT: %CallFunction: %CallFunction.type = struct_value () [concrete]
  695. // CHECK:STDOUT: %.0e5: type = fn_type_with_self_type %J.F.type, %J.facet [concrete]
  696. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
  697. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  698. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  699. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  700. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  701. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  702. // 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]
  703. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  704. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  705. // 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]
  706. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  707. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  708. // CHECK:STDOUT: %.863: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  709. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  710. // 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]
  711. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  712. // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
  713. // CHECK:STDOUT: }
  714. // CHECK:STDOUT:
  715. // CHECK:STDOUT: imports {
  716. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  717. // CHECK:STDOUT: .Int = %Core.Int
  718. // CHECK:STDOUT: .Negate = %Core.Negate
  719. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  720. // CHECK:STDOUT: import Core//prelude
  721. // CHECK:STDOUT: import Core//prelude/...
  722. // CHECK:STDOUT: }
  723. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  724. // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type]
  725. // CHECK:STDOUT: %Core.import_ref.475 = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, unloaded
  726. // 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)]
  727. // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.475, %Core.import_ref.d40), @Int.as.Negate.impl [concrete]
  728. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  729. // 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)]
  730. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  731. // CHECK:STDOUT: }
  732. // CHECK:STDOUT:
  733. // CHECK:STDOUT: file {
  734. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  735. // CHECK:STDOUT: .Core = imports.%Core
  736. // CHECK:STDOUT: .J = %J.decl
  737. // CHECK:STDOUT: .D = %D.decl
  738. // CHECK:STDOUT: .CallFunction = %CallFunction.decl
  739. // CHECK:STDOUT: }
  740. // CHECK:STDOUT: %Core.import = import Core
  741. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  742. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  743. // CHECK:STDOUT: impl_decl @D.as.J.impl [concrete] {} {
  744. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  745. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  746. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  747. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.2fa]
  748. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  749. // CHECK:STDOUT: %.loc10_19: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  750. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  751. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  752. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  753. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  754. // CHECK:STDOUT: %.loc10_13: type = where_expr %.Self [concrete = constants.%J_where.type] {
  755. // CHECK:STDOUT: requirement_base_facet_type constants.%J.type
  756. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  757. // CHECK:STDOUT: }
  758. // CHECK:STDOUT: }
  759. // CHECK:STDOUT: %CallFunction.decl: %CallFunction.type = fn_decl @CallFunction [concrete = constants.%CallFunction] {
  760. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  761. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  762. // CHECK:STDOUT: } {
  763. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  764. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  765. // CHECK:STDOUT: %.loc14: form = init_form %i32, call_param0 [concrete = constants.%.941]
  766. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  767. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  768. // CHECK:STDOUT: }
  769. // CHECK:STDOUT: }
  770. // CHECK:STDOUT:
  771. // CHECK:STDOUT: interface @J {
  772. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  773. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  774. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.d5c]
  775. // CHECK:STDOUT: }
  776. // CHECK:STDOUT: %J.F.decl: %J.F.type = fn_decl @J.F [concrete = constants.%J.F] {
  777. // CHECK:STDOUT: %u.patt: @J.F.%pattern_type (%pattern_type.c1a) = value_binding_pattern u [concrete]
  778. // CHECK:STDOUT: %u.param_patt: @J.F.%pattern_type (%pattern_type.c1a) = value_param_pattern %u.patt, call_param0 [concrete]
  779. // CHECK:STDOUT: %return.patt: @J.F.%pattern_type (%pattern_type.c1a) = return_slot_pattern [concrete]
  780. // CHECK:STDOUT: %return.param_patt: @J.F.%pattern_type (%pattern_type.c1a) = out_param_pattern %return.patt, call_param1 [concrete]
  781. // CHECK:STDOUT: } {
  782. // 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)]
  783. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  784. // CHECK:STDOUT: %.loc5_17.2: form = init_form %U.ref.loc5_17, call_param1 [symbolic = %.loc5_17.1 (constants.%.eaf)]
  785. // CHECK:STDOUT: %u.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_param call_param0
  786. // CHECK:STDOUT: %.loc5_11: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)] {
  787. // 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)]
  788. // 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)]
  789. // CHECK:STDOUT: }
  790. // CHECK:STDOUT: %u: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_binding u, %u.param
  791. // CHECK:STDOUT: %return.param: ref @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = out_param call_param1
  792. // CHECK:STDOUT: %return: ref @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = return_slot %return.param
  793. // CHECK:STDOUT: }
  794. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.F.decl [concrete = constants.%assoc1.a57]
  795. // CHECK:STDOUT:
  796. // CHECK:STDOUT: !members:
  797. // CHECK:STDOUT: .Self = %Self
  798. // CHECK:STDOUT: .U = @U.%assoc0
  799. // CHECK:STDOUT: .F = %assoc1
  800. // CHECK:STDOUT: witness = (%U, %J.F.decl)
  801. // CHECK:STDOUT:
  802. // CHECK:STDOUT: !requires:
  803. // CHECK:STDOUT: }
  804. // CHECK:STDOUT:
  805. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  806. // CHECK:STDOUT: assoc_const U:! type;
  807. // CHECK:STDOUT: }
  808. // CHECK:STDOUT:
  809. // CHECK:STDOUT: impl @D.as.J.impl: %D.ref as %.loc10_13 {
  810. // 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] {
  811. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = value_binding_pattern u [concrete]
  812. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern %u.patt, call_param0 [concrete]
  813. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  814. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  815. // CHECK:STDOUT: } {
  816. // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  817. // CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  818. // CHECK:STDOUT: %.loc11_19: form = init_form %i32.loc11_19, call_param1 [concrete = constants.%.4d5]
  819. // CHECK:STDOUT: %u.param: %i32 = value_param call_param0
  820. // CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [concrete = constants.%i32] {
  821. // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  822. // CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param
  825. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  826. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  827. // CHECK:STDOUT: }
  828. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %D.as.J.impl.F.decl), @D.as.J.impl [concrete]
  829. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  830. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  831. // CHECK:STDOUT:
  832. // CHECK:STDOUT: !members:
  833. // CHECK:STDOUT: .F = %D.as.J.impl.F.decl
  834. // CHECK:STDOUT: witness = %J.impl_witness
  835. // CHECK:STDOUT: }
  836. // CHECK:STDOUT:
  837. // CHECK:STDOUT: class @D {
  838. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  839. // CHECK:STDOUT: complete_type_witness = %complete_type
  840. // CHECK:STDOUT:
  841. // CHECK:STDOUT: !members:
  842. // CHECK:STDOUT: .Self = constants.%D
  843. // CHECK:STDOUT: }
  844. // CHECK:STDOUT:
  845. // CHECK:STDOUT: generic fn @J.F(@J.%Self: %J.type) {
  846. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  847. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  848. // 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)]
  849. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.c1a)]
  850. // CHECK:STDOUT: %.loc5_17.1: form = init_form %impl.elem0.loc5_11.1, call_param1 [symbolic = %.loc5_17.1 (constants.%.eaf)]
  851. // CHECK:STDOUT:
  852. // CHECK:STDOUT: fn(%u.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335)) -> out %return.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335);
  853. // CHECK:STDOUT: }
  854. // CHECK:STDOUT:
  855. // CHECK:STDOUT: fn @D.as.J.impl.F(%u.param: %i32) -> out %return.param: %i32 {
  856. // CHECK:STDOUT: !entry:
  857. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
  858. // CHECK:STDOUT: %impl.elem1: %.dd4 = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f]
  859. // CHECK:STDOUT: %bound_method.loc11_32.1: <bound method> = bound_method %u.ref, %impl.elem1
  860. // 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]
  861. // CHECK:STDOUT: %bound_method.loc11_32.2: <bound method> = bound_method %u.ref, %specific_fn
  862. // CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc11_32.2(%u.ref)
  863. // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call
  864. // CHECK:STDOUT: }
  865. // CHECK:STDOUT:
  866. // CHECK:STDOUT: fn @CallFunction() -> out %return.param: %i32 {
  867. // CHECK:STDOUT: !entry:
  868. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  869. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  870. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.a57]
  871. // CHECK:STDOUT: %J.facet: %J.type = facet_value %D.ref, (constants.%J.impl_witness) [concrete = constants.%J.facet]
  872. // CHECK:STDOUT: %.loc15_11: %J.type = converted %D.ref, %J.facet [concrete = constants.%J.facet]
  873. // CHECK:STDOUT: %impl.elem1: %.0e5 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%D.as.J.impl.F]
  874. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  875. // CHECK:STDOUT: %impl.elem0: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  876. // CHECK:STDOUT: %bound_method.loc15_18.1: <bound method> = bound_method %int_4, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  877. // 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]
  878. // CHECK:STDOUT: %bound_method.loc15_18.2: <bound method> = bound_method %int_4, %specific_fn [concrete = constants.%bound_method]
  879. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc15_18.2(%int_4) [concrete = constants.%int_4.940]
  880. // CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_4.940]
  881. // CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_4, %.loc15_18.1 [concrete = constants.%int_4.940]
  882. // CHECK:STDOUT: %D.as.J.impl.F.call: init %i32 = call %impl.elem1(%.loc15_18.2)
  883. // CHECK:STDOUT: return %D.as.J.impl.F.call
  884. // CHECK:STDOUT: }
  885. // CHECK:STDOUT:
  886. // CHECK:STDOUT: specific @U(constants.%Self.8a1) {}
  887. // CHECK:STDOUT:
  888. // CHECK:STDOUT: specific @J.F(constants.%Self.8a1) {
  889. // CHECK:STDOUT: %Self => constants.%Self.8a1
  890. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  891. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.335
  892. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c1a
  893. // CHECK:STDOUT: %.loc5_17.1 => constants.%.eaf
  894. // CHECK:STDOUT: }
  895. // CHECK:STDOUT:
  896. // CHECK:STDOUT: specific @U(constants.%.Self.2fa) {}
  897. // CHECK:STDOUT:
  898. // CHECK:STDOUT: specific @J.F(constants.%J.facet) {
  899. // CHECK:STDOUT: %Self => constants.%J.facet
  900. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  901. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  902. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  903. // CHECK:STDOUT: %.loc5_17.1 => constants.%.4d5
  904. // CHECK:STDOUT: }
  905. // CHECK:STDOUT:
  906. // CHECK:STDOUT: --- extend_impl_with_associated_type_in_signature.carbon
  907. // CHECK:STDOUT:
  908. // CHECK:STDOUT: constants {
  909. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  910. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  911. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  912. // CHECK:STDOUT: %assoc0.d5c: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  913. // CHECK:STDOUT: %Self.binding.as_type.ed8: type = symbolic_binding_type Self, 0, %Self.8a1 [symbolic]
  914. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  915. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  916. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  917. // CHECK:STDOUT: %.eaf: form = init_form %impl.elem0.335, call_param1 [symbolic]
  918. // CHECK:STDOUT: %J.F.type: type = fn_type @J.F [concrete]
  919. // CHECK:STDOUT: %J.F: %J.F.type = struct_value () [concrete]
  920. // CHECK:STDOUT: %assoc1.a57: %J.assoc_type = assoc_entity element1, @J.%J.F.decl [concrete]
  921. // CHECK:STDOUT: %pattern_type.832: type = pattern_type %Self.binding.as_type.ed8 [symbolic]
  922. // CHECK:STDOUT: %.f80: form = init_form %impl.elem0.335, call_param2 [symbolic]
  923. // CHECK:STDOUT: %J.G.type: type = fn_type @J.G [concrete]
  924. // CHECK:STDOUT: %J.G: %J.G.type = struct_value () [concrete]
  925. // CHECK:STDOUT: %assoc2: %J.assoc_type = assoc_entity element2, @J.%J.G.decl [concrete]
  926. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  927. // CHECK:STDOUT: %.Self.2fa: %J.type = symbolic_binding .Self [symbolic_self]
  928. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.2fa [symbolic_self]
  929. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self.2fa, @J [symbolic_self]
  930. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  931. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  932. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  933. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  934. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  935. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  936. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  937. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  938. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  939. // CHECK:STDOUT: %.4d5: form = init_form %i32, call_param1 [concrete]
  940. // CHECK:STDOUT: %E.as.J.impl.F.type: type = fn_type @E.as.J.impl.F [concrete]
  941. // CHECK:STDOUT: %E.as.J.impl.F: %E.as.J.impl.F.type = struct_value () [concrete]
  942. // CHECK:STDOUT: %pattern_type.99f: type = pattern_type %E [concrete]
  943. // CHECK:STDOUT: %.88a: form = init_form %i32, call_param2 [concrete]
  944. // CHECK:STDOUT: %E.as.J.impl.G.type: type = fn_type @E.as.J.impl.G [concrete]
  945. // CHECK:STDOUT: %E.as.J.impl.G: %E.as.J.impl.G.type = struct_value () [concrete]
  946. // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  947. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  948. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  949. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  950. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
  951. // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
  952. // CHECK:STDOUT: %Negate.Op.type: type = fn_type @Negate.Op [concrete]
  953. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.5e6: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%N) [symbolic]
  954. // CHECK:STDOUT: %Int.as.Negate.impl.Op.7f5: %Int.as.Negate.impl.Op.type.5e6 = struct_value () [symbolic]
  955. // CHECK:STDOUT: %Negate.impl_witness.11c: <witness> = impl_witness imports.%Negate.impl_witness_table, @Int.as.Negate.impl(%int_32) [concrete]
  956. // CHECK:STDOUT: %Int.as.Negate.impl.Op.type.e60: type = fn_type @Int.as.Negate.impl.Op, @Int.as.Negate.impl(%int_32) [concrete]
  957. // CHECK:STDOUT: %Int.as.Negate.impl.Op.e7f: %Int.as.Negate.impl.Op.type.e60 = struct_value () [concrete]
  958. // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %i32, (%Negate.impl_witness.11c) [concrete]
  959. // CHECK:STDOUT: %.dd4: type = fn_type_with_self_type %Negate.Op.type, %Negate.facet [concrete]
  960. // 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]
  961. // CHECK:STDOUT: %CallBoth.type: type = fn_type @CallBoth [concrete]
  962. // CHECK:STDOUT: %CallBoth: %CallBoth.type = struct_value () [concrete]
  963. // CHECK:STDOUT: %.013: type = fn_type_with_self_type %J.F.type, %J.facet [concrete]
  964. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  965. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  966. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  967. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  968. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  969. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  970. // 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]
  971. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  972. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  973. // 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]
  974. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  975. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  976. // CHECK:STDOUT: %.863: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  977. // 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]
  978. // 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]
  979. // CHECK:STDOUT: %bound_method.646: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  980. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  981. // CHECK:STDOUT: %.35c: type = fn_type_with_self_type %J.G.type, %J.facet [concrete]
  982. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  983. // 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]
  984. // CHECK:STDOUT: %bound_method.fa7: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  985. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  986. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
  987. // 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]
  988. // CHECK:STDOUT: %bound_method.6d7: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  989. // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
  990. // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
  991. // 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]
  992. // CHECK:STDOUT: %bound_method.e9d: <bound method> = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  993. // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete]
  994. // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete]
  995. // 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]
  996. // CHECK:STDOUT: %bound_method.bc2: <bound method> = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  997. // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete]
  998. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  999. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  1000. // CHECK:STDOUT: %T: %J.type = symbolic_binding T, 0 [symbolic]
  1001. // CHECK:STDOUT: %pattern_type.f76: type = pattern_type %J.type [concrete]
  1002. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic]
  1003. // CHECK:STDOUT: %pattern_type.14f: type = pattern_type %T.binding.as_type [symbolic]
  1004. // CHECK:STDOUT: %J.lookup_impl_witness.264: <witness> = lookup_impl_witness %T, @J [symbolic]
  1005. // CHECK:STDOUT: %impl.elem0.560: type = impl_witness_access %J.lookup_impl_witness.264, element0 [symbolic]
  1006. // CHECK:STDOUT: %pattern_type.ad6: type = pattern_type %impl.elem0.560 [symbolic]
  1007. // CHECK:STDOUT: %.722: form = init_form %impl.elem0.560, call_param2 [symbolic]
  1008. // CHECK:STDOUT: %GenericCallF.type: type = fn_type @GenericCallF [concrete]
  1009. // CHECK:STDOUT: %GenericCallF: %GenericCallF.type = struct_value () [concrete]
  1010. // CHECK:STDOUT: %require_complete.06a: <witness> = require_complete_type %impl.elem0.560 [symbolic]
  1011. // CHECK:STDOUT: %require_complete.19a: <witness> = require_complete_type %T.binding.as_type [symbolic]
  1012. // CHECK:STDOUT: %.322: type = fn_type_with_self_type %J.F.type, %T [symbolic]
  1013. // CHECK:STDOUT: %impl.elem1: %.322 = impl_witness_access %J.lookup_impl_witness.264, element1 [symbolic]
  1014. // CHECK:STDOUT: %.873: form = init_form %impl.elem0.560, call_param1 [symbolic]
  1015. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem1, @J.F(%T) [symbolic]
  1016. // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete]
  1017. // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete]
  1018. // CHECK:STDOUT: %GenericCallF.specific_fn: <specific function> = specific_function %GenericCallF, @GenericCallF(%J.facet) [concrete]
  1019. // CHECK:STDOUT: }
  1020. // CHECK:STDOUT:
  1021. // CHECK:STDOUT: imports {
  1022. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1023. // CHECK:STDOUT: .Int = %Core.Int
  1024. // CHECK:STDOUT: .Negate = %Core.Negate
  1025. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1026. // CHECK:STDOUT: import Core//prelude
  1027. // CHECK:STDOUT: import Core//prelude/...
  1028. // CHECK:STDOUT: }
  1029. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1030. // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type]
  1031. // CHECK:STDOUT: %Core.import_ref.475 = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, unloaded
  1032. // 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)]
  1033. // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.475, %Core.import_ref.d40), @Int.as.Negate.impl [concrete]
  1034. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1035. // 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)]
  1036. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  1037. // CHECK:STDOUT: }
  1038. // CHECK:STDOUT:
  1039. // CHECK:STDOUT: file {
  1040. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1041. // CHECK:STDOUT: .Core = imports.%Core
  1042. // CHECK:STDOUT: .J = %J.decl
  1043. // CHECK:STDOUT: .E = %E.decl
  1044. // CHECK:STDOUT: .CallBoth = %CallBoth.decl
  1045. // CHECK:STDOUT: .GenericCallF = %GenericCallF.decl
  1046. // CHECK:STDOUT: .CallGeneric = %CallGeneric.decl
  1047. // CHECK:STDOUT: }
  1048. // CHECK:STDOUT: %Core.import = import Core
  1049. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1050. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  1051. // CHECK:STDOUT: %CallBoth.decl: %CallBoth.type = fn_decl @CallBoth [concrete = constants.%CallBoth] {
  1052. // CHECK:STDOUT: %e.patt: %pattern_type.99f = value_binding_pattern e [concrete]
  1053. // CHECK:STDOUT: %e.param_patt: %pattern_type.99f = value_param_pattern %e.patt, call_param0 [concrete]
  1054. // CHECK:STDOUT: } {
  1055. // CHECK:STDOUT: %e.param: %E = value_param call_param0
  1056. // CHECK:STDOUT: %E.ref.loc20: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1057. // CHECK:STDOUT: %e: %E = value_binding e, %e.param
  1058. // CHECK:STDOUT: }
  1059. // CHECK:STDOUT: %GenericCallF.decl: %GenericCallF.type = fn_decl @GenericCallF [concrete = constants.%GenericCallF] {
  1060. // CHECK:STDOUT: %T.patt: %pattern_type.f76 = symbolic_binding_pattern T, 0 [concrete]
  1061. // CHECK:STDOUT: %t.patt: @GenericCallF.%pattern_type.loc28_24 (%pattern_type.14f) = value_binding_pattern t [concrete]
  1062. // CHECK:STDOUT: %t.param_patt: @GenericCallF.%pattern_type.loc28_24 (%pattern_type.14f) = value_param_pattern %t.patt, call_param0 [concrete]
  1063. // CHECK:STDOUT: %u.patt: @GenericCallF.%pattern_type.loc28_30 (%pattern_type.ad6) = value_binding_pattern u [concrete]
  1064. // CHECK:STDOUT: %u.param_patt: @GenericCallF.%pattern_type.loc28_30 (%pattern_type.ad6) = value_param_pattern %u.patt, call_param1 [concrete]
  1065. // CHECK:STDOUT: %return.patt: @GenericCallF.%pattern_type.loc28_30 (%pattern_type.ad6) = return_slot_pattern [concrete]
  1066. // CHECK:STDOUT: %return.param_patt: @GenericCallF.%pattern_type.loc28_30 (%pattern_type.ad6) = out_param_pattern %return.patt, call_param2 [concrete]
  1067. // CHECK:STDOUT: } {
  1068. // CHECK:STDOUT: %T.ref.loc28_41: %J.type = name_ref T, %T.loc28_17.2 [symbolic = %T.loc28_17.1 (constants.%T)]
  1069. // CHECK:STDOUT: %T.as_type.loc28_42: type = facet_access_type %T.ref.loc28_41 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1070. // CHECK:STDOUT: %.loc28_42.3: type = converted %T.ref.loc28_41, %T.as_type.loc28_42 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1071. // CHECK:STDOUT: %U.ref.loc28_42: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  1072. // 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)]
  1073. // CHECK:STDOUT: %.loc28_42.4: form = init_form %impl.elem0.loc28_42, call_param2 [symbolic = %.loc28_42.2 (constants.%.722)]
  1074. // CHECK:STDOUT: %.loc28_21: type = splice_block %J.ref [concrete = constants.%J.type] {
  1075. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  1076. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1077. // CHECK:STDOUT: }
  1078. // CHECK:STDOUT: %T.loc28_17.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc28_17.1 (constants.%T)]
  1079. // CHECK:STDOUT: %t.param: @GenericCallF.%T.binding.as_type (%T.binding.as_type) = value_param call_param0
  1080. // CHECK:STDOUT: %.loc28_27.1: type = splice_block %.loc28_27.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
  1081. // CHECK:STDOUT: %T.ref.loc28_27: %J.type = name_ref T, %T.loc28_17.2 [symbolic = %T.loc28_17.1 (constants.%T)]
  1082. // CHECK:STDOUT: %T.as_type.loc28_27: type = facet_access_type %T.ref.loc28_27 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1083. // CHECK:STDOUT: %.loc28_27.2: type = converted %T.ref.loc28_27, %T.as_type.loc28_27 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1084. // CHECK:STDOUT: }
  1085. // CHECK:STDOUT: %t: @GenericCallF.%T.binding.as_type (%T.binding.as_type) = value_binding t, %t.param
  1086. // CHECK:STDOUT: %u.param: @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = value_param call_param1
  1087. // CHECK:STDOUT: %.loc28_34.1: type = splice_block %impl.elem0.loc28_34.2 [symbolic = %impl.elem0.loc28_34.1 (constants.%impl.elem0.560)] {
  1088. // CHECK:STDOUT: %T.ref.loc28_33: %J.type = name_ref T, %T.loc28_17.2 [symbolic = %T.loc28_17.1 (constants.%T)]
  1089. // CHECK:STDOUT: %T.as_type.loc28_34: type = facet_access_type %T.ref.loc28_33 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1090. // CHECK:STDOUT: %.loc28_34.2: type = converted %T.ref.loc28_33, %T.as_type.loc28_34 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1091. // CHECK:STDOUT: %U.ref.loc28_34: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  1092. // 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)]
  1093. // CHECK:STDOUT: }
  1094. // CHECK:STDOUT: %u: @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = value_binding u, %u.param
  1095. // CHECK:STDOUT: %return.param: ref @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = out_param call_param2
  1096. // CHECK:STDOUT: %return: ref @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = return_slot %return.param
  1097. // CHECK:STDOUT: }
  1098. // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] {
  1099. // CHECK:STDOUT: %e.patt: %pattern_type.99f = value_binding_pattern e [concrete]
  1100. // CHECK:STDOUT: %e.param_patt: %pattern_type.99f = value_param_pattern %e.patt, call_param0 [concrete]
  1101. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1102. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1103. // CHECK:STDOUT: } {
  1104. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1105. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1106. // CHECK:STDOUT: %.loc32: form = init_form %i32, call_param1 [concrete = constants.%.4d5]
  1107. // CHECK:STDOUT: %e.param: %E = value_param call_param0
  1108. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1109. // CHECK:STDOUT: %e: %E = value_binding e, %e.param
  1110. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1111. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1112. // CHECK:STDOUT: }
  1113. // CHECK:STDOUT: }
  1114. // CHECK:STDOUT:
  1115. // CHECK:STDOUT: interface @J {
  1116. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  1117. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1118. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.d5c]
  1119. // CHECK:STDOUT: }
  1120. // CHECK:STDOUT: %J.F.decl: %J.F.type = fn_decl @J.F [concrete = constants.%J.F] {
  1121. // CHECK:STDOUT: %u.patt: @J.F.%pattern_type (%pattern_type.c1a) = value_binding_pattern u [concrete]
  1122. // CHECK:STDOUT: %u.param_patt: @J.F.%pattern_type (%pattern_type.c1a) = value_param_pattern %u.patt, call_param0 [concrete]
  1123. // CHECK:STDOUT: %return.patt: @J.F.%pattern_type (%pattern_type.c1a) = return_slot_pattern [concrete]
  1124. // CHECK:STDOUT: %return.param_patt: @J.F.%pattern_type (%pattern_type.c1a) = out_param_pattern %return.patt, call_param1 [concrete]
  1125. // CHECK:STDOUT: } {
  1126. // 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)]
  1127. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  1128. // CHECK:STDOUT: %.loc5_17.2: form = init_form %U.ref.loc5_17, call_param1 [symbolic = %.loc5_17.1 (constants.%.eaf)]
  1129. // CHECK:STDOUT: %u.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_param call_param0
  1130. // CHECK:STDOUT: %.loc5_11: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)] {
  1131. // 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)]
  1132. // 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)]
  1133. // CHECK:STDOUT: }
  1134. // CHECK:STDOUT: %u: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_binding u, %u.param
  1135. // CHECK:STDOUT: %return.param: ref @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = out_param call_param1
  1136. // CHECK:STDOUT: %return: ref @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = return_slot %return.param
  1137. // CHECK:STDOUT: }
  1138. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.F.decl [concrete = constants.%assoc1.a57]
  1139. // CHECK:STDOUT: %J.G.decl: %J.G.type = fn_decl @J.G [concrete = constants.%J.G] {
  1140. // CHECK:STDOUT: %self.patt: @J.G.%pattern_type.loc6_8 (%pattern_type.832) = value_binding_pattern self [concrete]
  1141. // CHECK:STDOUT: %self.param_patt: @J.G.%pattern_type.loc6_8 (%pattern_type.832) = value_param_pattern %self.patt, call_param0 [concrete]
  1142. // CHECK:STDOUT: %v.patt: @J.G.%pattern_type.loc6_20 (%pattern_type.c1a) = value_binding_pattern v [concrete]
  1143. // CHECK:STDOUT: %v.param_patt: @J.G.%pattern_type.loc6_20 (%pattern_type.c1a) = value_param_pattern %v.patt, call_param1 [concrete]
  1144. // CHECK:STDOUT: %return.patt: @J.G.%pattern_type.loc6_20 (%pattern_type.c1a) = return_slot_pattern [concrete]
  1145. // CHECK:STDOUT: %return.param_patt: @J.G.%pattern_type.loc6_20 (%pattern_type.c1a) = out_param_pattern %return.patt, call_param2 [concrete]
  1146. // CHECK:STDOUT: } {
  1147. // 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)]
  1148. // CHECK:STDOUT: %U.ref.loc6_29: type = name_ref U, %impl.elem0.loc6_29 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.335)]
  1149. // CHECK:STDOUT: %.loc6_29.2: form = init_form %U.ref.loc6_29, call_param2 [symbolic = %.loc6_29.1 (constants.%.f80)]
  1150. // CHECK:STDOUT: %self.param: @J.G.%Self.binding.as_type (%Self.binding.as_type.ed8) = value_param call_param0
  1151. // CHECK:STDOUT: %.loc6_14.1: type = splice_block %.loc6_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.ed8)] {
  1152. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self.8a1)]
  1153. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.ed8)]
  1154. // CHECK:STDOUT: %.loc6_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.ed8)]
  1155. // CHECK:STDOUT: }
  1156. // CHECK:STDOUT: %self: @J.G.%Self.binding.as_type (%Self.binding.as_type.ed8) = value_binding self, %self.param
  1157. // CHECK:STDOUT: %v.param: @J.G.%impl.elem0.loc6_23.1 (%impl.elem0.335) = value_param call_param1
  1158. // CHECK:STDOUT: %.loc6_23: type = splice_block %U.ref.loc6_23 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.335)] {
  1159. // 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)]
  1160. // 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)]
  1161. // CHECK:STDOUT: }
  1162. // CHECK:STDOUT: %v: @J.G.%impl.elem0.loc6_23.1 (%impl.elem0.335) = value_binding v, %v.param
  1163. // CHECK:STDOUT: %return.param: ref @J.G.%impl.elem0.loc6_23.1 (%impl.elem0.335) = out_param call_param2
  1164. // CHECK:STDOUT: %return: ref @J.G.%impl.elem0.loc6_23.1 (%impl.elem0.335) = return_slot %return.param
  1165. // CHECK:STDOUT: }
  1166. // CHECK:STDOUT: %assoc2: %J.assoc_type = assoc_entity element2, %J.G.decl [concrete = constants.%assoc2]
  1167. // CHECK:STDOUT:
  1168. // CHECK:STDOUT: !members:
  1169. // CHECK:STDOUT: .Self = %Self
  1170. // CHECK:STDOUT: .U = @U.%assoc0
  1171. // CHECK:STDOUT: .F = %assoc1
  1172. // CHECK:STDOUT: .G = %assoc2
  1173. // CHECK:STDOUT: witness = (%U, %J.F.decl, %J.G.decl)
  1174. // CHECK:STDOUT:
  1175. // CHECK:STDOUT: !requires:
  1176. // CHECK:STDOUT: }
  1177. // CHECK:STDOUT:
  1178. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  1179. // CHECK:STDOUT: assoc_const U:! type;
  1180. // CHECK:STDOUT: }
  1181. // CHECK:STDOUT:
  1182. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %.loc10_20 {
  1183. // 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] {
  1184. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = value_binding_pattern u [concrete]
  1185. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern %u.patt, call_param0 [concrete]
  1186. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1187. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1188. // CHECK:STDOUT: } {
  1189. // CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1190. // CHECK:STDOUT: %i32.loc11_21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1191. // CHECK:STDOUT: %.loc11_21: form = init_form %i32.loc11_21, call_param1 [concrete = constants.%.4d5]
  1192. // CHECK:STDOUT: %u.param: %i32 = value_param call_param0
  1193. // CHECK:STDOUT: %.loc11_13: type = splice_block %i32.loc11_13 [concrete = constants.%i32] {
  1194. // CHECK:STDOUT: %int_32.loc11_13: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1195. // CHECK:STDOUT: %i32.loc11_13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1196. // CHECK:STDOUT: }
  1197. // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param
  1198. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1199. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1200. // CHECK:STDOUT: }
  1201. // 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] {
  1202. // CHECK:STDOUT: %self.patt: %pattern_type.99f = value_binding_pattern self [concrete]
  1203. // CHECK:STDOUT: %self.param_patt: %pattern_type.99f = value_param_pattern %self.patt, call_param0 [concrete]
  1204. // CHECK:STDOUT: %v.patt: %pattern_type.7ce = value_binding_pattern v [concrete]
  1205. // CHECK:STDOUT: %v.param_patt: %pattern_type.7ce = value_param_pattern %v.patt, call_param1 [concrete]
  1206. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1207. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete]
  1208. // CHECK:STDOUT: } {
  1209. // CHECK:STDOUT: %int_32.loc14_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1210. // CHECK:STDOUT: %i32.loc14_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1211. // CHECK:STDOUT: %.loc14_33: form = init_form %i32.loc14_33, call_param2 [concrete = constants.%.88a]
  1212. // CHECK:STDOUT: %self.param: %E = value_param call_param0
  1213. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  1214. // CHECK:STDOUT: %self: %E = value_binding self, %self.param
  1215. // CHECK:STDOUT: %v.param: %i32 = value_param call_param1
  1216. // CHECK:STDOUT: %.loc14_25: type = splice_block %i32.loc14_25 [concrete = constants.%i32] {
  1217. // CHECK:STDOUT: %int_32.loc14_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1218. // CHECK:STDOUT: %i32.loc14_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1219. // CHECK:STDOUT: }
  1220. // CHECK:STDOUT: %v: %i32 = value_binding v, %v.param
  1221. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
  1222. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1223. // CHECK:STDOUT: }
  1224. // 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]
  1225. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  1226. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  1227. // CHECK:STDOUT:
  1228. // CHECK:STDOUT: !members:
  1229. // CHECK:STDOUT: .F = %E.as.J.impl.F.decl
  1230. // CHECK:STDOUT: .G = %E.as.J.impl.G.decl
  1231. // CHECK:STDOUT: witness = %J.impl_witness
  1232. // CHECK:STDOUT: }
  1233. // CHECK:STDOUT:
  1234. // CHECK:STDOUT: class @E {
  1235. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  1236. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  1237. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1238. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  1239. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.2fa]
  1240. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  1241. // CHECK:STDOUT: %.loc10_26: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  1242. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  1243. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  1244. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1245. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1246. // CHECK:STDOUT: %.loc10_20: type = where_expr %.Self [concrete = constants.%J_where.type] {
  1247. // CHECK:STDOUT: requirement_base_facet_type constants.%J.type
  1248. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  1249. // CHECK:STDOUT: }
  1250. // CHECK:STDOUT: }
  1251. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1252. // CHECK:STDOUT: complete_type_witness = %complete_type
  1253. // CHECK:STDOUT:
  1254. // CHECK:STDOUT: !members:
  1255. // CHECK:STDOUT: .Self = constants.%E
  1256. // CHECK:STDOUT: .J = <poisoned>
  1257. // CHECK:STDOUT: .F = <poisoned>
  1258. // CHECK:STDOUT: .G = <poisoned>
  1259. // CHECK:STDOUT: extend @E.as.J.impl.%.loc10_20
  1260. // CHECK:STDOUT: }
  1261. // CHECK:STDOUT:
  1262. // CHECK:STDOUT: generic fn @J.F(@J.%Self: %J.type) {
  1263. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  1264. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  1265. // 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)]
  1266. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.c1a)]
  1267. // CHECK:STDOUT: %.loc5_17.1: form = init_form %impl.elem0.loc5_11.1, call_param1 [symbolic = %.loc5_17.1 (constants.%.eaf)]
  1268. // CHECK:STDOUT:
  1269. // CHECK:STDOUT: fn(%u.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335)) -> out %return.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335);
  1270. // CHECK:STDOUT: }
  1271. // CHECK:STDOUT:
  1272. // CHECK:STDOUT: generic fn @J.G(@J.%Self: %J.type) {
  1273. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  1274. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.ed8)]
  1275. // CHECK:STDOUT: %pattern_type.loc6_8: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.loc6_8 (constants.%pattern_type.832)]
  1276. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  1277. // 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)]
  1278. // CHECK:STDOUT: %pattern_type.loc6_20: type = pattern_type %impl.elem0.loc6_23.1 [symbolic = %pattern_type.loc6_20 (constants.%pattern_type.c1a)]
  1279. // CHECK:STDOUT: %.loc6_29.1: form = init_form %impl.elem0.loc6_23.1, call_param2 [symbolic = %.loc6_29.1 (constants.%.f80)]
  1280. // CHECK:STDOUT:
  1281. // CHECK:STDOUT: fn(%self.param: @J.G.%Self.binding.as_type (%Self.binding.as_type.ed8), %v.param: @J.G.%impl.elem0.loc6_23.1 (%impl.elem0.335)) -> out %return.param: @J.G.%impl.elem0.loc6_23.1 (%impl.elem0.335);
  1282. // CHECK:STDOUT: }
  1283. // CHECK:STDOUT:
  1284. // CHECK:STDOUT: fn @E.as.J.impl.F(%u.param: %i32) -> out %return.param: %i32 {
  1285. // CHECK:STDOUT: !entry:
  1286. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
  1287. // CHECK:STDOUT: %impl.elem1: %.dd4 = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f]
  1288. // CHECK:STDOUT: %bound_method.loc12_14.1: <bound method> = bound_method %u.ref, %impl.elem1
  1289. // 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]
  1290. // CHECK:STDOUT: %bound_method.loc12_14.2: <bound method> = bound_method %u.ref, %specific_fn
  1291. // CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc12_14.2(%u.ref)
  1292. // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call
  1293. // CHECK:STDOUT: }
  1294. // CHECK:STDOUT:
  1295. // CHECK:STDOUT: fn @E.as.J.impl.G(%self.param: %E, %v.param: %i32) -> out %return.param: %i32 {
  1296. // CHECK:STDOUT: !entry:
  1297. // CHECK:STDOUT: %v.ref: %i32 = name_ref v, %v
  1298. // CHECK:STDOUT: %impl.elem1: %.dd4 = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f]
  1299. // CHECK:STDOUT: %bound_method.loc15_14.1: <bound method> = bound_method %v.ref, %impl.elem1
  1300. // 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]
  1301. // CHECK:STDOUT: %bound_method.loc15_14.2: <bound method> = bound_method %v.ref, %specific_fn
  1302. // CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc15_14.2(%v.ref)
  1303. // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call
  1304. // CHECK:STDOUT: }
  1305. // CHECK:STDOUT:
  1306. // CHECK:STDOUT: fn @CallBoth(%e.param: %E) {
  1307. // CHECK:STDOUT: !entry:
  1308. // CHECK:STDOUT: name_binding_decl {
  1309. // CHECK:STDOUT: %e1.patt: %pattern_type.7ce = value_binding_pattern e1 [concrete]
  1310. // CHECK:STDOUT: }
  1311. // CHECK:STDOUT: %e.ref.loc21: %E = name_ref e, %e
  1312. // CHECK:STDOUT: %F.ref.loc21: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.a57]
  1313. // CHECK:STDOUT: %impl.elem1.loc21: %.013 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%E.as.J.impl.F]
  1314. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  1315. // CHECK:STDOUT: %impl.elem0.loc21: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1316. // CHECK:STDOUT: %bound_method.loc21_21.1: <bound method> = bound_method %int_2, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  1317. // 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]
  1318. // CHECK:STDOUT: %bound_method.loc21_21.2: <bound method> = bound_method %int_2, %specific_fn.loc21 [concrete = constants.%bound_method.646]
  1319. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_21.2(%int_2) [concrete = constants.%int_2.ef8]
  1320. // CHECK:STDOUT: %.loc21_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_2.ef8]
  1321. // CHECK:STDOUT: %.loc21_21.2: %i32 = converted %int_2, %.loc21_21.1 [concrete = constants.%int_2.ef8]
  1322. // CHECK:STDOUT: %E.as.J.impl.F.call.loc21: init %i32 = call %impl.elem1.loc21(%.loc21_21.2)
  1323. // CHECK:STDOUT: %.loc21_11: type = splice_block %i32.loc21 [concrete = constants.%i32] {
  1324. // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1325. // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1326. // CHECK:STDOUT: }
  1327. // CHECK:STDOUT: %.loc21_22.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc21
  1328. // CHECK:STDOUT: %.loc21_22.2: %i32 = converted %E.as.J.impl.F.call.loc21, %.loc21_22.1
  1329. // CHECK:STDOUT: %e1: %i32 = value_binding e1, %.loc21_22.2
  1330. // CHECK:STDOUT: name_binding_decl {
  1331. // CHECK:STDOUT: %e2.patt: %pattern_type.7ce = value_binding_pattern e2 [concrete]
  1332. // CHECK:STDOUT: }
  1333. // CHECK:STDOUT: %e.ref.loc22: %E = name_ref e, %e
  1334. // CHECK:STDOUT: %G.ref.loc22: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2]
  1335. // CHECK:STDOUT: %impl.elem2.loc22: %.35c = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G]
  1336. // CHECK:STDOUT: %bound_method.loc22_18: <bound method> = bound_method %e.ref.loc22, %impl.elem2.loc22
  1337. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  1338. // CHECK:STDOUT: %impl.elem0.loc22: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1339. // CHECK:STDOUT: %bound_method.loc22_21.1: <bound method> = bound_method %int_3, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
  1340. // 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]
  1341. // CHECK:STDOUT: %bound_method.loc22_21.2: <bound method> = bound_method %int_3, %specific_fn.loc22 [concrete = constants.%bound_method.fa7]
  1342. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_21.2(%int_3) [concrete = constants.%int_3.822]
  1343. // CHECK:STDOUT: %.loc22_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822]
  1344. // CHECK:STDOUT: %.loc22_21.2: %i32 = converted %int_3, %.loc22_21.1 [concrete = constants.%int_3.822]
  1345. // CHECK:STDOUT: %E.as.J.impl.G.call.loc22: init %i32 = call %bound_method.loc22_18(%e.ref.loc22, %.loc22_21.2)
  1346. // CHECK:STDOUT: %.loc22_11: type = splice_block %i32.loc22 [concrete = constants.%i32] {
  1347. // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1348. // CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1349. // CHECK:STDOUT: }
  1350. // CHECK:STDOUT: %.loc22_22.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc22
  1351. // CHECK:STDOUT: %.loc22_22.2: %i32 = converted %E.as.J.impl.G.call.loc22, %.loc22_22.1
  1352. // CHECK:STDOUT: %e2: %i32 = value_binding e2, %.loc22_22.2
  1353. // CHECK:STDOUT: name_binding_decl {
  1354. // CHECK:STDOUT: %e3.patt: %pattern_type.7ce = value_binding_pattern e3 [concrete]
  1355. // CHECK:STDOUT: }
  1356. // CHECK:STDOUT: %E.ref.loc23: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1357. // CHECK:STDOUT: %F.ref.loc23: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.a57]
  1358. // CHECK:STDOUT: %impl.elem1.loc23: %.013 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%E.as.J.impl.F]
  1359. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  1360. // CHECK:STDOUT: %impl.elem0.loc23: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1361. // CHECK:STDOUT: %bound_method.loc23_21.1: <bound method> = bound_method %int_4, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c]
  1362. // 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]
  1363. // CHECK:STDOUT: %bound_method.loc23_21.2: <bound method> = bound_method %int_4, %specific_fn.loc23 [concrete = constants.%bound_method.6d7]
  1364. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_21.2(%int_4) [concrete = constants.%int_4.940]
  1365. // CHECK:STDOUT: %.loc23_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_4.940]
  1366. // CHECK:STDOUT: %.loc23_21.2: %i32 = converted %int_4, %.loc23_21.1 [concrete = constants.%int_4.940]
  1367. // CHECK:STDOUT: %E.as.J.impl.F.call.loc23: init %i32 = call %impl.elem1.loc23(%.loc23_21.2)
  1368. // CHECK:STDOUT: %.loc23_11: type = splice_block %i32.loc23 [concrete = constants.%i32] {
  1369. // CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1370. // CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1371. // CHECK:STDOUT: }
  1372. // CHECK:STDOUT: %.loc23_22.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc23
  1373. // CHECK:STDOUT: %.loc23_22.2: %i32 = converted %E.as.J.impl.F.call.loc23, %.loc23_22.1
  1374. // CHECK:STDOUT: %e3: %i32 = value_binding e3, %.loc23_22.2
  1375. // CHECK:STDOUT: name_binding_decl {
  1376. // CHECK:STDOUT: %e4.patt: %pattern_type.7ce = value_binding_pattern e4 [concrete]
  1377. // CHECK:STDOUT: }
  1378. // CHECK:STDOUT: %e.ref.loc24: %E = name_ref e, %e
  1379. // CHECK:STDOUT: %E.ref.loc24: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1380. // CHECK:STDOUT: %G.ref.loc24: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2]
  1381. // CHECK:STDOUT: %impl.elem2.loc24: %.35c = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G]
  1382. // CHECK:STDOUT: %bound_method.loc24_18: <bound method> = bound_method %e.ref.loc24, %impl.elem2.loc24
  1383. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
  1384. // CHECK:STDOUT: %impl.elem0.loc24: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1385. // CHECK:STDOUT: %bound_method.loc24_25.1: <bound method> = bound_method %int_5, %impl.elem0.loc24 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005]
  1386. // 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]
  1387. // CHECK:STDOUT: %bound_method.loc24_25.2: <bound method> = bound_method %int_5, %specific_fn.loc24 [concrete = constants.%bound_method.e9d]
  1388. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24: init %i32 = call %bound_method.loc24_25.2(%int_5) [concrete = constants.%int_5.0f6]
  1389. // CHECK:STDOUT: %.loc24_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_5.0f6]
  1390. // CHECK:STDOUT: %.loc24_25.2: %i32 = converted %int_5, %.loc24_25.1 [concrete = constants.%int_5.0f6]
  1391. // CHECK:STDOUT: %E.as.J.impl.G.call.loc24: init %i32 = call %bound_method.loc24_18(%e.ref.loc24, %.loc24_25.2)
  1392. // CHECK:STDOUT: %.loc24_11: type = splice_block %i32.loc24 [concrete = constants.%i32] {
  1393. // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1394. // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1395. // CHECK:STDOUT: }
  1396. // CHECK:STDOUT: %.loc24_26.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc24
  1397. // CHECK:STDOUT: %.loc24_26.2: %i32 = converted %E.as.J.impl.G.call.loc24, %.loc24_26.1
  1398. // CHECK:STDOUT: %e4: %i32 = value_binding e4, %.loc24_26.2
  1399. // CHECK:STDOUT: name_binding_decl {
  1400. // CHECK:STDOUT: %e5.patt: %pattern_type.7ce = value_binding_pattern e5 [concrete]
  1401. // CHECK:STDOUT: }
  1402. // CHECK:STDOUT: %e.ref.loc25: %E = name_ref e, %e
  1403. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1404. // CHECK:STDOUT: %G.ref.loc25: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2]
  1405. // CHECK:STDOUT: %impl.elem2.loc25: %.35c = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G]
  1406. // CHECK:STDOUT: %bound_method.loc25_18: <bound method> = bound_method %e.ref.loc25, %impl.elem2.loc25
  1407. // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462]
  1408. // CHECK:STDOUT: %impl.elem0.loc25: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1409. // CHECK:STDOUT: %bound_method.loc25_25.1: <bound method> = bound_method %int_6, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.502]
  1410. // 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]
  1411. // CHECK:STDOUT: %bound_method.loc25_25.2: <bound method> = bound_method %int_6, %specific_fn.loc25 [concrete = constants.%bound_method.bc2]
  1412. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i32 = call %bound_method.loc25_25.2(%int_6) [concrete = constants.%int_6.e56]
  1413. // CHECK:STDOUT: %.loc25_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_6.e56]
  1414. // CHECK:STDOUT: %.loc25_25.2: %i32 = converted %int_6, %.loc25_25.1 [concrete = constants.%int_6.e56]
  1415. // CHECK:STDOUT: %E.as.J.impl.G.call.loc25: init %i32 = call %bound_method.loc25_18(%e.ref.loc25, %.loc25_25.2)
  1416. // CHECK:STDOUT: %.loc25_11: type = splice_block %i32.loc25 [concrete = constants.%i32] {
  1417. // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1418. // CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1419. // CHECK:STDOUT: }
  1420. // CHECK:STDOUT: %.loc25_26.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc25
  1421. // CHECK:STDOUT: %.loc25_26.2: %i32 = converted %E.as.J.impl.G.call.loc25, %.loc25_26.1
  1422. // CHECK:STDOUT: %e5: %i32 = value_binding e5, %.loc25_26.2
  1423. // CHECK:STDOUT: return
  1424. // CHECK:STDOUT: }
  1425. // CHECK:STDOUT:
  1426. // CHECK:STDOUT: generic fn @GenericCallF(%T.loc28_17.2: %J.type) {
  1427. // CHECK:STDOUT: %T.loc28_17.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc28_17.1 (constants.%T)]
  1428. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc28_17.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1429. // CHECK:STDOUT: %pattern_type.loc28_24: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc28_24 (constants.%pattern_type.14f)]
  1430. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc28_17.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264)]
  1431. // 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)]
  1432. // CHECK:STDOUT: %pattern_type.loc28_30: type = pattern_type %impl.elem0.loc28_34.1 [symbolic = %pattern_type.loc28_30 (constants.%pattern_type.ad6)]
  1433. // CHECK:STDOUT: %.loc28_42.2: form = init_form %impl.elem0.loc28_34.1, call_param2 [symbolic = %.loc28_42.2 (constants.%.722)]
  1434. // CHECK:STDOUT:
  1435. // CHECK:STDOUT: !definition:
  1436. // CHECK:STDOUT: %require_complete.loc28_42: <witness> = require_complete_type %impl.elem0.loc28_34.1 [symbolic = %require_complete.loc28_42 (constants.%require_complete.06a)]
  1437. // CHECK:STDOUT: %require_complete.loc28_25: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc28_25 (constants.%require_complete.19a)]
  1438. // CHECK:STDOUT: %.loc29: type = fn_type_with_self_type constants.%J.F.type, %T.loc28_17.1 [symbolic = %.loc29 (constants.%.322)]
  1439. // CHECK:STDOUT: %impl.elem1.loc29_11.2: @GenericCallF.%.loc29 (%.322) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc29_11.2 (constants.%impl.elem1)]
  1440. // CHECK:STDOUT: %specific_impl_fn.loc29_11.2: <specific function> = specific_impl_function %impl.elem1.loc29_11.2, @J.F(%T.loc28_17.1) [symbolic = %specific_impl_fn.loc29_11.2 (constants.%specific_impl_fn)]
  1441. // CHECK:STDOUT:
  1442. // CHECK:STDOUT: fn(%t.param: @GenericCallF.%T.binding.as_type (%T.binding.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) {
  1443. // CHECK:STDOUT: !entry:
  1444. // CHECK:STDOUT: %t.ref: @GenericCallF.%T.binding.as_type (%T.binding.as_type) = name_ref t, %t
  1445. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.a57]
  1446. // CHECK:STDOUT: %impl.elem1.loc29_11.1: @GenericCallF.%.loc29 (%.322) = impl_witness_access constants.%J.lookup_impl_witness.264, element1 [symbolic = %impl.elem1.loc29_11.2 (constants.%impl.elem1)]
  1447. // CHECK:STDOUT: %u.ref: @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = name_ref u, %u
  1448. // CHECK:STDOUT: %specific_impl_fn.loc29_11.1: <specific function> = specific_impl_function %impl.elem1.loc29_11.1, @J.F(constants.%T) [symbolic = %specific_impl_fn.loc29_11.2 (constants.%specific_impl_fn)]
  1449. // CHECK:STDOUT: %.loc28_42.1: ref @GenericCallF.%impl.elem0.loc28_34.1 (%impl.elem0.560) = splice_block %return.param {}
  1450. // CHECK:STDOUT: %J.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)
  1451. // CHECK:STDOUT: return %J.F.call to %return.param
  1452. // CHECK:STDOUT: }
  1453. // CHECK:STDOUT: }
  1454. // CHECK:STDOUT:
  1455. // CHECK:STDOUT: fn @CallGeneric(%e.param: %E) -> out %return.param: %i32 {
  1456. // CHECK:STDOUT: !entry:
  1457. // CHECK:STDOUT: %GenericCallF.ref: %GenericCallF.type = name_ref GenericCallF, file.%GenericCallF.decl [concrete = constants.%GenericCallF]
  1458. // CHECK:STDOUT: %e.ref: %E = name_ref e, %e
  1459. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  1460. // CHECK:STDOUT: %J.facet.loc33_27.1: %J.type = facet_value constants.%E, (constants.%J.impl_witness) [concrete = constants.%J.facet]
  1461. // CHECK:STDOUT: %.loc33_27.1: %J.type = converted constants.%E, %J.facet.loc33_27.1 [concrete = constants.%J.facet]
  1462. // CHECK:STDOUT: %J.facet.loc33_27.2: %J.type = facet_value constants.%E, (constants.%J.impl_witness) [concrete = constants.%J.facet]
  1463. // CHECK:STDOUT: %.loc33_27.2: %J.type = converted constants.%E, %J.facet.loc33_27.2 [concrete = constants.%J.facet]
  1464. // CHECK:STDOUT: %GenericCallF.specific_fn: <specific function> = specific_function %GenericCallF.ref, @GenericCallF(constants.%J.facet) [concrete = constants.%GenericCallF.specific_fn]
  1465. // CHECK:STDOUT: %impl.elem0: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1466. // 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]
  1467. // 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]
  1468. // CHECK:STDOUT: %bound_method.loc33_26.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.646]
  1469. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc33_26.2(%int_2) [concrete = constants.%int_2.ef8]
  1470. // CHECK:STDOUT: %.loc33_26.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_2.ef8]
  1471. // CHECK:STDOUT: %.loc33_26.2: %i32 = converted %int_2, %.loc33_26.1 [concrete = constants.%int_2.ef8]
  1472. // CHECK:STDOUT: %GenericCallF.call: init %i32 = call %GenericCallF.specific_fn(%e.ref, %.loc33_26.2)
  1473. // CHECK:STDOUT: return %GenericCallF.call
  1474. // CHECK:STDOUT: }
  1475. // CHECK:STDOUT:
  1476. // CHECK:STDOUT: specific @U(constants.%Self.8a1) {}
  1477. // CHECK:STDOUT:
  1478. // CHECK:STDOUT: specific @J.F(constants.%Self.8a1) {
  1479. // CHECK:STDOUT: %Self => constants.%Self.8a1
  1480. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  1481. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.335
  1482. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c1a
  1483. // CHECK:STDOUT: %.loc5_17.1 => constants.%.eaf
  1484. // CHECK:STDOUT: }
  1485. // CHECK:STDOUT:
  1486. // CHECK:STDOUT: specific @J.G(constants.%Self.8a1) {
  1487. // CHECK:STDOUT: %Self => constants.%Self.8a1
  1488. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.ed8
  1489. // CHECK:STDOUT: %pattern_type.loc6_8 => constants.%pattern_type.832
  1490. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  1491. // CHECK:STDOUT: %impl.elem0.loc6_23.1 => constants.%impl.elem0.335
  1492. // CHECK:STDOUT: %pattern_type.loc6_20 => constants.%pattern_type.c1a
  1493. // CHECK:STDOUT: %.loc6_29.1 => constants.%.f80
  1494. // CHECK:STDOUT: }
  1495. // CHECK:STDOUT:
  1496. // CHECK:STDOUT: specific @U(constants.%.Self.2fa) {}
  1497. // CHECK:STDOUT:
  1498. // CHECK:STDOUT: specific @J.F(constants.%J.facet) {
  1499. // CHECK:STDOUT: %Self => constants.%J.facet
  1500. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  1501. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  1502. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  1503. // CHECK:STDOUT: %.loc5_17.1 => constants.%.4d5
  1504. // CHECK:STDOUT: }
  1505. // CHECK:STDOUT:
  1506. // CHECK:STDOUT: specific @J.G(constants.%J.facet) {
  1507. // CHECK:STDOUT: %Self => constants.%J.facet
  1508. // CHECK:STDOUT: %Self.binding.as_type => constants.%E
  1509. // CHECK:STDOUT: %pattern_type.loc6_8 => constants.%pattern_type.99f
  1510. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  1511. // CHECK:STDOUT: %impl.elem0.loc6_23.1 => constants.%i32
  1512. // CHECK:STDOUT: %pattern_type.loc6_20 => constants.%pattern_type.7ce
  1513. // CHECK:STDOUT: %.loc6_29.1 => constants.%.88a
  1514. // CHECK:STDOUT: }
  1515. // CHECK:STDOUT:
  1516. // CHECK:STDOUT: specific @U(constants.%T) {}
  1517. // CHECK:STDOUT:
  1518. // CHECK:STDOUT: specific @GenericCallF(constants.%T) {
  1519. // CHECK:STDOUT: %T.loc28_17.1 => constants.%T
  1520. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  1521. // CHECK:STDOUT: %pattern_type.loc28_24 => constants.%pattern_type.14f
  1522. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  1523. // CHECK:STDOUT: %impl.elem0.loc28_34.1 => constants.%impl.elem0.560
  1524. // CHECK:STDOUT: %pattern_type.loc28_30 => constants.%pattern_type.ad6
  1525. // CHECK:STDOUT: %.loc28_42.2 => constants.%.722
  1526. // CHECK:STDOUT: }
  1527. // CHECK:STDOUT:
  1528. // CHECK:STDOUT: specific @J.F(constants.%T) {
  1529. // CHECK:STDOUT: %Self => constants.%T
  1530. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  1531. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.560
  1532. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad6
  1533. // CHECK:STDOUT: %.loc5_17.1 => constants.%.873
  1534. // CHECK:STDOUT: }
  1535. // CHECK:STDOUT:
  1536. // CHECK:STDOUT: specific @GenericCallF(constants.%J.facet) {
  1537. // CHECK:STDOUT: %T.loc28_17.1 => constants.%J.facet
  1538. // CHECK:STDOUT: %T.binding.as_type => constants.%E
  1539. // CHECK:STDOUT: %pattern_type.loc28_24 => constants.%pattern_type.99f
  1540. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  1541. // CHECK:STDOUT: %impl.elem0.loc28_34.1 => constants.%i32
  1542. // CHECK:STDOUT: %pattern_type.loc28_30 => constants.%pattern_type.7ce
  1543. // CHECK:STDOUT: %.loc28_42.2 => constants.%.88a
  1544. // CHECK:STDOUT:
  1545. // CHECK:STDOUT: !definition:
  1546. // CHECK:STDOUT: %require_complete.loc28_42 => constants.%complete_type.f8a
  1547. // CHECK:STDOUT: %require_complete.loc28_25 => constants.%complete_type.357
  1548. // CHECK:STDOUT: %.loc29 => constants.%.013
  1549. // CHECK:STDOUT: %impl.elem1.loc29_11.2 => constants.%E.as.J.impl.F
  1550. // CHECK:STDOUT: %specific_impl_fn.loc29_11.2 => constants.%E.as.J.impl.F
  1551. // CHECK:STDOUT: }
  1552. // CHECK:STDOUT:
  1553. // CHECK:STDOUT: --- use_constraint_on_associated_type.carbon
  1554. // CHECK:STDOUT:
  1555. // CHECK:STDOUT: constants {
  1556. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1557. // CHECK:STDOUT: %Self.ab9: %I.type = symbolic_binding Self, 0 [symbolic]
  1558. // CHECK:STDOUT: %Self.binding.as_type.d31: type = symbolic_binding_type Self, 0, %Self.ab9 [symbolic]
  1559. // CHECK:STDOUT: %pattern_type.fa0: type = pattern_type %Self.binding.as_type.d31 [symbolic]
  1560. // CHECK:STDOUT: %.1fc: form = init_form %Self.binding.as_type.d31, call_param2 [symbolic]
  1561. // CHECK:STDOUT: %I.Op.type: type = fn_type @I.Op [concrete]
  1562. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1563. // CHECK:STDOUT: %I.Op: %I.Op.type = struct_value () [concrete]
  1564. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1565. // CHECK:STDOUT: %assoc0.20d: %I.assoc_type = assoc_entity element0, @I.%I.Op.decl [concrete]
  1566. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  1567. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  1568. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1569. // CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete]
  1570. // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete]
  1571. // CHECK:STDOUT: %facet_type: type = facet_type <@I & @Destroy> [concrete]
  1572. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  1573. // CHECK:STDOUT: %assoc0.918: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  1574. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  1575. // CHECK:STDOUT: %impl.elem0.193: %facet_type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  1576. // CHECK:STDOUT: %as_type.d83: type = facet_access_type %impl.elem0.193 [symbolic]
  1577. // CHECK:STDOUT: %pattern_type.d76: type = pattern_type %as_type.d83 [symbolic]
  1578. // CHECK:STDOUT: %.8da: form = init_form %as_type.d83, call_param1 [symbolic]
  1579. // CHECK:STDOUT: %J.F.type: type = fn_type @J.F [concrete]
  1580. // CHECK:STDOUT: %J.F: %J.F.type = struct_value () [concrete]
  1581. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%J.F.decl [concrete]
  1582. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1583. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1584. // CHECK:STDOUT: %T: %J.type = symbolic_binding T, 0 [symbolic]
  1585. // CHECK:STDOUT: %pattern_type.f76: type = pattern_type %J.type [concrete]
  1586. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic]
  1587. // CHECK:STDOUT: %pattern_type.14f: type = pattern_type %T.binding.as_type [symbolic]
  1588. // CHECK:STDOUT: %J.lookup_impl_witness.264: <witness> = lookup_impl_witness %T, @J [symbolic]
  1589. // CHECK:STDOUT: %impl.elem0.397: %facet_type = impl_witness_access %J.lookup_impl_witness.264, element0 [symbolic]
  1590. // CHECK:STDOUT: %as_type.baf: type = facet_access_type %impl.elem0.397 [symbolic]
  1591. // CHECK:STDOUT: %pattern_type.bba: type = pattern_type %as_type.baf [symbolic]
  1592. // CHECK:STDOUT: %.997: form = init_form %as_type.baf, call_param2 [symbolic]
  1593. // CHECK:STDOUT: %GenericResult.type: type = fn_type @GenericResult [concrete]
  1594. // CHECK:STDOUT: %GenericResult: %GenericResult.type = struct_value () [concrete]
  1595. // CHECK:STDOUT: %require_complete.9b3: <witness> = require_complete_type %as_type.baf [symbolic]
  1596. // CHECK:STDOUT: %require_complete.19a: <witness> = require_complete_type %T.binding.as_type [symbolic]
  1597. // CHECK:STDOUT: %.322: type = fn_type_with_self_type %J.F.type, %T [symbolic]
  1598. // CHECK:STDOUT: %impl.elem1: %.322 = impl_witness_access %J.lookup_impl_witness.264, element1 [symbolic]
  1599. // CHECK:STDOUT: %.d40: form = init_form %as_type.baf, call_param1 [symbolic]
  1600. // CHECK:STDOUT: %specific_impl_fn.c25: <specific function> = specific_impl_function %impl.elem1, @J.F(%T) [symbolic]
  1601. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.397, @I [symbolic]
  1602. // CHECK:STDOUT: %I.facet: %I.type = facet_value %as_type.baf, (%I.lookup_impl_witness) [symbolic]
  1603. // CHECK:STDOUT: %.74f: type = fn_type_with_self_type %I.Op.type, %I.facet [symbolic]
  1604. // CHECK:STDOUT: %impl.elem0.aa5: %.74f = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
  1605. // CHECK:STDOUT: %specific_impl_fn.dcb: <specific function> = specific_impl_function %impl.elem0.aa5, @I.Op(%I.facet) [symbolic]
  1606. // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete]
  1607. // CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete]
  1608. // CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete]
  1609. // CHECK:STDOUT: %custom_witness.809: <witness> = custom_witness (%DestroyOp), @Destroy [concrete]
  1610. // CHECK:STDOUT: %Destroy.facet.0b6: %Destroy.type = facet_value %as_type.baf, (%custom_witness.809) [symbolic]
  1611. // CHECK:STDOUT: %.54d: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.0b6 [symbolic]
  1612. // CHECK:STDOUT: }
  1613. // CHECK:STDOUT:
  1614. // CHECK:STDOUT: imports {
  1615. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1616. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1617. // CHECK:STDOUT: .BitAndWith = %Core.BitAndWith
  1618. // CHECK:STDOUT: import Core//prelude
  1619. // CHECK:STDOUT: import Core//prelude/...
  1620. // CHECK:STDOUT: }
  1621. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1622. // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic]
  1623. // CHECK:STDOUT: }
  1624. // CHECK:STDOUT:
  1625. // CHECK:STDOUT: file {
  1626. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1627. // CHECK:STDOUT: .Core = imports.%Core
  1628. // CHECK:STDOUT: .I = %I.decl
  1629. // CHECK:STDOUT: .J = %J.decl
  1630. // CHECK:STDOUT: .GenericResult = %GenericResult.decl
  1631. // CHECK:STDOUT: }
  1632. // CHECK:STDOUT: %Core.import = import Core
  1633. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1634. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1635. // CHECK:STDOUT: %GenericResult.decl: %GenericResult.type = fn_decl @GenericResult [concrete = constants.%GenericResult] {
  1636. // CHECK:STDOUT: %T.patt: %pattern_type.f76 = symbolic_binding_pattern T, 0 [concrete]
  1637. // CHECK:STDOUT: %t.patt: @GenericResult.%pattern_type.loc12_25 (%pattern_type.14f) = value_binding_pattern t [concrete]
  1638. // CHECK:STDOUT: %t.param_patt: @GenericResult.%pattern_type.loc12_25 (%pattern_type.14f) = value_param_pattern %t.patt, call_param0 [concrete]
  1639. // CHECK:STDOUT: %u.patt: @GenericResult.%pattern_type.loc12_31 (%pattern_type.bba) = value_binding_pattern u [concrete]
  1640. // CHECK:STDOUT: %u.param_patt: @GenericResult.%pattern_type.loc12_31 (%pattern_type.bba) = value_param_pattern %u.patt, call_param1 [concrete]
  1641. // CHECK:STDOUT: %return.patt: @GenericResult.%pattern_type.loc12_31 (%pattern_type.bba) = return_slot_pattern [concrete]
  1642. // CHECK:STDOUT: %return.param_patt: @GenericResult.%pattern_type.loc12_31 (%pattern_type.bba) = out_param_pattern %return.patt, call_param2 [concrete]
  1643. // CHECK:STDOUT: } {
  1644. // CHECK:STDOUT: %T.ref.loc12_42: %J.type = name_ref T, %T.loc12_18.2 [symbolic = %T.loc12_18.1 (constants.%T)]
  1645. // CHECK:STDOUT: %T.as_type.loc12_43: type = facet_access_type %T.ref.loc12_42 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1646. // CHECK:STDOUT: %.loc12_43.3: type = converted %T.ref.loc12_42, %T.as_type.loc12_43 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1647. // CHECK:STDOUT: %U.ref.loc12_43: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.918]
  1648. // 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)]
  1649. // CHECK:STDOUT: %as_type.loc12_43: type = facet_access_type %impl.elem0.loc12_43 [symbolic = %as_type.loc12_35.1 (constants.%as_type.baf)]
  1650. // 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)]
  1651. // CHECK:STDOUT: %.loc12_43.5: form = init_form %.loc12_43.4, call_param2 [symbolic = %.loc12_43.2 (constants.%.997)]
  1652. // CHECK:STDOUT: %.loc12_22: type = splice_block %J.ref [concrete = constants.%J.type] {
  1653. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1654. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1655. // CHECK:STDOUT: }
  1656. // CHECK:STDOUT: %T.loc12_18.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc12_18.1 (constants.%T)]
  1657. // CHECK:STDOUT: %t.param: @GenericResult.%T.binding.as_type (%T.binding.as_type) = value_param call_param0
  1658. // CHECK:STDOUT: %.loc12_28.1: type = splice_block %.loc12_28.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
  1659. // CHECK:STDOUT: %T.ref.loc12_28: %J.type = name_ref T, %T.loc12_18.2 [symbolic = %T.loc12_18.1 (constants.%T)]
  1660. // CHECK:STDOUT: %T.as_type.loc12_28: type = facet_access_type %T.ref.loc12_28 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1661. // CHECK:STDOUT: %.loc12_28.2: type = converted %T.ref.loc12_28, %T.as_type.loc12_28 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1662. // CHECK:STDOUT: }
  1663. // CHECK:STDOUT: %t: @GenericResult.%T.binding.as_type (%T.binding.as_type) = value_binding t, %t.param
  1664. // CHECK:STDOUT: %u.param: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = value_param call_param1
  1665. // CHECK:STDOUT: %.loc12_35.1: type = splice_block %.loc12_35.3 [symbolic = %as_type.loc12_35.1 (constants.%as_type.baf)] {
  1666. // CHECK:STDOUT: %T.ref.loc12_34: %J.type = name_ref T, %T.loc12_18.2 [symbolic = %T.loc12_18.1 (constants.%T)]
  1667. // CHECK:STDOUT: %T.as_type.loc12_35: type = facet_access_type %T.ref.loc12_34 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1668. // CHECK:STDOUT: %.loc12_35.2: type = converted %T.ref.loc12_34, %T.as_type.loc12_35 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1669. // CHECK:STDOUT: %U.ref.loc12_35: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.918]
  1670. // 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)]
  1671. // 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)]
  1672. // 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)]
  1673. // CHECK:STDOUT: }
  1674. // CHECK:STDOUT: %u: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = value_binding u, %u.param
  1675. // CHECK:STDOUT: %return.param: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = out_param call_param2
  1676. // CHECK:STDOUT: %return: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = return_slot %return.param
  1677. // CHECK:STDOUT: }
  1678. // CHECK:STDOUT: }
  1679. // CHECK:STDOUT:
  1680. // CHECK:STDOUT: interface @I {
  1681. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.ab9]
  1682. // CHECK:STDOUT: %I.Op.decl: %I.Op.type = fn_decl @I.Op [concrete = constants.%I.Op] {
  1683. // CHECK:STDOUT: %self.patt: @I.Op.%pattern_type (%pattern_type.fa0) = value_binding_pattern self [concrete]
  1684. // CHECK:STDOUT: %self.param_patt: @I.Op.%pattern_type (%pattern_type.fa0) = value_param_pattern %self.patt, call_param0 [concrete]
  1685. // CHECK:STDOUT: %b.patt: @I.Op.%pattern_type (%pattern_type.fa0) = value_binding_pattern b [concrete]
  1686. // CHECK:STDOUT: %b.param_patt: @I.Op.%pattern_type (%pattern_type.fa0) = value_param_pattern %b.patt, call_param1 [concrete]
  1687. // CHECK:STDOUT: %return.patt: @I.Op.%pattern_type (%pattern_type.fa0) = return_slot_pattern [concrete]
  1688. // CHECK:STDOUT: %return.param_patt: @I.Op.%pattern_type (%pattern_type.fa0) = out_param_pattern %return.patt, call_param2 [concrete]
  1689. // CHECK:STDOUT: } {
  1690. // CHECK:STDOUT: %Self.ref.loc4_33: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.ab9)]
  1691. // CHECK:STDOUT: %Self.as_type.loc4_33: type = facet_access_type %Self.ref.loc4_33 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  1692. // CHECK:STDOUT: %.loc4_33.2: type = converted %Self.ref.loc4_33, %Self.as_type.loc4_33 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  1693. // CHECK:STDOUT: %.loc4_33.3: form = init_form %.loc4_33.2, call_param2 [symbolic = %.loc4_33.1 (constants.%.1fc)]
  1694. // CHECK:STDOUT: %self.param: @I.Op.%Self.binding.as_type (%Self.binding.as_type.d31) = value_param call_param0
  1695. // CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)] {
  1696. // CHECK:STDOUT: %Self.ref.loc4_15: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.ab9)]
  1697. // CHECK:STDOUT: %Self.as_type.loc4_15: type = facet_access_type %Self.ref.loc4_15 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  1698. // CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref.loc4_15, %Self.as_type.loc4_15 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  1699. // CHECK:STDOUT: }
  1700. // CHECK:STDOUT: %self: @I.Op.%Self.binding.as_type (%Self.binding.as_type.d31) = value_binding self, %self.param
  1701. // CHECK:STDOUT: %b.param: @I.Op.%Self.binding.as_type (%Self.binding.as_type.d31) = value_param call_param1
  1702. // CHECK:STDOUT: %.loc4_24.1: type = splice_block %.loc4_24.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)] {
  1703. // CHECK:STDOUT: %Self.ref.loc4_24: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.ab9)]
  1704. // CHECK:STDOUT: %Self.as_type.loc4_24: type = facet_access_type %Self.ref.loc4_24 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  1705. // CHECK:STDOUT: %.loc4_24.2: type = converted %Self.ref.loc4_24, %Self.as_type.loc4_24 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  1706. // CHECK:STDOUT: }
  1707. // CHECK:STDOUT: %b: @I.Op.%Self.binding.as_type (%Self.binding.as_type.d31) = value_binding b, %b.param
  1708. // CHECK:STDOUT: %return.param: ref @I.Op.%Self.binding.as_type (%Self.binding.as_type.d31) = out_param call_param2
  1709. // CHECK:STDOUT: %return: ref @I.Op.%Self.binding.as_type (%Self.binding.as_type.d31) = return_slot %return.param
  1710. // CHECK:STDOUT: }
  1711. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.Op.decl [concrete = constants.%assoc0.20d]
  1712. // CHECK:STDOUT:
  1713. // CHECK:STDOUT: !members:
  1714. // CHECK:STDOUT: .Self = %Self
  1715. // CHECK:STDOUT: .Op = %assoc0
  1716. // CHECK:STDOUT: witness = (%I.Op.decl)
  1717. // CHECK:STDOUT:
  1718. // CHECK:STDOUT: !requires:
  1719. // CHECK:STDOUT: }
  1720. // CHECK:STDOUT:
  1721. // CHECK:STDOUT: interface @J {
  1722. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  1723. // CHECK:STDOUT: %U: %facet_type = assoc_const_decl @U [concrete] {
  1724. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.918]
  1725. // CHECK:STDOUT: }
  1726. // CHECK:STDOUT: %J.F.decl: %J.F.type = fn_decl @J.F [concrete = constants.%J.F] {
  1727. // CHECK:STDOUT: %u.patt: @J.F.%pattern_type (%pattern_type.d76) = value_binding_pattern u [concrete]
  1728. // CHECK:STDOUT: %u.param_patt: @J.F.%pattern_type (%pattern_type.d76) = value_param_pattern %u.patt, call_param0 [concrete]
  1729. // CHECK:STDOUT: %return.patt: @J.F.%pattern_type (%pattern_type.d76) = return_slot_pattern [concrete]
  1730. // CHECK:STDOUT: %return.param_patt: @J.F.%pattern_type (%pattern_type.d76) = out_param_pattern %return.patt, call_param1 [concrete]
  1731. // CHECK:STDOUT: } {
  1732. // 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)]
  1733. // 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)]
  1734. // CHECK:STDOUT: %U.as_type.loc9_17: type = facet_access_type %U.ref.loc9_17 [symbolic = %as_type (constants.%as_type.d83)]
  1735. // CHECK:STDOUT: %.loc9_17.2: type = converted %U.ref.loc9_17, %U.as_type.loc9_17 [symbolic = %as_type (constants.%as_type.d83)]
  1736. // CHECK:STDOUT: %.loc9_17.3: form = init_form %.loc9_17.2, call_param1 [symbolic = %.loc9_17.1 (constants.%.8da)]
  1737. // CHECK:STDOUT: %u.param: @J.F.%as_type (%as_type.d83) = value_param call_param0
  1738. // CHECK:STDOUT: %.loc9_11.1: type = splice_block %.loc9_11.2 [symbolic = %as_type (constants.%as_type.d83)] {
  1739. // 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)]
  1740. // 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)]
  1741. // CHECK:STDOUT: %U.as_type.loc9_11: type = facet_access_type %U.ref.loc9_11 [symbolic = %as_type (constants.%as_type.d83)]
  1742. // CHECK:STDOUT: %.loc9_11.2: type = converted %U.ref.loc9_11, %U.as_type.loc9_11 [symbolic = %as_type (constants.%as_type.d83)]
  1743. // CHECK:STDOUT: }
  1744. // CHECK:STDOUT: %u: @J.F.%as_type (%as_type.d83) = value_binding u, %u.param
  1745. // CHECK:STDOUT: %return.param: ref @J.F.%as_type (%as_type.d83) = out_param call_param1
  1746. // CHECK:STDOUT: %return: ref @J.F.%as_type (%as_type.d83) = return_slot %return.param
  1747. // CHECK:STDOUT: }
  1748. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.F.decl [concrete = constants.%assoc1]
  1749. // CHECK:STDOUT:
  1750. // CHECK:STDOUT: !members:
  1751. // CHECK:STDOUT: .Self = %Self
  1752. // CHECK:STDOUT: .I = <poisoned>
  1753. // CHECK:STDOUT: .U = @U.%assoc0
  1754. // CHECK:STDOUT: .F = %assoc1
  1755. // CHECK:STDOUT: witness = (%U, %J.F.decl)
  1756. // CHECK:STDOUT:
  1757. // CHECK:STDOUT: !requires:
  1758. // CHECK:STDOUT: }
  1759. // CHECK:STDOUT:
  1760. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  1761. // CHECK:STDOUT: assoc_const U:! %facet_type;
  1762. // CHECK:STDOUT: }
  1763. // CHECK:STDOUT:
  1764. // CHECK:STDOUT: generic fn @I.Op(@I.%Self: %I.type) {
  1765. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.ab9)]
  1766. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  1767. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.fa0)]
  1768. // CHECK:STDOUT: %.loc4_33.1: form = init_form %Self.binding.as_type, call_param2 [symbolic = %.loc4_33.1 (constants.%.1fc)]
  1769. // CHECK:STDOUT:
  1770. // CHECK:STDOUT: fn(%self.param: @I.Op.%Self.binding.as_type (%Self.binding.as_type.d31), %b.param: @I.Op.%Self.binding.as_type (%Self.binding.as_type.d31)) -> out %return.param: @I.Op.%Self.binding.as_type (%Self.binding.as_type.d31);
  1771. // CHECK:STDOUT: }
  1772. // CHECK:STDOUT:
  1773. // CHECK:STDOUT: generic fn @J.F(@J.%Self: %J.type) {
  1774. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  1775. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  1776. // 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)]
  1777. // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.loc9_11.1 [symbolic = %as_type (constants.%as_type.d83)]
  1778. // CHECK:STDOUT: %pattern_type: type = pattern_type %as_type [symbolic = %pattern_type (constants.%pattern_type.d76)]
  1779. // CHECK:STDOUT: %.loc9_17.1: form = init_form %as_type, call_param1 [symbolic = %.loc9_17.1 (constants.%.8da)]
  1780. // CHECK:STDOUT:
  1781. // CHECK:STDOUT: fn(%u.param: @J.F.%as_type (%as_type.d83)) -> out %return.param: @J.F.%as_type (%as_type.d83);
  1782. // CHECK:STDOUT: }
  1783. // CHECK:STDOUT:
  1784. // CHECK:STDOUT: generic fn @GenericResult(%T.loc12_18.2: %J.type) {
  1785. // CHECK:STDOUT: %T.loc12_18.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc12_18.1 (constants.%T)]
  1786. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc12_18.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1787. // CHECK:STDOUT: %pattern_type.loc12_25: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc12_25 (constants.%pattern_type.14f)]
  1788. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc12_18.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264)]
  1789. // 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)]
  1790. // 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)]
  1791. // CHECK:STDOUT: %pattern_type.loc12_31: type = pattern_type %as_type.loc12_35.1 [symbolic = %pattern_type.loc12_31 (constants.%pattern_type.bba)]
  1792. // CHECK:STDOUT: %.loc12_43.2: form = init_form %as_type.loc12_35.1, call_param2 [symbolic = %.loc12_43.2 (constants.%.997)]
  1793. // CHECK:STDOUT:
  1794. // CHECK:STDOUT: !definition:
  1795. // CHECK:STDOUT: %require_complete.loc12_43: <witness> = require_complete_type %as_type.loc12_35.1 [symbolic = %require_complete.loc12_43 (constants.%require_complete.9b3)]
  1796. // CHECK:STDOUT: %require_complete.loc12_26: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc12_26 (constants.%require_complete.19a)]
  1797. // CHECK:STDOUT: %.loc13_11: type = fn_type_with_self_type constants.%J.F.type, %T.loc12_18.1 [symbolic = %.loc13_11 (constants.%.322)]
  1798. // CHECK:STDOUT: %impl.elem1.loc13_11.2: @GenericResult.%.loc13_11 (%.322) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc13_11.2 (constants.%impl.elem1)]
  1799. // CHECK:STDOUT: %specific_impl_fn.loc13_11.2: <specific function> = specific_impl_function %impl.elem1.loc13_11.2, @J.F(%T.loc12_18.1) [symbolic = %specific_impl_fn.loc13_11.2 (constants.%specific_impl_fn.c25)]
  1800. // 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)]
  1801. // 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)]
  1802. // CHECK:STDOUT: %.loc13_16: type = fn_type_with_self_type constants.%I.Op.type, %I.facet.loc13_16 [symbolic = %.loc13_16 (constants.%.74f)]
  1803. // CHECK:STDOUT: %impl.elem0.loc13_16.2: @GenericResult.%.loc13_16 (%.74f) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_16.2 (constants.%impl.elem0.aa5)]
  1804. // CHECK:STDOUT: %specific_impl_fn.loc13_16.2: <specific function> = specific_impl_function %impl.elem0.loc13_16.2, @I.Op(%I.facet.loc13_16) [symbolic = %specific_impl_fn.loc13_16.2 (constants.%specific_impl_fn.dcb)]
  1805. // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %as_type.loc12_35.1, (constants.%custom_witness.809) [symbolic = %Destroy.facet (constants.%Destroy.facet.0b6)]
  1806. // CHECK:STDOUT: %.loc13_29.6: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc13_29.6 (constants.%.54d)]
  1807. // CHECK:STDOUT:
  1808. // CHECK:STDOUT: fn(%t.param: @GenericResult.%T.binding.as_type (%T.binding.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) {
  1809. // CHECK:STDOUT: !entry:
  1810. // CHECK:STDOUT: %t.ref: @GenericResult.%T.binding.as_type (%T.binding.as_type) = name_ref t, %t
  1811. // CHECK:STDOUT: %F.ref.loc13_11: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1]
  1812. // CHECK:STDOUT: %impl.elem1.loc13_11.1: @GenericResult.%.loc13_11 (%.322) = impl_witness_access constants.%J.lookup_impl_witness.264, element1 [symbolic = %impl.elem1.loc13_11.2 (constants.%impl.elem1)]
  1813. // CHECK:STDOUT: %u.ref.loc13_14: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = name_ref u, %u
  1814. // 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)]
  1815. // CHECK:STDOUT: %.loc13_15.2: %facet_type = converted constants.%as_type.baf, constants.%impl.elem0.397 [symbolic = %impl.elem0.loc12_35.1 (constants.%impl.elem0.397)]
  1816. // CHECK:STDOUT: %specific_impl_fn.loc13_11.1: <specific function> = specific_impl_function %impl.elem1.loc13_11.1, @J.F(constants.%T) [symbolic = %specific_impl_fn.loc13_11.2 (constants.%specific_impl_fn.c25)]
  1817. // CHECK:STDOUT: %.loc13_15.3: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = temporary_storage
  1818. // CHECK:STDOUT: %J.F.call.loc13_15: init @GenericResult.%as_type.loc12_35.1 (%as_type.baf) to %.loc13_15.3 = call %specific_impl_fn.loc13_11.1(%u.ref.loc13_14)
  1819. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1820. // CHECK:STDOUT: %Op.ref: %I.assoc_type = name_ref Op, @I.%assoc0 [concrete = constants.%assoc0.20d]
  1821. // CHECK:STDOUT: %impl.elem0.loc13_16.1: @GenericResult.%.loc13_16 (%.74f) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_16.2 (constants.%impl.elem0.aa5)]
  1822. // CHECK:STDOUT: %bound_method.loc13_16: <bound method> = bound_method %J.F.call.loc13_15, %impl.elem0.loc13_16.1
  1823. // CHECK:STDOUT: %T.ref.loc13: %J.type = name_ref T, %T.loc12_18.2 [symbolic = %T.loc12_18.1 (constants.%T)]
  1824. // CHECK:STDOUT: %T.as_type.loc13: type = facet_access_type %T.ref.loc13 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1825. // CHECK:STDOUT: %.loc13_25: type = converted %T.ref.loc13, %T.as_type.loc13 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1826. // CHECK:STDOUT: %F.ref.loc13_25: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1]
  1827. // CHECK:STDOUT: %impl.elem1.loc13_25: @GenericResult.%.loc13_11 (%.322) = impl_witness_access constants.%J.lookup_impl_witness.264, element1 [symbolic = %impl.elem1.loc13_11.2 (constants.%impl.elem1)]
  1828. // CHECK:STDOUT: %u.ref.loc13_28: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = name_ref u, %u
  1829. // 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)]
  1830. // CHECK:STDOUT: %.loc13_29.2: %facet_type = converted constants.%as_type.baf, constants.%impl.elem0.397 [symbolic = %impl.elem0.loc12_35.1 (constants.%impl.elem0.397)]
  1831. // CHECK:STDOUT: %specific_impl_fn.loc13_25: <specific function> = specific_impl_function %impl.elem1.loc13_25, @J.F(constants.%T) [symbolic = %specific_impl_fn.loc13_11.2 (constants.%specific_impl_fn.c25)]
  1832. // CHECK:STDOUT: %.loc13_29.3: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = temporary_storage
  1833. // CHECK:STDOUT: %J.F.call.loc13_29: init @GenericResult.%as_type.loc12_35.1 (%as_type.baf) to %.loc13_29.3 = call %specific_impl_fn.loc13_25(%u.ref.loc13_28)
  1834. // CHECK:STDOUT: %I.facet.loc13_30.1: %I.type = facet_value constants.%as_type.baf, (constants.%I.lookup_impl_witness) [symbolic = %I.facet.loc13_16 (constants.%I.facet)]
  1835. // CHECK:STDOUT: %.loc13_30.1: %I.type = converted constants.%as_type.baf, %I.facet.loc13_30.1 [symbolic = %I.facet.loc13_16 (constants.%I.facet)]
  1836. // CHECK:STDOUT: %I.facet.loc13_30.2: %I.type = facet_value constants.%as_type.baf, (constants.%I.lookup_impl_witness) [symbolic = %I.facet.loc13_16 (constants.%I.facet)]
  1837. // CHECK:STDOUT: %.loc13_30.2: %I.type = converted constants.%as_type.baf, %I.facet.loc13_30.2 [symbolic = %I.facet.loc13_16 (constants.%I.facet)]
  1838. // CHECK:STDOUT: %specific_impl_fn.loc13_16.1: <specific function> = specific_impl_function %impl.elem0.loc13_16.1, @I.Op(constants.%I.facet) [symbolic = %specific_impl_fn.loc13_16.2 (constants.%specific_impl_fn.dcb)]
  1839. // CHECK:STDOUT: %bound_method.loc13_30: <bound method> = bound_method %J.F.call.loc13_15, %specific_impl_fn.loc13_16.1
  1840. // CHECK:STDOUT: %.loc12_43.1: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = splice_block %return.param {}
  1841. // CHECK:STDOUT: %.loc13_15.4: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = temporary %.loc13_15.3, %J.F.call.loc13_15
  1842. // CHECK:STDOUT: %.loc13_15.5: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = acquire_value %.loc13_15.4
  1843. // CHECK:STDOUT: %.loc13_29.4: ref @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = temporary %.loc13_29.3, %J.F.call.loc13_29
  1844. // CHECK:STDOUT: %.loc13_29.5: @GenericResult.%as_type.loc12_35.1 (%as_type.baf) = acquire_value %.loc13_29.4
  1845. // CHECK:STDOUT: %I.Op.call: init @GenericResult.%as_type.loc12_35.1 (%as_type.baf) to %.loc12_43.1 = call %bound_method.loc13_30(%.loc13_15.5, %.loc13_29.5)
  1846. // CHECK:STDOUT: %as_type.loc13: type = facet_access_type constants.%impl.elem0.397 [symbolic = %as_type.loc12_35.1 (constants.%as_type.baf)]
  1847. // CHECK:STDOUT: %DestroyOp.bound.loc13_29: <bound method> = bound_method %.loc13_29.4, constants.%DestroyOp
  1848. // CHECK:STDOUT: %DestroyOp.call.loc13_29: init %empty_tuple.type = call %DestroyOp.bound.loc13_29(%.loc13_29.4)
  1849. // CHECK:STDOUT: %DestroyOp.bound.loc13_15: <bound method> = bound_method %.loc13_15.4, constants.%DestroyOp
  1850. // CHECK:STDOUT: %DestroyOp.call.loc13_15: init %empty_tuple.type = call %DestroyOp.bound.loc13_15(%.loc13_15.4)
  1851. // CHECK:STDOUT: return %I.Op.call to %return.param
  1852. // CHECK:STDOUT: }
  1853. // CHECK:STDOUT: }
  1854. // CHECK:STDOUT:
  1855. // CHECK:STDOUT: fn @DestroyOp(%self.param: @GenericResult.%as_type.loc12_35.1 (%as_type.baf)) = "no_op";
  1856. // CHECK:STDOUT:
  1857. // CHECK:STDOUT: specific @I.Op(constants.%Self.ab9) {
  1858. // CHECK:STDOUT: %Self => constants.%Self.ab9
  1859. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.d31
  1860. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fa0
  1861. // CHECK:STDOUT: %.loc4_33.1 => constants.%.1fc
  1862. // CHECK:STDOUT: }
  1863. // CHECK:STDOUT:
  1864. // CHECK:STDOUT: specific @U(constants.%Self.8a1) {}
  1865. // CHECK:STDOUT:
  1866. // CHECK:STDOUT: specific @J.F(constants.%Self.8a1) {
  1867. // CHECK:STDOUT: %Self => constants.%Self.8a1
  1868. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  1869. // CHECK:STDOUT: %impl.elem0.loc9_11.1 => constants.%impl.elem0.193
  1870. // CHECK:STDOUT: %as_type => constants.%as_type.d83
  1871. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.d76
  1872. // CHECK:STDOUT: %.loc9_17.1 => constants.%.8da
  1873. // CHECK:STDOUT: }
  1874. // CHECK:STDOUT:
  1875. // CHECK:STDOUT: specific @U(constants.%T) {}
  1876. // CHECK:STDOUT:
  1877. // CHECK:STDOUT: specific @GenericResult(constants.%T) {
  1878. // CHECK:STDOUT: %T.loc12_18.1 => constants.%T
  1879. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  1880. // CHECK:STDOUT: %pattern_type.loc12_25 => constants.%pattern_type.14f
  1881. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  1882. // CHECK:STDOUT: %impl.elem0.loc12_35.1 => constants.%impl.elem0.397
  1883. // CHECK:STDOUT: %as_type.loc12_35.1 => constants.%as_type.baf
  1884. // CHECK:STDOUT: %pattern_type.loc12_31 => constants.%pattern_type.bba
  1885. // CHECK:STDOUT: %.loc12_43.2 => constants.%.997
  1886. // CHECK:STDOUT: }
  1887. // CHECK:STDOUT:
  1888. // CHECK:STDOUT: specific @J.F(constants.%T) {
  1889. // CHECK:STDOUT: %Self => constants.%T
  1890. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  1891. // CHECK:STDOUT: %impl.elem0.loc9_11.1 => constants.%impl.elem0.397
  1892. // CHECK:STDOUT: %as_type => constants.%as_type.baf
  1893. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.bba
  1894. // CHECK:STDOUT: %.loc9_17.1 => constants.%.d40
  1895. // CHECK:STDOUT: }
  1896. // CHECK:STDOUT:
  1897. // CHECK:STDOUT: specific @I.Op(constants.%I.facet) {
  1898. // CHECK:STDOUT: %Self => constants.%I.facet
  1899. // CHECK:STDOUT: %Self.binding.as_type => constants.%as_type.baf
  1900. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.bba
  1901. // CHECK:STDOUT: %.loc4_33.1 => constants.%.997
  1902. // CHECK:STDOUT: }
  1903. // CHECK:STDOUT:
  1904. // CHECK:STDOUT: --- interface_qualified.carbon
  1905. // CHECK:STDOUT:
  1906. // CHECK:STDOUT: constants {
  1907. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  1908. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic]
  1909. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  1910. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  1911. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic]
  1912. // CHECK:STDOUT: %pattern_type.832: type = pattern_type %Self.binding.as_type [symbolic]
  1913. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self, @J [symbolic]
  1914. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  1915. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  1916. // CHECK:STDOUT: %.f80: form = init_form %impl.elem0.335, call_param2 [symbolic]
  1917. // CHECK:STDOUT: %J.G.type: type = fn_type @J.G [concrete]
  1918. // CHECK:STDOUT: %J.G: %J.G.type = struct_value () [concrete]
  1919. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%J.G.decl [concrete]
  1920. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1921. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1922. // CHECK:STDOUT: %T: %J.type = symbolic_binding T, 0 [symbolic]
  1923. // CHECK:STDOUT: %pattern_type.f76: type = pattern_type %J.type [concrete]
  1924. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic]
  1925. // CHECK:STDOUT: %pattern_type.14f: type = pattern_type %T.binding.as_type [symbolic]
  1926. // CHECK:STDOUT: %J.lookup_impl_witness.264: <witness> = lookup_impl_witness %T, @J [symbolic]
  1927. // CHECK:STDOUT: %impl.elem0.560: type = impl_witness_access %J.lookup_impl_witness.264, element0 [symbolic]
  1928. // CHECK:STDOUT: %pattern_type.ad6: type = pattern_type %impl.elem0.560 [symbolic]
  1929. // CHECK:STDOUT: %.722: form = init_form %impl.elem0.560, call_param2 [symbolic]
  1930. // CHECK:STDOUT: %GenericCallInterfaceQualified.type: type = fn_type @GenericCallInterfaceQualified [concrete]
  1931. // CHECK:STDOUT: %GenericCallInterfaceQualified: %GenericCallInterfaceQualified.type = struct_value () [concrete]
  1932. // CHECK:STDOUT: %require_complete.06a: <witness> = require_complete_type %impl.elem0.560 [symbolic]
  1933. // CHECK:STDOUT: %require_complete.19a: <witness> = require_complete_type %T.binding.as_type [symbolic]
  1934. // CHECK:STDOUT: %.588: type = fn_type_with_self_type %J.G.type, %T [symbolic]
  1935. // CHECK:STDOUT: %impl.elem1: %.588 = impl_witness_access %J.lookup_impl_witness.264, element1 [symbolic]
  1936. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem1, @J.G(%T) [symbolic]
  1937. // CHECK:STDOUT: }
  1938. // CHECK:STDOUT:
  1939. // CHECK:STDOUT: imports {
  1940. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1941. // CHECK:STDOUT: import Core//prelude
  1942. // CHECK:STDOUT: import Core//prelude/...
  1943. // CHECK:STDOUT: }
  1944. // CHECK:STDOUT: }
  1945. // CHECK:STDOUT:
  1946. // CHECK:STDOUT: file {
  1947. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1948. // CHECK:STDOUT: .Core = imports.%Core
  1949. // CHECK:STDOUT: .J = %J.decl
  1950. // CHECK:STDOUT: .GenericCallInterfaceQualified = %GenericCallInterfaceQualified.decl
  1951. // CHECK:STDOUT: }
  1952. // CHECK:STDOUT: %Core.import = import Core
  1953. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1954. // CHECK:STDOUT: %GenericCallInterfaceQualified.decl: %GenericCallInterfaceQualified.type = fn_decl @GenericCallInterfaceQualified [concrete = constants.%GenericCallInterfaceQualified] {
  1955. // CHECK:STDOUT: %T.patt: %pattern_type.f76 = symbolic_binding_pattern T, 0 [concrete]
  1956. // CHECK:STDOUT: %t.patt: @GenericCallInterfaceQualified.%pattern_type.loc8_41 (%pattern_type.14f) = value_binding_pattern t [concrete]
  1957. // CHECK:STDOUT: %t.param_patt: @GenericCallInterfaceQualified.%pattern_type.loc8_41 (%pattern_type.14f) = value_param_pattern %t.patt, call_param0 [concrete]
  1958. // CHECK:STDOUT: %u.patt: @GenericCallInterfaceQualified.%pattern_type.loc8_47 (%pattern_type.ad6) = value_binding_pattern u [concrete]
  1959. // CHECK:STDOUT: %u.param_patt: @GenericCallInterfaceQualified.%pattern_type.loc8_47 (%pattern_type.ad6) = value_param_pattern %u.patt, call_param1 [concrete]
  1960. // CHECK:STDOUT: %return.patt: @GenericCallInterfaceQualified.%pattern_type.loc8_47 (%pattern_type.ad6) = return_slot_pattern [concrete]
  1961. // CHECK:STDOUT: %return.param_patt: @GenericCallInterfaceQualified.%pattern_type.loc8_47 (%pattern_type.ad6) = out_param_pattern %return.patt, call_param2 [concrete]
  1962. // CHECK:STDOUT: } {
  1963. // CHECK:STDOUT: %T.ref.loc8_58: %J.type = name_ref T, %T.loc8_34.2 [symbolic = %T.loc8_34.1 (constants.%T)]
  1964. // CHECK:STDOUT: %T.as_type.loc8_59: type = facet_access_type %T.ref.loc8_58 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1965. // CHECK:STDOUT: %.loc8_59.3: type = converted %T.ref.loc8_58, %T.as_type.loc8_59 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1966. // CHECK:STDOUT: %U.ref.loc8_59: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  1967. // 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)]
  1968. // CHECK:STDOUT: %.loc8_59.4: form = init_form %impl.elem0.loc8_59, call_param2 [symbolic = %.loc8_59.2 (constants.%.722)]
  1969. // CHECK:STDOUT: %.loc8_38: type = splice_block %J.ref.loc8 [concrete = constants.%J.type] {
  1970. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1971. // CHECK:STDOUT: %J.ref.loc8: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1972. // CHECK:STDOUT: }
  1973. // CHECK:STDOUT: %T.loc8_34.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc8_34.1 (constants.%T)]
  1974. // CHECK:STDOUT: %t.param: @GenericCallInterfaceQualified.%T.binding.as_type (%T.binding.as_type) = value_param call_param0
  1975. // CHECK:STDOUT: %.loc8_44.1: type = splice_block %.loc8_44.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
  1976. // CHECK:STDOUT: %T.ref.loc8_44: %J.type = name_ref T, %T.loc8_34.2 [symbolic = %T.loc8_34.1 (constants.%T)]
  1977. // CHECK:STDOUT: %T.as_type.loc8_44: type = facet_access_type %T.ref.loc8_44 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1978. // CHECK:STDOUT: %.loc8_44.2: type = converted %T.ref.loc8_44, %T.as_type.loc8_44 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1979. // CHECK:STDOUT: }
  1980. // CHECK:STDOUT: %t: @GenericCallInterfaceQualified.%T.binding.as_type (%T.binding.as_type) = value_binding t, %t.param
  1981. // CHECK:STDOUT: %u.param: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = value_param call_param1
  1982. // CHECK:STDOUT: %.loc8_51.1: type = splice_block %impl.elem0.loc8_51.2 [symbolic = %impl.elem0.loc8_51.1 (constants.%impl.elem0.560)] {
  1983. // CHECK:STDOUT: %T.ref.loc8_50: %J.type = name_ref T, %T.loc8_34.2 [symbolic = %T.loc8_34.1 (constants.%T)]
  1984. // CHECK:STDOUT: %T.as_type.loc8_51: type = facet_access_type %T.ref.loc8_50 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1985. // CHECK:STDOUT: %.loc8_51.2: type = converted %T.ref.loc8_50, %T.as_type.loc8_51 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1986. // CHECK:STDOUT: %U.ref.loc8_51: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  1987. // 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)]
  1988. // CHECK:STDOUT: }
  1989. // CHECK:STDOUT: %u: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = value_binding u, %u.param
  1990. // CHECK:STDOUT: %return.param: ref @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = out_param call_param2
  1991. // CHECK:STDOUT: %return: ref @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = return_slot %return.param
  1992. // CHECK:STDOUT: }
  1993. // CHECK:STDOUT: }
  1994. // CHECK:STDOUT:
  1995. // CHECK:STDOUT: interface @J {
  1996. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  1997. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1998. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0]
  1999. // CHECK:STDOUT: }
  2000. // CHECK:STDOUT: %J.G.decl: %J.G.type = fn_decl @J.G [concrete = constants.%J.G] {
  2001. // CHECK:STDOUT: %self.patt: @J.G.%pattern_type.loc5_8 (%pattern_type.832) = value_binding_pattern self [concrete]
  2002. // CHECK:STDOUT: %self.param_patt: @J.G.%pattern_type.loc5_8 (%pattern_type.832) = value_param_pattern %self.patt, call_param0 [concrete]
  2003. // CHECK:STDOUT: %v.patt: @J.G.%pattern_type.loc5_20 (%pattern_type.c1a) = value_binding_pattern v [concrete]
  2004. // CHECK:STDOUT: %v.param_patt: @J.G.%pattern_type.loc5_20 (%pattern_type.c1a) = value_param_pattern %v.patt, call_param1 [concrete]
  2005. // CHECK:STDOUT: %return.patt: @J.G.%pattern_type.loc5_20 (%pattern_type.c1a) = return_slot_pattern [concrete]
  2006. // CHECK:STDOUT: %return.param_patt: @J.G.%pattern_type.loc5_20 (%pattern_type.c1a) = out_param_pattern %return.patt, call_param2 [concrete]
  2007. // CHECK:STDOUT: } {
  2008. // 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)]
  2009. // CHECK:STDOUT: %U.ref.loc5_29: type = name_ref U, %impl.elem0.loc5_29 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)]
  2010. // CHECK:STDOUT: %.loc5_29.2: form = init_form %U.ref.loc5_29, call_param2 [symbolic = %.loc5_29.1 (constants.%.f80)]
  2011. // CHECK:STDOUT: %self.param: @J.G.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
  2012. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  2013. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self)]
  2014. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  2015. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  2016. // CHECK:STDOUT: }
  2017. // CHECK:STDOUT: %self: @J.G.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
  2018. // CHECK:STDOUT: %v.param: @J.G.%impl.elem0.loc5_23.1 (%impl.elem0.335) = value_param call_param1
  2019. // CHECK:STDOUT: %.loc5_23: type = splice_block %U.ref.loc5_23 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.335)] {
  2020. // 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)]
  2021. // 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)]
  2022. // CHECK:STDOUT: }
  2023. // CHECK:STDOUT: %v: @J.G.%impl.elem0.loc5_23.1 (%impl.elem0.335) = value_binding v, %v.param
  2024. // CHECK:STDOUT: %return.param: ref @J.G.%impl.elem0.loc5_23.1 (%impl.elem0.335) = out_param call_param2
  2025. // CHECK:STDOUT: %return: ref @J.G.%impl.elem0.loc5_23.1 (%impl.elem0.335) = return_slot %return.param
  2026. // CHECK:STDOUT: }
  2027. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.G.decl [concrete = constants.%assoc1]
  2028. // CHECK:STDOUT:
  2029. // CHECK:STDOUT: !members:
  2030. // CHECK:STDOUT: .Self = %Self
  2031. // CHECK:STDOUT: .U = @U.%assoc0
  2032. // CHECK:STDOUT: .G = %assoc1
  2033. // CHECK:STDOUT: witness = (%U, %J.G.decl)
  2034. // CHECK:STDOUT:
  2035. // CHECK:STDOUT: !requires:
  2036. // CHECK:STDOUT: }
  2037. // CHECK:STDOUT:
  2038. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  2039. // CHECK:STDOUT: assoc_const U:! type;
  2040. // CHECK:STDOUT: }
  2041. // CHECK:STDOUT:
  2042. // CHECK:STDOUT: generic fn @J.G(@J.%Self: %J.type) {
  2043. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  2044. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  2045. // CHECK:STDOUT: %pattern_type.loc5_8: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.loc5_8 (constants.%pattern_type.832)]
  2046. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  2047. // 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)]
  2048. // CHECK:STDOUT: %pattern_type.loc5_20: type = pattern_type %impl.elem0.loc5_23.1 [symbolic = %pattern_type.loc5_20 (constants.%pattern_type.c1a)]
  2049. // CHECK:STDOUT: %.loc5_29.1: form = init_form %impl.elem0.loc5_23.1, call_param2 [symbolic = %.loc5_29.1 (constants.%.f80)]
  2050. // CHECK:STDOUT:
  2051. // CHECK:STDOUT: fn(%self.param: @J.G.%Self.binding.as_type (%Self.binding.as_type), %v.param: @J.G.%impl.elem0.loc5_23.1 (%impl.elem0.335)) -> out %return.param: @J.G.%impl.elem0.loc5_23.1 (%impl.elem0.335);
  2052. // CHECK:STDOUT: }
  2053. // CHECK:STDOUT:
  2054. // CHECK:STDOUT: generic fn @GenericCallInterfaceQualified(%T.loc8_34.2: %J.type) {
  2055. // CHECK:STDOUT: %T.loc8_34.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc8_34.1 (constants.%T)]
  2056. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc8_34.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  2057. // CHECK:STDOUT: %pattern_type.loc8_41: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc8_41 (constants.%pattern_type.14f)]
  2058. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_34.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264)]
  2059. // 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)]
  2060. // CHECK:STDOUT: %pattern_type.loc8_47: type = pattern_type %impl.elem0.loc8_51.1 [symbolic = %pattern_type.loc8_47 (constants.%pattern_type.ad6)]
  2061. // CHECK:STDOUT: %.loc8_59.2: form = init_form %impl.elem0.loc8_51.1, call_param2 [symbolic = %.loc8_59.2 (constants.%.722)]
  2062. // CHECK:STDOUT:
  2063. // CHECK:STDOUT: !definition:
  2064. // CHECK:STDOUT: %require_complete.loc8_59: <witness> = require_complete_type %impl.elem0.loc8_51.1 [symbolic = %require_complete.loc8_59 (constants.%require_complete.06a)]
  2065. // CHECK:STDOUT: %require_complete.loc8_42: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc8_42 (constants.%require_complete.19a)]
  2066. // CHECK:STDOUT: %.loc9: type = fn_type_with_self_type constants.%J.G.type, %T.loc8_34.1 [symbolic = %.loc9 (constants.%.588)]
  2067. // CHECK:STDOUT: %impl.elem1.loc9_11.2: @GenericCallInterfaceQualified.%.loc9 (%.588) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2068. // CHECK:STDOUT: %specific_impl_fn.loc9_11.2: <specific function> = specific_impl_function %impl.elem1.loc9_11.2, @J.G(%T.loc8_34.1) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2069. // CHECK:STDOUT:
  2070. // CHECK:STDOUT: fn(%t.param: @GenericCallInterfaceQualified.%T.binding.as_type (%T.binding.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) {
  2071. // CHECK:STDOUT: !entry:
  2072. // CHECK:STDOUT: %t.ref: @GenericCallInterfaceQualified.%T.binding.as_type (%T.binding.as_type) = name_ref t, %t
  2073. // CHECK:STDOUT: %J.ref.loc9: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2074. // CHECK:STDOUT: %G.ref: %J.assoc_type = name_ref G, @J.%assoc1 [concrete = constants.%assoc1]
  2075. // CHECK:STDOUT: %impl.elem1.loc9_11.1: @GenericCallInterfaceQualified.%.loc9 (%.588) = impl_witness_access constants.%J.lookup_impl_witness.264, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2076. // CHECK:STDOUT: %bound_method.loc9_11: <bound method> = bound_method %t.ref, %impl.elem1.loc9_11.1
  2077. // CHECK:STDOUT: %u.ref: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = name_ref u, %u
  2078. // CHECK:STDOUT: %specific_impl_fn.loc9_11.1: <specific function> = specific_impl_function %impl.elem1.loc9_11.1, @J.G(constants.%T) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2079. // CHECK:STDOUT: %bound_method.loc9_19: <bound method> = bound_method %t.ref, %specific_impl_fn.loc9_11.1
  2080. // CHECK:STDOUT: %.loc8_59.1: ref @GenericCallInterfaceQualified.%impl.elem0.loc8_51.1 (%impl.elem0.560) = splice_block %return.param {}
  2081. // CHECK:STDOUT: %J.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)
  2082. // CHECK:STDOUT: return %J.G.call to %return.param
  2083. // CHECK:STDOUT: }
  2084. // CHECK:STDOUT: }
  2085. // CHECK:STDOUT:
  2086. // CHECK:STDOUT: specific @U(constants.%Self) {}
  2087. // CHECK:STDOUT:
  2088. // CHECK:STDOUT: specific @J.G(constants.%Self) {
  2089. // CHECK:STDOUT: %Self => constants.%Self
  2090. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  2091. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.832
  2092. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  2093. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.335
  2094. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.c1a
  2095. // CHECK:STDOUT: %.loc5_29.1 => constants.%.f80
  2096. // CHECK:STDOUT: }
  2097. // CHECK:STDOUT:
  2098. // CHECK:STDOUT: specific @U(constants.%T) {}
  2099. // CHECK:STDOUT:
  2100. // CHECK:STDOUT: specific @GenericCallInterfaceQualified(constants.%T) {
  2101. // CHECK:STDOUT: %T.loc8_34.1 => constants.%T
  2102. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  2103. // CHECK:STDOUT: %pattern_type.loc8_41 => constants.%pattern_type.14f
  2104. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  2105. // CHECK:STDOUT: %impl.elem0.loc8_51.1 => constants.%impl.elem0.560
  2106. // CHECK:STDOUT: %pattern_type.loc8_47 => constants.%pattern_type.ad6
  2107. // CHECK:STDOUT: %.loc8_59.2 => constants.%.722
  2108. // CHECK:STDOUT: }
  2109. // CHECK:STDOUT:
  2110. // CHECK:STDOUT: specific @J.G(constants.%T) {
  2111. // CHECK:STDOUT: %Self => constants.%T
  2112. // CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type
  2113. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.14f
  2114. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264
  2115. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.560
  2116. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.ad6
  2117. // CHECK:STDOUT: %.loc5_29.1 => constants.%.722
  2118. // CHECK:STDOUT: }
  2119. // CHECK:STDOUT:
  2120. // CHECK:STDOUT: --- use_where.carbon
  2121. // CHECK:STDOUT:
  2122. // CHECK:STDOUT: constants {
  2123. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2124. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  2125. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2126. // CHECK:STDOUT: %assoc0.d5c: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  2127. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  2128. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  2129. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  2130. // CHECK:STDOUT: %.eaf: form = init_form %impl.elem0.335, call_param1 [symbolic]
  2131. // CHECK:STDOUT: %J.F.type: type = fn_type @J.F [concrete]
  2132. // CHECK:STDOUT: %J.F: %J.F.type = struct_value () [concrete]
  2133. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%J.F.decl [concrete]
  2134. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  2135. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  2136. // CHECK:STDOUT: %.Self.2fa: %J.type = symbolic_binding .Self [symbolic_self]
  2137. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.2fa [symbolic_self]
  2138. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self.2fa, @J [symbolic_self]
  2139. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  2140. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  2141. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  2142. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  2143. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  2144. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  2145. // CHECK:STDOUT: %T: %J_where.type = symbolic_binding T, 0 [symbolic]
  2146. // CHECK:STDOUT: %pattern_type.6f0: type = pattern_type %J_where.type [concrete]
  2147. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic]
  2148. // CHECK:STDOUT: %pattern_type.12a: type = pattern_type %T.binding.as_type [symbolic]
  2149. // CHECK:STDOUT: %.4d5: form = init_form %i32, call_param1 [concrete]
  2150. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  2151. // CHECK:STDOUT: %GenericCallFI32.type: type = fn_type @GenericCallFI32 [concrete]
  2152. // CHECK:STDOUT: %GenericCallFI32: %GenericCallFI32.type = struct_value () [concrete]
  2153. // CHECK:STDOUT: %require_complete.226: <witness> = require_complete_type %T.binding.as_type [symbolic]
  2154. // CHECK:STDOUT: %J.lookup_impl_witness.74d: <witness> = lookup_impl_witness %T, @J [symbolic]
  2155. // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.binding.as_type, (%J.lookup_impl_witness.74d) [symbolic]
  2156. // CHECK:STDOUT: %.0ba: type = fn_type_with_self_type %J.F.type, %J.facet [symbolic]
  2157. // CHECK:STDOUT: %impl.elem1: %.0ba = impl_witness_access %J.lookup_impl_witness.74d, element1 [symbolic]
  2158. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  2159. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem1, @J.F(%J.facet) [symbolic]
  2160. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  2161. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  2162. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  2163. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  2164. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  2165. // 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]
  2166. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  2167. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  2168. // 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]
  2169. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  2170. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  2171. // CHECK:STDOUT: %.863: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  2172. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  2173. // 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]
  2174. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  2175. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  2176. // CHECK:STDOUT: }
  2177. // CHECK:STDOUT:
  2178. // CHECK:STDOUT: imports {
  2179. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2180. // CHECK:STDOUT: .Int = %Core.Int
  2181. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  2182. // CHECK:STDOUT: import Core//prelude
  2183. // CHECK:STDOUT: import Core//prelude/...
  2184. // CHECK:STDOUT: }
  2185. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  2186. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  2187. // 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)]
  2188. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  2189. // CHECK:STDOUT: }
  2190. // CHECK:STDOUT:
  2191. // CHECK:STDOUT: file {
  2192. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2193. // CHECK:STDOUT: .Core = imports.%Core
  2194. // CHECK:STDOUT: .J = %J.decl
  2195. // CHECK:STDOUT: .GenericCallFI32 = %GenericCallFI32.decl
  2196. // CHECK:STDOUT: }
  2197. // CHECK:STDOUT: %Core.import = import Core
  2198. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2199. // CHECK:STDOUT: %GenericCallFI32.decl: %GenericCallFI32.type = fn_decl @GenericCallFI32 [concrete = constants.%GenericCallFI32] {
  2200. // CHECK:STDOUT: %T.patt: %pattern_type.6f0 = symbolic_binding_pattern T, 0 [concrete]
  2201. // CHECK:STDOUT: %t.patt: @GenericCallFI32.%pattern_type (%pattern_type.12a) = value_binding_pattern t [concrete]
  2202. // CHECK:STDOUT: %t.param_patt: @GenericCallFI32.%pattern_type (%pattern_type.12a) = value_param_pattern %t.patt, call_param0 [concrete]
  2203. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  2204. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  2205. // CHECK:STDOUT: } {
  2206. // CHECK:STDOUT: %int_32.loc8_51: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  2207. // CHECK:STDOUT: %i32.loc8_51: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  2208. // CHECK:STDOUT: %.loc8_51: form = init_form %i32.loc8_51, call_param1 [concrete = constants.%.4d5]
  2209. // CHECK:STDOUT: %.loc8_26.1: type = splice_block %.loc8_26.2 [concrete = constants.%J_where.type] {
  2210. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  2211. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2212. // CHECK:STDOUT: %.Self.2: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.2fa]
  2213. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.2fa]
  2214. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  2215. // CHECK:STDOUT: %.loc8_32: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  2216. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  2217. // CHECK:STDOUT: %impl.elem0.loc8: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  2218. // CHECK:STDOUT: %int_32.loc8_37: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  2219. // CHECK:STDOUT: %i32.loc8_37: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  2220. // CHECK:STDOUT: %.loc8_26.2: type = where_expr %.Self.2 [concrete = constants.%J_where.type] {
  2221. // CHECK:STDOUT: requirement_base_facet_type constants.%J.type
  2222. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %i32.loc8_37
  2223. // CHECK:STDOUT: }
  2224. // CHECK:STDOUT: }
  2225. // CHECK:STDOUT: %T.loc8_20.2: %J_where.type = symbolic_binding T, 0 [symbolic = %T.loc8_20.1 (constants.%T)]
  2226. // CHECK:STDOUT: %t.param: @GenericCallFI32.%T.binding.as_type (%T.binding.as_type) = value_param call_param0
  2227. // CHECK:STDOUT: %.loc8_45.1: type = splice_block %.loc8_45.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
  2228. // CHECK:STDOUT: %T.ref: %J_where.type = name_ref T, %T.loc8_20.2 [symbolic = %T.loc8_20.1 (constants.%T)]
  2229. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  2230. // CHECK:STDOUT: %.loc8_45.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  2231. // CHECK:STDOUT: }
  2232. // CHECK:STDOUT: %t: @GenericCallFI32.%T.binding.as_type (%T.binding.as_type) = value_binding t, %t.param
  2233. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  2234. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  2235. // CHECK:STDOUT: }
  2236. // CHECK:STDOUT: }
  2237. // CHECK:STDOUT:
  2238. // CHECK:STDOUT: interface @J {
  2239. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  2240. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  2241. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.d5c]
  2242. // CHECK:STDOUT: }
  2243. // CHECK:STDOUT: %J.F.decl: %J.F.type = fn_decl @J.F [concrete = constants.%J.F] {
  2244. // CHECK:STDOUT: %u.patt: @J.F.%pattern_type (%pattern_type.c1a) = value_binding_pattern u [concrete]
  2245. // CHECK:STDOUT: %u.param_patt: @J.F.%pattern_type (%pattern_type.c1a) = value_param_pattern %u.patt, call_param0 [concrete]
  2246. // CHECK:STDOUT: %return.patt: @J.F.%pattern_type (%pattern_type.c1a) = return_slot_pattern [concrete]
  2247. // CHECK:STDOUT: %return.param_patt: @J.F.%pattern_type (%pattern_type.c1a) = out_param_pattern %return.patt, call_param1 [concrete]
  2248. // CHECK:STDOUT: } {
  2249. // 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)]
  2250. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2251. // CHECK:STDOUT: %.loc5_17.2: form = init_form %U.ref.loc5_17, call_param1 [symbolic = %.loc5_17.1 (constants.%.eaf)]
  2252. // CHECK:STDOUT: %u.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_param call_param0
  2253. // CHECK:STDOUT: %.loc5_11: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)] {
  2254. // 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)]
  2255. // 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)]
  2256. // CHECK:STDOUT: }
  2257. // CHECK:STDOUT: %u: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_binding u, %u.param
  2258. // CHECK:STDOUT: %return.param: ref @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = out_param call_param1
  2259. // CHECK:STDOUT: %return: ref @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = return_slot %return.param
  2260. // CHECK:STDOUT: }
  2261. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.F.decl [concrete = constants.%assoc1]
  2262. // CHECK:STDOUT:
  2263. // CHECK:STDOUT: !members:
  2264. // CHECK:STDOUT: .Self = %Self
  2265. // CHECK:STDOUT: .U = @U.%assoc0
  2266. // CHECK:STDOUT: .F = %assoc1
  2267. // CHECK:STDOUT: witness = (%U, %J.F.decl)
  2268. // CHECK:STDOUT:
  2269. // CHECK:STDOUT: !requires:
  2270. // CHECK:STDOUT: }
  2271. // CHECK:STDOUT:
  2272. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  2273. // CHECK:STDOUT: assoc_const U:! type;
  2274. // CHECK:STDOUT: }
  2275. // CHECK:STDOUT:
  2276. // CHECK:STDOUT: generic fn @J.F(@J.%Self: %J.type) {
  2277. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  2278. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  2279. // 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)]
  2280. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.c1a)]
  2281. // CHECK:STDOUT: %.loc5_17.1: form = init_form %impl.elem0.loc5_11.1, call_param1 [symbolic = %.loc5_17.1 (constants.%.eaf)]
  2282. // CHECK:STDOUT:
  2283. // CHECK:STDOUT: fn(%u.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335)) -> out %return.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335);
  2284. // CHECK:STDOUT: }
  2285. // CHECK:STDOUT:
  2286. // CHECK:STDOUT: generic fn @GenericCallFI32(%T.loc8_20.2: %J_where.type) {
  2287. // CHECK:STDOUT: %T.loc8_20.1: %J_where.type = symbolic_binding T, 0 [symbolic = %T.loc8_20.1 (constants.%T)]
  2288. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc8_20.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  2289. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.12a)]
  2290. // CHECK:STDOUT:
  2291. // CHECK:STDOUT: !definition:
  2292. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.226)]
  2293. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_20.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.74d)]
  2294. // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.binding.as_type, (%J.lookup_impl_witness) [symbolic = %J.facet (constants.%J.facet)]
  2295. // CHECK:STDOUT: %.loc9_11: type = fn_type_with_self_type constants.%J.F.type, %J.facet [symbolic = %.loc9_11 (constants.%.0ba)]
  2296. // CHECK:STDOUT: %impl.elem1.loc9_11.2: @GenericCallFI32.%.loc9_11 (%.0ba) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2297. // CHECK:STDOUT: %specific_impl_fn.loc9_11.2: <specific function> = specific_impl_function %impl.elem1.loc9_11.2, @J.F(%J.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2298. // CHECK:STDOUT:
  2299. // CHECK:STDOUT: fn(%t.param: @GenericCallFI32.%T.binding.as_type (%T.binding.as_type)) -> out %return.param: %i32 {
  2300. // CHECK:STDOUT: !entry:
  2301. // CHECK:STDOUT: %t.ref: @GenericCallFI32.%T.binding.as_type (%T.binding.as_type) = name_ref t, %t
  2302. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1]
  2303. // CHECK:STDOUT: %impl.elem1.loc9_11.1: @GenericCallFI32.%.loc9_11 (%.0ba) = impl_witness_access constants.%J.lookup_impl_witness.74d, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2304. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  2305. // CHECK:STDOUT: %specific_impl_fn.loc9_11.1: <specific function> = specific_impl_function %impl.elem1.loc9_11.1, @J.F(constants.%J.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2306. // CHECK:STDOUT: %impl.elem0.loc9: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  2307. // 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]
  2308. // 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]
  2309. // CHECK:STDOUT: %bound_method.loc9_14.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
  2310. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc9_14.2(%int_2) [concrete = constants.%int_2.ef8]
  2311. // CHECK:STDOUT: %.loc9_14.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_2.ef8]
  2312. // CHECK:STDOUT: %.loc9_14.2: %i32 = converted %int_2, %.loc9_14.1 [concrete = constants.%int_2.ef8]
  2313. // CHECK:STDOUT: %J.F.call: init %i32 = call %specific_impl_fn.loc9_11.1(%.loc9_14.2)
  2314. // CHECK:STDOUT: return %J.F.call
  2315. // CHECK:STDOUT: }
  2316. // CHECK:STDOUT: }
  2317. // CHECK:STDOUT:
  2318. // CHECK:STDOUT: specific @U(constants.%Self.8a1) {}
  2319. // CHECK:STDOUT:
  2320. // CHECK:STDOUT: specific @J.F(constants.%Self.8a1) {
  2321. // CHECK:STDOUT: %Self => constants.%Self.8a1
  2322. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  2323. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.335
  2324. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c1a
  2325. // CHECK:STDOUT: %.loc5_17.1 => constants.%.eaf
  2326. // CHECK:STDOUT: }
  2327. // CHECK:STDOUT:
  2328. // CHECK:STDOUT: specific @U(constants.%.Self.2fa) {}
  2329. // CHECK:STDOUT:
  2330. // CHECK:STDOUT: specific @GenericCallFI32(constants.%T) {
  2331. // CHECK:STDOUT: %T.loc8_20.1 => constants.%T
  2332. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  2333. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.12a
  2334. // CHECK:STDOUT: }
  2335. // CHECK:STDOUT:
  2336. // CHECK:STDOUT: specific @J.F(constants.%J.facet) {
  2337. // CHECK:STDOUT: %Self => constants.%J.facet
  2338. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.74d
  2339. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  2340. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  2341. // CHECK:STDOUT: %.loc5_17.1 => constants.%.4d5
  2342. // CHECK:STDOUT: }
  2343. // CHECK:STDOUT:
  2344. // CHECK:STDOUT: --- fail_todo_use_associated_constant_in_impl.carbon
  2345. // CHECK:STDOUT:
  2346. // CHECK:STDOUT: constants {
  2347. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2348. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  2349. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2350. // CHECK:STDOUT: %assoc0.d5c: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  2351. // CHECK:STDOUT: %J.lookup_impl_witness.89e: <witness> = lookup_impl_witness %Self.8a1, @J [symbolic]
  2352. // CHECK:STDOUT: %impl.elem0.335: type = impl_witness_access %J.lookup_impl_witness.89e, element0 [symbolic]
  2353. // CHECK:STDOUT: %pattern_type.c1a: type = pattern_type %impl.elem0.335 [symbolic]
  2354. // CHECK:STDOUT: %.eaf: form = init_form %impl.elem0.335, call_param1 [symbolic]
  2355. // CHECK:STDOUT: %J.F.type: type = fn_type @J.F [concrete]
  2356. // CHECK:STDOUT: %J.F: %J.F.type = struct_value () [concrete]
  2357. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%J.F.decl [concrete]
  2358. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  2359. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self]
  2360. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  2361. // CHECK:STDOUT: %J.lookup_impl_witness.46a: <witness> = lookup_impl_witness %.Self, @J [symbolic_self]
  2362. // CHECK:STDOUT: %impl.elem0.a58: type = impl_witness_access %J.lookup_impl_witness.46a, element0 [symbolic_self]
  2363. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  2364. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  2365. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  2366. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  2367. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.a58 = %i32> [concrete]
  2368. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  2369. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  2370. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  2371. // CHECK:STDOUT: %E.as.J.impl.F.type.4b5c2a.1: type = fn_type @E.as.J.impl.F.loc27_21.1 [concrete]
  2372. // CHECK:STDOUT: %E.as.J.impl.F.b4e6ab.1: %E.as.J.impl.F.type.4b5c2a.1 = struct_value () [concrete]
  2373. // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  2374. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  2375. // CHECK:STDOUT: %.4d5: form = init_form %i32, call_param1 [concrete]
  2376. // CHECK:STDOUT: %E.as.J.impl.F.type.4b5c2a.2: type = fn_type @E.as.J.impl.F.loc27_21.2 [concrete]
  2377. // CHECK:STDOUT: %E.as.J.impl.F.b4e6ab.2: %E.as.J.impl.F.type.4b5c2a.2 = struct_value () [concrete]
  2378. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2379. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  2380. // CHECK:STDOUT: }
  2381. // CHECK:STDOUT:
  2382. // CHECK:STDOUT: imports {
  2383. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2384. // CHECK:STDOUT: .Int = %Core.Int
  2385. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  2386. // CHECK:STDOUT: import Core//prelude
  2387. // CHECK:STDOUT: import Core//prelude/...
  2388. // CHECK:STDOUT: }
  2389. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  2390. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  2391. // CHECK:STDOUT: }
  2392. // CHECK:STDOUT:
  2393. // CHECK:STDOUT: file {
  2394. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2395. // CHECK:STDOUT: .Core = imports.%Core
  2396. // CHECK:STDOUT: .J = %J.decl
  2397. // CHECK:STDOUT: .E = %E.decl
  2398. // CHECK:STDOUT: }
  2399. // CHECK:STDOUT: %Core.import = import Core
  2400. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2401. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  2402. // CHECK:STDOUT: }
  2403. // CHECK:STDOUT:
  2404. // CHECK:STDOUT: interface @J {
  2405. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  2406. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  2407. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.d5c]
  2408. // CHECK:STDOUT: }
  2409. // CHECK:STDOUT: %J.F.decl: %J.F.type = fn_decl @J.F [concrete = constants.%J.F] {
  2410. // CHECK:STDOUT: %u.patt: @J.F.%pattern_type (%pattern_type.c1a) = value_binding_pattern u [concrete]
  2411. // CHECK:STDOUT: %u.param_patt: @J.F.%pattern_type (%pattern_type.c1a) = value_param_pattern %u.patt, call_param0 [concrete]
  2412. // CHECK:STDOUT: %return.patt: @J.F.%pattern_type (%pattern_type.c1a) = return_slot_pattern [concrete]
  2413. // CHECK:STDOUT: %return.param_patt: @J.F.%pattern_type (%pattern_type.c1a) = out_param_pattern %return.patt, call_param1 [concrete]
  2414. // CHECK:STDOUT: } {
  2415. // 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)]
  2416. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)]
  2417. // CHECK:STDOUT: %.loc5_17.2: form = init_form %U.ref.loc5_17, call_param1 [symbolic = %.loc5_17.1 (constants.%.eaf)]
  2418. // CHECK:STDOUT: %u.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_param call_param0
  2419. // CHECK:STDOUT: %.loc5_11: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.335)] {
  2420. // 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)]
  2421. // 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)]
  2422. // CHECK:STDOUT: }
  2423. // CHECK:STDOUT: %u: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = value_binding u, %u.param
  2424. // CHECK:STDOUT: %return.param: ref @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = out_param call_param1
  2425. // CHECK:STDOUT: %return: ref @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335) = return_slot %return.param
  2426. // CHECK:STDOUT: }
  2427. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.F.decl [concrete = constants.%assoc1]
  2428. // CHECK:STDOUT:
  2429. // CHECK:STDOUT: !members:
  2430. // CHECK:STDOUT: .Self = %Self
  2431. // CHECK:STDOUT: .U = @U.%assoc0
  2432. // CHECK:STDOUT: .F = %assoc1
  2433. // CHECK:STDOUT: witness = (%U, %J.F.decl)
  2434. // CHECK:STDOUT:
  2435. // CHECK:STDOUT: !requires:
  2436. // CHECK:STDOUT: }
  2437. // CHECK:STDOUT:
  2438. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  2439. // CHECK:STDOUT: assoc_const U:! type;
  2440. // CHECK:STDOUT: }
  2441. // CHECK:STDOUT:
  2442. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %.loc9_20 {
  2443. // 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] {
  2444. // CHECK:STDOUT: %u.patt: <error> = value_binding_pattern u [concrete]
  2445. // CHECK:STDOUT: %u.param_patt: <error> = value_param_pattern %u.patt, call_param0 [concrete]
  2446. // CHECK:STDOUT: } {
  2447. // CHECK:STDOUT: %U.ref.loc27_19: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  2448. // CHECK:STDOUT: %.loc27_19: type = converted %U.ref.loc27_19, <error> [concrete = <error>]
  2449. // CHECK:STDOUT: %u.param: <error> = value_param call_param0
  2450. // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
  2451. // CHECK:STDOUT: %U.ref.loc27_13: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  2452. // CHECK:STDOUT: %.loc27_13: type = converted %U.ref.loc27_13, <error> [concrete = <error>]
  2453. // CHECK:STDOUT: }
  2454. // CHECK:STDOUT: %u: <error> = value_binding u, %u.param
  2455. // CHECK:STDOUT: }
  2456. // CHECK:STDOUT: %.loc5_17.1: type = specific_constant @J.F.%U.ref.loc5_17, @J.F(constants.%J.facet) [concrete = constants.%i32]
  2457. // CHECK:STDOUT: %.loc5_17.2: type = specific_constant @J.F.%.loc5_17.2, @J.F(constants.%J.facet) [concrete = constants.%.4d5]
  2458. // 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] {
  2459. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = value_binding_pattern u [concrete]
  2460. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern %u.patt, call_param0 [concrete]
  2461. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  2462. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  2463. // CHECK:STDOUT: } {
  2464. // CHECK:STDOUT: %u.param: %i32 = value_param call_param0
  2465. // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param
  2466. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  2467. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  2468. // CHECK:STDOUT: }
  2469. // 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]
  2470. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  2471. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  2472. // CHECK:STDOUT:
  2473. // CHECK:STDOUT: !members:
  2474. // CHECK:STDOUT: .U = <poisoned>
  2475. // CHECK:STDOUT: .F = %E.as.J.impl.F.decl.loc27_21.1
  2476. // CHECK:STDOUT: witness = %J.impl_witness
  2477. // CHECK:STDOUT: }
  2478. // CHECK:STDOUT:
  2479. // CHECK:STDOUT: class @E {
  2480. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  2481. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2482. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2483. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  2484. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  2485. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  2486. // CHECK:STDOUT: %.loc9_26: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  2487. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.d5c]
  2488. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.46a, element0 [symbolic_self = constants.%impl.elem0.a58]
  2489. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  2490. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  2491. // CHECK:STDOUT: %.loc9_20: type = where_expr %.Self [concrete = constants.%J_where.type] {
  2492. // CHECK:STDOUT: requirement_base_facet_type constants.%J.type
  2493. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  2494. // CHECK:STDOUT: }
  2495. // CHECK:STDOUT: }
  2496. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  2497. // CHECK:STDOUT: complete_type_witness = %complete_type
  2498. // CHECK:STDOUT:
  2499. // CHECK:STDOUT: !members:
  2500. // CHECK:STDOUT: .Self = constants.%E
  2501. // CHECK:STDOUT: .J = <poisoned>
  2502. // CHECK:STDOUT: .U = <poisoned>
  2503. // CHECK:STDOUT: extend @E.as.J.impl.%.loc9_20
  2504. // CHECK:STDOUT: }
  2505. // CHECK:STDOUT:
  2506. // CHECK:STDOUT: generic fn @J.F(@J.%Self: %J.type) {
  2507. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  2508. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.89e)]
  2509. // 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)]
  2510. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.c1a)]
  2511. // CHECK:STDOUT: %.loc5_17.1: form = init_form %impl.elem0.loc5_11.1, call_param1 [symbolic = %.loc5_17.1 (constants.%.eaf)]
  2512. // CHECK:STDOUT:
  2513. // CHECK:STDOUT: fn(%u.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335)) -> out %return.param: @J.F.%impl.elem0.loc5_11.1 (%impl.elem0.335);
  2514. // CHECK:STDOUT: }
  2515. // CHECK:STDOUT:
  2516. // CHECK:STDOUT: fn @E.as.J.impl.F.loc27_21.1(%u.param: <error>) -> <error> {
  2517. // CHECK:STDOUT: !entry:
  2518. // CHECK:STDOUT: %u.ref: <error> = name_ref u, %u
  2519. // CHECK:STDOUT: return <error>
  2520. // CHECK:STDOUT: }
  2521. // CHECK:STDOUT:
  2522. // 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] {
  2523. // CHECK:STDOUT: !entry:
  2524. // 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]
  2525. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u.param
  2526. // CHECK:STDOUT: %return.ref: ref %i32 = name_ref <return slot>, %return.param
  2527. // CHECK:STDOUT: %E.as.J.impl.F.call: <error> = call %F.ref(<error>)
  2528. // CHECK:STDOUT: return <error>
  2529. // CHECK:STDOUT: }
  2530. // CHECK:STDOUT:
  2531. // CHECK:STDOUT: specific @U(constants.%Self.8a1) {}
  2532. // CHECK:STDOUT:
  2533. // CHECK:STDOUT: specific @J.F(constants.%Self.8a1) {
  2534. // CHECK:STDOUT: %Self => constants.%Self.8a1
  2535. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.89e
  2536. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.335
  2537. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c1a
  2538. // CHECK:STDOUT: %.loc5_17.1 => constants.%.eaf
  2539. // CHECK:STDOUT: }
  2540. // CHECK:STDOUT:
  2541. // CHECK:STDOUT: specific @U(constants.%.Self) {}
  2542. // CHECK:STDOUT:
  2543. // CHECK:STDOUT: specific @J.F(constants.%J.facet) {
  2544. // CHECK:STDOUT: %Self => constants.%J.facet
  2545. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  2546. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  2547. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  2548. // CHECK:STDOUT: %.loc5_17.1 => constants.%.4d5
  2549. // CHECK:STDOUT: }
  2550. // CHECK:STDOUT:
  2551. // CHECK:STDOUT: --- fail_todo_call_extend_fn.carbon
  2552. // CHECK:STDOUT:
  2553. // CHECK:STDOUT: constants {
  2554. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2555. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic]
  2556. // CHECK:STDOUT: %J.F.type: type = fn_type @J.F [concrete]
  2557. // CHECK:STDOUT: %J.F: %J.F.type = struct_value () [concrete]
  2558. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2559. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%J.F.decl [concrete]
  2560. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  2561. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  2562. // CHECK:STDOUT: %E.as.J.impl.F.type: type = fn_type @E.as.J.impl.F [concrete]
  2563. // CHECK:STDOUT: %E.as.J.impl.F: %E.as.J.impl.F.type = struct_value () [concrete]
  2564. // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  2565. // CHECK:STDOUT: %E.G.type: type = fn_type @E.G [concrete]
  2566. // CHECK:STDOUT: %E.G: %E.G.type = struct_value () [concrete]
  2567. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2568. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2569. // CHECK:STDOUT: }
  2570. // CHECK:STDOUT:
  2571. // CHECK:STDOUT: imports {
  2572. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2573. // CHECK:STDOUT: import Core//prelude
  2574. // CHECK:STDOUT: import Core//prelude/...
  2575. // CHECK:STDOUT: }
  2576. // CHECK:STDOUT: }
  2577. // CHECK:STDOUT:
  2578. // CHECK:STDOUT: file {
  2579. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2580. // CHECK:STDOUT: .Core = imports.%Core
  2581. // CHECK:STDOUT: .J = %J.decl
  2582. // CHECK:STDOUT: .E = %E.decl
  2583. // CHECK:STDOUT: }
  2584. // CHECK:STDOUT: %Core.import = import Core
  2585. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2586. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  2587. // CHECK:STDOUT: }
  2588. // CHECK:STDOUT:
  2589. // CHECK:STDOUT: interface @J {
  2590. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  2591. // CHECK:STDOUT: %J.F.decl: %J.F.type = fn_decl @J.F [concrete = constants.%J.F] {} {}
  2592. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, %J.F.decl [concrete = constants.%assoc0]
  2593. // CHECK:STDOUT:
  2594. // CHECK:STDOUT: !members:
  2595. // CHECK:STDOUT: .Self = %Self
  2596. // CHECK:STDOUT: .F = %assoc0
  2597. // CHECK:STDOUT: witness = (%J.F.decl)
  2598. // CHECK:STDOUT:
  2599. // CHECK:STDOUT: !requires:
  2600. // CHECK:STDOUT: }
  2601. // CHECK:STDOUT:
  2602. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %J.ref {
  2603. // 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] {} {}
  2604. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%E.as.J.impl.F.decl), @E.as.J.impl [concrete]
  2605. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  2606. // CHECK:STDOUT:
  2607. // CHECK:STDOUT: !members:
  2608. // CHECK:STDOUT: .F = %E.as.J.impl.F.decl
  2609. // CHECK:STDOUT: witness = %J.impl_witness
  2610. // CHECK:STDOUT: }
  2611. // CHECK:STDOUT:
  2612. // CHECK:STDOUT: class @E {
  2613. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  2614. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2615. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2616. // CHECK:STDOUT: }
  2617. // CHECK:STDOUT: %E.G.decl: %E.G.type = fn_decl @E.G [concrete = constants.%E.G] {} {}
  2618. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2619. // CHECK:STDOUT: complete_type_witness = %complete_type
  2620. // CHECK:STDOUT:
  2621. // CHECK:STDOUT: !members:
  2622. // CHECK:STDOUT: .Self = constants.%E
  2623. // CHECK:STDOUT: .J = <poisoned>
  2624. // CHECK:STDOUT: .G = %E.G.decl
  2625. // CHECK:STDOUT: .F = <poisoned>
  2626. // CHECK:STDOUT: extend @E.as.J.impl.%J.ref
  2627. // CHECK:STDOUT: }
  2628. // CHECK:STDOUT:
  2629. // CHECK:STDOUT: generic fn @J.F(@J.%Self: %J.type) {
  2630. // CHECK:STDOUT: !definition:
  2631. // CHECK:STDOUT:
  2632. // CHECK:STDOUT: fn() {
  2633. // CHECK:STDOUT: !entry:
  2634. // CHECK:STDOUT: return
  2635. // CHECK:STDOUT: }
  2636. // CHECK:STDOUT: }
  2637. // CHECK:STDOUT:
  2638. // CHECK:STDOUT: fn @E.as.J.impl.F() {
  2639. // CHECK:STDOUT: !entry:
  2640. // CHECK:STDOUT: return
  2641. // CHECK:STDOUT: }
  2642. // CHECK:STDOUT:
  2643. // CHECK:STDOUT: fn @E.G() {
  2644. // CHECK:STDOUT: !entry:
  2645. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc0 [concrete = constants.%assoc0]
  2646. // CHECK:STDOUT: return
  2647. // CHECK:STDOUT: }
  2648. // CHECK:STDOUT:
  2649. // CHECK:STDOUT: specific @J.F(constants.%Self) {}
  2650. // CHECK:STDOUT:
  2651. // CHECK:STDOUT: specific @J.F(constants.%J.facet) {}
  2652. // CHECK:STDOUT:
  2653. // CHECK:STDOUT: --- call_extend_method.carbon
  2654. // CHECK:STDOUT:
  2655. // CHECK:STDOUT: constants {
  2656. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2657. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic]
  2658. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic]
  2659. // CHECK:STDOUT: %pattern_type.832: type = pattern_type %Self.binding.as_type [symbolic]
  2660. // CHECK:STDOUT: %J.F.type: type = fn_type @J.F [concrete]
  2661. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2662. // CHECK:STDOUT: %J.F: %J.F.type = struct_value () [concrete]
  2663. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2664. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%J.F.decl [concrete]
  2665. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.binding.as_type [symbolic]
  2666. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  2667. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  2668. // CHECK:STDOUT: %pattern_type.99f: type = pattern_type %E [concrete]
  2669. // CHECK:STDOUT: %E.as.J.impl.F.type: type = fn_type @E.as.J.impl.F [concrete]
  2670. // CHECK:STDOUT: %E.as.J.impl.F: %E.as.J.impl.F.type = struct_value () [concrete]
  2671. // CHECK:STDOUT: %J.facet: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  2672. // CHECK:STDOUT: %E.G.type: type = fn_type @E.G [concrete]
  2673. // CHECK:STDOUT: %E.G: %E.G.type = struct_value () [concrete]
  2674. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2675. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2676. // CHECK:STDOUT: %.772: type = fn_type_with_self_type %J.F.type, %J.facet [concrete]
  2677. // CHECK:STDOUT: }
  2678. // CHECK:STDOUT:
  2679. // CHECK:STDOUT: imports {
  2680. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2681. // CHECK:STDOUT: import Core//prelude
  2682. // CHECK:STDOUT: import Core//prelude/...
  2683. // CHECK:STDOUT: }
  2684. // CHECK:STDOUT: }
  2685. // CHECK:STDOUT:
  2686. // CHECK:STDOUT: file {
  2687. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2688. // CHECK:STDOUT: .Core = imports.%Core
  2689. // CHECK:STDOUT: .J = %J.decl
  2690. // CHECK:STDOUT: .E = %E.decl
  2691. // CHECK:STDOUT: }
  2692. // CHECK:STDOUT: %Core.import = import Core
  2693. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2694. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  2695. // CHECK:STDOUT: }
  2696. // CHECK:STDOUT:
  2697. // CHECK:STDOUT: interface @J {
  2698. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  2699. // CHECK:STDOUT: %J.F.decl: %J.F.type = fn_decl @J.F [concrete = constants.%J.F] {
  2700. // CHECK:STDOUT: %self.patt: @J.F.%pattern_type (%pattern_type.832) = value_binding_pattern self [concrete]
  2701. // CHECK:STDOUT: %self.param_patt: @J.F.%pattern_type (%pattern_type.832) = value_param_pattern %self.patt, call_param0 [concrete]
  2702. // CHECK:STDOUT: } {
  2703. // CHECK:STDOUT: %self.param: @J.F.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
  2704. // CHECK:STDOUT: %.loc4_14.1: type = splice_block %.loc4_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  2705. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self)]
  2706. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  2707. // CHECK:STDOUT: %.loc4_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  2708. // CHECK:STDOUT: }
  2709. // CHECK:STDOUT: %self: @J.F.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
  2710. // CHECK:STDOUT: }
  2711. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, %J.F.decl [concrete = constants.%assoc0]
  2712. // CHECK:STDOUT:
  2713. // CHECK:STDOUT: !members:
  2714. // CHECK:STDOUT: .Self = %Self
  2715. // CHECK:STDOUT: .F = %assoc0
  2716. // CHECK:STDOUT: witness = (%J.F.decl)
  2717. // CHECK:STDOUT:
  2718. // CHECK:STDOUT: !requires:
  2719. // CHECK:STDOUT: }
  2720. // CHECK:STDOUT:
  2721. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %J.ref {
  2722. // 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] {
  2723. // CHECK:STDOUT: %self.patt: %pattern_type.99f = value_binding_pattern self [concrete]
  2724. // CHECK:STDOUT: %self.param_patt: %pattern_type.99f = value_param_pattern %self.patt, call_param0 [concrete]
  2725. // CHECK:STDOUT: } {
  2726. // CHECK:STDOUT: %self.param: %E = value_param call_param0
  2727. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2728. // CHECK:STDOUT: %self: %E = value_binding self, %self.param
  2729. // CHECK:STDOUT: }
  2730. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%E.as.J.impl.F.decl), @E.as.J.impl [concrete]
  2731. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  2732. // CHECK:STDOUT:
  2733. // CHECK:STDOUT: !members:
  2734. // CHECK:STDOUT: .F = %E.as.J.impl.F.decl
  2735. // CHECK:STDOUT: witness = %J.impl_witness
  2736. // CHECK:STDOUT: }
  2737. // CHECK:STDOUT:
  2738. // CHECK:STDOUT: class @E {
  2739. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  2740. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2741. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2742. // CHECK:STDOUT: }
  2743. // CHECK:STDOUT: %E.G.decl: %E.G.type = fn_decl @E.G [concrete = constants.%E.G] {
  2744. // CHECK:STDOUT: %self.patt: %pattern_type.99f = value_binding_pattern self [concrete]
  2745. // CHECK:STDOUT: %self.param_patt: %pattern_type.99f = value_param_pattern %self.patt, call_param0 [concrete]
  2746. // CHECK:STDOUT: } {
  2747. // CHECK:STDOUT: %self.param: %E = value_param call_param0
  2748. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2749. // CHECK:STDOUT: %self: %E = value_binding self, %self.param
  2750. // CHECK:STDOUT: }
  2751. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2752. // CHECK:STDOUT: complete_type_witness = %complete_type
  2753. // CHECK:STDOUT:
  2754. // CHECK:STDOUT: !members:
  2755. // CHECK:STDOUT: .Self = constants.%E
  2756. // CHECK:STDOUT: .J = <poisoned>
  2757. // CHECK:STDOUT: .G = %E.G.decl
  2758. // CHECK:STDOUT: .F = <poisoned>
  2759. // CHECK:STDOUT: extend @E.as.J.impl.%J.ref
  2760. // CHECK:STDOUT: }
  2761. // CHECK:STDOUT:
  2762. // CHECK:STDOUT: generic fn @J.F(@J.%Self: %J.type) {
  2763. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  2764. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  2765. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.832)]
  2766. // CHECK:STDOUT:
  2767. // CHECK:STDOUT: !definition:
  2768. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.binding.as_type [symbolic = %require_complete (constants.%require_complete)]
  2769. // CHECK:STDOUT:
  2770. // CHECK:STDOUT: fn(%self.param: @J.F.%Self.binding.as_type (%Self.binding.as_type)) {
  2771. // CHECK:STDOUT: !entry:
  2772. // CHECK:STDOUT: return
  2773. // CHECK:STDOUT: }
  2774. // CHECK:STDOUT: }
  2775. // CHECK:STDOUT:
  2776. // CHECK:STDOUT: fn @E.as.J.impl.F(%self.param: %E) {
  2777. // CHECK:STDOUT: !entry:
  2778. // CHECK:STDOUT: return
  2779. // CHECK:STDOUT: }
  2780. // CHECK:STDOUT:
  2781. // CHECK:STDOUT: fn @E.G(%self.param: %E) {
  2782. // CHECK:STDOUT: !entry:
  2783. // CHECK:STDOUT: %self.ref: %E = name_ref self, %self
  2784. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc0 [concrete = constants.%assoc0]
  2785. // CHECK:STDOUT: %impl.elem0: %.772 = impl_witness_access constants.%J.impl_witness, element0 [concrete = constants.%E.as.J.impl.F]
  2786. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %self.ref, %impl.elem0
  2787. // CHECK:STDOUT: %E.as.J.impl.F.call: init %empty_tuple.type = call %bound_method(%self.ref)
  2788. // CHECK:STDOUT: return
  2789. // CHECK:STDOUT: }
  2790. // CHECK:STDOUT:
  2791. // CHECK:STDOUT: specific @J.F(constants.%Self) {
  2792. // CHECK:STDOUT: %Self => constants.%Self
  2793. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  2794. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.832
  2795. // CHECK:STDOUT: }
  2796. // CHECK:STDOUT:
  2797. // CHECK:STDOUT: specific @J.F(constants.%J.facet) {
  2798. // CHECK:STDOUT: %Self => constants.%J.facet
  2799. // CHECK:STDOUT: %Self.binding.as_type => constants.%E
  2800. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.99f
  2801. // CHECK:STDOUT: }
  2802. // CHECK:STDOUT:
  2803. // CHECK:STDOUT: --- fail_todo_use_extend_constant.carbon
  2804. // CHECK:STDOUT:
  2805. // CHECK:STDOUT: constants {
  2806. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2807. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  2808. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2809. // CHECK:STDOUT: %assoc0.cab: %J.assoc_type = assoc_entity element0, @J.%X [concrete]
  2810. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  2811. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self]
  2812. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2813. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  2814. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @J [symbolic_self]
  2815. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic_self]
  2816. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  2817. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0 = %empty_tuple.type> [concrete]
  2818. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.as.J.impl.%J.impl_witness_table [concrete]
  2819. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  2820. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  2821. // CHECK:STDOUT: %E.G.type: type = fn_type @E.G [concrete]
  2822. // CHECK:STDOUT: %E.G: %E.G.type = struct_value () [concrete]
  2823. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2824. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2825. // CHECK:STDOUT: }
  2826. // CHECK:STDOUT:
  2827. // CHECK:STDOUT: imports {
  2828. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2829. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  2830. // CHECK:STDOUT: import Core//prelude
  2831. // CHECK:STDOUT: import Core//prelude/...
  2832. // CHECK:STDOUT: }
  2833. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  2834. // CHECK:STDOUT: }
  2835. // CHECK:STDOUT:
  2836. // CHECK:STDOUT: file {
  2837. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2838. // CHECK:STDOUT: .Core = imports.%Core
  2839. // CHECK:STDOUT: .J = %J.decl
  2840. // CHECK:STDOUT: .E = %E.decl
  2841. // CHECK:STDOUT: }
  2842. // CHECK:STDOUT: %Core.import = import Core
  2843. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2844. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  2845. // CHECK:STDOUT: }
  2846. // CHECK:STDOUT:
  2847. // CHECK:STDOUT: interface @J {
  2848. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  2849. // CHECK:STDOUT: %X: type = assoc_const_decl @X [concrete] {
  2850. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%X [concrete = constants.%assoc0.cab]
  2851. // CHECK:STDOUT: }
  2852. // CHECK:STDOUT:
  2853. // CHECK:STDOUT: !members:
  2854. // CHECK:STDOUT: .Self = %Self
  2855. // CHECK:STDOUT: .X = @X.%assoc0
  2856. // CHECK:STDOUT: witness = (%X)
  2857. // CHECK:STDOUT:
  2858. // CHECK:STDOUT: !requires:
  2859. // CHECK:STDOUT: }
  2860. // CHECK:STDOUT:
  2861. // CHECK:STDOUT: generic assoc_const @X(@J.%Self: %J.type) {
  2862. // CHECK:STDOUT: assoc_const X:! type;
  2863. // CHECK:STDOUT: }
  2864. // CHECK:STDOUT:
  2865. // CHECK:STDOUT: impl @E.as.J.impl: %Self.ref as %.loc8_20 {
  2866. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @E.as.J.impl [concrete]
  2867. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  2868. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  2869. // CHECK:STDOUT:
  2870. // CHECK:STDOUT: !members:
  2871. // CHECK:STDOUT: witness = %J.impl_witness
  2872. // CHECK:STDOUT: }
  2873. // CHECK:STDOUT:
  2874. // CHECK:STDOUT: class @E {
  2875. // CHECK:STDOUT: impl_decl @E.as.J.impl [concrete] {} {
  2876. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2877. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2878. // CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  2879. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  2880. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  2881. // CHECK:STDOUT: %.loc8_26: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  2882. // CHECK:STDOUT: %X.ref: %J.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.cab]
  2883. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  2884. // CHECK:STDOUT: %.loc8_32.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  2885. // CHECK:STDOUT: %.loc8_32.2: type = converted %.loc8_32.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  2886. // CHECK:STDOUT: %.loc8_20: type = where_expr %.Self [concrete = constants.%J_where.type] {
  2887. // CHECK:STDOUT: requirement_base_facet_type constants.%J.type
  2888. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_32.2
  2889. // CHECK:STDOUT: }
  2890. // CHECK:STDOUT: }
  2891. // CHECK:STDOUT: %E.G.decl: %E.G.type = fn_decl @E.G [concrete = constants.%E.G] {} {
  2892. // CHECK:STDOUT: %X.ref: %J.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.cab]
  2893. // CHECK:STDOUT: %.loc18_13: type = converted %X.ref, <error> [concrete = <error>]
  2894. // CHECK:STDOUT: }
  2895. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2896. // CHECK:STDOUT: complete_type_witness = %complete_type
  2897. // CHECK:STDOUT:
  2898. // CHECK:STDOUT: !members:
  2899. // CHECK:STDOUT: .Self = constants.%E
  2900. // CHECK:STDOUT: .J = <poisoned>
  2901. // CHECK:STDOUT: .X = <poisoned>
  2902. // CHECK:STDOUT: .G = %E.G.decl
  2903. // CHECK:STDOUT: extend @E.as.J.impl.%.loc8_20
  2904. // CHECK:STDOUT: }
  2905. // CHECK:STDOUT:
  2906. // CHECK:STDOUT: fn @E.G() -> <error> {
  2907. // CHECK:STDOUT: !entry:
  2908. // CHECK:STDOUT: %.loc18_25: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  2909. // CHECK:STDOUT: return <error>
  2910. // CHECK:STDOUT: }
  2911. // CHECK:STDOUT:
  2912. // CHECK:STDOUT: specific @X(constants.%Self.8a1) {}
  2913. // CHECK:STDOUT:
  2914. // CHECK:STDOUT: specific @X(constants.%.Self) {}
  2915. // CHECK:STDOUT:
  2916. // CHECK:STDOUT: --- fail_todo_self_period_associated_type.carbon
  2917. // CHECK:STDOUT:
  2918. // CHECK:STDOUT: constants {
  2919. // CHECK:STDOUT: %J2.type: type = facet_type <@J2> [concrete]
  2920. // CHECK:STDOUT: %Self: %J2.type = symbolic_binding Self, 0 [symbolic]
  2921. // CHECK:STDOUT: %J2.assoc_type: type = assoc_entity_type @J2 [concrete]
  2922. // CHECK:STDOUT: %assoc0: %J2.assoc_type = assoc_entity element0, @J2.%U2 [concrete]
  2923. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic]
  2924. // CHECK:STDOUT: %pattern_type.21d: type = pattern_type %Self.binding.as_type [symbolic]
  2925. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2926. // CHECK:STDOUT: %J2.F.type: type = fn_type @J2.F [concrete]
  2927. // CHECK:STDOUT: %J2.F: %J2.F.type = struct_value () [concrete]
  2928. // CHECK:STDOUT: %assoc1: %J2.assoc_type = assoc_entity element1, @J2.%J2.F.decl [concrete]
  2929. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  2930. // CHECK:STDOUT: %.Self: %J2.type = symbolic_binding .Self [symbolic_self]
  2931. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  2932. // CHECK:STDOUT: %J2.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @J2 [symbolic_self]
  2933. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J2.lookup_impl_witness, element0 [symbolic_self]
  2934. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2935. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  2936. // CHECK:STDOUT: %J2_where.type.1ad: type = facet_type <@J2 where %impl.elem0 = %empty_struct_type> [concrete]
  2937. // CHECK:STDOUT: %J2.impl_witness.941: <witness> = impl_witness @empty_tuple.type.as.J2.impl.%J2.impl_witness_table [concrete]
  2938. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  2939. // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
  2940. // CHECK:STDOUT: %.d7d: form = init_form %empty_struct_type, call_param2 [concrete]
  2941. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_33.1 [concrete]
  2942. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.7b8679.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = struct_value () [concrete]
  2943. // CHECK:STDOUT: %J2.facet.6c9: %J2.type = facet_value %empty_tuple.type, (%J2.impl_witness.941) [concrete]
  2944. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_33.2 [concrete]
  2945. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.7b8679.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = struct_value () [concrete]
  2946. // CHECK:STDOUT: %C2: type = class_type @C2 [concrete]
  2947. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2948. // CHECK:STDOUT: %J2_where.type.de0: type = facet_type <@J2 where %impl.elem0 = %C2> [concrete]
  2949. // CHECK:STDOUT: %J2.impl_witness.30f: <witness> = impl_witness @C2.as.J2.impl.%J2.impl_witness_table [concrete]
  2950. // CHECK:STDOUT: %pattern_type.8df: type = pattern_type %C2 [concrete]
  2951. // CHECK:STDOUT: %.da5: form = init_form %C2, call_param2 [concrete]
  2952. // CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.1: type = fn_type @C2.as.J2.impl.F.loc32_33.1 [concrete]
  2953. // CHECK:STDOUT: %C2.as.J2.impl.F.720bb2.1: %C2.as.J2.impl.F.type.d2a210.1 = struct_value () [concrete]
  2954. // CHECK:STDOUT: %J2.facet.f19: %J2.type = facet_value %C2, (%J2.impl_witness.30f) [concrete]
  2955. // CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.2: type = fn_type @C2.as.J2.impl.F.loc32_33.2 [concrete]
  2956. // CHECK:STDOUT: %C2.as.J2.impl.F.720bb2.2: %C2.as.J2.impl.F.type.d2a210.2 = struct_value () [concrete]
  2957. // CHECK:STDOUT: %C2.val: %C2 = struct_value () [concrete]
  2958. // CHECK:STDOUT: }
  2959. // CHECK:STDOUT:
  2960. // CHECK:STDOUT: imports {
  2961. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2962. // CHECK:STDOUT: import Core//prelude
  2963. // CHECK:STDOUT: import Core//prelude/...
  2964. // CHECK:STDOUT: }
  2965. // CHECK:STDOUT: }
  2966. // CHECK:STDOUT:
  2967. // CHECK:STDOUT: file {
  2968. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2969. // CHECK:STDOUT: .Core = imports.%Core
  2970. // CHECK:STDOUT: .J2 = %J2.decl
  2971. // CHECK:STDOUT: .C2 = %C2.decl
  2972. // CHECK:STDOUT: }
  2973. // CHECK:STDOUT: %Core.import = import Core
  2974. // CHECK:STDOUT: %J2.decl: type = interface_decl @J2 [concrete = constants.%J2.type] {} {}
  2975. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.J2.impl [concrete] {} {
  2976. // CHECK:STDOUT: %.loc22_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  2977. // CHECK:STDOUT: %.loc22_7.2: type = converted %.loc22_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  2978. // CHECK:STDOUT: %J2.ref: type = name_ref J2, file.%J2.decl [concrete = constants.%J2.type]
  2979. // CHECK:STDOUT: %.Self: %J2.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  2980. // CHECK:STDOUT: %.Self.ref: %J2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  2981. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  2982. // CHECK:STDOUT: %.loc22_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  2983. // CHECK:STDOUT: %U2.ref: %J2.assoc_type = name_ref U2, @U2.%assoc0 [concrete = constants.%assoc0]
  2984. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  2985. // CHECK:STDOUT: %.loc22_28.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  2986. // CHECK:STDOUT: %.loc22_28.2: type = converted %.loc22_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  2987. // CHECK:STDOUT: %.loc22_15: type = where_expr %.Self [concrete = constants.%J2_where.type.1ad] {
  2988. // CHECK:STDOUT: requirement_base_facet_type constants.%J2.type
  2989. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc22_28.2
  2990. // CHECK:STDOUT: }
  2991. // CHECK:STDOUT: }
  2992. // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [concrete = constants.%C2] {} {}
  2993. // CHECK:STDOUT: impl_decl @C2.as.J2.impl [concrete] {} {
  2994. // CHECK:STDOUT: %C2.ref.loc31_6: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  2995. // CHECK:STDOUT: %J2.ref: type = name_ref J2, file.%J2.decl [concrete = constants.%J2.type]
  2996. // CHECK:STDOUT: %.Self: %J2.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  2997. // CHECK:STDOUT: %.Self.ref: %J2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  2998. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  2999. // CHECK:STDOUT: %.loc31_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  3000. // CHECK:STDOUT: %U2.ref: %J2.assoc_type = name_ref U2, @U2.%assoc0 [concrete = constants.%assoc0]
  3001. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3002. // CHECK:STDOUT: %C2.ref.loc31_27: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  3003. // CHECK:STDOUT: %.loc31_15: type = where_expr %.Self [concrete = constants.%J2_where.type.de0] {
  3004. // CHECK:STDOUT: requirement_base_facet_type constants.%J2.type
  3005. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C2.ref.loc31_27
  3006. // CHECK:STDOUT: }
  3007. // CHECK:STDOUT: }
  3008. // CHECK:STDOUT: }
  3009. // CHECK:STDOUT:
  3010. // CHECK:STDOUT: interface @J2 {
  3011. // CHECK:STDOUT: %Self: %J2.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  3012. // CHECK:STDOUT: %U2: type = assoc_const_decl @U2 [concrete] {
  3013. // CHECK:STDOUT: %assoc0: %J2.assoc_type = assoc_entity element0, @J2.%U2 [concrete = constants.%assoc0]
  3014. // CHECK:STDOUT: }
  3015. // CHECK:STDOUT: %J2.F.decl: %J2.F.type = fn_decl @J2.F [concrete = constants.%J2.F] {
  3016. // CHECK:STDOUT: %self.patt: @J2.F.%pattern_type (%pattern_type.21d) = value_binding_pattern self [concrete]
  3017. // CHECK:STDOUT: %self.param_patt: @J2.F.%pattern_type (%pattern_type.21d) = value_param_pattern %self.patt, call_param0 [concrete]
  3018. // CHECK:STDOUT: %z.patt: <error> = value_binding_pattern z [concrete]
  3019. // CHECK:STDOUT: %z.param_patt: <error> = value_param_pattern %z.patt, call_param1 [concrete]
  3020. // CHECK:STDOUT: } {
  3021. // CHECK:STDOUT: %Self.ref.loc19_35: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)]
  3022. // CHECK:STDOUT: %Self.as_type.loc19_39: type = facet_access_type %Self.ref.loc19_35 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  3023. // CHECK:STDOUT: %.loc19_39: type = converted %Self.ref.loc19_35, %Self.as_type.loc19_39 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  3024. // CHECK:STDOUT: %U2.ref.loc19_39: <error> = name_ref U2, <error> [concrete = <error>]
  3025. // CHECK:STDOUT: %self.param: @J2.F.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
  3026. // CHECK:STDOUT: %.loc19_14.1: type = splice_block %.loc19_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  3027. // CHECK:STDOUT: %Self.ref.loc19_14: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)]
  3028. // CHECK:STDOUT: %Self.as_type.loc19_14: type = facet_access_type %Self.ref.loc19_14 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  3029. // CHECK:STDOUT: %.loc19_14.2: type = converted %Self.ref.loc19_14, %Self.as_type.loc19_14 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  3030. // CHECK:STDOUT: }
  3031. // CHECK:STDOUT: %self: @J2.F.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
  3032. // CHECK:STDOUT: %z.param: <error> = value_param call_param1
  3033. // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
  3034. // CHECK:STDOUT: %Self.ref.loc19_23: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)]
  3035. // CHECK:STDOUT: %Self.as_type.loc19_27: type = facet_access_type %Self.ref.loc19_23 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  3036. // CHECK:STDOUT: %.loc19_27: type = converted %Self.ref.loc19_23, %Self.as_type.loc19_27 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  3037. // CHECK:STDOUT: %U2.ref.loc19_27: <error> = name_ref U2, <error> [concrete = <error>]
  3038. // CHECK:STDOUT: }
  3039. // CHECK:STDOUT: %z: <error> = value_binding z, %z.param
  3040. // CHECK:STDOUT: }
  3041. // CHECK:STDOUT: %assoc1: %J2.assoc_type = assoc_entity element1, %J2.F.decl [concrete = constants.%assoc1]
  3042. // CHECK:STDOUT:
  3043. // CHECK:STDOUT: !members:
  3044. // CHECK:STDOUT: .Self = %Self
  3045. // CHECK:STDOUT: .U2 = @U2.%assoc0
  3046. // CHECK:STDOUT: .F = %assoc1
  3047. // CHECK:STDOUT: witness = (%U2, %J2.F.decl)
  3048. // CHECK:STDOUT:
  3049. // CHECK:STDOUT: !requires:
  3050. // CHECK:STDOUT: }
  3051. // CHECK:STDOUT:
  3052. // CHECK:STDOUT: generic assoc_const @U2(@J2.%Self: %J2.type) {
  3053. // CHECK:STDOUT: assoc_const U2:! type;
  3054. // CHECK:STDOUT: }
  3055. // CHECK:STDOUT:
  3056. // CHECK:STDOUT: impl @empty_tuple.type.as.J2.impl: %.loc22_7.2 as %.loc22_15 {
  3057. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_33.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_33.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1] {
  3058. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
  3059. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  3060. // CHECK:STDOUT: %z.patt: %pattern_type.a96 = value_binding_pattern z [concrete]
  3061. // CHECK:STDOUT: %z.param_patt: %pattern_type.a96 = value_param_pattern %z.patt, call_param1 [concrete]
  3062. // CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern [concrete]
  3063. // CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern %return.patt, call_param2 [concrete]
  3064. // CHECK:STDOUT: } {
  3065. // CHECK:STDOUT: %.loc23_31.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3066. // CHECK:STDOUT: %.loc23_31.2: type = converted %.loc23_31.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3067. // CHECK:STDOUT: %.loc23_31.3: form = init_form %.loc23_31.2, call_param2 [concrete = constants.%.d7d]
  3068. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  3069. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.J2.impl.%.loc22_7.2 [concrete = constants.%empty_tuple.type]
  3070. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  3071. // CHECK:STDOUT: %z.param: %empty_struct_type = value_param call_param1
  3072. // CHECK:STDOUT: %.loc23_24.1: type = splice_block %.loc23_24.3 [concrete = constants.%empty_struct_type] {
  3073. // CHECK:STDOUT: %.loc23_24.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3074. // CHECK:STDOUT: %.loc23_24.3: type = converted %.loc23_24.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3075. // CHECK:STDOUT: }
  3076. // CHECK:STDOUT: %z: %empty_struct_type = value_binding z, %z.param
  3077. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param2
  3078. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  3079. // CHECK:STDOUT: }
  3080. // CHECK:STDOUT: %.1: type = specific_constant <error>, @J2.F(constants.%J2.facet.6c9) [concrete = <error>]
  3081. // CHECK:STDOUT: %.2: type = specific_constant <error>, @J2.F(constants.%J2.facet.6c9) [concrete = <error>]
  3082. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_33.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_33.2 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.2] {
  3083. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
  3084. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  3085. // CHECK:STDOUT: %.param_patt: <error> = value_param_pattern <error>, call_param1 [concrete]
  3086. // CHECK:STDOUT: } {
  3087. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  3088. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  3089. // CHECK:STDOUT: %.param: <error> = value_param call_param1
  3090. // CHECK:STDOUT: }
  3091. // CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.J2.impl.F.decl.loc23_33.2), @empty_tuple.type.as.J2.impl [concrete]
  3092. // CHECK:STDOUT: %J2.impl_witness: <witness> = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.941]
  3093. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3094. // CHECK:STDOUT:
  3095. // CHECK:STDOUT: !members:
  3096. // CHECK:STDOUT: .F = %empty_tuple.type.as.J2.impl.F.decl.loc23_33.1
  3097. // CHECK:STDOUT: witness = %J2.impl_witness
  3098. // CHECK:STDOUT: }
  3099. // CHECK:STDOUT:
  3100. // CHECK:STDOUT: impl @C2.as.J2.impl: %C2.ref.loc31_6 as %.loc31_15 {
  3101. // CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_33.1: %C2.as.J2.impl.F.type.d2a210.1 = fn_decl @C2.as.J2.impl.F.loc32_33.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1] {
  3102. // CHECK:STDOUT: %self.patt: %pattern_type.8df = value_binding_pattern self [concrete]
  3103. // CHECK:STDOUT: %self.param_patt: %pattern_type.8df = value_param_pattern %self.patt, call_param0 [concrete]
  3104. // CHECK:STDOUT: %z.patt: %pattern_type.8df = value_binding_pattern z [concrete]
  3105. // CHECK:STDOUT: %z.param_patt: %pattern_type.8df = value_param_pattern %z.patt, call_param1 [concrete]
  3106. // CHECK:STDOUT: %return.patt: %pattern_type.8df = return_slot_pattern [concrete]
  3107. // CHECK:STDOUT: %return.param_patt: %pattern_type.8df = out_param_pattern %return.patt, call_param2 [concrete]
  3108. // CHECK:STDOUT: } {
  3109. // CHECK:STDOUT: %C2.ref.loc32_30: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  3110. // CHECK:STDOUT: %.loc32_30: form = init_form %C2.ref.loc32_30, call_param2 [concrete = constants.%.da5]
  3111. // CHECK:STDOUT: %self.param: %C2 = value_param call_param0
  3112. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C2.as.J2.impl.%C2.ref.loc31_6 [concrete = constants.%C2]
  3113. // CHECK:STDOUT: %self: %C2 = value_binding self, %self.param
  3114. // CHECK:STDOUT: %z.param: %C2 = value_param call_param1
  3115. // CHECK:STDOUT: %C2.ref.loc32_23: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  3116. // CHECK:STDOUT: %z: %C2 = value_binding z, %z.param
  3117. // CHECK:STDOUT: %return.param: ref %C2 = out_param call_param2
  3118. // CHECK:STDOUT: %return: ref %C2 = return_slot %return.param
  3119. // CHECK:STDOUT: }
  3120. // CHECK:STDOUT: %.1: type = specific_constant <error>, @J2.F(constants.%J2.facet.f19) [concrete = <error>]
  3121. // CHECK:STDOUT: %.2: type = specific_constant <error>, @J2.F(constants.%J2.facet.f19) [concrete = <error>]
  3122. // CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_33.2: %C2.as.J2.impl.F.type.d2a210.2 = fn_decl @C2.as.J2.impl.F.loc32_33.2 [concrete = constants.%C2.as.J2.impl.F.720bb2.2] {
  3123. // CHECK:STDOUT: %self.patt: %pattern_type.8df = value_binding_pattern self [concrete]
  3124. // CHECK:STDOUT: %self.param_patt: %pattern_type.8df = value_param_pattern %self.patt, call_param0 [concrete]
  3125. // CHECK:STDOUT: %.param_patt: <error> = value_param_pattern <error>, call_param1 [concrete]
  3126. // CHECK:STDOUT: } {
  3127. // CHECK:STDOUT: %self.param: %C2 = value_param call_param0
  3128. // CHECK:STDOUT: %self: %C2 = value_binding self, %self.param
  3129. // CHECK:STDOUT: %.param: <error> = value_param call_param1
  3130. // CHECK:STDOUT: }
  3131. // CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C2.as.J2.impl.F.decl.loc32_33.2), @C2.as.J2.impl [concrete]
  3132. // CHECK:STDOUT: %J2.impl_witness: <witness> = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.30f]
  3133. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C2 [concrete = constants.%C2]
  3134. // CHECK:STDOUT:
  3135. // CHECK:STDOUT: !members:
  3136. // CHECK:STDOUT: .C2 = <poisoned>
  3137. // CHECK:STDOUT: .F = %C2.as.J2.impl.F.decl.loc32_33.1
  3138. // CHECK:STDOUT: witness = %J2.impl_witness
  3139. // CHECK:STDOUT: }
  3140. // CHECK:STDOUT:
  3141. // CHECK:STDOUT: class @C2 {
  3142. // CHECK:STDOUT: %.loc28_10: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3143. // CHECK:STDOUT: %.loc28_11: type = converted %.loc28_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3144. // CHECK:STDOUT: adapt_decl %.loc28_11 [concrete]
  3145. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  3146. // CHECK:STDOUT: complete_type_witness = %complete_type
  3147. // CHECK:STDOUT:
  3148. // CHECK:STDOUT: !members:
  3149. // CHECK:STDOUT: .Self = constants.%C2
  3150. // CHECK:STDOUT: }
  3151. // CHECK:STDOUT:
  3152. // CHECK:STDOUT: generic fn @J2.F(@J2.%Self: %J2.type) {
  3153. // CHECK:STDOUT: %Self: %J2.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  3154. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  3155. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.21d)]
  3156. // CHECK:STDOUT:
  3157. // CHECK:STDOUT: fn(%self.param: @J2.F.%Self.binding.as_type (%Self.binding.as_type), %z.param: <error>) -> <error>;
  3158. // CHECK:STDOUT: }
  3159. // CHECK:STDOUT:
  3160. // CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_33.1(%self.param: %empty_tuple.type, %z.param: %empty_struct_type) -> out %return.param: %empty_struct_type {
  3161. // CHECK:STDOUT: !entry:
  3162. // CHECK:STDOUT: %z.ref: %empty_struct_type = name_ref z, %z
  3163. // CHECK:STDOUT: %.loc23_42: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
  3164. // CHECK:STDOUT: %.loc23_43: init %empty_struct_type = converted %z.ref, %.loc23_42 [concrete = constants.%empty_struct]
  3165. // CHECK:STDOUT: return %.loc23_43
  3166. // CHECK:STDOUT: }
  3167. // CHECK:STDOUT:
  3168. // CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_33.2(%self.param: %empty_tuple.type, %.param: <error>) -> <error> [thunk @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_33.1] {
  3169. // CHECK:STDOUT: !entry:
  3170. // 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_33.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1]
  3171. // CHECK:STDOUT: %self.ref: %empty_tuple.type = name_ref self, %self.param
  3172. // CHECK:STDOUT: %.ref: <error> = name_ref <none>, %.param
  3173. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.bound: <bound method> = bound_method %self.ref, %F.ref
  3174. // CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.call: init %empty_struct_type = call %empty_tuple.type.as.J2.impl.F.bound(%self.ref, <error>)
  3175. // CHECK:STDOUT: return <error>
  3176. // CHECK:STDOUT: }
  3177. // CHECK:STDOUT:
  3178. // CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_33.1(%self.param: %C2, %z.param: %C2) -> out %return.param: %C2 {
  3179. // CHECK:STDOUT: !entry:
  3180. // CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self
  3181. // CHECK:STDOUT: %.loc32_46.1: %empty_struct_type = as_compatible %self.ref
  3182. // CHECK:STDOUT: %.loc32_46.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
  3183. // CHECK:STDOUT: %.loc32_46.3: init %C2 = as_compatible %.loc32_46.2 [concrete = constants.%C2.val]
  3184. // CHECK:STDOUT: %.loc32_46.4: init %C2 = converted %self.ref, %.loc32_46.3 [concrete = constants.%C2.val]
  3185. // CHECK:STDOUT: return %.loc32_46.4
  3186. // CHECK:STDOUT: }
  3187. // CHECK:STDOUT:
  3188. // CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_33.2(%self.param: %C2, %.param: <error>) -> <error> [thunk @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_33.1] {
  3189. // CHECK:STDOUT: !entry:
  3190. // 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_33.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1]
  3191. // CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self.param
  3192. // CHECK:STDOUT: %.ref: <error> = name_ref <none>, %.param
  3193. // CHECK:STDOUT: %C2.as.J2.impl.F.bound: <bound method> = bound_method %self.ref, %F.ref
  3194. // CHECK:STDOUT: %C2.as.J2.impl.F.call: init %C2 = call %C2.as.J2.impl.F.bound(%self.ref, <error>)
  3195. // CHECK:STDOUT: return <error>
  3196. // CHECK:STDOUT: }
  3197. // CHECK:STDOUT:
  3198. // CHECK:STDOUT: specific @U2(constants.%Self) {}
  3199. // CHECK:STDOUT:
  3200. // CHECK:STDOUT: specific @J2.F(constants.%Self) {
  3201. // CHECK:STDOUT: %Self => constants.%Self
  3202. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  3203. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.21d
  3204. // CHECK:STDOUT: }
  3205. // CHECK:STDOUT:
  3206. // CHECK:STDOUT: specific @U2(constants.%.Self) {}
  3207. // CHECK:STDOUT:
  3208. // CHECK:STDOUT: specific @J2.F(constants.%J2.facet.6c9) {
  3209. // CHECK:STDOUT: %Self => constants.%J2.facet.6c9
  3210. // CHECK:STDOUT: %Self.binding.as_type => constants.%empty_tuple.type
  3211. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb1
  3212. // CHECK:STDOUT: }
  3213. // CHECK:STDOUT:
  3214. // CHECK:STDOUT: specific @J2.F(constants.%J2.facet.f19) {
  3215. // CHECK:STDOUT: %Self => constants.%J2.facet.f19
  3216. // CHECK:STDOUT: %Self.binding.as_type => constants.%C2
  3217. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.8df
  3218. // CHECK:STDOUT: }
  3219. // CHECK:STDOUT:
  3220. // CHECK:STDOUT: --- fail_associated_type_in_signature_mismatch.carbon
  3221. // CHECK:STDOUT:
  3222. // CHECK:STDOUT: constants {
  3223. // CHECK:STDOUT: %K.type: type = facet_type <@K> [concrete]
  3224. // CHECK:STDOUT: %Self.44d: %K.type = symbolic_binding Self, 0 [symbolic]
  3225. // CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type @K [concrete]
  3226. // CHECK:STDOUT: %assoc0.d6c: %K.assoc_type = assoc_entity element0, @K.%V [concrete]
  3227. // CHECK:STDOUT: %Self.binding.as_type.87a: type = symbolic_binding_type Self, 0, %Self.44d [symbolic]
  3228. // CHECK:STDOUT: %pattern_type.bcd: type = pattern_type %Self.binding.as_type.87a [symbolic]
  3229. // CHECK:STDOUT: %K.lookup_impl_witness.a24: <witness> = lookup_impl_witness %Self.44d, @K [symbolic]
  3230. // CHECK:STDOUT: %impl.elem0.c23: type = impl_witness_access %K.lookup_impl_witness.a24, element0 [symbolic]
  3231. // CHECK:STDOUT: %pattern_type.9fa: type = pattern_type %impl.elem0.c23 [symbolic]
  3232. // CHECK:STDOUT: %.6f2: form = init_form %impl.elem0.c23, call_param2 [symbolic]
  3233. // CHECK:STDOUT: %K.F.type: type = fn_type @K.F [concrete]
  3234. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3235. // CHECK:STDOUT: %K.F: %K.F.type = struct_value () [concrete]
  3236. // CHECK:STDOUT: %assoc1: %K.assoc_type = assoc_entity element1, @K.%K.F.decl [concrete]
  3237. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  3238. // CHECK:STDOUT: %.Self: %K.type = symbolic_binding .Self [symbolic_self]
  3239. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  3240. // CHECK:STDOUT: %K.lookup_impl_witness.28c: <witness> = lookup_impl_witness %.Self, @K [symbolic_self]
  3241. // CHECK:STDOUT: %impl.elem0.afd: type = impl_witness_access %K.lookup_impl_witness.28c, element0 [symbolic_self]
  3242. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete]
  3243. // CHECK:STDOUT: %K_where.type: type = facet_type <@K where %impl.elem0.afd = %struct_type.a> [concrete]
  3244. // CHECK:STDOUT: %K.impl_witness: <witness> = impl_witness @empty_tuple.type.as.K.impl.%K.impl_witness_table [concrete]
  3245. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  3246. // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
  3247. // CHECK:STDOUT: %pattern_type.414: type = pattern_type %struct_type.x [concrete]
  3248. // CHECK:STDOUT: %.f87: form = init_form %struct_type.x, call_param2 [concrete]
  3249. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.1: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_45.1 [concrete]
  3250. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.907e52.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = struct_value () [concrete]
  3251. // CHECK:STDOUT: %K.facet: %K.type = facet_value %empty_tuple.type, (%K.impl_witness) [concrete]
  3252. // CHECK:STDOUT: %pattern_type.e85: type = pattern_type %struct_type.a [concrete]
  3253. // CHECK:STDOUT: %.c81: form = init_form %struct_type.a, call_param2 [concrete]
  3254. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.2: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_45.2 [concrete]
  3255. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.907e52.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = struct_value () [concrete]
  3256. // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
  3257. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  3258. // CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete]
  3259. // CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete]
  3260. // CHECK:STDOUT: }
  3261. // CHECK:STDOUT:
  3262. // CHECK:STDOUT: imports {
  3263. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3264. // CHECK:STDOUT: .Destroy = %Core.Destroy
  3265. // CHECK:STDOUT: import Core//prelude
  3266. // CHECK:STDOUT: import Core//prelude/...
  3267. // CHECK:STDOUT: }
  3268. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  3269. // CHECK:STDOUT: }
  3270. // CHECK:STDOUT:
  3271. // CHECK:STDOUT: file {
  3272. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3273. // CHECK:STDOUT: .Core = imports.%Core
  3274. // CHECK:STDOUT: .K = %K.decl
  3275. // CHECK:STDOUT: }
  3276. // CHECK:STDOUT: %Core.import = import Core
  3277. // CHECK:STDOUT: %K.decl: type = interface_decl @K [concrete = constants.%K.type] {} {}
  3278. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.K.impl [concrete] {} {
  3279. // CHECK:STDOUT: %.loc11_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3280. // CHECK:STDOUT: %.loc11_7.2: type = converted %.loc11_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3281. // CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [concrete = constants.%K.type]
  3282. // CHECK:STDOUT: %.Self: %K.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  3283. // CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3284. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  3285. // CHECK:STDOUT: %.loc11_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  3286. // CHECK:STDOUT: %V.ref: %K.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.d6c]
  3287. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%K.lookup_impl_witness.28c, element0 [symbolic_self = constants.%impl.elem0.afd]
  3288. // CHECK:STDOUT: %.loc11_31.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3289. // CHECK:STDOUT: %.loc11_31.2: type = converted %.loc11_31.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3290. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete = constants.%struct_type.a]
  3291. // CHECK:STDOUT: %.loc11_14: type = where_expr %.Self [concrete = constants.%K_where.type] {
  3292. // CHECK:STDOUT: requirement_base_facet_type constants.%K.type
  3293. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %struct_type.a
  3294. // CHECK:STDOUT: }
  3295. // CHECK:STDOUT: }
  3296. // CHECK:STDOUT: }
  3297. // CHECK:STDOUT:
  3298. // CHECK:STDOUT: interface @K {
  3299. // CHECK:STDOUT: %Self: %K.type = symbolic_binding Self, 0 [symbolic = constants.%Self.44d]
  3300. // CHECK:STDOUT: %V: type = assoc_const_decl @V [concrete] {
  3301. // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.%V [concrete = constants.%assoc0.d6c]
  3302. // CHECK:STDOUT: }
  3303. // CHECK:STDOUT: %K.F.decl: %K.F.type = fn_decl @K.F [concrete = constants.%K.F] {
  3304. // CHECK:STDOUT: %self.patt: @K.F.%pattern_type.loc8_8 (%pattern_type.bcd) = value_binding_pattern self [concrete]
  3305. // CHECK:STDOUT: %self.param_patt: @K.F.%pattern_type.loc8_8 (%pattern_type.bcd) = value_param_pattern %self.patt, call_param0 [concrete]
  3306. // CHECK:STDOUT: %v.patt: @K.F.%pattern_type.loc8_20 (%pattern_type.9fa) = value_binding_pattern v [concrete]
  3307. // CHECK:STDOUT: %v.param_patt: @K.F.%pattern_type.loc8_20 (%pattern_type.9fa) = value_param_pattern %v.patt, call_param1 [concrete]
  3308. // CHECK:STDOUT: %return.patt: @K.F.%pattern_type.loc8_20 (%pattern_type.9fa) = return_slot_pattern [concrete]
  3309. // CHECK:STDOUT: %return.param_patt: @K.F.%pattern_type.loc8_20 (%pattern_type.9fa) = out_param_pattern %return.patt, call_param2 [concrete]
  3310. // CHECK:STDOUT: } {
  3311. // 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)]
  3312. // CHECK:STDOUT: %V.ref.loc8_29: type = name_ref V, %impl.elem0.loc8_29 [symbolic = %impl.elem0.loc8_23.1 (constants.%impl.elem0.c23)]
  3313. // CHECK:STDOUT: %.loc8_29.2: form = init_form %V.ref.loc8_29, call_param2 [symbolic = %.loc8_29.1 (constants.%.6f2)]
  3314. // CHECK:STDOUT: %self.param: @K.F.%Self.binding.as_type (%Self.binding.as_type.87a) = value_param call_param0
  3315. // CHECK:STDOUT: %.loc8_14.1: type = splice_block %.loc8_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.87a)] {
  3316. // CHECK:STDOUT: %Self.ref: %K.type = name_ref Self, @K.%Self [symbolic = %Self (constants.%Self.44d)]
  3317. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.87a)]
  3318. // CHECK:STDOUT: %.loc8_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.87a)]
  3319. // CHECK:STDOUT: }
  3320. // CHECK:STDOUT: %self: @K.F.%Self.binding.as_type (%Self.binding.as_type.87a) = value_binding self, %self.param
  3321. // CHECK:STDOUT: %v.param: @K.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23) = value_param call_param1
  3322. // CHECK:STDOUT: %.loc8_23: type = splice_block %V.ref.loc8_23 [symbolic = %impl.elem0.loc8_23.1 (constants.%impl.elem0.c23)] {
  3323. // 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)]
  3324. // 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)]
  3325. // CHECK:STDOUT: }
  3326. // CHECK:STDOUT: %v: @K.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23) = value_binding v, %v.param
  3327. // CHECK:STDOUT: %return.param: ref @K.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23) = out_param call_param2
  3328. // CHECK:STDOUT: %return: ref @K.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23) = return_slot %return.param
  3329. // CHECK:STDOUT: }
  3330. // CHECK:STDOUT: %assoc1: %K.assoc_type = assoc_entity element1, %K.F.decl [concrete = constants.%assoc1]
  3331. // CHECK:STDOUT:
  3332. // CHECK:STDOUT: !members:
  3333. // CHECK:STDOUT: .Self = %Self
  3334. // CHECK:STDOUT: .V = @V.%assoc0
  3335. // CHECK:STDOUT: .F = %assoc1
  3336. // CHECK:STDOUT: witness = (%V, %K.F.decl)
  3337. // CHECK:STDOUT:
  3338. // CHECK:STDOUT: !requires:
  3339. // CHECK:STDOUT: }
  3340. // CHECK:STDOUT:
  3341. // CHECK:STDOUT: generic assoc_const @V(@K.%Self: %K.type) {
  3342. // CHECK:STDOUT: assoc_const V:! type;
  3343. // CHECK:STDOUT: }
  3344. // CHECK:STDOUT:
  3345. // CHECK:STDOUT: impl @empty_tuple.type.as.K.impl: %.loc11_7.2 as %.loc11_14 {
  3346. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_45.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_45.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1] {
  3347. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
  3348. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  3349. // CHECK:STDOUT: %v.patt: %pattern_type.414 = value_binding_pattern v [concrete]
  3350. // CHECK:STDOUT: %v.param_patt: %pattern_type.414 = value_param_pattern %v.patt, call_param1 [concrete]
  3351. // CHECK:STDOUT: %return.patt: %pattern_type.414 = return_slot_pattern [concrete]
  3352. // CHECK:STDOUT: %return.param_patt: %pattern_type.414 = out_param_pattern %return.patt, call_param2 [concrete]
  3353. // CHECK:STDOUT: } {
  3354. // CHECK:STDOUT: %.loc26_42.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3355. // CHECK:STDOUT: %.loc26_42.2: type = converted %.loc26_42.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3356. // CHECK:STDOUT: %struct_type.x.loc26_43: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
  3357. // CHECK:STDOUT: %.loc26_43: form = init_form %struct_type.x.loc26_43, call_param2 [concrete = constants.%.f87]
  3358. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  3359. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.K.impl.%.loc11_7.2 [concrete = constants.%empty_tuple.type]
  3360. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  3361. // CHECK:STDOUT: %v.param: %struct_type.x = value_param call_param1
  3362. // CHECK:STDOUT: %.loc26_30: type = splice_block %struct_type.x.loc26_30 [concrete = constants.%struct_type.x] {
  3363. // CHECK:STDOUT: %.loc26_29.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3364. // CHECK:STDOUT: %.loc26_29.2: type = converted %.loc26_29.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3365. // CHECK:STDOUT: %struct_type.x.loc26_30: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
  3366. // CHECK:STDOUT: }
  3367. // CHECK:STDOUT: %v: %struct_type.x = value_binding v, %v.param
  3368. // CHECK:STDOUT: %return.param: ref %struct_type.x = out_param call_param2
  3369. // CHECK:STDOUT: %return: ref %struct_type.x = return_slot %return.param
  3370. // CHECK:STDOUT: }
  3371. // CHECK:STDOUT: %.loc8_29.1: type = specific_constant @K.F.%V.ref.loc8_29, @K.F(constants.%K.facet) [concrete = constants.%struct_type.a]
  3372. // CHECK:STDOUT: %.loc8_29.2: type = specific_constant @K.F.%.loc8_29.2, @K.F(constants.%K.facet) [concrete = constants.%.c81]
  3373. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_45.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_45.2 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.2] {
  3374. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
  3375. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  3376. // CHECK:STDOUT: %v.patt: %pattern_type.e85 = value_binding_pattern v [concrete]
  3377. // CHECK:STDOUT: %v.param_patt: %pattern_type.e85 = value_param_pattern %v.patt, call_param1 [concrete]
  3378. // CHECK:STDOUT: %return.patt: %pattern_type.e85 = return_slot_pattern [concrete]
  3379. // CHECK:STDOUT: %return.param_patt: %pattern_type.e85 = out_param_pattern %return.patt, call_param2 [concrete]
  3380. // CHECK:STDOUT: } {
  3381. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  3382. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  3383. // CHECK:STDOUT: %v.param: %struct_type.a = value_param call_param1
  3384. // CHECK:STDOUT: %v: %struct_type.a = value_binding v, %v.param
  3385. // CHECK:STDOUT: %return.param: ref %struct_type.a = out_param call_param2
  3386. // CHECK:STDOUT: %return: ref %struct_type.a = return_slot %return.param
  3387. // CHECK:STDOUT: }
  3388. // CHECK:STDOUT: %K.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.K.impl.F.decl.loc26_45.2), @empty_tuple.type.as.K.impl [concrete]
  3389. // CHECK:STDOUT: %K.impl_witness: <witness> = impl_witness %K.impl_witness_table [concrete = constants.%K.impl_witness]
  3390. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%struct_type.a [concrete = constants.%struct_type.a]
  3391. // CHECK:STDOUT:
  3392. // CHECK:STDOUT: !members:
  3393. // CHECK:STDOUT: .F = %empty_tuple.type.as.K.impl.F.decl.loc26_45.1
  3394. // CHECK:STDOUT: witness = %K.impl_witness
  3395. // CHECK:STDOUT: }
  3396. // CHECK:STDOUT:
  3397. // CHECK:STDOUT: generic fn @K.F(@K.%Self: %K.type) {
  3398. // CHECK:STDOUT: %Self: %K.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.44d)]
  3399. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.87a)]
  3400. // CHECK:STDOUT: %pattern_type.loc8_8: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.loc8_8 (constants.%pattern_type.bcd)]
  3401. // CHECK:STDOUT: %K.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @K [symbolic = %K.lookup_impl_witness (constants.%K.lookup_impl_witness.a24)]
  3402. // 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)]
  3403. // CHECK:STDOUT: %pattern_type.loc8_20: type = pattern_type %impl.elem0.loc8_23.1 [symbolic = %pattern_type.loc8_20 (constants.%pattern_type.9fa)]
  3404. // CHECK:STDOUT: %.loc8_29.1: form = init_form %impl.elem0.loc8_23.1, call_param2 [symbolic = %.loc8_29.1 (constants.%.6f2)]
  3405. // CHECK:STDOUT:
  3406. // CHECK:STDOUT: fn(%self.param: @K.F.%Self.binding.as_type (%Self.binding.as_type.87a), %v.param: @K.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23)) -> out %return.param: @K.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23);
  3407. // CHECK:STDOUT: }
  3408. // CHECK:STDOUT:
  3409. // CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_45.1(%self.param: %empty_tuple.type, %v.param: %struct_type.x) -> out %return.param: %struct_type.x {
  3410. // CHECK:STDOUT: !entry:
  3411. // CHECK:STDOUT: %v.ref: %struct_type.x = name_ref v, %v
  3412. // CHECK:STDOUT: %.loc26_54.1: %empty_tuple.type = struct_access %v.ref, element0
  3413. // CHECK:STDOUT: %.loc26_54.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
  3414. // CHECK:STDOUT: %.loc26_54.3: init %empty_tuple.type = converted %.loc26_54.1, %.loc26_54.2 [concrete = constants.%empty_tuple]
  3415. // CHECK:STDOUT: %.loc26_54.4: init %struct_type.x = struct_init (%.loc26_54.3) [concrete = constants.%struct]
  3416. // CHECK:STDOUT: %.loc26_55: init %struct_type.x = converted %v.ref, %.loc26_54.4 [concrete = constants.%struct]
  3417. // CHECK:STDOUT: return %.loc26_55
  3418. // CHECK:STDOUT: }
  3419. // CHECK:STDOUT:
  3420. // CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_45.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_45.1] {
  3421. // CHECK:STDOUT: !entry:
  3422. // 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_45.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1]
  3423. // CHECK:STDOUT: %self.ref: %empty_tuple.type = name_ref self, %self.param
  3424. // CHECK:STDOUT: %v.ref: %struct_type.a = name_ref v, %v.param
  3425. // CHECK:STDOUT: %return.ref: ref %struct_type.a = name_ref <return slot>, %return.param
  3426. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.bound: <bound method> = bound_method %self.ref, %F.ref
  3427. // CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.call: init %struct_type.x = call %empty_tuple.type.as.K.impl.F.bound(%self.ref, <error>)
  3428. // CHECK:STDOUT: %.loc26_45.1: ref %struct_type.x = temporary_storage
  3429. // CHECK:STDOUT: %.loc26_45.2: ref %struct_type.x = temporary %.loc26_45.1, %empty_tuple.type.as.K.impl.F.call
  3430. // CHECK:STDOUT: %DestroyOp.bound: <bound method> = bound_method %.loc26_45.2, constants.%DestroyOp
  3431. // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc26_45.2)
  3432. // CHECK:STDOUT: return <error>
  3433. // CHECK:STDOUT: }
  3434. // CHECK:STDOUT:
  3435. // CHECK:STDOUT: fn @DestroyOp(%self.param: %struct_type.x) = "no_op";
  3436. // CHECK:STDOUT:
  3437. // CHECK:STDOUT: specific @V(constants.%Self.44d) {}
  3438. // CHECK:STDOUT:
  3439. // CHECK:STDOUT: specific @K.F(constants.%Self.44d) {
  3440. // CHECK:STDOUT: %Self => constants.%Self.44d
  3441. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.87a
  3442. // CHECK:STDOUT: %pattern_type.loc8_8 => constants.%pattern_type.bcd
  3443. // CHECK:STDOUT: %K.lookup_impl_witness => constants.%K.lookup_impl_witness.a24
  3444. // CHECK:STDOUT: %impl.elem0.loc8_23.1 => constants.%impl.elem0.c23
  3445. // CHECK:STDOUT: %pattern_type.loc8_20 => constants.%pattern_type.9fa
  3446. // CHECK:STDOUT: %.loc8_29.1 => constants.%.6f2
  3447. // CHECK:STDOUT: }
  3448. // CHECK:STDOUT:
  3449. // CHECK:STDOUT: specific @V(constants.%.Self) {}
  3450. // CHECK:STDOUT:
  3451. // CHECK:STDOUT: specific @K.F(constants.%K.facet) {
  3452. // CHECK:STDOUT: %Self => constants.%K.facet
  3453. // CHECK:STDOUT: %Self.binding.as_type => constants.%empty_tuple.type
  3454. // CHECK:STDOUT: %pattern_type.loc8_8 => constants.%pattern_type.cb1
  3455. // CHECK:STDOUT: %K.lookup_impl_witness => constants.%K.impl_witness
  3456. // CHECK:STDOUT: %impl.elem0.loc8_23.1 => constants.%struct_type.a
  3457. // CHECK:STDOUT: %pattern_type.loc8_20 => constants.%pattern_type.e85
  3458. // CHECK:STDOUT: %.loc8_29.1 => constants.%.c81
  3459. // CHECK:STDOUT: }
  3460. // CHECK:STDOUT:
  3461. // CHECK:STDOUT: --- use_non-type_in_function.carbon
  3462. // CHECK:STDOUT:
  3463. // CHECK:STDOUT: constants {
  3464. // CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete]
  3465. // CHECK:STDOUT: %Self: %M.type = symbolic_binding Self, 0 [symbolic]
  3466. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3467. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  3468. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3469. // CHECK:STDOUT: %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
  3470. // CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type @M [concrete]
  3471. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete]
  3472. // CHECK:STDOUT: %.e6e: form = init_form %empty_struct_type, call_param0 [concrete]
  3473. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_struct_type [concrete]
  3474. // CHECK:STDOUT: %M.G.type: type = fn_type @M.G [concrete]
  3475. // CHECK:STDOUT: %M.G: %M.G.type = struct_value () [concrete]
  3476. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, @M.%M.G.decl [concrete]
  3477. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  3478. // CHECK:STDOUT: %.Self: %M.type = symbolic_binding .Self [symbolic_self]
  3479. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  3480. // CHECK:STDOUT: %M.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @M [symbolic_self]
  3481. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self]
  3482. // CHECK:STDOUT: %struct: %struct_type.b.347 = struct_value (%empty_struct) [concrete]
  3483. // CHECK:STDOUT: %M_where.type: type = facet_type <@M where %impl.elem0 = %struct> [concrete]
  3484. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness @empty_tuple.type.as.M.impl.%M.impl_witness_table [concrete]
  3485. // CHECK:STDOUT: %empty_tuple.type.as.M.impl.G.type: type = fn_type @empty_tuple.type.as.M.impl.G [concrete]
  3486. // CHECK:STDOUT: %empty_tuple.type.as.M.impl.G: %empty_tuple.type.as.M.impl.G.type = struct_value () [concrete]
  3487. // CHECK:STDOUT: %M.facet: %M.type = facet_value %empty_tuple.type, (%M.impl_witness) [concrete]
  3488. // CHECK:STDOUT: }
  3489. // CHECK:STDOUT:
  3490. // CHECK:STDOUT: imports {
  3491. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3492. // CHECK:STDOUT: import Core//prelude
  3493. // CHECK:STDOUT: import Core//prelude/...
  3494. // CHECK:STDOUT: }
  3495. // CHECK:STDOUT: }
  3496. // CHECK:STDOUT:
  3497. // CHECK:STDOUT: file {
  3498. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3499. // CHECK:STDOUT: .Core = imports.%Core
  3500. // CHECK:STDOUT: .M = %M.decl
  3501. // CHECK:STDOUT: }
  3502. // CHECK:STDOUT: %Core.import = import Core
  3503. // CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {}
  3504. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.M.impl [concrete] {} {
  3505. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3506. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3507. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3508. // CHECK:STDOUT: %.Self: %M.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  3509. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3510. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  3511. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  3512. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3513. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3514. // CHECK:STDOUT: %.loc8_32: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3515. // CHECK:STDOUT: %.loc8_33.1: %struct_type.b.347 = struct_literal (%.loc8_32) [concrete = constants.%struct]
  3516. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  3517. // CHECK:STDOUT: %.loc8_33.2: %empty_struct_type = converted %.loc8_32, %empty_struct [concrete = constants.%empty_struct]
  3518. // CHECK:STDOUT: %struct: %struct_type.b.347 = struct_value (%.loc8_33.2) [concrete = constants.%struct]
  3519. // CHECK:STDOUT: %.loc8_33.3: %struct_type.b.347 = converted %.loc8_33.1, %struct [concrete = constants.%struct]
  3520. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [concrete = constants.%M_where.type] {
  3521. // CHECK:STDOUT: requirement_base_facet_type constants.%M.type
  3522. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_33.3
  3523. // CHECK:STDOUT: }
  3524. // CHECK:STDOUT: }
  3525. // CHECK:STDOUT: }
  3526. // CHECK:STDOUT:
  3527. // CHECK:STDOUT: interface @M {
  3528. // CHECK:STDOUT: %Self: %M.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  3529. // CHECK:STDOUT: %Z: %struct_type.b.347 = assoc_const_decl @Z [concrete] {
  3530. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete = constants.%assoc0]
  3531. // CHECK:STDOUT: }
  3532. // CHECK:STDOUT: %M.G.decl: %M.G.type = fn_decl @M.G [concrete = constants.%M.G] {
  3533. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  3534. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  3535. // CHECK:STDOUT: } {
  3536. // CHECK:STDOUT: %.loc5_14.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3537. // CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3538. // CHECK:STDOUT: %.loc5_14.3: form = init_form %.loc5_14.2, call_param0 [concrete = constants.%.e6e]
  3539. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
  3540. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  3541. // CHECK:STDOUT: }
  3542. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, %M.G.decl [concrete = constants.%assoc1]
  3543. // CHECK:STDOUT:
  3544. // CHECK:STDOUT: !members:
  3545. // CHECK:STDOUT: .Self = %Self
  3546. // CHECK:STDOUT: .Z = @Z.%assoc0
  3547. // CHECK:STDOUT: .G = %assoc1
  3548. // CHECK:STDOUT: witness = (%Z, %M.G.decl)
  3549. // CHECK:STDOUT:
  3550. // CHECK:STDOUT: !requires:
  3551. // CHECK:STDOUT: }
  3552. // CHECK:STDOUT:
  3553. // CHECK:STDOUT: generic assoc_const @Z(@M.%Self: %M.type) {
  3554. // CHECK:STDOUT: assoc_const Z:! %struct_type.b.347;
  3555. // CHECK:STDOUT: }
  3556. // CHECK:STDOUT:
  3557. // CHECK:STDOUT: impl @empty_tuple.type.as.M.impl: %.loc8_7.2 as %.loc8_14 {
  3558. // 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] {
  3559. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  3560. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  3561. // CHECK:STDOUT: } {
  3562. // CHECK:STDOUT: %.loc9_14.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3563. // CHECK:STDOUT: %.loc9_14.2: type = converted %.loc9_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3564. // CHECK:STDOUT: %.loc9_14.3: form = init_form %.loc9_14.2, call_param0 [concrete = constants.%.e6e]
  3565. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
  3566. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  3567. // CHECK:STDOUT: }
  3568. // 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]
  3569. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness]
  3570. // CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.347 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct]
  3571. // CHECK:STDOUT:
  3572. // CHECK:STDOUT: !members:
  3573. // CHECK:STDOUT: .G = %empty_tuple.type.as.M.impl.G.decl
  3574. // CHECK:STDOUT: .M = <poisoned>
  3575. // CHECK:STDOUT: witness = %M.impl_witness
  3576. // CHECK:STDOUT: }
  3577. // CHECK:STDOUT:
  3578. // CHECK:STDOUT: generic fn @M.G(@M.%Self: %M.type) {
  3579. // CHECK:STDOUT: fn() -> out %return.param: %empty_struct_type;
  3580. // CHECK:STDOUT: }
  3581. // CHECK:STDOUT:
  3582. // CHECK:STDOUT: fn @empty_tuple.type.as.M.impl.G() -> out %return.param: %empty_struct_type {
  3583. // CHECK:STDOUT: !entry:
  3584. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.M.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  3585. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3586. // CHECK:STDOUT: %M.facet: %M.type = facet_value %Self.ref, (constants.%M.impl_witness) [concrete = constants.%M.facet]
  3587. // CHECK:STDOUT: %.loc10_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet]
  3588. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc10_18 [concrete = constants.%empty_tuple.type]
  3589. // CHECK:STDOUT: %.loc10_23: type = converted %.loc10_18, %as_type [concrete = constants.%empty_tuple.type]
  3590. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3591. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access constants.%M.impl_witness, element0 [concrete = constants.%struct]
  3592. // CHECK:STDOUT: %.loc10_25.1: %empty_struct_type = struct_access %impl.elem0, element0 [concrete = constants.%empty_struct]
  3593. // CHECK:STDOUT: %.loc10_25.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
  3594. // CHECK:STDOUT: %.loc10_27: init %empty_struct_type = converted %.loc10_25.1, %.loc10_25.2 [concrete = constants.%empty_struct]
  3595. // CHECK:STDOUT: return %.loc10_27
  3596. // CHECK:STDOUT: }
  3597. // CHECK:STDOUT:
  3598. // CHECK:STDOUT: specific @Z(constants.%Self) {}
  3599. // CHECK:STDOUT:
  3600. // CHECK:STDOUT: specific @M.G(constants.%Self) {}
  3601. // CHECK:STDOUT:
  3602. // CHECK:STDOUT: specific @Z(constants.%.Self) {}
  3603. // CHECK:STDOUT:
  3604. // CHECK:STDOUT: specific @M.G(constants.%M.facet) {}
  3605. // CHECK:STDOUT:
  3606. // CHECK:STDOUT: specific @Z(constants.%M.facet) {}
  3607. // CHECK:STDOUT:
  3608. // CHECK:STDOUT: --- self_as_uses_correct_rewrite_constraint.carbon
  3609. // CHECK:STDOUT:
  3610. // CHECK:STDOUT: constants {
  3611. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  3612. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  3613. // CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic]
  3614. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  3615. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  3616. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3617. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  3618. // CHECK:STDOUT: %C.5a3: type = class_type @C, @C(%T.67d) [symbolic]
  3619. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3620. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  3621. // CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete]
  3622. // CHECK:STDOUT: %Self.0c7: %M.type = symbolic_binding Self, 0 [symbolic]
  3623. // CHECK:STDOUT: %struct_type.b.86f: type = struct_type {.b: type} [concrete]
  3624. // CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type @M [concrete]
  3625. // CHECK:STDOUT: %assoc0.5f4: %M.assoc_type = assoc_entity element0, @M.%Z [concrete]
  3626. // CHECK:STDOUT: %.d96: form = init_form type, call_param0 [concrete]
  3627. // CHECK:STDOUT: %M.G.type: type = fn_type @M.G [concrete]
  3628. // CHECK:STDOUT: %M.G: %M.G.type = struct_value () [concrete]
  3629. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, @M.%M.G.decl [concrete]
  3630. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  3631. // CHECK:STDOUT: %C.850: type = class_type @C, @C(%empty_struct_type) [concrete]
  3632. // CHECK:STDOUT: %.Self.b4d: %M.type = symbolic_binding .Self [symbolic_self]
  3633. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.b4d [symbolic_self]
  3634. // CHECK:STDOUT: %M.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.b4d, @M [symbolic_self]
  3635. // CHECK:STDOUT: %impl.elem0.47b: %struct_type.b.86f = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self]
  3636. // CHECK:STDOUT: %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
  3637. // CHECK:STDOUT: %struct.692: %struct_type.b.347 = struct_value (%empty_struct) [concrete]
  3638. // CHECK:STDOUT: %struct_type.b.161: type = struct_type {.b: %empty_tuple.type} [concrete]
  3639. // CHECK:STDOUT: %struct.0f3: %struct_type.b.86f = struct_value (%empty_struct_type) [concrete]
  3640. // CHECK:STDOUT: %M_where.type.2ad: type = facet_type <@M where %impl.elem0.47b = %struct.0f3> [concrete]
  3641. // CHECK:STDOUT: %M.impl_witness.9de: <witness> = impl_witness @C.as.M.impl.20d.%M.impl_witness_table [concrete]
  3642. // CHECK:STDOUT: %C.as.M.impl.G.type.107: type = fn_type @C.as.M.impl.G.loc11 [concrete]
  3643. // CHECK:STDOUT: %C.as.M.impl.G.eb6: %C.as.M.impl.G.type.107 = struct_value () [concrete]
  3644. // CHECK:STDOUT: %M.facet.9e0: %M.type = facet_value %C.850, (%M.impl_witness.9de) [concrete]
  3645. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  3646. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  3647. // CHECK:STDOUT: %Copy.impl_witness.b47: <witness> = impl_witness imports.%Copy.impl_witness_table.b1c [concrete]
  3648. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value type, (%Copy.impl_witness.b47) [concrete]
  3649. // CHECK:STDOUT: %.436: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
  3650. // CHECK:STDOUT: %type.as.Copy.impl.Op.type: type = fn_type @type.as.Copy.impl.Op [concrete]
  3651. // CHECK:STDOUT: %type.as.Copy.impl.Op: %type.as.Copy.impl.Op.type = struct_value () [concrete]
  3652. // CHECK:STDOUT: %type.as.Copy.impl.Op.bound.bca: <bound method> = bound_method %empty_struct_type, %type.as.Copy.impl.Op [concrete]
  3653. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  3654. // CHECK:STDOUT: %C.e8f: type = class_type @C, @C(%empty_tuple.type) [concrete]
  3655. // CHECK:STDOUT: %struct.63c: %struct_type.b.161 = struct_value (%empty_tuple) [concrete]
  3656. // CHECK:STDOUT: %struct.c94: %struct_type.b.86f = struct_value (%empty_tuple.type) [concrete]
  3657. // CHECK:STDOUT: %M_where.type.bf5: type = facet_type <@M where %impl.elem0.47b = %struct.c94> [concrete]
  3658. // CHECK:STDOUT: %M.impl_witness.a5c: <witness> = impl_witness @C.as.M.impl.243.%M.impl_witness_table [concrete]
  3659. // CHECK:STDOUT: %C.as.M.impl.G.type.52d: type = fn_type @C.as.M.impl.G.loc17 [concrete]
  3660. // CHECK:STDOUT: %C.as.M.impl.G.973: %C.as.M.impl.G.type.52d = struct_value () [concrete]
  3661. // CHECK:STDOUT: %M.facet.586: %M.type = facet_value %C.e8f, (%M.impl_witness.a5c) [concrete]
  3662. // CHECK:STDOUT: %type.as.Copy.impl.Op.bound.f05: <bound method> = bound_method %empty_tuple.type, %type.as.Copy.impl.Op [concrete]
  3663. // CHECK:STDOUT: }
  3664. // CHECK:STDOUT:
  3665. // CHECK:STDOUT: imports {
  3666. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3667. // CHECK:STDOUT: .Copy = %Core.Copy
  3668. // CHECK:STDOUT: import Core//prelude
  3669. // CHECK:STDOUT: import Core//prelude/...
  3670. // CHECK:STDOUT: }
  3671. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  3672. // 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]
  3673. // CHECK:STDOUT: %Copy.impl_witness_table.b1c = impl_witness_table (%Core.import_ref.1a7), @type.as.Copy.impl [concrete]
  3674. // CHECK:STDOUT: }
  3675. // CHECK:STDOUT:
  3676. // CHECK:STDOUT: file {
  3677. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3678. // CHECK:STDOUT: .Core = imports.%Core
  3679. // CHECK:STDOUT: .C = %C.decl
  3680. // CHECK:STDOUT: .M = %M.decl
  3681. // CHECK:STDOUT: }
  3682. // CHECK:STDOUT: %Core.import = import Core
  3683. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  3684. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  3685. // CHECK:STDOUT: } {
  3686. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  3687. // CHECK:STDOUT: %T.loc3_9.2: type = symbolic_binding T, 0 [symbolic = %T.loc3_9.1 (constants.%T.67d)]
  3688. // CHECK:STDOUT: }
  3689. // CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {}
  3690. // CHECK:STDOUT: impl_decl @C.as.M.impl.20d [concrete] {} {
  3691. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  3692. // CHECK:STDOUT: %.loc10_9: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3693. // CHECK:STDOUT: %.loc10_10: type = converted %.loc10_9, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3694. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type) [concrete = constants.%C.850]
  3695. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3696. // CHECK:STDOUT: %.Self: %M.type = symbolic_binding .Self [symbolic_self = constants.%.Self.b4d]
  3697. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.b4d]
  3698. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  3699. // CHECK:STDOUT: %.loc10_23: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  3700. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0.5f4]
  3701. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0.47b]
  3702. // CHECK:STDOUT: %.loc10_35: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  3703. // CHECK:STDOUT: %.loc10_36.1: %struct_type.b.347 = struct_literal (%.loc10_35) [concrete = constants.%struct.692]
  3704. // CHECK:STDOUT: %.loc10_36.2: type = converted %.loc10_35, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3705. // CHECK:STDOUT: %struct: %struct_type.b.86f = struct_value (%.loc10_36.2) [concrete = constants.%struct.0f3]
  3706. // CHECK:STDOUT: %.loc10_36.3: %struct_type.b.86f = converted %.loc10_36.1, %struct [concrete = constants.%struct.0f3]
  3707. // CHECK:STDOUT: %.loc10_17: type = where_expr %.Self [concrete = constants.%M_where.type.2ad] {
  3708. // CHECK:STDOUT: requirement_base_facet_type constants.%M.type
  3709. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_36.3
  3710. // CHECK:STDOUT: }
  3711. // CHECK:STDOUT: }
  3712. // CHECK:STDOUT: impl_decl @C.as.M.impl.243 [concrete] {} {
  3713. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  3714. // CHECK:STDOUT: %.loc16_9: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3715. // CHECK:STDOUT: %.loc16_10: type = converted %.loc16_9, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3716. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_tuple.type) [concrete = constants.%C.e8f]
  3717. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3718. // CHECK:STDOUT: %.Self: %M.type = symbolic_binding .Self [symbolic_self = constants.%.Self.b4d]
  3719. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.b4d]
  3720. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  3721. // CHECK:STDOUT: %.loc16_23: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  3722. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0.5f4]
  3723. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0.47b]
  3724. // CHECK:STDOUT: %.loc16_35: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3725. // CHECK:STDOUT: %.loc16_36.1: %struct_type.b.161 = struct_literal (%.loc16_35) [concrete = constants.%struct.63c]
  3726. // CHECK:STDOUT: %.loc16_36.2: type = converted %.loc16_35, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3727. // CHECK:STDOUT: %struct: %struct_type.b.86f = struct_value (%.loc16_36.2) [concrete = constants.%struct.c94]
  3728. // CHECK:STDOUT: %.loc16_36.3: %struct_type.b.86f = converted %.loc16_36.1, %struct [concrete = constants.%struct.c94]
  3729. // CHECK:STDOUT: %.loc16_17: type = where_expr %.Self [concrete = constants.%M_where.type.bf5] {
  3730. // CHECK:STDOUT: requirement_base_facet_type constants.%M.type
  3731. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc16_36.3
  3732. // CHECK:STDOUT: }
  3733. // CHECK:STDOUT: }
  3734. // CHECK:STDOUT: }
  3735. // CHECK:STDOUT:
  3736. // CHECK:STDOUT: interface @M {
  3737. // CHECK:STDOUT: %Self: %M.type = symbolic_binding Self, 0 [symbolic = constants.%Self.0c7]
  3738. // CHECK:STDOUT: %Z: %struct_type.b.86f = assoc_const_decl @Z [concrete] {
  3739. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete = constants.%assoc0.5f4]
  3740. // CHECK:STDOUT: }
  3741. // CHECK:STDOUT: %M.G.decl: %M.G.type = fn_decl @M.G [concrete = constants.%M.G] {
  3742. // CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern [concrete]
  3743. // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern %return.patt, call_param0 [concrete]
  3744. // CHECK:STDOUT: } {
  3745. // CHECK:STDOUT: %.loc7: form = init_form type, call_param0 [concrete = constants.%.d96]
  3746. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  3747. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  3748. // CHECK:STDOUT: }
  3749. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, %M.G.decl [concrete = constants.%assoc1]
  3750. // CHECK:STDOUT:
  3751. // CHECK:STDOUT: !members:
  3752. // CHECK:STDOUT: .Self = %Self
  3753. // CHECK:STDOUT: .Z = @Z.%assoc0
  3754. // CHECK:STDOUT: .G = %assoc1
  3755. // CHECK:STDOUT: witness = (%Z, %M.G.decl)
  3756. // CHECK:STDOUT:
  3757. // CHECK:STDOUT: !requires:
  3758. // CHECK:STDOUT: }
  3759. // CHECK:STDOUT:
  3760. // CHECK:STDOUT: generic assoc_const @Z(@M.%Self: %M.type) {
  3761. // CHECK:STDOUT: assoc_const Z:! %struct_type.b.86f;
  3762. // CHECK:STDOUT: }
  3763. // CHECK:STDOUT:
  3764. // CHECK:STDOUT: impl @C.as.M.impl.20d: %C as %.loc10_17 {
  3765. // 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] {
  3766. // CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern [concrete]
  3767. // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern %return.patt, call_param0 [concrete]
  3768. // CHECK:STDOUT: } {
  3769. // CHECK:STDOUT: %.loc11: form = init_form type, call_param0 [concrete = constants.%.d96]
  3770. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  3771. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  3772. // CHECK:STDOUT: }
  3773. // 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]
  3774. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness.9de]
  3775. // CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.0f3 [concrete = constants.%struct.0f3]
  3776. // CHECK:STDOUT:
  3777. // CHECK:STDOUT: !members:
  3778. // CHECK:STDOUT: .G = %C.as.M.impl.G.decl
  3779. // CHECK:STDOUT: .M = <poisoned>
  3780. // CHECK:STDOUT: witness = %M.impl_witness
  3781. // CHECK:STDOUT: }
  3782. // CHECK:STDOUT:
  3783. // CHECK:STDOUT: impl @C.as.M.impl.243: %C as %.loc16_17 {
  3784. // 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] {
  3785. // CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern [concrete]
  3786. // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern %return.patt, call_param0 [concrete]
  3787. // CHECK:STDOUT: } {
  3788. // CHECK:STDOUT: %.loc17: form = init_form type, call_param0 [concrete = constants.%.d96]
  3789. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  3790. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  3791. // CHECK:STDOUT: }
  3792. // 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]
  3793. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness.a5c]
  3794. // CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.c94 [concrete = constants.%struct.c94]
  3795. // CHECK:STDOUT:
  3796. // CHECK:STDOUT: !members:
  3797. // CHECK:STDOUT: .G = %C.as.M.impl.G.decl
  3798. // CHECK:STDOUT: .M = <poisoned>
  3799. // CHECK:STDOUT: witness = %M.impl_witness
  3800. // CHECK:STDOUT: }
  3801. // CHECK:STDOUT:
  3802. // CHECK:STDOUT: generic class @C(%T.loc3_9.2: type) {
  3803. // CHECK:STDOUT: %T.loc3_9.1: type = symbolic_binding T, 0 [symbolic = %T.loc3_9.1 (constants.%T.67d)]
  3804. // CHECK:STDOUT:
  3805. // CHECK:STDOUT: !definition:
  3806. // CHECK:STDOUT:
  3807. // CHECK:STDOUT: class {
  3808. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  3809. // CHECK:STDOUT: complete_type_witness = %complete_type
  3810. // CHECK:STDOUT:
  3811. // CHECK:STDOUT: !members:
  3812. // CHECK:STDOUT: .Self = constants.%C.5a3
  3813. // CHECK:STDOUT: }
  3814. // CHECK:STDOUT: }
  3815. // CHECK:STDOUT:
  3816. // CHECK:STDOUT: generic fn @M.G(@M.%Self: %M.type) {
  3817. // CHECK:STDOUT: fn() -> out %return.param: type;
  3818. // CHECK:STDOUT: }
  3819. // CHECK:STDOUT:
  3820. // CHECK:STDOUT: fn @C.as.M.impl.G.loc11() -> out %return.param: type {
  3821. // CHECK:STDOUT: !entry:
  3822. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.M.impl.20d.%C [concrete = constants.%C.850]
  3823. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3824. // CHECK:STDOUT: %M.facet: %M.type = facet_value %Self.ref, (constants.%M.impl_witness.9de) [concrete = constants.%M.facet.9e0]
  3825. // CHECK:STDOUT: %.loc12_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.9e0]
  3826. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc12_18 [concrete = constants.%C.850]
  3827. // CHECK:STDOUT: %.loc12_23: type = converted %.loc12_18, %as_type [concrete = constants.%C.850]
  3828. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0.5f4]
  3829. // CHECK:STDOUT: %impl.elem0.loc12_23: %struct_type.b.86f = impl_witness_access constants.%M.impl_witness.9de, element0 [concrete = constants.%struct.0f3]
  3830. // CHECK:STDOUT: %.loc12_25: type = struct_access %impl.elem0.loc12_23, element0 [concrete = constants.%empty_struct_type]
  3831. // CHECK:STDOUT: %impl.elem0.loc12_25: %.436 = impl_witness_access constants.%Copy.impl_witness.b47, element0 [concrete = constants.%type.as.Copy.impl.Op]
  3832. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc12_25, %impl.elem0.loc12_25 [concrete = constants.%type.as.Copy.impl.Op.bound.bca]
  3833. // CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%.loc12_25) [concrete = constants.%empty_struct_type]
  3834. // CHECK:STDOUT: return %type.as.Copy.impl.Op.call
  3835. // CHECK:STDOUT: }
  3836. // CHECK:STDOUT:
  3837. // CHECK:STDOUT: fn @C.as.M.impl.G.loc17() -> out %return.param: type {
  3838. // CHECK:STDOUT: !entry:
  3839. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.M.impl.243.%C [concrete = constants.%C.e8f]
  3840. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3841. // CHECK:STDOUT: %M.facet: %M.type = facet_value %Self.ref, (constants.%M.impl_witness.a5c) [concrete = constants.%M.facet.586]
  3842. // CHECK:STDOUT: %.loc18_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.586]
  3843. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc18_18 [concrete = constants.%C.e8f]
  3844. // CHECK:STDOUT: %.loc18_23: type = converted %.loc18_18, %as_type [concrete = constants.%C.e8f]
  3845. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0.5f4]
  3846. // CHECK:STDOUT: %impl.elem0.loc18_23: %struct_type.b.86f = impl_witness_access constants.%M.impl_witness.a5c, element0 [concrete = constants.%struct.c94]
  3847. // CHECK:STDOUT: %.loc18_25: type = struct_access %impl.elem0.loc18_23, element0 [concrete = constants.%empty_tuple.type]
  3848. // CHECK:STDOUT: %impl.elem0.loc18_25: %.436 = impl_witness_access constants.%Copy.impl_witness.b47, element0 [concrete = constants.%type.as.Copy.impl.Op]
  3849. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc18_25, %impl.elem0.loc18_25 [concrete = constants.%type.as.Copy.impl.Op.bound.f05]
  3850. // CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%.loc18_25) [concrete = constants.%empty_tuple.type]
  3851. // CHECK:STDOUT: return %type.as.Copy.impl.Op.call
  3852. // CHECK:STDOUT: }
  3853. // CHECK:STDOUT:
  3854. // CHECK:STDOUT: specific @C(constants.%T.67d) {
  3855. // CHECK:STDOUT: %T.loc3_9.1 => constants.%T.67d
  3856. // CHECK:STDOUT: }
  3857. // CHECK:STDOUT:
  3858. // CHECK:STDOUT: specific @Z(constants.%Self.0c7) {}
  3859. // CHECK:STDOUT:
  3860. // CHECK:STDOUT: specific @M.G(constants.%Self.0c7) {}
  3861. // CHECK:STDOUT:
  3862. // CHECK:STDOUT: specific @C(constants.%empty_struct_type) {
  3863. // CHECK:STDOUT: %T.loc3_9.1 => constants.%empty_struct_type
  3864. // CHECK:STDOUT: }
  3865. // CHECK:STDOUT:
  3866. // CHECK:STDOUT: specific @Z(constants.%.Self.b4d) {}
  3867. // CHECK:STDOUT:
  3868. // CHECK:STDOUT: specific @M.G(constants.%M.facet.9e0) {}
  3869. // CHECK:STDOUT:
  3870. // CHECK:STDOUT: specific @Z(constants.%M.facet.9e0) {}
  3871. // CHECK:STDOUT:
  3872. // CHECK:STDOUT: specific @C(constants.%empty_tuple.type) {
  3873. // CHECK:STDOUT: %T.loc3_9.1 => constants.%empty_tuple.type
  3874. // CHECK:STDOUT: }
  3875. // CHECK:STDOUT:
  3876. // CHECK:STDOUT: specific @M.G(constants.%M.facet.586) {}
  3877. // CHECK:STDOUT:
  3878. // CHECK:STDOUT: specific @Z(constants.%M.facet.586) {}
  3879. // CHECK:STDOUT:
  3880. // CHECK:STDOUT: --- associated_int_in_array.carbon
  3881. // CHECK:STDOUT:
  3882. // CHECK:STDOUT: constants {
  3883. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  3884. // CHECK:STDOUT: %Self.ab9: %I.type = symbolic_binding Self, 0 [symbolic]
  3885. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  3886. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  3887. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3888. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  3889. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  3890. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  3891. // CHECK:STDOUT: %assoc0.607: %I.assoc_type = assoc_entity element0, @I.%N [concrete]
  3892. // CHECK:STDOUT: %Self.binding.as_type.d31: type = symbolic_binding_type Self, 0, %Self.ab9 [symbolic]
  3893. // CHECK:STDOUT: %pattern_type.fa0: type = pattern_type %Self.binding.as_type.d31 [symbolic]
  3894. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  3895. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  3896. // CHECK:STDOUT: %I.lookup_impl_witness.3ae: <witness> = lookup_impl_witness %Self.ab9, @I [symbolic]
  3897. // CHECK:STDOUT: %impl.elem0.f83: %i32 = impl_witness_access %I.lookup_impl_witness.3ae, element0 [symbolic]
  3898. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  3899. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  3900. // CHECK:STDOUT: %ImplicitAs.type.139: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  3901. // CHECK:STDOUT: %ImplicitAs.Convert.type.71e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete]
  3902. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  3903. // 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]
  3904. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  3905. // CHECK:STDOUT: %From: Core.IntLiteral = symbolic_binding From, 0 [symbolic]
  3906. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.2ed: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic]
  3907. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.d29: %Int.as.ImplicitAs.impl.Convert.type.2ed = struct_value () [symbolic]
  3908. // CHECK:STDOUT: %ImplicitAs.impl_witness.640: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.ea2, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  3909. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.240: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  3910. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.dd4: %Int.as.ImplicitAs.impl.Convert.type.240 = struct_value () [concrete]
  3911. // CHECK:STDOUT: %ImplicitAs.facet.290: %ImplicitAs.type.139 = facet_value %i32, (%ImplicitAs.impl_witness.640) [concrete]
  3912. // CHECK:STDOUT: %.71e: type = fn_type_with_self_type %ImplicitAs.Convert.type.71e, %ImplicitAs.facet.290 [concrete]
  3913. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound.0e7: <bound method> = bound_method %impl.elem0.f83, %Int.as.ImplicitAs.impl.Convert.dd4 [symbolic]
  3914. // 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]
  3915. // CHECK:STDOUT: %bound_method.2a2: <bound method> = bound_method %impl.elem0.f83, %Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  3916. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.2a2(%impl.elem0.f83) [symbolic]
  3917. // CHECK:STDOUT: %array_type.d35: type = array_type %Int.as.ImplicitAs.impl.Convert.call, bool [symbolic]
  3918. // CHECK:STDOUT: %.939: form = init_form %array_type.d35, call_param1 [symbolic]
  3919. // CHECK:STDOUT: %pattern_type.3e2: type = pattern_type %array_type.d35 [symbolic]
  3920. // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
  3921. // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
  3922. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%I.F.decl [concrete]
  3923. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  3924. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  3925. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  3926. // CHECK:STDOUT: %I.lookup_impl_witness.c4b: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  3927. // CHECK:STDOUT: %impl.elem0.667: %i32 = impl_witness_access %I.lookup_impl_witness.c4b, element0 [symbolic_self]
  3928. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  3929. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  3930. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  3931. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  3932. // 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]
  3933. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  3934. // CHECK:STDOUT: %ImplicitAs.facet.b94: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  3935. // CHECK:STDOUT: %.863: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet.b94 [concrete]
  3936. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  3937. // 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]
  3938. // CHECK:STDOUT: %bound_method.646: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  3939. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  3940. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0.667 = %int_2.ef8> [concrete]
  3941. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete]
  3942. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  3943. // CHECK:STDOUT: %array_type.c9b: type = array_type %int_2.ecc, bool [concrete]
  3944. // CHECK:STDOUT: %.366: form = init_form %array_type.c9b, call_param1 [concrete]
  3945. // CHECK:STDOUT: %pattern_type.5d5: type = pattern_type %array_type.c9b [concrete]
  3946. // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type: type = fn_type @empty_tuple.type.as.I.impl.F [concrete]
  3947. // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F: %empty_tuple.type.as.I.impl.F.type = struct_value () [concrete]
  3948. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_tuple.type, (%I.impl_witness) [concrete]
  3949. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound.075: <bound method> = bound_method %int_2.ef8, %Int.as.ImplicitAs.impl.Convert.dd4 [concrete]
  3950. // CHECK:STDOUT: %bound_method.bea: <bound method> = bound_method %int_2.ef8, %Int.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  3951. // CHECK:STDOUT: %true: bool = bool_literal true [concrete]
  3952. // CHECK:STDOUT: %false: bool = bool_literal false [concrete]
  3953. // CHECK:STDOUT: %tuple.type.784: type = tuple_type (bool, bool) [concrete]
  3954. // CHECK:STDOUT: %tuple.a9a: %tuple.type.784 = tuple_value (%true, %false) [concrete]
  3955. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  3956. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  3957. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  3958. // CHECK:STDOUT: %Copy.impl_witness.348: <witness> = impl_witness imports.%Copy.impl_witness_table.3cc [concrete]
  3959. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value bool, (%Copy.impl_witness.348) [concrete]
  3960. // CHECK:STDOUT: %.56b: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
  3961. // CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete]
  3962. // CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete]
  3963. // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound.12b: <bound method> = bound_method %true, %bool.as.Copy.impl.Op [concrete]
  3964. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  3965. // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound.082: <bound method> = bound_method %false, %bool.as.Copy.impl.Op [concrete]
  3966. // CHECK:STDOUT: %array: %array_type.c9b = tuple_value (%true, %false) [concrete]
  3967. // CHECK:STDOUT: }
  3968. // CHECK:STDOUT:
  3969. // CHECK:STDOUT: imports {
  3970. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3971. // CHECK:STDOUT: .Int = %Core.Int
  3972. // CHECK:STDOUT: .Bool = %Core.Bool
  3973. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  3974. // CHECK:STDOUT: .Copy = %Core.Copy
  3975. // CHECK:STDOUT: import Core//prelude
  3976. // CHECK:STDOUT: import Core//prelude/...
  3977. // CHECK:STDOUT: }
  3978. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  3979. // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool]
  3980. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  3981. // 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)]
  3982. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  3983. // 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)]
  3984. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.ea2 = impl_witness_table (%Core.import_ref.0bc), @Int.as.ImplicitAs.impl [concrete]
  3985. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  3986. // 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]
  3987. // CHECK:STDOUT: %Copy.impl_witness_table.3cc = impl_witness_table (%Core.import_ref.595), @bool.as.Copy.impl [concrete]
  3988. // CHECK:STDOUT: }
  3989. // CHECK:STDOUT:
  3990. // CHECK:STDOUT: file {
  3991. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3992. // CHECK:STDOUT: .Core = imports.%Core
  3993. // CHECK:STDOUT: .I = %I.decl
  3994. // CHECK:STDOUT: }
  3995. // CHECK:STDOUT: %Core.import = import Core
  3996. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  3997. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.I.impl [concrete] {} {
  3998. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  3999. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  4000. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  4001. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  4002. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  4003. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  4004. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  4005. // CHECK:STDOUT: %N.ref: %I.assoc_type = name_ref N, @N.%assoc0 [concrete = constants.%assoc0.607]
  4006. // CHECK:STDOUT: %impl.elem0.loc8_20: %i32 = impl_witness_access constants.%I.lookup_impl_witness.c4b, element0 [symbolic_self = constants.%impl.elem0.667]
  4007. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  4008. // CHECK:STDOUT: %impl.elem0.loc8_25: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  4009. // 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]
  4010. // 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]
  4011. // CHECK:STDOUT: %bound_method.loc8_25.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.646]
  4012. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_25.2(%int_2) [concrete = constants.%int_2.ef8]
  4013. // CHECK:STDOUT: %.loc8_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_2.ef8]
  4014. // CHECK:STDOUT: %.loc8_25.2: %i32 = converted %int_2, %.loc8_25.1 [concrete = constants.%int_2.ef8]
  4015. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [concrete = constants.%I_where.type] {
  4016. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  4017. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8_20, %.loc8_25.2
  4018. // CHECK:STDOUT: }
  4019. // CHECK:STDOUT: }
  4020. // CHECK:STDOUT: }
  4021. // CHECK:STDOUT:
  4022. // CHECK:STDOUT: interface @I {
  4023. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.ab9]
  4024. // CHECK:STDOUT: %N: %i32 = assoc_const_decl @N [concrete] {
  4025. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%N [concrete = constants.%assoc0.607]
  4026. // CHECK:STDOUT: }
  4027. // CHECK:STDOUT: %I.F.decl: %I.F.type = fn_decl @I.F [concrete = constants.%I.F] {
  4028. // CHECK:STDOUT: %self.patt: @I.F.%pattern_type.loc5_8 (%pattern_type.fa0) = value_binding_pattern self [concrete]
  4029. // CHECK:STDOUT: %self.param_patt: @I.F.%pattern_type.loc5_8 (%pattern_type.fa0) = value_param_pattern %self.patt, call_param0 [concrete]
  4030. // CHECK:STDOUT: %return.patt: @I.F.%pattern_type.loc5_22 (%pattern_type.3e2) = return_slot_pattern [concrete]
  4031. // CHECK:STDOUT: %return.param_patt: @I.F.%pattern_type.loc5_22 (%pattern_type.3e2) = out_param_pattern %return.patt, call_param1 [concrete]
  4032. // CHECK:STDOUT: } {
  4033. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  4034. // 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)]
  4035. // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %impl.elem0.loc5_37.2 [symbolic = %impl.elem0.loc5_37.1 (constants.%impl.elem0.f83)]
  4036. // CHECK:STDOUT: %.loc5_31.1: type = value_of_initializer %Bool.call [concrete = bool]
  4037. // CHECK:STDOUT: %.loc5_31.2: type = converted %Bool.call, %.loc5_31.1 [concrete = bool]
  4038. // CHECK:STDOUT: %impl.elem0.loc5_37.3: %.71e = impl_witness_access constants.%ImplicitAs.impl_witness.640, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.dd4]
  4039. // 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)]
  4040. // 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]
  4041. // 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)]
  4042. // 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)]
  4043. // 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)]
  4044. // 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)]
  4045. // CHECK:STDOUT: %array_type.loc5_38.2: type = array_type %.loc5_37.2, %.loc5_31.2 [symbolic = %array_type.loc5_38.1 (constants.%array_type.d35)]
  4046. // CHECK:STDOUT: %.loc5_38.2: form = init_form %array_type.loc5_38.2, call_param1 [symbolic = %.loc5_38.1 (constants.%.939)]
  4047. // CHECK:STDOUT: %self.param: @I.F.%Self.binding.as_type (%Self.binding.as_type.d31) = value_param call_param0
  4048. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)] {
  4049. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.ab9)]
  4050. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  4051. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  4052. // CHECK:STDOUT: }
  4053. // CHECK:STDOUT: %self: @I.F.%Self.binding.as_type (%Self.binding.as_type.d31) = value_binding self, %self.param
  4054. // CHECK:STDOUT: %return.param: ref @I.F.%array_type.loc5_38.1 (%array_type.d35) = out_param call_param1
  4055. // CHECK:STDOUT: %return: ref @I.F.%array_type.loc5_38.1 (%array_type.d35) = return_slot %return.param
  4056. // CHECK:STDOUT: }
  4057. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %I.F.decl [concrete = constants.%assoc1]
  4058. // CHECK:STDOUT:
  4059. // CHECK:STDOUT: !members:
  4060. // CHECK:STDOUT: .Self = %Self
  4061. // CHECK:STDOUT: .N = @N.%assoc0
  4062. // CHECK:STDOUT: .F = %assoc1
  4063. // CHECK:STDOUT: witness = (%N, %I.F.decl)
  4064. // CHECK:STDOUT:
  4065. // CHECK:STDOUT: !requires:
  4066. // CHECK:STDOUT: }
  4067. // CHECK:STDOUT:
  4068. // CHECK:STDOUT: generic assoc_const @N(@I.%Self: %I.type) {
  4069. // CHECK:STDOUT: assoc_const N:! %i32;
  4070. // CHECK:STDOUT: }
  4071. // CHECK:STDOUT:
  4072. // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc8_7.2 as %.loc8_14 {
  4073. // 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] {
  4074. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
  4075. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  4076. // CHECK:STDOUT: %return.patt: %pattern_type.5d5 = return_slot_pattern [concrete]
  4077. // CHECK:STDOUT: %return.param_patt: %pattern_type.5d5 = out_param_pattern %return.patt, call_param1 [concrete]
  4078. // CHECK:STDOUT: } {
  4079. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  4080. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  4081. // CHECK:STDOUT: %.loc9_31.1: type = value_of_initializer %Bool.call [concrete = bool]
  4082. // CHECK:STDOUT: %.loc9_31.2: type = converted %Bool.call, %.loc9_31.1 [concrete = bool]
  4083. // CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc9_31.2 [concrete = constants.%array_type.c9b]
  4084. // CHECK:STDOUT: %.loc9_38: form = init_form %array_type, call_param1 [concrete = constants.%.366]
  4085. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  4086. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.I.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  4087. // CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
  4088. // CHECK:STDOUT: %return.param: ref %array_type.c9b = out_param call_param1
  4089. // CHECK:STDOUT: %return: ref %array_type.c9b = return_slot %return.param
  4090. // CHECK:STDOUT: }
  4091. // 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]
  4092. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  4093. // CHECK:STDOUT: %impl_witness_assoc_constant: %i32 = impl_witness_assoc_constant constants.%int_2.ef8 [concrete = constants.%int_2.ef8]
  4094. // CHECK:STDOUT:
  4095. // CHECK:STDOUT: !members:
  4096. // CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl
  4097. // CHECK:STDOUT: witness = %I.impl_witness
  4098. // CHECK:STDOUT: }
  4099. // CHECK:STDOUT:
  4100. // CHECK:STDOUT: generic fn @I.F(@I.%Self: %I.type) {
  4101. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.ab9)]
  4102. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.d31)]
  4103. // CHECK:STDOUT: %pattern_type.loc5_8: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.loc5_8 (constants.%pattern_type.fa0)]
  4104. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness.3ae)]
  4105. // 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)]
  4106. // 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)]
  4107. // 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)]
  4108. // 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)]
  4109. // 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)]
  4110. // CHECK:STDOUT: %.loc5_38.1: form = init_form %array_type.loc5_38.1, call_param1 [symbolic = %.loc5_38.1 (constants.%.939)]
  4111. // CHECK:STDOUT: %pattern_type.loc5_22: type = pattern_type %array_type.loc5_38.1 [symbolic = %pattern_type.loc5_22 (constants.%pattern_type.3e2)]
  4112. // CHECK:STDOUT:
  4113. // CHECK:STDOUT: fn(%self.param: @I.F.%Self.binding.as_type (%Self.binding.as_type.d31)) -> out %return.param: @I.F.%array_type.loc5_38.1 (%array_type.d35);
  4114. // CHECK:STDOUT: }
  4115. // CHECK:STDOUT:
  4116. // CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.F(%self.param: %empty_tuple.type) -> out %return.param: %array_type.c9b {
  4117. // CHECK:STDOUT: !entry:
  4118. // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
  4119. // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false]
  4120. // CHECK:STDOUT: %.loc9_61.1: %tuple.type.784 = tuple_literal (%true, %false) [concrete = constants.%tuple.a9a]
  4121. // CHECK:STDOUT: %impl.elem0.loc9_50: %.56b = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op]
  4122. // CHECK:STDOUT: %bound_method.loc9_50: <bound method> = bound_method %true, %impl.elem0.loc9_50 [concrete = constants.%bool.as.Copy.impl.Op.bound.12b]
  4123. // CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_50: init bool = call %bound_method.loc9_50(%true) [concrete = constants.%true]
  4124. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  4125. // CHECK:STDOUT: %.loc9_61.2: ref bool = array_index %return.param, %int_0
  4126. // CHECK:STDOUT: %.loc9_61.3: init bool to %.loc9_61.2 = initialize_from %bool.as.Copy.impl.Op.call.loc9_50 [concrete = constants.%true]
  4127. // CHECK:STDOUT: %impl.elem0.loc9_56: %.56b = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op]
  4128. // CHECK:STDOUT: %bound_method.loc9_56: <bound method> = bound_method %false, %impl.elem0.loc9_56 [concrete = constants.%bool.as.Copy.impl.Op.bound.082]
  4129. // CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_56: init bool = call %bound_method.loc9_56(%false) [concrete = constants.%false]
  4130. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  4131. // CHECK:STDOUT: %.loc9_61.4: ref bool = array_index %return.param, %int_1
  4132. // CHECK:STDOUT: %.loc9_61.5: init bool to %.loc9_61.4 = initialize_from %bool.as.Copy.impl.Op.call.loc9_56 [concrete = constants.%false]
  4133. // CHECK:STDOUT: %.loc9_61.6: init %array_type.c9b to %return.param = array_init (%.loc9_61.3, %.loc9_61.5) [concrete = constants.%array]
  4134. // CHECK:STDOUT: %.loc9_62: init %array_type.c9b = converted %.loc9_61.1, %.loc9_61.6 [concrete = constants.%array]
  4135. // CHECK:STDOUT: return %.loc9_62 to %return.param
  4136. // CHECK:STDOUT: }
  4137. // CHECK:STDOUT:
  4138. // CHECK:STDOUT: specific @N(constants.%Self.ab9) {}
  4139. // CHECK:STDOUT:
  4140. // CHECK:STDOUT: specific @I.F(constants.%Self.ab9) {
  4141. // CHECK:STDOUT: %Self => constants.%Self.ab9
  4142. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.d31
  4143. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.fa0
  4144. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness.3ae
  4145. // CHECK:STDOUT: %impl.elem0.loc5_37.1 => constants.%impl.elem0.f83
  4146. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound.0e7
  4147. // CHECK:STDOUT: %bound_method.loc5_37.1 => constants.%bound_method.2a2
  4148. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1 => constants.%Int.as.ImplicitAs.impl.Convert.call
  4149. // CHECK:STDOUT: %array_type.loc5_38.1 => constants.%array_type.d35
  4150. // CHECK:STDOUT: %.loc5_38.1 => constants.%.939
  4151. // CHECK:STDOUT: %pattern_type.loc5_22 => constants.%pattern_type.3e2
  4152. // CHECK:STDOUT: }
  4153. // CHECK:STDOUT:
  4154. // CHECK:STDOUT: specific @N(constants.%.Self) {}
  4155. // CHECK:STDOUT:
  4156. // CHECK:STDOUT: specific @I.F(constants.%I.facet) {
  4157. // CHECK:STDOUT: %Self => constants.%I.facet
  4158. // CHECK:STDOUT: %Self.binding.as_type => constants.%empty_tuple.type
  4159. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.cb1
  4160. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.impl_witness
  4161. // CHECK:STDOUT: %impl.elem0.loc5_37.1 => constants.%int_2.ef8
  4162. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound.075
  4163. // CHECK:STDOUT: %bound_method.loc5_37.1 => constants.%bound_method.bea
  4164. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_37.1 => constants.%int_2.ecc
  4165. // CHECK:STDOUT: %array_type.loc5_38.1 => constants.%array_type.c9b
  4166. // CHECK:STDOUT: %.loc5_38.1 => constants.%.366
  4167. // CHECK:STDOUT: %pattern_type.loc5_22 => constants.%pattern_type.5d5
  4168. // CHECK:STDOUT: }
  4169. // CHECK:STDOUT:
  4170. // CHECK:STDOUT: --- symbolic_associated_type_in_concrete_context.carbon
  4171. // CHECK:STDOUT:
  4172. // CHECK:STDOUT: constants {
  4173. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  4174. // CHECK:STDOUT: %Self.c59: %Z.type = symbolic_binding Self, 0 [symbolic]
  4175. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  4176. // CHECK:STDOUT: %assoc0.bdb: %Z.assoc_type = assoc_entity element0, @Z.%X [concrete]
  4177. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  4178. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  4179. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  4180. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  4181. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  4182. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  4183. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  4184. // CHECK:STDOUT: %C.5a3: type = class_type @C, @C(%T) [symbolic]
  4185. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  4186. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  4187. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  4188. // CHECK:STDOUT: %.Self.aac: %Z.type = symbolic_binding .Self [symbolic_self]
  4189. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.aac [symbolic_self]
  4190. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.aac, @Z [symbolic_self]
  4191. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic_self]
  4192. // CHECK:STDOUT: %Z_where.type.ea1: type = facet_type <@Z where %impl.elem0 = %C.5a3> [symbolic]
  4193. // CHECK:STDOUT: %Z.impl_witness.8d2: <witness> = impl_witness @T.as.Z.impl.%Z.impl_witness_table, @T.as.Z.impl(%T) [symbolic]
  4194. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Z_where.type.ea1 [symbolic]
  4195. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  4196. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  4197. // CHECK:STDOUT: %C.302: type = class_type @C, @C(%D) [concrete]
  4198. // CHECK:STDOUT: %Z_where.type.4e0: type = facet_type <@Z where %impl.elem0 = %C.302> [concrete]
  4199. // CHECK:STDOUT: %Z.impl_witness.63b: <witness> = impl_witness @T.as.Z.impl.%Z.impl_witness_table, @T.as.Z.impl(%D) [concrete]
  4200. // CHECK:STDOUT: %complete_type.9a2: <witness> = complete_type_witness %Z_where.type.4e0 [concrete]
  4201. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %D, (%Z.impl_witness.63b) [concrete]
  4202. // CHECK:STDOUT: %pattern_type.a7e: type = pattern_type %C.302 [concrete]
  4203. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  4204. // CHECK:STDOUT: %C.val: %C.302 = struct_value () [concrete]
  4205. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  4206. // CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete]
  4207. // CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete]
  4208. // CHECK:STDOUT: }
  4209. // CHECK:STDOUT:
  4210. // CHECK:STDOUT: imports {
  4211. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  4212. // CHECK:STDOUT: .Destroy = %Core.Destroy
  4213. // CHECK:STDOUT: import Core//prelude
  4214. // CHECK:STDOUT: import Core//prelude/...
  4215. // CHECK:STDOUT: }
  4216. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  4217. // CHECK:STDOUT: }
  4218. // CHECK:STDOUT:
  4219. // CHECK:STDOUT: file {
  4220. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  4221. // CHECK:STDOUT: .Core = imports.%Core
  4222. // CHECK:STDOUT: .Z = %Z.decl
  4223. // CHECK:STDOUT: .C = %C.decl
  4224. // CHECK:STDOUT: .D = %D.decl
  4225. // CHECK:STDOUT: .F = %F.decl
  4226. // CHECK:STDOUT: }
  4227. // CHECK:STDOUT: %Core.import = import Core
  4228. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  4229. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  4230. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  4231. // CHECK:STDOUT: } {
  4232. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  4233. // CHECK:STDOUT: %T.loc6_9.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_9.1 (constants.%T)]
  4234. // CHECK:STDOUT: }
  4235. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  4236. // CHECK:STDOUT: impl_decl @T.as.Z.impl [concrete] {
  4237. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  4238. // CHECK:STDOUT: } {
  4239. // CHECK:STDOUT: %T.ref.loc9_24: type = name_ref T, %T.loc9_14.1 [symbolic = %T.loc9_14.2 (constants.%T)]
  4240. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  4241. // CHECK:STDOUT: %.Self.1: %Z.type = symbolic_binding .Self [symbolic_self = constants.%.Self.aac]
  4242. // CHECK:STDOUT: %.Self.ref: %Z.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self.aac]
  4243. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  4244. // CHECK:STDOUT: %.loc9_37: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  4245. // CHECK:STDOUT: %X.ref: %Z.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.bdb]
  4246. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  4247. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  4248. // CHECK:STDOUT: %T.ref.loc9_44: type = name_ref T, %T.loc9_14.1 [symbolic = %T.loc9_14.2 (constants.%T)]
  4249. // CHECK:STDOUT: %C.loc9_45.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc9_45.2 (constants.%C.5a3)]
  4250. // CHECK:STDOUT: %.loc9_31: type = where_expr %.Self.1 [symbolic = %Z_where.type (constants.%Z_where.type.ea1)] {
  4251. // CHECK:STDOUT: requirement_base_facet_type constants.%Z.type
  4252. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.loc9_45.1
  4253. // CHECK:STDOUT: }
  4254. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  4255. // CHECK:STDOUT: %T.loc9_14.1: type = symbolic_binding T, 0 [symbolic = %T.loc9_14.2 (constants.%T)]
  4256. // CHECK:STDOUT: }
  4257. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  4258. // CHECK:STDOUT: }
  4259. // CHECK:STDOUT:
  4260. // CHECK:STDOUT: interface @Z {
  4261. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.c59]
  4262. // CHECK:STDOUT: %X: type = assoc_const_decl @X [concrete] {
  4263. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, @Z.%X [concrete = constants.%assoc0.bdb]
  4264. // CHECK:STDOUT: }
  4265. // CHECK:STDOUT:
  4266. // CHECK:STDOUT: !members:
  4267. // CHECK:STDOUT: .Self = %Self
  4268. // CHECK:STDOUT: .X = @X.%assoc0
  4269. // CHECK:STDOUT: witness = (%X)
  4270. // CHECK:STDOUT:
  4271. // CHECK:STDOUT: !requires:
  4272. // CHECK:STDOUT: }
  4273. // CHECK:STDOUT:
  4274. // CHECK:STDOUT: generic assoc_const @X(@Z.%Self: %Z.type) {
  4275. // CHECK:STDOUT: assoc_const X:! type;
  4276. // CHECK:STDOUT: }
  4277. // CHECK:STDOUT:
  4278. // CHECK:STDOUT: generic impl @T.as.Z.impl(%T.loc9_14.1: type) {
  4279. // CHECK:STDOUT: %T.loc9_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc9_14.2 (constants.%T)]
  4280. // CHECK:STDOUT: %C.loc9_45.2: type = class_type @C, @C(%T.loc9_14.2) [symbolic = %C.loc9_45.2 (constants.%C.5a3)]
  4281. // 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)]
  4282. // CHECK:STDOUT: %Z.impl_witness.loc9_47.2: <witness> = impl_witness %Z.impl_witness_table, @T.as.Z.impl(%T.loc9_14.2) [symbolic = %Z.impl_witness.loc9_47.2 (constants.%Z.impl_witness.8d2)]
  4283. // CHECK:STDOUT:
  4284. // CHECK:STDOUT: !definition:
  4285. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete)]
  4286. // CHECK:STDOUT:
  4287. // CHECK:STDOUT: impl: %T.ref.loc9_24 as %.loc9_31 {
  4288. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @T.as.Z.impl [concrete]
  4289. // 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)]
  4290. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C.5a3 [symbolic = %C.loc9_45.2 (constants.%C.5a3)]
  4291. // CHECK:STDOUT:
  4292. // CHECK:STDOUT: !members:
  4293. // CHECK:STDOUT: witness = %Z.impl_witness.loc9_47.1
  4294. // CHECK:STDOUT: }
  4295. // CHECK:STDOUT: }
  4296. // CHECK:STDOUT:
  4297. // CHECK:STDOUT: generic class @C(%T.loc6_9.2: type) {
  4298. // CHECK:STDOUT: %T.loc6_9.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_9.1 (constants.%T)]
  4299. // CHECK:STDOUT:
  4300. // CHECK:STDOUT: !definition:
  4301. // CHECK:STDOUT:
  4302. // CHECK:STDOUT: class {
  4303. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  4304. // CHECK:STDOUT: complete_type_witness = %complete_type
  4305. // CHECK:STDOUT:
  4306. // CHECK:STDOUT: !members:
  4307. // CHECK:STDOUT: .Self = constants.%C.5a3
  4308. // CHECK:STDOUT: }
  4309. // CHECK:STDOUT: }
  4310. // CHECK:STDOUT:
  4311. // CHECK:STDOUT: class @D {
  4312. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  4313. // CHECK:STDOUT: complete_type_witness = %complete_type
  4314. // CHECK:STDOUT:
  4315. // CHECK:STDOUT: !members:
  4316. // CHECK:STDOUT: .Self = constants.%D
  4317. // CHECK:STDOUT: }
  4318. // CHECK:STDOUT:
  4319. // CHECK:STDOUT: fn @F() {
  4320. // CHECK:STDOUT: !entry:
  4321. // CHECK:STDOUT: name_binding_decl {
  4322. // CHECK:STDOUT: %a.patt: %pattern_type.a7e = value_binding_pattern a [concrete]
  4323. // CHECK:STDOUT: }
  4324. // CHECK:STDOUT: %.loc12_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  4325. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  4326. // CHECK:STDOUT: %D.ref.loc12_28: type = name_ref D, file.%D.decl [concrete = constants.%D]
  4327. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%D) [concrete = constants.%C.302]
  4328. // CHECK:STDOUT: %.loc12_21.2: ref %C.302 = temporary_storage
  4329. // CHECK:STDOUT: %.loc12_21.3: init %C.302 to %.loc12_21.2 = class_init () [concrete = constants.%C.val]
  4330. // CHECK:STDOUT: %.loc12_21.4: ref %C.302 = temporary %.loc12_21.2, %.loc12_21.3
  4331. // CHECK:STDOUT: %.loc12_23.1: ref %C.302 = converted %.loc12_21.1, %.loc12_21.4
  4332. // CHECK:STDOUT: %.loc12_11.1: type = splice_block %impl.elem0 [concrete = constants.%C.302] {
  4333. // CHECK:STDOUT: %D.ref.loc12_10: type = name_ref D, file.%D.decl [concrete = constants.%D]
  4334. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  4335. // CHECK:STDOUT: %X.ref: %Z.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.bdb]
  4336. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %D.ref.loc12_10, (constants.%Z.impl_witness.63b) [concrete = constants.%Z.facet]
  4337. // CHECK:STDOUT: %.loc12_11.2: %Z.type = converted %D.ref.loc12_10, %Z.facet [concrete = constants.%Z.facet]
  4338. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.impl_witness.63b, element0 [concrete = constants.%C.302]
  4339. // CHECK:STDOUT: }
  4340. // CHECK:STDOUT: %.loc12_23.2: %C.302 = acquire_value %.loc12_23.1
  4341. // CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_23.2
  4342. // CHECK:STDOUT: %DestroyOp.bound: <bound method> = bound_method %.loc12_21.4, constants.%DestroyOp
  4343. // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc12_21.4)
  4344. // CHECK:STDOUT: return
  4345. // CHECK:STDOUT: }
  4346. // CHECK:STDOUT:
  4347. // CHECK:STDOUT: fn @DestroyOp(%self.param: %C.302) = "no_op";
  4348. // CHECK:STDOUT:
  4349. // CHECK:STDOUT: specific @X(constants.%Self.c59) {}
  4350. // CHECK:STDOUT:
  4351. // CHECK:STDOUT: specific @C(constants.%T) {
  4352. // CHECK:STDOUT: %T.loc6_9.1 => constants.%T
  4353. // CHECK:STDOUT: }
  4354. // CHECK:STDOUT:
  4355. // CHECK:STDOUT: specific @X(constants.%.Self.aac) {}
  4356. // CHECK:STDOUT:
  4357. // CHECK:STDOUT: specific @T.as.Z.impl(constants.%T) {
  4358. // CHECK:STDOUT: %T.loc9_14.2 => constants.%T
  4359. // CHECK:STDOUT: %C.loc9_45.2 => constants.%C.5a3
  4360. // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.ea1
  4361. // CHECK:STDOUT: %Z.impl_witness.loc9_47.2 => constants.%Z.impl_witness.8d2
  4362. // CHECK:STDOUT: }
  4363. // CHECK:STDOUT:
  4364. // CHECK:STDOUT: specific @T.as.Z.impl(constants.%D) {
  4365. // CHECK:STDOUT: %T.loc9_14.2 => constants.%D
  4366. // CHECK:STDOUT: %C.loc9_45.2 => constants.%C.302
  4367. // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.4e0
  4368. // CHECK:STDOUT: %Z.impl_witness.loc9_47.2 => constants.%Z.impl_witness.63b
  4369. // CHECK:STDOUT:
  4370. // CHECK:STDOUT: !definition:
  4371. // CHECK:STDOUT: %require_complete => constants.%complete_type.9a2
  4372. // CHECK:STDOUT: }
  4373. // CHECK:STDOUT:
  4374. // CHECK:STDOUT: specific @C(constants.%D) {
  4375. // CHECK:STDOUT: %T.loc6_9.1 => constants.%D
  4376. // CHECK:STDOUT:
  4377. // CHECK:STDOUT: !definition:
  4378. // CHECK:STDOUT: }
  4379. // CHECK:STDOUT:
  4380. // CHECK:STDOUT: specific @X(constants.%Z.facet) {}
  4381. // CHECK:STDOUT: