use_assoc_const.carbon 293 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921
  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. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/use_assoc_const.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/use_assoc_const.carbon
  13. // --- associated_type_in_method_signature.carbon
  14. library "[[@TEST_NAME]]";
  15. interface J {
  16. let U:! type;
  17. fn F[self: Self](u: U) -> U;
  18. }
  19. impl () as J where .U = i32 {
  20. fn F[self: Self](u: i32) -> i32 { return u + 2; }
  21. }
  22. fn CallMethod(x: ()) -> i32 {
  23. return x.(J.F)(40);
  24. }
  25. class C {
  26. // This allows the type to be copyable so it can be returned.
  27. adapt {};
  28. }
  29. impl C as J where .U = C {
  30. fn F[self: Self](u: C) -> C { return self; }
  31. }
  32. // --- associated_type_in_function_signature.carbon
  33. library "[[@TEST_NAME]]";
  34. interface J {
  35. let U:! type;
  36. fn F(u: U) -> U;
  37. }
  38. class D { }
  39. impl D as J where .U = i32 {
  40. fn F(u: i32) -> i32 { return u + 3; }
  41. }
  42. fn CallFunction() -> i32 {
  43. return D.(J.F)(4);
  44. }
  45. // --- extend_impl_with_associated_type_in_signature.carbon
  46. library "[[@TEST_NAME]]";
  47. interface J {
  48. let U:! type;
  49. fn F(u: U) -> U;
  50. fn G[self: Self](v: U) -> U;
  51. }
  52. class E {
  53. extend impl as J where .U = i32 {
  54. fn F(u: i32) -> i32 {
  55. return u + 1;
  56. }
  57. fn G[self: Self](v: i32) -> i32 {
  58. return v + 2;
  59. }
  60. }
  61. }
  62. fn CallBoth(e: E) -> i32 {
  63. return e.F(2) + e.G(3) + E.F(4) + e.(E.G)(5) + e.(J.G)(6);
  64. }
  65. fn GenericCallF[T:! J](t: T, u: T.U) -> T.U {
  66. return t.F(u);
  67. }
  68. fn CallGeneric(e: E) -> i32 {
  69. return GenericCallF(e, 2);
  70. }
  71. // --- use_constraint_on_associated_type.carbon
  72. library "[[@TEST_NAME]]";
  73. interface I {
  74. fn Op[self: Self](b: Self) -> Self;
  75. }
  76. interface J {
  77. let U:! I;
  78. fn F(u: U) -> U;
  79. }
  80. fn GenericResult[T:! J](t: T, u: T.U) -> T.U {
  81. return t.F(u).(I.Op)(T.F(u));
  82. }
  83. // --- interface_qualified.carbon
  84. library "[[@TEST_NAME]]";
  85. interface J {
  86. let U:! type;
  87. fn G[self: Self](v: U) -> U;
  88. }
  89. fn GenericCallInterfaceQualified[T:! J](t: T, u: T.U) -> T.U {
  90. return t.(J.G)(u);
  91. }
  92. // --- use_where.carbon
  93. library "[[@TEST_NAME]]";
  94. interface J {
  95. let U:! type;
  96. fn F(u: U) -> U;
  97. }
  98. fn GenericCallFI32[T:! J where .U = i32](t: T) -> i32 {
  99. return t.F(2);
  100. }
  101. // --- fail_todo_use_associated_constant_in_impl.carbon
  102. library "[[@TEST_NAME]]";
  103. interface J {
  104. let U:! type;
  105. fn F(u: U) -> U;
  106. }
  107. class E {
  108. extend impl as J where .U = i32 {
  109. // 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]
  110. // CHECK:STDERR: fn F(u: U) -> U {
  111. // CHECK:STDERR: ^
  112. // 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]
  113. // CHECK:STDERR: fn F(u: U) -> U {
  114. // CHECK:STDERR: ^
  115. // CHECK:STDERR:
  116. // 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]
  117. // CHECK:STDERR: fn F(u: U) -> U {
  118. // CHECK:STDERR: ^
  119. // 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]
  120. // CHECK:STDERR: fn F(u: U) -> U {
  121. // CHECK:STDERR: ^
  122. // CHECK:STDERR:
  123. fn F(u: U) -> U {
  124. return u + 1;
  125. }
  126. }
  127. }
  128. // --- fail_todo_self_period_associated_type.carbon
  129. library "[[@TEST_NAME]]";
  130. interface J2 {
  131. let U2:! type;
  132. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE+14]]:23: error: member access into object of incomplete type `J2` [IncompleteTypeInMemberAccess]
  133. // CHECK:STDERR: fn F[self: Self](z: Self.U2) -> Self.U2;
  134. // CHECK:STDERR: ^~~~
  135. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE-5]]:1: note: interface is currently being defined [InterfaceIncompleteWithinDefinition]
  136. // CHECK:STDERR: interface J2 {
  137. // CHECK:STDERR: ^~~~~~~~~~~~~~
  138. // CHECK:STDERR:
  139. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE+7]]:35: error: member access into object of incomplete type `J2` [IncompleteTypeInMemberAccess]
  140. // CHECK:STDERR: fn F[self: Self](z: Self.U2) -> Self.U2;
  141. // CHECK:STDERR: ^~~~
  142. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE-12]]:1: note: interface is currently being defined [InterfaceIncompleteWithinDefinition]
  143. // CHECK:STDERR: interface J2 {
  144. // CHECK:STDERR: ^~~~~~~~~~~~~~
  145. // CHECK:STDERR:
  146. fn F[self: Self](z: Self.U2) -> Self.U2;
  147. }
  148. impl () as J2 where .U2 = {} {
  149. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE+7]]:3: error: expression cannot be used as a value [UseOfNonExprAsValue]
  150. // CHECK:STDERR: fn F[self: Self](z: {}) -> {} { return z; }
  151. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  152. // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE-7]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
  153. // CHECK:STDERR: fn F[self: Self](z: Self.U2) -> Self.U2;
  154. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  155. // CHECK:STDERR:
  156. fn F[self: Self](z: {}) -> {} { return z; }
  157. }
  158. class C2 {
  159. // This allows the type to be copyable so it can be returned.
  160. adapt {};
  161. }
  162. impl C2 as J2 where .U2 = C2 {
  163. fn F[self: Self](z: C2) -> C2 { return self; }
  164. }
  165. // --- fail_associated_type_in_signature_mismatch.carbon
  166. library "[[@TEST_NAME]]";
  167. interface K {
  168. let V:! type;
  169. fn F[self: Self](v: V) -> V;
  170. }
  171. impl () as K where .V = {.a: ()} {
  172. // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+7]]:3: error: expression cannot be used as a value [UseOfNonExprAsValue]
  173. // CHECK:STDERR: fn F[self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
  174. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  175. // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-7]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
  176. // CHECK:STDERR: fn F[self: Self](v: V) -> V;
  177. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  178. // CHECK:STDERR:
  179. fn F[self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
  180. }
  181. // --- use_non-type_in_function.carbon
  182. library "[[@TEST_NAME]]";
  183. interface M {
  184. let Z:! {.b: {}};
  185. fn G() -> {};
  186. }
  187. impl () as M where .Z = {.b = {}} {
  188. fn G() -> {} {
  189. return (Self as M).Z.b;
  190. }
  191. }
  192. // --- self_as_uses_correct_rewrite_constraint.carbon
  193. library "[[@TEST_NAME]]";
  194. class C(T:! type) {}
  195. interface M {
  196. let Z:! {.b: type};
  197. fn G() -> type;
  198. }
  199. impl C({}) as M where .Z = {.b = {}} {
  200. fn G() -> type {
  201. return (Self as M).Z.b;
  202. }
  203. }
  204. impl C(()) as M where .Z = {.b = ()} {
  205. fn G() -> type {
  206. return (Self as M).Z.b;
  207. }
  208. }
  209. // --- associated_int_in_array.carbon
  210. library "[[@TEST_NAME]]";
  211. interface I {
  212. let N:! i32;
  213. fn F[self: Self]() -> array(bool, N);
  214. }
  215. impl () as I where .N = 2 {
  216. fn F[self: Self]() -> array(bool, 2) { return (true, false); }
  217. }
  218. // --- symbolic_associated_type_in_concrete_context.carbon
  219. interface Z {
  220. let X:! type;
  221. }
  222. class C(T:! type) {}
  223. class D {}
  224. impl forall [T:! type] T as Z where .X = C(T) {}
  225. fn F() {
  226. let a: D.(Z.X) = {} as C(D);
  227. }
  228. // CHECK:STDOUT: --- associated_type_in_method_signature.carbon
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: constants {
  231. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  232. // CHECK:STDOUT: %Self.ccd: %J.type = bind_symbolic_name Self, 0 [symbolic]
  233. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  234. // CHECK:STDOUT: %assoc0.411: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  235. // CHECK:STDOUT: %Self.as_type.3df: type = facet_access_type %Self.ccd [symbolic]
  236. // CHECK:STDOUT: %pattern_type.4ca: type = pattern_type %Self.as_type.3df [symbolic]
  237. // CHECK:STDOUT: %J.lookup_impl_witness.646: <witness> = lookup_impl_witness %Self.ccd, @J [symbolic]
  238. // CHECK:STDOUT: %J.facet.521: %J.type = facet_value %Self.as_type.3df, (%J.lookup_impl_witness.646) [symbolic]
  239. // CHECK:STDOUT: %impl.elem0.11f: type = impl_witness_access %J.lookup_impl_witness.646, element0 [symbolic]
  240. // CHECK:STDOUT: %pattern_type.b98: type = pattern_type %impl.elem0.11f [symbolic]
  241. // CHECK:STDOUT: %F.type.c14: type = fn_type @F.1 [concrete]
  242. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  243. // CHECK:STDOUT: %F.b71: %F.type.c14 = struct_value () [concrete]
  244. // CHECK:STDOUT: %assoc1.572: %J.assoc_type = assoc_entity element1, @J.%F.decl [concrete]
  245. // CHECK:STDOUT: %.Self.968: %J.type = bind_symbolic_name .Self [symbolic_self]
  246. // CHECK:STDOUT: %.Self.as_type.78d: type = facet_access_type %.Self.968 [symbolic_self]
  247. // CHECK:STDOUT: %J.lookup_impl_witness.25c: <witness> = lookup_impl_witness %.Self.968, @J [symbolic_self]
  248. // CHECK:STDOUT: %J.facet.330: %J.type = facet_value %.Self.as_type.78d, (%J.lookup_impl_witness.25c) [symbolic_self]
  249. // CHECK:STDOUT: %impl.elem0.83f: type = impl_witness_access %J.lookup_impl_witness.25c, element0 [symbolic_self]
  250. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  251. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  252. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  253. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  254. // CHECK:STDOUT: %Int.49d0e6.1: type = class_type @Int, @Int(%N) [symbolic]
  255. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  256. // CHECK:STDOUT: %J_where.type.b64: type = facet_type <@J where %impl.elem0.83f = %i32> [concrete]
  257. // CHECK:STDOUT: %J.impl_witness.e42: <witness> = impl_witness file.%J.impl_witness_table.loc8 [concrete]
  258. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  259. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  260. // CHECK:STDOUT: %F.type.7d4: type = fn_type @F.2 [concrete]
  261. // CHECK:STDOUT: %F.46e: %F.type.7d4 = struct_value () [concrete]
  262. // CHECK:STDOUT: %J.facet.ecc: %J.type = facet_value %empty_tuple.type, (%J.impl_witness.e42) [concrete]
  263. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  264. // CHECK:STDOUT: %AddWith.type.e05: type = generic_interface_type @AddWith [concrete]
  265. // CHECK:STDOUT: %AddWith.generic: %AddWith.type.e05 = struct_value () [concrete]
  266. // CHECK:STDOUT: %AddWith.type.d7d: type = facet_type <@AddWith, @AddWith(Core.IntLiteral)> [concrete]
  267. // CHECK:STDOUT: %Op.type.0ee: type = fn_type @Op.1, @AddWith(Core.IntLiteral) [concrete]
  268. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  269. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  270. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  271. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
  272. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  273. // CHECK:STDOUT: %ImplicitAs.type.080b83.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Int.49d0e6.1)> [symbolic]
  274. // CHECK:STDOUT: %U: %ImplicitAs.type.080b83.2 = bind_symbolic_name U, 1 [symbolic]
  275. // CHECK:STDOUT: %Op.type.c98676.1: type = fn_type @Op.12, @impl.b98(%N, %U) [symbolic]
  276. // CHECK:STDOUT: %Op.aee6d7.1: %Op.type.c98676.1 = struct_value () [symbolic]
  277. // CHECK:STDOUT: %Op.type.c98676.2: type = fn_type @Op.13, @impl.b98(%N, %U) [symbolic]
  278. // CHECK:STDOUT: %Op.aee6d7.2: %Op.type.c98676.2 = struct_value () [symbolic]
  279. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  280. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  281. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  282. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
  283. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  284. // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  285. // CHECK:STDOUT: %AddWith.impl_witness.5e4: <witness> = impl_witness imports.%AddWith.impl_witness_table.61f, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete]
  286. // CHECK:STDOUT: %Op.type.0437e0.1: type = fn_type @Op.12, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete]
  287. // CHECK:STDOUT: %Op.a9544c.1: %Op.type.0437e0.1 = struct_value () [concrete]
  288. // CHECK:STDOUT: %Op.type.0437e0.2: type = fn_type @Op.13, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete]
  289. // CHECK:STDOUT: %Op.a9544c.2: %Op.type.0437e0.2 = struct_value () [concrete]
  290. // CHECK:STDOUT: %AddWith.facet: %AddWith.type.d7d = facet_value %i32, (%AddWith.impl_witness.5e4) [concrete]
  291. // CHECK:STDOUT: %.b70: type = fn_type_with_self_type %Op.type.0ee, %AddWith.facet [concrete]
  292. // CHECK:STDOUT: %Op.specific_fn.418e74.1: <specific function> = specific_function %Op.a9544c.2, @Op.13(%int_32, %ImplicitAs.facet.921) [concrete]
  293. // CHECK:STDOUT: %Op.specific_fn.418e74.2: <specific function> = specific_function %Op.a9544c.1, @Op.12(%int_32, %ImplicitAs.facet.921) [concrete]
  294. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
  295. // CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
  296. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
  297. // CHECK:STDOUT: %bound_method.b92: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
  298. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  299. // CHECK:STDOUT: %CallMethod.type: type = fn_type @CallMethod [concrete]
  300. // CHECK:STDOUT: %CallMethod: %CallMethod.type = struct_value () [concrete]
  301. // CHECK:STDOUT: %.597: type = fn_type_with_self_type %F.type.c14, %J.facet.ecc [concrete]
  302. // CHECK:STDOUT: %int_40.f80: Core.IntLiteral = int_value 40 [concrete]
  303. // CHECK:STDOUT: %Convert.bound.e52: <bound method> = bound_method %int_40.f80, %Convert.956 [concrete]
  304. // CHECK:STDOUT: %bound_method.7b8: <bound method> = bound_method %int_40.f80, %Convert.specific_fn [concrete]
  305. // CHECK:STDOUT: %int_40.518: %i32 = int_value 40 [concrete]
  306. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  307. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  308. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  309. // CHECK:STDOUT: %J_where.type.0bc: type = facet_type <@J where %impl.elem0.83f = %C> [concrete]
  310. // CHECK:STDOUT: %J.impl_witness.12d: <witness> = impl_witness file.%J.impl_witness_table.loc21 [concrete]
  311. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  312. // CHECK:STDOUT: %F.type.2a7: type = fn_type @F.3 [concrete]
  313. // CHECK:STDOUT: %F.fb5: %F.type.2a7 = struct_value () [concrete]
  314. // CHECK:STDOUT: %J.facet.30e: %J.type = facet_value %C, (%J.impl_witness.12d) [concrete]
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: imports {
  318. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  319. // CHECK:STDOUT: .Int = %Core.Int
  320. // CHECK:STDOUT: .AddWith = %Core.AddWith
  321. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  322. // CHECK:STDOUT: import Core//prelude
  323. // CHECK:STDOUT: import Core//prelude/...
  324. // CHECK:STDOUT: }
  325. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  326. // CHECK:STDOUT: %Core.AddWith: %AddWith.type.e05 = import_ref Core//prelude/operators/arithmetic, AddWith, loaded [concrete = constants.%AddWith.generic]
  327. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  328. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  329. // CHECK:STDOUT: %Core.import_ref.5f5145.7 = import_ref Core//prelude/types/int, loc124_49, unloaded
  330. // CHECK:STDOUT: %Core.import_ref.34c: @impl.b98.%Op.type.2 (%Op.type.c98676.2) = import_ref Core//prelude/types/int, loc125_48, loaded [symbolic = @impl.b98.%Op.2 (constants.%Op.aee6d7.2)]
  331. // CHECK:STDOUT: %AddWith.impl_witness_table.61f = impl_witness_table (%Core.import_ref.5f5145.7, %Core.import_ref.34c), @impl.b98 [concrete]
  332. // CHECK:STDOUT: %Core.Op.574: @impl.b98.%Op.type.1 (%Op.type.c98676.1) = import_ref Core//prelude/types/int, Op, loaded [symbolic = @impl.b98.%Op.1 (constants.%Op.aee6d7.1)]
  333. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  334. // CHECK:STDOUT: }
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: file {
  337. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  338. // CHECK:STDOUT: .Core = imports.%Core
  339. // CHECK:STDOUT: .J = %J.decl
  340. // CHECK:STDOUT: .CallMethod = %CallMethod.decl
  341. // CHECK:STDOUT: .C = %C.decl
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT: %Core.import = import Core
  344. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  345. // CHECK:STDOUT: impl_decl @impl.32a [concrete] {} {
  346. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  347. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  348. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  349. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.968]
  350. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.968]
  351. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  352. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type.78d]
  353. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type.78d]
  354. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.25c, element0 [symbolic_self = constants.%impl.elem0.83f]
  355. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  356. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  357. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [concrete = constants.%J_where.type.b64] {
  358. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  359. // CHECK:STDOUT: }
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT: %J.impl_witness_table.loc8 = impl_witness_table (%impl_witness_assoc_constant.loc8, @impl.32a.%F.decl), @impl.32a [concrete]
  362. // CHECK:STDOUT: %J.impl_witness.loc8: <witness> = impl_witness %J.impl_witness_table.loc8 [concrete = constants.%J.impl_witness.e42]
  363. // CHECK:STDOUT: %impl_witness_assoc_constant.loc8: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  364. // CHECK:STDOUT: %CallMethod.decl: %CallMethod.type = fn_decl @CallMethod [concrete = constants.%CallMethod] {
  365. // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = binding_pattern x [concrete]
  366. // CHECK:STDOUT: %x.param_patt: %pattern_type.cb1 = value_param_pattern %x.patt, call_param0 [concrete]
  367. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  368. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  369. // CHECK:STDOUT: } {
  370. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  371. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  372. // CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0
  373. // CHECK:STDOUT: %.loc12_19.1: type = splice_block %.loc12_19.3 [concrete = constants.%empty_tuple.type] {
  374. // CHECK:STDOUT: %.loc12_19.2: %empty_tuple.type = tuple_literal ()
  375. // CHECK:STDOUT: %.loc12_19.3: type = converted %.loc12_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  376. // CHECK:STDOUT: }
  377. // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %x.param
  378. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  379. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  380. // CHECK:STDOUT: }
  381. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  382. // CHECK:STDOUT: impl_decl @impl.043 [concrete] {} {
  383. // CHECK:STDOUT: %C.ref.loc21_6: type = name_ref C, file.%C.decl [concrete = constants.%C]
  384. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  385. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.968]
  386. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.968]
  387. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  388. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type.78d]
  389. // CHECK:STDOUT: %.loc21_19: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type.78d]
  390. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.25c, element0 [symbolic_self = constants.%impl.elem0.83f]
  391. // CHECK:STDOUT: %C.ref.loc21_24: type = name_ref C, file.%C.decl [concrete = constants.%C]
  392. // CHECK:STDOUT: %.loc21_13: type = where_expr %.Self [concrete = constants.%J_where.type.0bc] {
  393. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.ref.loc21_24
  394. // CHECK:STDOUT: }
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT: %J.impl_witness_table.loc21 = impl_witness_table (%impl_witness_assoc_constant.loc21, @impl.043.%F.decl), @impl.043 [concrete]
  397. // CHECK:STDOUT: %J.impl_witness.loc21: <witness> = impl_witness %J.impl_witness_table.loc21 [concrete = constants.%J.impl_witness.12d]
  398. // CHECK:STDOUT: %impl_witness_assoc_constant.loc21: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C]
  399. // CHECK:STDOUT: }
  400. // CHECK:STDOUT:
  401. // CHECK:STDOUT: interface @J {
  402. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.ccd]
  403. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  404. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.411]
  405. // CHECK:STDOUT: }
  406. // CHECK:STDOUT: %F.decl: %F.type.c14 = fn_decl @F.1 [concrete = constants.%F.b71] {
  407. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type.loc5_8 (%pattern_type.4ca) = binding_pattern self [concrete]
  408. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type.loc5_8 (%pattern_type.4ca) = value_param_pattern %self.patt, call_param0 [concrete]
  409. // CHECK:STDOUT: %u.patt: @F.1.%pattern_type.loc5_20 (%pattern_type.b98) = binding_pattern u [concrete]
  410. // CHECK:STDOUT: %u.param_patt: @F.1.%pattern_type.loc5_20 (%pattern_type.b98) = value_param_pattern %u.patt, call_param1 [concrete]
  411. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type.loc5_20 (%pattern_type.b98) = return_slot_pattern [concrete]
  412. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type.loc5_20 (%pattern_type.b98) = out_param_pattern %return.patt, call_param2 [concrete]
  413. // CHECK:STDOUT: } {
  414. // CHECK:STDOUT: %impl.elem0.loc5_29: type = impl_witness_access constants.%J.lookup_impl_witness.646, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11f)]
  415. // CHECK:STDOUT: %U.ref.loc5_29: type = name_ref U, %impl.elem0.loc5_29 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11f)]
  416. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type.3df) = value_param call_param0
  417. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.3df)] {
  418. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self.ccd)]
  419. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.3df)]
  420. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.3df)]
  421. // CHECK:STDOUT: }
  422. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type.3df) = bind_name self, %self.param
  423. // CHECK:STDOUT: %u.param: @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.11f) = value_param call_param1
  424. // CHECK:STDOUT: %.loc5_23: type = splice_block %U.ref.loc5_23 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11f)] {
  425. // CHECK:STDOUT: %impl.elem0.loc5_23.2: type = impl_witness_access constants.%J.lookup_impl_witness.646, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11f)]
  426. // CHECK:STDOUT: %U.ref.loc5_23: type = name_ref U, %impl.elem0.loc5_23.2 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11f)]
  427. // CHECK:STDOUT: }
  428. // CHECK:STDOUT: %u: @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.11f) = bind_name u, %u.param
  429. // CHECK:STDOUT: %return.param: ref @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.11f) = out_param call_param2
  430. // CHECK:STDOUT: %return: ref @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.11f) = return_slot %return.param
  431. // CHECK:STDOUT: }
  432. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1.572]
  433. // CHECK:STDOUT:
  434. // CHECK:STDOUT: !members:
  435. // CHECK:STDOUT: .Self = %Self
  436. // CHECK:STDOUT: .U = @U.%assoc0
  437. // CHECK:STDOUT: .F = %assoc1
  438. // CHECK:STDOUT: witness = (%U, %F.decl)
  439. // CHECK:STDOUT: }
  440. // CHECK:STDOUT:
  441. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  442. // CHECK:STDOUT: assoc_const U:! type;
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: impl @impl.32a: %.loc8_7.2 as %.loc8_14 {
  446. // CHECK:STDOUT: %F.decl: %F.type.7d4 = fn_decl @F.2 [concrete = constants.%F.46e] {
  447. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
  448. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  449. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = binding_pattern u [concrete]
  450. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern %u.patt, call_param1 [concrete]
  451. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  452. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete]
  453. // CHECK:STDOUT: } {
  454. // CHECK:STDOUT: %int_32.loc9_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  455. // CHECK:STDOUT: %i32.loc9_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  456. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  457. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.32a.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  458. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  459. // CHECK:STDOUT: %u.param: %i32 = value_param call_param1
  460. // CHECK:STDOUT: %.loc9_23: type = splice_block %i32.loc9_23 [concrete = constants.%i32] {
  461. // CHECK:STDOUT: %int_32.loc9_23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  462. // CHECK:STDOUT: %i32.loc9_23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  463. // CHECK:STDOUT: }
  464. // CHECK:STDOUT: %u: %i32 = bind_name u, %u.param
  465. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
  466. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT:
  469. // CHECK:STDOUT: !members:
  470. // CHECK:STDOUT: .F = %F.decl
  471. // CHECK:STDOUT: witness = file.%J.impl_witness.loc8
  472. // CHECK:STDOUT: }
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: impl @impl.043: %C.ref.loc21_6 as %.loc21_13 {
  475. // CHECK:STDOUT: %F.decl: %F.type.2a7 = fn_decl @F.3 [concrete = constants.%F.fb5] {
  476. // CHECK:STDOUT: %self.patt: %pattern_type.c48 = binding_pattern self [concrete]
  477. // CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete]
  478. // CHECK:STDOUT: %u.patt: %pattern_type.c48 = binding_pattern u [concrete]
  479. // CHECK:STDOUT: %u.param_patt: %pattern_type.c48 = value_param_pattern %u.patt, call_param1 [concrete]
  480. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  481. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param2 [concrete]
  482. // CHECK:STDOUT: } {
  483. // CHECK:STDOUT: %C.ref.loc22_29: type = name_ref C, file.%C.decl [concrete = constants.%C]
  484. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  485. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.043.%C.ref.loc21_6 [concrete = constants.%C]
  486. // CHECK:STDOUT: %self: %C = bind_name self, %self.param
  487. // CHECK:STDOUT: %u.param: %C = value_param call_param1
  488. // CHECK:STDOUT: %C.ref.loc22_23: type = name_ref C, file.%C.decl [concrete = constants.%C]
  489. // CHECK:STDOUT: %u: %C = bind_name u, %u.param
  490. // CHECK:STDOUT: %return.param: ref %C = out_param call_param2
  491. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  492. // CHECK:STDOUT: }
  493. // CHECK:STDOUT:
  494. // CHECK:STDOUT: !members:
  495. // CHECK:STDOUT: .C = <poisoned>
  496. // CHECK:STDOUT: .F = %F.decl
  497. // CHECK:STDOUT: witness = file.%J.impl_witness.loc21
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: class @C {
  501. // CHECK:STDOUT: %.loc18_10: %empty_struct_type = struct_literal ()
  502. // CHECK:STDOUT: %.loc18_11: type = converted %.loc18_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  503. // CHECK:STDOUT: adapt_decl %.loc18_11 [concrete]
  504. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  505. // CHECK:STDOUT: complete_type_witness = %complete_type
  506. // CHECK:STDOUT:
  507. // CHECK:STDOUT: !members:
  508. // CHECK:STDOUT: .Self = constants.%C
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT:
  511. // CHECK:STDOUT: generic fn @F.1(@J.%Self: %J.type) {
  512. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.ccd)]
  513. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.3df)]
  514. // CHECK:STDOUT: %pattern_type.loc5_8: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type.loc5_8 (constants.%pattern_type.4ca)]
  515. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.646)]
  516. // 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.11f)]
  517. // CHECK:STDOUT: %pattern_type.loc5_20: type = pattern_type %impl.elem0.loc5_23.1 [symbolic = %pattern_type.loc5_20 (constants.%pattern_type.b98)]
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type.3df), %u.param: @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.11f)) -> @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.11f);
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT:
  522. // CHECK:STDOUT: fn @F.2(%self.param: %empty_tuple.type, %u.param: %i32) -> %i32 {
  523. // CHECK:STDOUT: !entry:
  524. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
  525. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  526. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.c75) [concrete = constants.%ImplicitAs.facet.921]
  527. // CHECK:STDOUT: %.loc9_46.1: %ImplicitAs.type.205 = converted Core.IntLiteral, %ImplicitAs.facet [concrete = constants.%ImplicitAs.facet.921]
  528. // CHECK:STDOUT: %impl.elem1: %.b70 = impl_witness_access constants.%AddWith.impl_witness.5e4, element1 [concrete = constants.%Op.a9544c.2]
  529. // CHECK:STDOUT: %bound_method.loc9_46.1: <bound method> = bound_method %u.ref, %impl.elem1
  530. // CHECK:STDOUT: %specific_fn.loc9_46: <specific function> = specific_function %impl.elem1, @Op.13(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.1]
  531. // CHECK:STDOUT: %bound_method.loc9_46.2: <bound method> = bound_method %u.ref, %specific_fn.loc9_46
  532. // CHECK:STDOUT: %.loc9_46.2: %Op.type.0437e0.1 = specific_constant imports.%Core.Op.574, @impl.b98(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.a9544c.1]
  533. // CHECK:STDOUT: %Op.ref: %Op.type.0437e0.1 = name_ref Op, %.loc9_46.2 [concrete = constants.%Op.a9544c.1]
  534. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %u.ref, %Op.ref
  535. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.ref, @Op.12(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.2]
  536. // CHECK:STDOUT: %bound_method.loc9_46.3: <bound method> = bound_method %u.ref, %Op.specific_fn
  537. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  538. // CHECK:STDOUT: %bound_method.loc9_48.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9]
  539. // CHECK:STDOUT: %specific_fn.loc9_48: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  540. // CHECK:STDOUT: %bound_method.loc9_48.2: <bound method> = bound_method %int_2, %specific_fn.loc9_48 [concrete = constants.%bound_method.b92]
  541. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc9_48.2(%int_2) [concrete = constants.%int_2.ef8]
  542. // CHECK:STDOUT: %.loc9_48.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8]
  543. // CHECK:STDOUT: %.loc9_48.2: %i32 = converted %int_2, %.loc9_48.1 [concrete = constants.%int_2.ef8]
  544. // CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc9_46.3(%u.ref, %.loc9_48.2)
  545. // CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.sadd
  546. // CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.sadd, %.loc9_49.1
  547. // CHECK:STDOUT: return %.loc9_49.2
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT:
  550. // CHECK:STDOUT: fn @CallMethod(%x.param: %empty_tuple.type) -> %i32 {
  551. // CHECK:STDOUT: !entry:
  552. // CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, %x
  553. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  554. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572]
  555. // CHECK:STDOUT: %impl.elem1: %.597 = impl_witness_access constants.%J.impl_witness.e42, element1 [concrete = constants.%F.46e]
  556. // CHECK:STDOUT: %bound_method.loc13_11: <bound method> = bound_method %x.ref, %impl.elem1
  557. // CHECK:STDOUT: %int_40: Core.IntLiteral = int_value 40 [concrete = constants.%int_40.f80]
  558. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  559. // CHECK:STDOUT: %bound_method.loc13_18.1: <bound method> = bound_method %int_40, %impl.elem0 [concrete = constants.%Convert.bound.e52]
  560. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  561. // CHECK:STDOUT: %bound_method.loc13_18.2: <bound method> = bound_method %int_40, %specific_fn [concrete = constants.%bound_method.7b8]
  562. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_18.2(%int_40) [concrete = constants.%int_40.518]
  563. // CHECK:STDOUT: %.loc13_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_40.518]
  564. // CHECK:STDOUT: %.loc13_18.2: %i32 = converted %int_40, %.loc13_18.1 [concrete = constants.%int_40.518]
  565. // CHECK:STDOUT: %F.call: init %i32 = call %bound_method.loc13_11(%x.ref, %.loc13_18.2)
  566. // CHECK:STDOUT: %.loc13_21.1: %i32 = value_of_initializer %F.call
  567. // CHECK:STDOUT: %.loc13_21.2: %i32 = converted %F.call, %.loc13_21.1
  568. // CHECK:STDOUT: return %.loc13_21.2
  569. // CHECK:STDOUT: }
  570. // CHECK:STDOUT:
  571. // CHECK:STDOUT: fn @F.3(%self.param: %C, %u.param: %C) -> %C {
  572. // CHECK:STDOUT: !entry:
  573. // CHECK:STDOUT: %self.ref: %C = name_ref self, %self
  574. // CHECK:STDOUT: return %self.ref
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: specific @U(constants.%Self.ccd) {}
  578. // CHECK:STDOUT:
  579. // CHECK:STDOUT: specific @U(constants.%J.facet.521) {}
  580. // CHECK:STDOUT:
  581. // CHECK:STDOUT: specific @F.1(constants.%Self.ccd) {
  582. // CHECK:STDOUT: %Self => constants.%Self.ccd
  583. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.3df
  584. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.4ca
  585. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.646
  586. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.11f
  587. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.b98
  588. // CHECK:STDOUT: }
  589. // CHECK:STDOUT:
  590. // CHECK:STDOUT: specific @U(constants.%J.facet.330) {}
  591. // CHECK:STDOUT:
  592. // CHECK:STDOUT: specific @F.1(constants.%J.facet.ecc) {
  593. // CHECK:STDOUT: %Self => constants.%J.facet.ecc
  594. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_tuple.type
  595. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.cb1
  596. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness.e42
  597. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%i32
  598. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.7ce
  599. // CHECK:STDOUT: }
  600. // CHECK:STDOUT:
  601. // CHECK:STDOUT: specific @F.1(constants.%J.facet.30e) {
  602. // CHECK:STDOUT: %Self => constants.%J.facet.30e
  603. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%C
  604. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.c48
  605. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness.12d
  606. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%C
  607. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.c48
  608. // CHECK:STDOUT: }
  609. // CHECK:STDOUT:
  610. // CHECK:STDOUT: --- associated_type_in_function_signature.carbon
  611. // CHECK:STDOUT:
  612. // CHECK:STDOUT: constants {
  613. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  614. // CHECK:STDOUT: %Self.ccd: %J.type = bind_symbolic_name Self, 0 [symbolic]
  615. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  616. // CHECK:STDOUT: %assoc0.411: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  617. // CHECK:STDOUT: %Self.as_type.3df: type = facet_access_type %Self.ccd [symbolic]
  618. // CHECK:STDOUT: %J.lookup_impl_witness.646: <witness> = lookup_impl_witness %Self.ccd, @J [symbolic]
  619. // CHECK:STDOUT: %J.facet.521: %J.type = facet_value %Self.as_type.3df, (%J.lookup_impl_witness.646) [symbolic]
  620. // CHECK:STDOUT: %impl.elem0.11f: type = impl_witness_access %J.lookup_impl_witness.646, element0 [symbolic]
  621. // CHECK:STDOUT: %pattern_type.b98: type = pattern_type %impl.elem0.11f [symbolic]
  622. // CHECK:STDOUT: %F.type.c14: type = fn_type @F.1 [concrete]
  623. // CHECK:STDOUT: %F.b71: %F.type.c14 = struct_value () [concrete]
  624. // CHECK:STDOUT: %assoc1.572: %J.assoc_type = assoc_entity element1, @J.%F.decl [concrete]
  625. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  626. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  627. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  628. // CHECK:STDOUT: %.Self.968: %J.type = bind_symbolic_name .Self [symbolic_self]
  629. // CHECK:STDOUT: %.Self.as_type.78d: type = facet_access_type %.Self.968 [symbolic_self]
  630. // CHECK:STDOUT: %J.lookup_impl_witness.25c: <witness> = lookup_impl_witness %.Self.968, @J [symbolic_self]
  631. // CHECK:STDOUT: %J.facet.330: %J.type = facet_value %.Self.as_type.78d, (%J.lookup_impl_witness.25c) [symbolic_self]
  632. // CHECK:STDOUT: %impl.elem0.83f: type = impl_witness_access %J.lookup_impl_witness.25c, element0 [symbolic_self]
  633. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  634. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  635. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  636. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  637. // CHECK:STDOUT: %Int.49d0e6.1: type = class_type @Int, @Int(%N) [symbolic]
  638. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  639. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.83f = %i32> [concrete]
  640. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness file.%J.impl_witness_table [concrete]
  641. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  642. // CHECK:STDOUT: %F.type.5d3: type = fn_type @F.2 [concrete]
  643. // CHECK:STDOUT: %F.b9c: %F.type.5d3 = struct_value () [concrete]
  644. // CHECK:STDOUT: %J.facet.183: %J.type = facet_value %D, (%J.impl_witness) [concrete]
  645. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  646. // CHECK:STDOUT: %AddWith.type.e05: type = generic_interface_type @AddWith [concrete]
  647. // CHECK:STDOUT: %AddWith.generic: %AddWith.type.e05 = struct_value () [concrete]
  648. // CHECK:STDOUT: %AddWith.type.d7d: type = facet_type <@AddWith, @AddWith(Core.IntLiteral)> [concrete]
  649. // CHECK:STDOUT: %Op.type.0ee: type = fn_type @Op.1, @AddWith(Core.IntLiteral) [concrete]
  650. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  651. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  652. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  653. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
  654. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  655. // CHECK:STDOUT: %ImplicitAs.type.080b83.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Int.49d0e6.1)> [symbolic]
  656. // CHECK:STDOUT: %U: %ImplicitAs.type.080b83.2 = bind_symbolic_name U, 1 [symbolic]
  657. // CHECK:STDOUT: %Op.type.c98676.1: type = fn_type @Op.12, @impl.b98(%N, %U) [symbolic]
  658. // CHECK:STDOUT: %Op.aee6d7.1: %Op.type.c98676.1 = struct_value () [symbolic]
  659. // CHECK:STDOUT: %Op.type.c98676.2: type = fn_type @Op.13, @impl.b98(%N, %U) [symbolic]
  660. // CHECK:STDOUT: %Op.aee6d7.2: %Op.type.c98676.2 = struct_value () [symbolic]
  661. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  662. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  663. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  664. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
  665. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  666. // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  667. // CHECK:STDOUT: %AddWith.impl_witness.5e4: <witness> = impl_witness imports.%AddWith.impl_witness_table.61f, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete]
  668. // CHECK:STDOUT: %Op.type.0437e0.1: type = fn_type @Op.12, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete]
  669. // CHECK:STDOUT: %Op.a9544c.1: %Op.type.0437e0.1 = struct_value () [concrete]
  670. // CHECK:STDOUT: %Op.type.0437e0.2: type = fn_type @Op.13, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete]
  671. // CHECK:STDOUT: %Op.a9544c.2: %Op.type.0437e0.2 = struct_value () [concrete]
  672. // CHECK:STDOUT: %AddWith.facet: %AddWith.type.d7d = facet_value %i32, (%AddWith.impl_witness.5e4) [concrete]
  673. // CHECK:STDOUT: %.b70: type = fn_type_with_self_type %Op.type.0ee, %AddWith.facet [concrete]
  674. // CHECK:STDOUT: %Op.specific_fn.418e74.1: <specific function> = specific_function %Op.a9544c.2, @Op.13(%int_32, %ImplicitAs.facet.921) [concrete]
  675. // CHECK:STDOUT: %Op.specific_fn.418e74.2: <specific function> = specific_function %Op.a9544c.1, @Op.12(%int_32, %ImplicitAs.facet.921) [concrete]
  676. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
  677. // CHECK:STDOUT: %Convert.bound.b30: <bound method> = bound_method %int_3.1ba, %Convert.956 [concrete]
  678. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
  679. // CHECK:STDOUT: %bound_method.047: <bound method> = bound_method %int_3.1ba, %Convert.specific_fn [concrete]
  680. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  681. // CHECK:STDOUT: %CallFunction.type: type = fn_type @CallFunction [concrete]
  682. // CHECK:STDOUT: %CallFunction: %CallFunction.type = struct_value () [concrete]
  683. // CHECK:STDOUT: %.490: type = fn_type_with_self_type %F.type.c14, %J.facet.183 [concrete]
  684. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
  685. // CHECK:STDOUT: %Convert.bound.ac3: <bound method> = bound_method %int_4.0c1, %Convert.956 [concrete]
  686. // CHECK:STDOUT: %bound_method.1da: <bound method> = bound_method %int_4.0c1, %Convert.specific_fn [concrete]
  687. // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
  688. // CHECK:STDOUT: }
  689. // CHECK:STDOUT:
  690. // CHECK:STDOUT: imports {
  691. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  692. // CHECK:STDOUT: .Int = %Core.Int
  693. // CHECK:STDOUT: .AddWith = %Core.AddWith
  694. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  695. // CHECK:STDOUT: import Core//prelude
  696. // CHECK:STDOUT: import Core//prelude/...
  697. // CHECK:STDOUT: }
  698. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  699. // CHECK:STDOUT: %Core.AddWith: %AddWith.type.e05 = import_ref Core//prelude/operators/arithmetic, AddWith, loaded [concrete = constants.%AddWith.generic]
  700. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  701. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  702. // CHECK:STDOUT: %Core.import_ref.5f5145.7 = import_ref Core//prelude/types/int, loc124_49, unloaded
  703. // CHECK:STDOUT: %Core.import_ref.34c: @impl.b98.%Op.type.2 (%Op.type.c98676.2) = import_ref Core//prelude/types/int, loc125_48, loaded [symbolic = @impl.b98.%Op.2 (constants.%Op.aee6d7.2)]
  704. // CHECK:STDOUT: %AddWith.impl_witness_table.61f = impl_witness_table (%Core.import_ref.5f5145.7, %Core.import_ref.34c), @impl.b98 [concrete]
  705. // CHECK:STDOUT: %Core.Op.574: @impl.b98.%Op.type.1 (%Op.type.c98676.1) = import_ref Core//prelude/types/int, Op, loaded [symbolic = @impl.b98.%Op.1 (constants.%Op.aee6d7.1)]
  706. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  707. // CHECK:STDOUT: }
  708. // CHECK:STDOUT:
  709. // CHECK:STDOUT: file {
  710. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  711. // CHECK:STDOUT: .Core = imports.%Core
  712. // CHECK:STDOUT: .J = %J.decl
  713. // CHECK:STDOUT: .D = %D.decl
  714. // CHECK:STDOUT: .CallFunction = %CallFunction.decl
  715. // CHECK:STDOUT: }
  716. // CHECK:STDOUT: %Core.import = import Core
  717. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  718. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  719. // CHECK:STDOUT: impl_decl @impl.fc1 [concrete] {} {
  720. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  721. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  722. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.968]
  723. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.968]
  724. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  725. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type.78d]
  726. // CHECK:STDOUT: %.loc10_19: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type.78d]
  727. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.25c, element0 [symbolic_self = constants.%impl.elem0.83f]
  728. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  729. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  730. // CHECK:STDOUT: %.loc10_13: type = where_expr %.Self [concrete = constants.%J_where.type] {
  731. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  732. // CHECK:STDOUT: }
  733. // CHECK:STDOUT: }
  734. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @impl.fc1.%F.decl), @impl.fc1 [concrete]
  735. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  736. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  737. // CHECK:STDOUT: %CallFunction.decl: %CallFunction.type = fn_decl @CallFunction [concrete = constants.%CallFunction] {
  738. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  739. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  740. // CHECK:STDOUT: } {
  741. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  742. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  743. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  744. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  745. // CHECK:STDOUT: }
  746. // CHECK:STDOUT: }
  747. // CHECK:STDOUT:
  748. // CHECK:STDOUT: interface @J {
  749. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.ccd]
  750. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  751. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.411]
  752. // CHECK:STDOUT: }
  753. // CHECK:STDOUT: %F.decl: %F.type.c14 = fn_decl @F.1 [concrete = constants.%F.b71] {
  754. // CHECK:STDOUT: %u.patt: @F.1.%pattern_type (%pattern_type.b98) = binding_pattern u [concrete]
  755. // CHECK:STDOUT: %u.param_patt: @F.1.%pattern_type (%pattern_type.b98) = value_param_pattern %u.patt, call_param0 [concrete]
  756. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.b98) = return_slot_pattern [concrete]
  757. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.b98) = out_param_pattern %return.patt, call_param1 [concrete]
  758. // CHECK:STDOUT: } {
  759. // CHECK:STDOUT: %impl.elem0.loc5_17: type = impl_witness_access constants.%J.lookup_impl_witness.646, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  760. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  761. // CHECK:STDOUT: %u.param: @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = value_param call_param0
  762. // CHECK:STDOUT: %.loc5: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)] {
  763. // CHECK:STDOUT: %impl.elem0.loc5_11.2: type = impl_witness_access constants.%J.lookup_impl_witness.646, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  764. // CHECK:STDOUT: %U.ref.loc5_11: type = name_ref U, %impl.elem0.loc5_11.2 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  765. // CHECK:STDOUT: }
  766. // CHECK:STDOUT: %u: @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = bind_name u, %u.param
  767. // CHECK:STDOUT: %return.param: ref @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = out_param call_param1
  768. // CHECK:STDOUT: %return: ref @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = return_slot %return.param
  769. // CHECK:STDOUT: }
  770. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1.572]
  771. // CHECK:STDOUT:
  772. // CHECK:STDOUT: !members:
  773. // CHECK:STDOUT: .Self = %Self
  774. // CHECK:STDOUT: .U = @U.%assoc0
  775. // CHECK:STDOUT: .F = %assoc1
  776. // CHECK:STDOUT: witness = (%U, %F.decl)
  777. // CHECK:STDOUT: }
  778. // CHECK:STDOUT:
  779. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  780. // CHECK:STDOUT: assoc_const U:! type;
  781. // CHECK:STDOUT: }
  782. // CHECK:STDOUT:
  783. // CHECK:STDOUT: impl @impl.fc1: %D.ref as %.loc10_13 {
  784. // CHECK:STDOUT: %F.decl: %F.type.5d3 = fn_decl @F.2 [concrete = constants.%F.b9c] {
  785. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = binding_pattern u [concrete]
  786. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern %u.patt, call_param0 [concrete]
  787. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  788. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  789. // CHECK:STDOUT: } {
  790. // CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  791. // CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  792. // CHECK:STDOUT: %u.param: %i32 = value_param call_param0
  793. // CHECK:STDOUT: %.loc11_11: type = splice_block %i32.loc11_11 [concrete = constants.%i32] {
  794. // CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  795. // CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  796. // CHECK:STDOUT: }
  797. // CHECK:STDOUT: %u: %i32 = bind_name u, %u.param
  798. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  799. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  800. // CHECK:STDOUT: }
  801. // CHECK:STDOUT:
  802. // CHECK:STDOUT: !members:
  803. // CHECK:STDOUT: .F = %F.decl
  804. // CHECK:STDOUT: witness = file.%J.impl_witness
  805. // CHECK:STDOUT: }
  806. // CHECK:STDOUT:
  807. // CHECK:STDOUT: class @D {
  808. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  809. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  810. // CHECK:STDOUT: complete_type_witness = %complete_type
  811. // CHECK:STDOUT:
  812. // CHECK:STDOUT: !members:
  813. // CHECK:STDOUT: .Self = constants.%D
  814. // CHECK:STDOUT: }
  815. // CHECK:STDOUT:
  816. // CHECK:STDOUT: generic fn @F.1(@J.%Self: %J.type) {
  817. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.ccd)]
  818. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.646)]
  819. // 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.11f)]
  820. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.b98)]
  821. // CHECK:STDOUT:
  822. // CHECK:STDOUT: fn(%u.param: @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f)) -> @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f);
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT:
  825. // CHECK:STDOUT: fn @F.2(%u.param: %i32) -> %i32 {
  826. // CHECK:STDOUT: !entry:
  827. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
  828. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  829. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.c75) [concrete = constants.%ImplicitAs.facet.921]
  830. // CHECK:STDOUT: %.loc11_34.1: %ImplicitAs.type.205 = converted Core.IntLiteral, %ImplicitAs.facet [concrete = constants.%ImplicitAs.facet.921]
  831. // CHECK:STDOUT: %impl.elem1: %.b70 = impl_witness_access constants.%AddWith.impl_witness.5e4, element1 [concrete = constants.%Op.a9544c.2]
  832. // CHECK:STDOUT: %bound_method.loc11_34.1: <bound method> = bound_method %u.ref, %impl.elem1
  833. // CHECK:STDOUT: %specific_fn.loc11_34: <specific function> = specific_function %impl.elem1, @Op.13(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.1]
  834. // CHECK:STDOUT: %bound_method.loc11_34.2: <bound method> = bound_method %u.ref, %specific_fn.loc11_34
  835. // CHECK:STDOUT: %.loc11_34.2: %Op.type.0437e0.1 = specific_constant imports.%Core.Op.574, @impl.b98(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.a9544c.1]
  836. // CHECK:STDOUT: %Op.ref: %Op.type.0437e0.1 = name_ref Op, %.loc11_34.2 [concrete = constants.%Op.a9544c.1]
  837. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %u.ref, %Op.ref
  838. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.ref, @Op.12(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.2]
  839. // CHECK:STDOUT: %bound_method.loc11_34.3: <bound method> = bound_method %u.ref, %Op.specific_fn
  840. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  841. // CHECK:STDOUT: %bound_method.loc11_36.1: <bound method> = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound.b30]
  842. // CHECK:STDOUT: %specific_fn.loc11_36: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  843. // CHECK:STDOUT: %bound_method.loc11_36.2: <bound method> = bound_method %int_3, %specific_fn.loc11_36 [concrete = constants.%bound_method.047]
  844. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_36.2(%int_3) [concrete = constants.%int_3.822]
  845. // CHECK:STDOUT: %.loc11_36.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_3.822]
  846. // CHECK:STDOUT: %.loc11_36.2: %i32 = converted %int_3, %.loc11_36.1 [concrete = constants.%int_3.822]
  847. // CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc11_34.3(%u.ref, %.loc11_36.2)
  848. // CHECK:STDOUT: %.loc11_37.1: %i32 = value_of_initializer %int.sadd
  849. // CHECK:STDOUT: %.loc11_37.2: %i32 = converted %int.sadd, %.loc11_37.1
  850. // CHECK:STDOUT: return %.loc11_37.2
  851. // CHECK:STDOUT: }
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: fn @CallFunction() -> %i32 {
  854. // CHECK:STDOUT: !entry:
  855. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  856. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  857. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572]
  858. // CHECK:STDOUT: %J.facet: %J.type = facet_value constants.%D, (constants.%J.impl_witness) [concrete = constants.%J.facet.183]
  859. // CHECK:STDOUT: %.loc15_11: %J.type = converted %D.ref, %J.facet [concrete = constants.%J.facet.183]
  860. // CHECK:STDOUT: %impl.elem1: %.490 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%F.b9c]
  861. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  862. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  863. // CHECK:STDOUT: %bound_method.loc15_18.1: <bound method> = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound.ac3]
  864. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  865. // CHECK:STDOUT: %bound_method.loc15_18.2: <bound method> = bound_method %int_4, %specific_fn [concrete = constants.%bound_method.1da]
  866. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_18.2(%int_4) [concrete = constants.%int_4.940]
  867. // CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_4.940]
  868. // CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_4, %.loc15_18.1 [concrete = constants.%int_4.940]
  869. // CHECK:STDOUT: %F.call: init %i32 = call %impl.elem1(%.loc15_18.2)
  870. // CHECK:STDOUT: %.loc15_20.1: %i32 = value_of_initializer %F.call
  871. // CHECK:STDOUT: %.loc15_20.2: %i32 = converted %F.call, %.loc15_20.1
  872. // CHECK:STDOUT: return %.loc15_20.2
  873. // CHECK:STDOUT: }
  874. // CHECK:STDOUT:
  875. // CHECK:STDOUT: specific @U(constants.%Self.ccd) {}
  876. // CHECK:STDOUT:
  877. // CHECK:STDOUT: specific @U(constants.%J.facet.521) {}
  878. // CHECK:STDOUT:
  879. // CHECK:STDOUT: specific @F.1(constants.%Self.ccd) {
  880. // CHECK:STDOUT: %Self => constants.%Self.ccd
  881. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.646
  882. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.11f
  883. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b98
  884. // CHECK:STDOUT: }
  885. // CHECK:STDOUT:
  886. // CHECK:STDOUT: specific @U(constants.%J.facet.330) {}
  887. // CHECK:STDOUT:
  888. // CHECK:STDOUT: specific @F.1(constants.%J.facet.183) {
  889. // CHECK:STDOUT: %Self => constants.%J.facet.183
  890. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  891. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  892. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  893. // CHECK:STDOUT: }
  894. // CHECK:STDOUT:
  895. // CHECK:STDOUT: --- extend_impl_with_associated_type_in_signature.carbon
  896. // CHECK:STDOUT:
  897. // CHECK:STDOUT: constants {
  898. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  899. // CHECK:STDOUT: %Self.ccd: %J.type = bind_symbolic_name Self, 0 [symbolic]
  900. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  901. // CHECK:STDOUT: %assoc0.411: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  902. // CHECK:STDOUT: %Self.as_type.3df: type = facet_access_type %Self.ccd [symbolic]
  903. // CHECK:STDOUT: %J.lookup_impl_witness.64628e.1: <witness> = lookup_impl_witness %Self.ccd, @J [symbolic]
  904. // CHECK:STDOUT: %J.facet.5210a7.1: %J.type = facet_value %Self.as_type.3df, (%J.lookup_impl_witness.64628e.1) [symbolic]
  905. // CHECK:STDOUT: %impl.elem0.11fef0.1: type = impl_witness_access %J.lookup_impl_witness.64628e.1, element0 [symbolic]
  906. // CHECK:STDOUT: %pattern_type.b984e7.1: type = pattern_type %impl.elem0.11fef0.1 [symbolic]
  907. // CHECK:STDOUT: %F.type.c14: type = fn_type @F.1 [concrete]
  908. // CHECK:STDOUT: %F.b71: %F.type.c14 = struct_value () [concrete]
  909. // CHECK:STDOUT: %assoc1.572: %J.assoc_type = assoc_entity element1, @J.%F.decl [concrete]
  910. // CHECK:STDOUT: %pattern_type.4ca604.1: type = pattern_type %Self.as_type.3df [symbolic]
  911. // CHECK:STDOUT: %G.type.285: type = fn_type @G.1 [concrete]
  912. // CHECK:STDOUT: %G.e4b: %G.type.285 = struct_value () [concrete]
  913. // CHECK:STDOUT: %assoc2.d75: %J.assoc_type = assoc_entity element2, @J.%G.decl [concrete]
  914. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  915. // CHECK:STDOUT: %.Self.968: %J.type = bind_symbolic_name .Self [symbolic_self]
  916. // CHECK:STDOUT: %.Self.as_type.78d: type = facet_access_type %.Self.968 [symbolic_self]
  917. // CHECK:STDOUT: %J.lookup_impl_witness.25c: <witness> = lookup_impl_witness %.Self.968, @J [symbolic_self]
  918. // CHECK:STDOUT: %J.facet.330: %J.type = facet_value %.Self.as_type.78d, (%J.lookup_impl_witness.25c) [symbolic_self]
  919. // CHECK:STDOUT: %impl.elem0.83f: type = impl_witness_access %J.lookup_impl_witness.25c, element0 [symbolic_self]
  920. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  921. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  922. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  923. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  924. // CHECK:STDOUT: %Int.49d0e6.1: type = class_type @Int, @Int(%N) [symbolic]
  925. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  926. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.83f = %i32> [concrete]
  927. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.%J.impl_witness_table [concrete]
  928. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  929. // CHECK:STDOUT: %F.type.b84: type = fn_type @F.2 [concrete]
  930. // CHECK:STDOUT: %F.b07: %F.type.b84 = struct_value () [concrete]
  931. // CHECK:STDOUT: %pattern_type.a4a: type = pattern_type %E [concrete]
  932. // CHECK:STDOUT: %G.type.4b6: type = fn_type @G.2 [concrete]
  933. // CHECK:STDOUT: %G.553: %G.type.4b6 = struct_value () [concrete]
  934. // CHECK:STDOUT: %J.facet.ee5: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  935. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  936. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  937. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  938. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
  939. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  940. // CHECK:STDOUT: %AddWith.type.e05: type = generic_interface_type @AddWith [concrete]
  941. // CHECK:STDOUT: %AddWith.generic: %AddWith.type.e05 = struct_value () [concrete]
  942. // CHECK:STDOUT: %AddWith.type.d7d: type = facet_type <@AddWith, @AddWith(Core.IntLiteral)> [concrete]
  943. // CHECK:STDOUT: %Op.type.0ee: type = fn_type @Op.1, @AddWith(Core.IntLiteral) [concrete]
  944. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  945. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  946. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  947. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
  948. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  949. // CHECK:STDOUT: %ImplicitAs.type.080b83.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Int.49d0e6.1)> [symbolic]
  950. // CHECK:STDOUT: %Op.type.41a: type = fn_type @Op.6, @impl.144(%N) [symbolic]
  951. // CHECK:STDOUT: %Op.fdd: %Op.type.41a = struct_value () [symbolic]
  952. // CHECK:STDOUT: %U: %ImplicitAs.type.080b83.2 = bind_symbolic_name U, 1 [symbolic]
  953. // CHECK:STDOUT: %Op.type.c98676.1: type = fn_type @Op.12, @impl.b98(%N, %U) [symbolic]
  954. // CHECK:STDOUT: %Op.aee6d7.1: %Op.type.c98676.1 = struct_value () [symbolic]
  955. // CHECK:STDOUT: %Op.type.c98676.2: type = fn_type @Op.13, @impl.b98(%N, %U) [symbolic]
  956. // CHECK:STDOUT: %Op.aee6d7.2: %Op.type.c98676.2 = struct_value () [symbolic]
  957. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  958. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  959. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  960. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
  961. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  962. // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  963. // CHECK:STDOUT: %AddWith.impl_witness.5e4: <witness> = impl_witness imports.%AddWith.impl_witness_table.61f, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete]
  964. // CHECK:STDOUT: %Op.type.0437e0.1: type = fn_type @Op.12, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete]
  965. // CHECK:STDOUT: %Op.a9544c.1: %Op.type.0437e0.1 = struct_value () [concrete]
  966. // CHECK:STDOUT: %Op.type.0437e0.2: type = fn_type @Op.13, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete]
  967. // CHECK:STDOUT: %Op.a9544c.2: %Op.type.0437e0.2 = struct_value () [concrete]
  968. // CHECK:STDOUT: %AddWith.facet.e10: %AddWith.type.d7d = facet_value %i32, (%AddWith.impl_witness.5e4) [concrete]
  969. // CHECK:STDOUT: %.b70: type = fn_type_with_self_type %Op.type.0ee, %AddWith.facet.e10 [concrete]
  970. // CHECK:STDOUT: %Op.specific_fn.418e74.1: <specific function> = specific_function %Op.a9544c.2, @Op.13(%int_32, %ImplicitAs.facet.921) [concrete]
  971. // CHECK:STDOUT: %Op.specific_fn.418e74.2: <specific function> = specific_function %Op.a9544c.1, @Op.12(%int_32, %ImplicitAs.facet.921) [concrete]
  972. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
  973. // CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [concrete]
  974. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
  975. // CHECK:STDOUT: %bound_method.9a1: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
  976. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  977. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  978. // CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
  979. // CHECK:STDOUT: %bound_method.b92: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
  980. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  981. // CHECK:STDOUT: %CallBoth.type: type = fn_type @CallBoth [concrete]
  982. // CHECK:STDOUT: %CallBoth: %CallBoth.type = struct_value () [concrete]
  983. // CHECK:STDOUT: %.29b: type = fn_type_with_self_type %F.type.c14, %J.facet.ee5 [concrete]
  984. // CHECK:STDOUT: %.ff5: type = fn_type_with_self_type %G.type.285, %J.facet.ee5 [concrete]
  985. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  986. // CHECK:STDOUT: %Convert.bound.b30: <bound method> = bound_method %int_3.1ba, %Convert.956 [concrete]
  987. // CHECK:STDOUT: %bound_method.047: <bound method> = bound_method %int_3.1ba, %Convert.specific_fn [concrete]
  988. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  989. // CHECK:STDOUT: %AddWith.type.1d9: type = facet_type <@AddWith, @AddWith(%i32)> [concrete]
  990. // CHECK:STDOUT: %Op.type.5eb: type = fn_type @Op.1, @AddWith(%i32) [concrete]
  991. // CHECK:STDOUT: %AddWith.impl_witness.091: <witness> = impl_witness imports.%AddWith.impl_witness_table.e20, @impl.144(%int_32) [concrete]
  992. // CHECK:STDOUT: %Op.type.630: type = fn_type @Op.6, @impl.144(%int_32) [concrete]
  993. // CHECK:STDOUT: %Op.04c: %Op.type.630 = struct_value () [concrete]
  994. // CHECK:STDOUT: %AddWith.facet.be2: %AddWith.type.1d9 = facet_value %i32, (%AddWith.impl_witness.091) [concrete]
  995. // CHECK:STDOUT: %.8f4: type = fn_type_with_self_type %Op.type.5eb, %AddWith.facet.be2 [concrete]
  996. // CHECK:STDOUT: %Op.specific_fn.951: <specific function> = specific_function %Op.04c, @Op.6(%int_32) [concrete]
  997. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
  998. // CHECK:STDOUT: %Convert.bound.ac3: <bound method> = bound_method %int_4.0c1, %Convert.956 [concrete]
  999. // CHECK:STDOUT: %bound_method.1da: <bound method> = bound_method %int_4.0c1, %Convert.specific_fn [concrete]
  1000. // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
  1001. // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
  1002. // CHECK:STDOUT: %Convert.bound.4e6: <bound method> = bound_method %int_5.64b, %Convert.956 [concrete]
  1003. // CHECK:STDOUT: %bound_method.a25: <bound method> = bound_method %int_5.64b, %Convert.specific_fn [concrete]
  1004. // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete]
  1005. // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete]
  1006. // CHECK:STDOUT: %Convert.bound.ce9: <bound method> = bound_method %int_6.462, %Convert.956 [concrete]
  1007. // CHECK:STDOUT: %bound_method.efa: <bound method> = bound_method %int_6.462, %Convert.specific_fn [concrete]
  1008. // CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete]
  1009. // CHECK:STDOUT: %T.ccd: %J.type = bind_symbolic_name T, 0 [symbolic]
  1010. // CHECK:STDOUT: %pattern_type.28e: type = pattern_type %J.type [concrete]
  1011. // CHECK:STDOUT: %T.as_type.3df: type = facet_access_type %T.ccd [symbolic]
  1012. // CHECK:STDOUT: %pattern_type.4ca604.2: type = pattern_type %T.as_type.3df [symbolic]
  1013. // CHECK:STDOUT: %J.lookup_impl_witness.64628e.2: <witness> = lookup_impl_witness %T.ccd, @J [symbolic]
  1014. // CHECK:STDOUT: %J.facet.5210a7.2: %J.type = facet_value %T.as_type.3df, (%J.lookup_impl_witness.64628e.2) [symbolic]
  1015. // CHECK:STDOUT: %impl.elem0.11fef0.2: type = impl_witness_access %J.lookup_impl_witness.64628e.2, element0 [symbolic]
  1016. // CHECK:STDOUT: %pattern_type.b984e7.2: type = pattern_type %impl.elem0.11fef0.2 [symbolic]
  1017. // CHECK:STDOUT: %GenericCallF.type: type = fn_type @GenericCallF [concrete]
  1018. // CHECK:STDOUT: %GenericCallF: %GenericCallF.type = struct_value () [concrete]
  1019. // CHECK:STDOUT: %require_complete.58f: <witness> = require_complete_type %impl.elem0.11fef0.2 [symbolic]
  1020. // CHECK:STDOUT: %require_complete.2a5: <witness> = require_complete_type %T.as_type.3df [symbolic]
  1021. // CHECK:STDOUT: %.d43: type = fn_type_with_self_type %F.type.c14, %J.facet.5210a7.2 [symbolic]
  1022. // CHECK:STDOUT: %impl.elem1: %.d43 = impl_witness_access %J.lookup_impl_witness.64628e.2, element1 [symbolic]
  1023. // CHECK:STDOUT: %specific_impl_fn.fe8: <specific function> = specific_impl_function %impl.elem1, @F.1(%J.facet.5210a7.2) [symbolic]
  1024. // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete]
  1025. // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete]
  1026. // CHECK:STDOUT: %GenericCallF.specific_fn: <specific function> = specific_function %GenericCallF, @GenericCallF(%J.facet.ee5) [concrete]
  1027. // CHECK:STDOUT: }
  1028. // CHECK:STDOUT:
  1029. // CHECK:STDOUT: imports {
  1030. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1031. // CHECK:STDOUT: .Int = %Core.Int
  1032. // CHECK:STDOUT: .AddWith = %Core.AddWith
  1033. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1034. // CHECK:STDOUT: import Core//prelude
  1035. // CHECK:STDOUT: import Core//prelude/...
  1036. // CHECK:STDOUT: }
  1037. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  1038. // CHECK:STDOUT: %Core.AddWith: %AddWith.type.e05 = import_ref Core//prelude/operators/arithmetic, AddWith, loaded [concrete = constants.%AddWith.generic]
  1039. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  1040. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  1041. // CHECK:STDOUT: %Core.import_ref.5f5145.1 = import_ref Core//prelude/types/int, loc92_50, unloaded
  1042. // CHECK:STDOUT: %Core.import_ref.bbf: @impl.144.%Op.type (%Op.type.41a) = import_ref Core//prelude/types/int, loc93_42, loaded [symbolic = @impl.144.%Op (constants.%Op.fdd)]
  1043. // CHECK:STDOUT: %AddWith.impl_witness_table.e20 = impl_witness_table (%Core.import_ref.5f5145.1, %Core.import_ref.bbf), @impl.144 [concrete]
  1044. // CHECK:STDOUT: %Core.import_ref.5f5145.7 = import_ref Core//prelude/types/int, loc124_49, unloaded
  1045. // CHECK:STDOUT: %Core.import_ref.34c: @impl.b98.%Op.type.2 (%Op.type.c98676.2) = import_ref Core//prelude/types/int, loc125_48, loaded [symbolic = @impl.b98.%Op.2 (constants.%Op.aee6d7.2)]
  1046. // CHECK:STDOUT: %AddWith.impl_witness_table.61f = impl_witness_table (%Core.import_ref.5f5145.7, %Core.import_ref.34c), @impl.b98 [concrete]
  1047. // CHECK:STDOUT: %Core.Op.574: @impl.b98.%Op.type.1 (%Op.type.c98676.1) = import_ref Core//prelude/types/int, Op, loaded [symbolic = @impl.b98.%Op.1 (constants.%Op.aee6d7.1)]
  1048. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1049. // CHECK:STDOUT: }
  1050. // CHECK:STDOUT:
  1051. // CHECK:STDOUT: file {
  1052. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1053. // CHECK:STDOUT: .Core = imports.%Core
  1054. // CHECK:STDOUT: .J = %J.decl
  1055. // CHECK:STDOUT: .E = %E.decl
  1056. // CHECK:STDOUT: .CallBoth = %CallBoth.decl
  1057. // CHECK:STDOUT: .GenericCallF = %GenericCallF.decl
  1058. // CHECK:STDOUT: .CallGeneric = %CallGeneric.decl
  1059. // CHECK:STDOUT: }
  1060. // CHECK:STDOUT: %Core.import = import Core
  1061. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1062. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  1063. // CHECK:STDOUT: %CallBoth.decl: %CallBoth.type = fn_decl @CallBoth [concrete = constants.%CallBoth] {
  1064. // CHECK:STDOUT: %e.patt: %pattern_type.a4a = binding_pattern e [concrete]
  1065. // CHECK:STDOUT: %e.param_patt: %pattern_type.a4a = value_param_pattern %e.patt, call_param0 [concrete]
  1066. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1067. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1068. // CHECK:STDOUT: } {
  1069. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1070. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1071. // CHECK:STDOUT: %e.param: %E = value_param call_param0
  1072. // CHECK:STDOUT: %E.ref.loc20: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1073. // CHECK:STDOUT: %e: %E = bind_name e, %e.param
  1074. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1075. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1076. // CHECK:STDOUT: }
  1077. // CHECK:STDOUT: %GenericCallF.decl: %GenericCallF.type = fn_decl @GenericCallF [concrete = constants.%GenericCallF] {
  1078. // CHECK:STDOUT: %T.patt: %pattern_type.28e = symbolic_binding_pattern T, 0 [concrete]
  1079. // CHECK:STDOUT: %t.patt: @GenericCallF.%pattern_type.loc24_24 (%pattern_type.4ca604.2) = binding_pattern t [concrete]
  1080. // CHECK:STDOUT: %t.param_patt: @GenericCallF.%pattern_type.loc24_24 (%pattern_type.4ca604.2) = value_param_pattern %t.patt, call_param0 [concrete]
  1081. // CHECK:STDOUT: %u.patt: @GenericCallF.%pattern_type.loc24_30 (%pattern_type.b984e7.2) = binding_pattern u [concrete]
  1082. // CHECK:STDOUT: %u.param_patt: @GenericCallF.%pattern_type.loc24_30 (%pattern_type.b984e7.2) = value_param_pattern %u.patt, call_param1 [concrete]
  1083. // CHECK:STDOUT: %return.patt: @GenericCallF.%pattern_type.loc24_30 (%pattern_type.b984e7.2) = return_slot_pattern [concrete]
  1084. // CHECK:STDOUT: %return.param_patt: @GenericCallF.%pattern_type.loc24_30 (%pattern_type.b984e7.2) = out_param_pattern %return.patt, call_param2 [concrete]
  1085. // CHECK:STDOUT: } {
  1086. // CHECK:STDOUT: %T.ref.loc24_41: %J.type = name_ref T, %T.loc24_17.1 [symbolic = %T.loc24_17.2 (constants.%T.ccd)]
  1087. // CHECK:STDOUT: %U.ref.loc24_42: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  1088. // CHECK:STDOUT: %T.as_type.loc24_42: type = facet_access_type %T.ref.loc24_41 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)]
  1089. // CHECK:STDOUT: %.loc24_42: type = converted %T.ref.loc24_41, %T.as_type.loc24_42 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)]
  1090. // CHECK:STDOUT: %impl.elem0.loc24_42: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc24_34.2 (constants.%impl.elem0.11fef0.2)]
  1091. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1092. // CHECK:STDOUT: %T.loc24_17.1: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc24_17.2 (constants.%T.ccd)]
  1093. // CHECK:STDOUT: %t.param: @GenericCallF.%T.as_type.loc24_27.2 (%T.as_type.3df) = value_param call_param0
  1094. // CHECK:STDOUT: %.loc24_27.1: type = splice_block %.loc24_27.2 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] {
  1095. // CHECK:STDOUT: %T.ref.loc24_27: %J.type = name_ref T, %T.loc24_17.1 [symbolic = %T.loc24_17.2 (constants.%T.ccd)]
  1096. // CHECK:STDOUT: %T.as_type.loc24_27.1: type = facet_access_type %T.ref.loc24_27 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)]
  1097. // CHECK:STDOUT: %.loc24_27.2: type = converted %T.ref.loc24_27, %T.as_type.loc24_27.1 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)]
  1098. // CHECK:STDOUT: }
  1099. // CHECK:STDOUT: %t: @GenericCallF.%T.as_type.loc24_27.2 (%T.as_type.3df) = bind_name t, %t.param
  1100. // CHECK:STDOUT: %u.param: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = value_param call_param1
  1101. // CHECK:STDOUT: %.loc24_34.1: type = splice_block %impl.elem0.loc24_34.1 [symbolic = %impl.elem0.loc24_34.2 (constants.%impl.elem0.11fef0.2)] {
  1102. // CHECK:STDOUT: %T.ref.loc24_33: %J.type = name_ref T, %T.loc24_17.1 [symbolic = %T.loc24_17.2 (constants.%T.ccd)]
  1103. // CHECK:STDOUT: %U.ref.loc24_34: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  1104. // CHECK:STDOUT: %T.as_type.loc24_34: type = facet_access_type %T.ref.loc24_33 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)]
  1105. // CHECK:STDOUT: %.loc24_34.2: type = converted %T.ref.loc24_33, %T.as_type.loc24_34 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)]
  1106. // CHECK:STDOUT: %impl.elem0.loc24_34.1: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc24_34.2 (constants.%impl.elem0.11fef0.2)]
  1107. // CHECK:STDOUT: }
  1108. // CHECK:STDOUT: %u: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = bind_name u, %u.param
  1109. // CHECK:STDOUT: %return.param: ref @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = out_param call_param2
  1110. // CHECK:STDOUT: %return: ref @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = return_slot %return.param
  1111. // CHECK:STDOUT: }
  1112. // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] {
  1113. // CHECK:STDOUT: %e.patt: %pattern_type.a4a = binding_pattern e [concrete]
  1114. // CHECK:STDOUT: %e.param_patt: %pattern_type.a4a = value_param_pattern %e.patt, call_param0 [concrete]
  1115. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1116. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1117. // CHECK:STDOUT: } {
  1118. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1119. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1120. // CHECK:STDOUT: %e.param: %E = value_param call_param0
  1121. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1122. // CHECK:STDOUT: %e: %E = bind_name e, %e.param
  1123. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1124. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1125. // CHECK:STDOUT: }
  1126. // CHECK:STDOUT: }
  1127. // CHECK:STDOUT:
  1128. // CHECK:STDOUT: interface @J {
  1129. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.ccd]
  1130. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1131. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.411]
  1132. // CHECK:STDOUT: }
  1133. // CHECK:STDOUT: %F.decl: %F.type.c14 = fn_decl @F.1 [concrete = constants.%F.b71] {
  1134. // CHECK:STDOUT: %u.patt: @F.1.%pattern_type (%pattern_type.b984e7.1) = binding_pattern u [concrete]
  1135. // CHECK:STDOUT: %u.param_patt: @F.1.%pattern_type (%pattern_type.b984e7.1) = value_param_pattern %u.patt, call_param0 [concrete]
  1136. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.b984e7.1) = return_slot_pattern [concrete]
  1137. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.b984e7.1) = out_param_pattern %return.patt, call_param1 [concrete]
  1138. // CHECK:STDOUT: } {
  1139. // CHECK:STDOUT: %impl.elem0.loc5_17: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.1, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11fef0.1)]
  1140. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11fef0.1)]
  1141. // CHECK:STDOUT: %u.param: @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11fef0.1) = value_param call_param0
  1142. // CHECK:STDOUT: %.loc5: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11fef0.1)] {
  1143. // CHECK:STDOUT: %impl.elem0.loc5_11.2: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.1, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11fef0.1)]
  1144. // CHECK:STDOUT: %U.ref.loc5_11: type = name_ref U, %impl.elem0.loc5_11.2 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11fef0.1)]
  1145. // CHECK:STDOUT: }
  1146. // CHECK:STDOUT: %u: @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11fef0.1) = bind_name u, %u.param
  1147. // CHECK:STDOUT: %return.param: ref @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11fef0.1) = out_param call_param1
  1148. // CHECK:STDOUT: %return: ref @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11fef0.1) = return_slot %return.param
  1149. // CHECK:STDOUT: }
  1150. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1.572]
  1151. // CHECK:STDOUT: %G.decl: %G.type.285 = fn_decl @G.1 [concrete = constants.%G.e4b] {
  1152. // CHECK:STDOUT: %self.patt: @G.1.%pattern_type.loc6_8 (%pattern_type.4ca604.1) = binding_pattern self [concrete]
  1153. // CHECK:STDOUT: %self.param_patt: @G.1.%pattern_type.loc6_8 (%pattern_type.4ca604.1) = value_param_pattern %self.patt, call_param0 [concrete]
  1154. // CHECK:STDOUT: %v.patt: @G.1.%pattern_type.loc6_20 (%pattern_type.b984e7.1) = binding_pattern v [concrete]
  1155. // CHECK:STDOUT: %v.param_patt: @G.1.%pattern_type.loc6_20 (%pattern_type.b984e7.1) = value_param_pattern %v.patt, call_param1 [concrete]
  1156. // CHECK:STDOUT: %return.patt: @G.1.%pattern_type.loc6_20 (%pattern_type.b984e7.1) = return_slot_pattern [concrete]
  1157. // CHECK:STDOUT: %return.param_patt: @G.1.%pattern_type.loc6_20 (%pattern_type.b984e7.1) = out_param_pattern %return.patt, call_param2 [concrete]
  1158. // CHECK:STDOUT: } {
  1159. // CHECK:STDOUT: %impl.elem0.loc6_29: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.1, element0 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.11fef0.1)]
  1160. // CHECK:STDOUT: %U.ref.loc6_29: type = name_ref U, %impl.elem0.loc6_29 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.11fef0.1)]
  1161. // CHECK:STDOUT: %self.param: @G.1.%Self.as_type.loc6_14.1 (%Self.as_type.3df) = value_param call_param0
  1162. // CHECK:STDOUT: %.loc6_14.1: type = splice_block %.loc6_14.2 [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.3df)] {
  1163. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self.ccd)]
  1164. // CHECK:STDOUT: %Self.as_type.loc6_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.3df)]
  1165. // CHECK:STDOUT: %.loc6_14.2: type = converted %Self.ref, %Self.as_type.loc6_14.2 [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.3df)]
  1166. // CHECK:STDOUT: }
  1167. // CHECK:STDOUT: %self: @G.1.%Self.as_type.loc6_14.1 (%Self.as_type.3df) = bind_name self, %self.param
  1168. // CHECK:STDOUT: %v.param: @G.1.%impl.elem0.loc6_23.1 (%impl.elem0.11fef0.1) = value_param call_param1
  1169. // CHECK:STDOUT: %.loc6_23: type = splice_block %U.ref.loc6_23 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.11fef0.1)] {
  1170. // CHECK:STDOUT: %impl.elem0.loc6_23.2: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.1, element0 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.11fef0.1)]
  1171. // CHECK:STDOUT: %U.ref.loc6_23: type = name_ref U, %impl.elem0.loc6_23.2 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.11fef0.1)]
  1172. // CHECK:STDOUT: }
  1173. // CHECK:STDOUT: %v: @G.1.%impl.elem0.loc6_23.1 (%impl.elem0.11fef0.1) = bind_name v, %v.param
  1174. // CHECK:STDOUT: %return.param: ref @G.1.%impl.elem0.loc6_23.1 (%impl.elem0.11fef0.1) = out_param call_param2
  1175. // CHECK:STDOUT: %return: ref @G.1.%impl.elem0.loc6_23.1 (%impl.elem0.11fef0.1) = return_slot %return.param
  1176. // CHECK:STDOUT: }
  1177. // CHECK:STDOUT: %assoc2: %J.assoc_type = assoc_entity element2, %G.decl [concrete = constants.%assoc2.d75]
  1178. // CHECK:STDOUT:
  1179. // CHECK:STDOUT: !members:
  1180. // CHECK:STDOUT: .Self = %Self
  1181. // CHECK:STDOUT: .U = @U.%assoc0
  1182. // CHECK:STDOUT: .F = %assoc1
  1183. // CHECK:STDOUT: .G = %assoc2
  1184. // CHECK:STDOUT: witness = (%U, %F.decl, %G.decl)
  1185. // CHECK:STDOUT: }
  1186. // CHECK:STDOUT:
  1187. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  1188. // CHECK:STDOUT: assoc_const U:! type;
  1189. // CHECK:STDOUT: }
  1190. // CHECK:STDOUT:
  1191. // CHECK:STDOUT: impl @impl.939: %Self.ref as %.loc10_20 {
  1192. // CHECK:STDOUT: %F.decl: %F.type.b84 = fn_decl @F.2 [concrete = constants.%F.b07] {
  1193. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = binding_pattern u [concrete]
  1194. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern %u.patt, call_param0 [concrete]
  1195. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1196. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1197. // CHECK:STDOUT: } {
  1198. // CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1199. // CHECK:STDOUT: %i32.loc11_21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1200. // CHECK:STDOUT: %u.param: %i32 = value_param call_param0
  1201. // CHECK:STDOUT: %.loc11: type = splice_block %i32.loc11_13 [concrete = constants.%i32] {
  1202. // CHECK:STDOUT: %int_32.loc11_13: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1203. // CHECK:STDOUT: %i32.loc11_13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1204. // CHECK:STDOUT: }
  1205. // CHECK:STDOUT: %u: %i32 = bind_name u, %u.param
  1206. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1207. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1208. // CHECK:STDOUT: }
  1209. // CHECK:STDOUT: %G.decl: %G.type.4b6 = fn_decl @G.2 [concrete = constants.%G.553] {
  1210. // CHECK:STDOUT: %self.patt: %pattern_type.a4a = binding_pattern self [concrete]
  1211. // CHECK:STDOUT: %self.param_patt: %pattern_type.a4a = value_param_pattern %self.patt, call_param0 [concrete]
  1212. // CHECK:STDOUT: %v.patt: %pattern_type.7ce = binding_pattern v [concrete]
  1213. // CHECK:STDOUT: %v.param_patt: %pattern_type.7ce = value_param_pattern %v.patt, call_param1 [concrete]
  1214. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1215. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete]
  1216. // CHECK:STDOUT: } {
  1217. // CHECK:STDOUT: %int_32.loc14_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1218. // CHECK:STDOUT: %i32.loc14_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1219. // CHECK:STDOUT: %self.param: %E = value_param call_param0
  1220. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  1221. // CHECK:STDOUT: %self: %E = bind_name self, %self.param
  1222. // CHECK:STDOUT: %v.param: %i32 = value_param call_param1
  1223. // CHECK:STDOUT: %.loc14: type = splice_block %i32.loc14_25 [concrete = constants.%i32] {
  1224. // CHECK:STDOUT: %int_32.loc14_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1225. // CHECK:STDOUT: %i32.loc14_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1226. // CHECK:STDOUT: }
  1227. // CHECK:STDOUT: %v: %i32 = bind_name v, %v.param
  1228. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
  1229. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1230. // CHECK:STDOUT: }
  1231. // CHECK:STDOUT:
  1232. // CHECK:STDOUT: !members:
  1233. // CHECK:STDOUT: .F = %F.decl
  1234. // CHECK:STDOUT: .G = %G.decl
  1235. // CHECK:STDOUT: witness = @E.%J.impl_witness
  1236. // CHECK:STDOUT: }
  1237. // CHECK:STDOUT:
  1238. // CHECK:STDOUT: class @E {
  1239. // CHECK:STDOUT: impl_decl @impl.939 [concrete] {} {
  1240. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  1241. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1242. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.968]
  1243. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.968]
  1244. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  1245. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type.78d]
  1246. // CHECK:STDOUT: %.loc10_26: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type.78d]
  1247. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.25c, element0 [symbolic_self = constants.%impl.elem0.83f]
  1248. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1249. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1250. // CHECK:STDOUT: %.loc10_20: type = where_expr %.Self [concrete = constants.%J_where.type] {
  1251. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  1252. // CHECK:STDOUT: }
  1253. // CHECK:STDOUT: }
  1254. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @impl.939.%F.decl, @impl.939.%G.decl), @impl.939 [concrete]
  1255. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  1256. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  1257. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1258. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  1259. // CHECK:STDOUT: complete_type_witness = %complete_type
  1260. // CHECK:STDOUT:
  1261. // CHECK:STDOUT: !members:
  1262. // CHECK:STDOUT: .Self = constants.%E
  1263. // CHECK:STDOUT: .J = <poisoned>
  1264. // CHECK:STDOUT: .F = <poisoned>
  1265. // CHECK:STDOUT: .G = <poisoned>
  1266. // CHECK:STDOUT: extend @impl.939.%.loc10_20
  1267. // CHECK:STDOUT: }
  1268. // CHECK:STDOUT:
  1269. // CHECK:STDOUT: generic fn @F.1(@J.%Self: %J.type) {
  1270. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.ccd)]
  1271. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.1)]
  1272. // 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.11fef0.1)]
  1273. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.b984e7.1)]
  1274. // CHECK:STDOUT:
  1275. // CHECK:STDOUT: fn(%u.param: @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11fef0.1)) -> @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11fef0.1);
  1276. // CHECK:STDOUT: }
  1277. // CHECK:STDOUT:
  1278. // CHECK:STDOUT: generic fn @G.1(@J.%Self: %J.type) {
  1279. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.ccd)]
  1280. // CHECK:STDOUT: %Self.as_type.loc6_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.3df)]
  1281. // CHECK:STDOUT: %pattern_type.loc6_8: type = pattern_type %Self.as_type.loc6_14.1 [symbolic = %pattern_type.loc6_8 (constants.%pattern_type.4ca604.1)]
  1282. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.1)]
  1283. // 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.11fef0.1)]
  1284. // CHECK:STDOUT: %pattern_type.loc6_20: type = pattern_type %impl.elem0.loc6_23.1 [symbolic = %pattern_type.loc6_20 (constants.%pattern_type.b984e7.1)]
  1285. // CHECK:STDOUT:
  1286. // CHECK:STDOUT: fn(%self.param: @G.1.%Self.as_type.loc6_14.1 (%Self.as_type.3df), %v.param: @G.1.%impl.elem0.loc6_23.1 (%impl.elem0.11fef0.1)) -> @G.1.%impl.elem0.loc6_23.1 (%impl.elem0.11fef0.1);
  1287. // CHECK:STDOUT: }
  1288. // CHECK:STDOUT:
  1289. // CHECK:STDOUT: fn @F.2(%u.param: %i32) -> %i32 {
  1290. // CHECK:STDOUT: !entry:
  1291. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
  1292. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  1293. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.c75) [concrete = constants.%ImplicitAs.facet.921]
  1294. // CHECK:STDOUT: %.loc12_16.1: %ImplicitAs.type.205 = converted Core.IntLiteral, %ImplicitAs.facet [concrete = constants.%ImplicitAs.facet.921]
  1295. // CHECK:STDOUT: %impl.elem1: %.b70 = impl_witness_access constants.%AddWith.impl_witness.5e4, element1 [concrete = constants.%Op.a9544c.2]
  1296. // CHECK:STDOUT: %bound_method.loc12_16.1: <bound method> = bound_method %u.ref, %impl.elem1
  1297. // CHECK:STDOUT: %specific_fn.loc12_16: <specific function> = specific_function %impl.elem1, @Op.13(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.1]
  1298. // CHECK:STDOUT: %bound_method.loc12_16.2: <bound method> = bound_method %u.ref, %specific_fn.loc12_16
  1299. // CHECK:STDOUT: %.loc12_16.2: %Op.type.0437e0.1 = specific_constant imports.%Core.Op.574, @impl.b98(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.a9544c.1]
  1300. // CHECK:STDOUT: %Op.ref: %Op.type.0437e0.1 = name_ref Op, %.loc12_16.2 [concrete = constants.%Op.a9544c.1]
  1301. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %u.ref, %Op.ref
  1302. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.ref, @Op.12(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.2]
  1303. // CHECK:STDOUT: %bound_method.loc12_16.3: <bound method> = bound_method %u.ref, %Op.specific_fn
  1304. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  1305. // CHECK:STDOUT: %bound_method.loc12_18.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5]
  1306. // CHECK:STDOUT: %specific_fn.loc12_18: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  1307. // CHECK:STDOUT: %bound_method.loc12_18.2: <bound method> = bound_method %int_1, %specific_fn.loc12_18 [concrete = constants.%bound_method.9a1]
  1308. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_18.2(%int_1) [concrete = constants.%int_1.5d2]
  1309. // CHECK:STDOUT: %.loc12_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2]
  1310. // CHECK:STDOUT: %.loc12_18.2: %i32 = converted %int_1, %.loc12_18.1 [concrete = constants.%int_1.5d2]
  1311. // CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc12_16.3(%u.ref, %.loc12_18.2)
  1312. // CHECK:STDOUT: %.loc12_19.1: %i32 = value_of_initializer %int.sadd
  1313. // CHECK:STDOUT: %.loc12_19.2: %i32 = converted %int.sadd, %.loc12_19.1
  1314. // CHECK:STDOUT: return %.loc12_19.2
  1315. // CHECK:STDOUT: }
  1316. // CHECK:STDOUT:
  1317. // CHECK:STDOUT: fn @G.2(%self.param: %E, %v.param: %i32) -> %i32 {
  1318. // CHECK:STDOUT: !entry:
  1319. // CHECK:STDOUT: %v.ref: %i32 = name_ref v, %v
  1320. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  1321. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.c75) [concrete = constants.%ImplicitAs.facet.921]
  1322. // CHECK:STDOUT: %.loc15_16.1: %ImplicitAs.type.205 = converted Core.IntLiteral, %ImplicitAs.facet [concrete = constants.%ImplicitAs.facet.921]
  1323. // CHECK:STDOUT: %impl.elem1: %.b70 = impl_witness_access constants.%AddWith.impl_witness.5e4, element1 [concrete = constants.%Op.a9544c.2]
  1324. // CHECK:STDOUT: %bound_method.loc15_16.1: <bound method> = bound_method %v.ref, %impl.elem1
  1325. // CHECK:STDOUT: %specific_fn.loc15_16: <specific function> = specific_function %impl.elem1, @Op.13(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.1]
  1326. // CHECK:STDOUT: %bound_method.loc15_16.2: <bound method> = bound_method %v.ref, %specific_fn.loc15_16
  1327. // CHECK:STDOUT: %.loc15_16.2: %Op.type.0437e0.1 = specific_constant imports.%Core.Op.574, @impl.b98(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.a9544c.1]
  1328. // CHECK:STDOUT: %Op.ref: %Op.type.0437e0.1 = name_ref Op, %.loc15_16.2 [concrete = constants.%Op.a9544c.1]
  1329. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %v.ref, %Op.ref
  1330. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.ref, @Op.12(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.2]
  1331. // CHECK:STDOUT: %bound_method.loc15_16.3: <bound method> = bound_method %v.ref, %Op.specific_fn
  1332. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  1333. // CHECK:STDOUT: %bound_method.loc15_18.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9]
  1334. // CHECK:STDOUT: %specific_fn.loc15_18: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  1335. // CHECK:STDOUT: %bound_method.loc15_18.2: <bound method> = bound_method %int_2, %specific_fn.loc15_18 [concrete = constants.%bound_method.b92]
  1336. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_18.2(%int_2) [concrete = constants.%int_2.ef8]
  1337. // CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8]
  1338. // CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_2, %.loc15_18.1 [concrete = constants.%int_2.ef8]
  1339. // CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc15_16.3(%v.ref, %.loc15_18.2)
  1340. // CHECK:STDOUT: %.loc15_19.1: %i32 = value_of_initializer %int.sadd
  1341. // CHECK:STDOUT: %.loc15_19.2: %i32 = converted %int.sadd, %.loc15_19.1
  1342. // CHECK:STDOUT: return %.loc15_19.2
  1343. // CHECK:STDOUT: }
  1344. // CHECK:STDOUT:
  1345. // CHECK:STDOUT: fn @CallBoth(%e.param: %E) -> %i32 {
  1346. // CHECK:STDOUT: !entry:
  1347. // CHECK:STDOUT: %e.ref.loc21_10: %E = name_ref e, %e
  1348. // CHECK:STDOUT: %F.ref.loc21_11: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572]
  1349. // CHECK:STDOUT: %impl.elem1.loc21_11: %.29b = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%F.b07]
  1350. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  1351. // CHECK:STDOUT: %impl.elem0.loc21_14: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  1352. // CHECK:STDOUT: %bound_method.loc21_14.1: <bound method> = bound_method %int_2, %impl.elem0.loc21_14 [concrete = constants.%Convert.bound.ef9]
  1353. // CHECK:STDOUT: %specific_fn.loc21_14: <specific function> = specific_function %impl.elem0.loc21_14, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  1354. // CHECK:STDOUT: %bound_method.loc21_14.2: <bound method> = bound_method %int_2, %specific_fn.loc21_14 [concrete = constants.%bound_method.b92]
  1355. // CHECK:STDOUT: %int.convert_checked.loc21_14: init %i32 = call %bound_method.loc21_14.2(%int_2) [concrete = constants.%int_2.ef8]
  1356. // CHECK:STDOUT: %.loc21_14.1: %i32 = value_of_initializer %int.convert_checked.loc21_14 [concrete = constants.%int_2.ef8]
  1357. // CHECK:STDOUT: %.loc21_14.2: %i32 = converted %int_2, %.loc21_14.1 [concrete = constants.%int_2.ef8]
  1358. // CHECK:STDOUT: %F.call.loc21_15: init %i32 = call %impl.elem1.loc21_11(%.loc21_14.2)
  1359. // CHECK:STDOUT: %e.ref.loc21_19: %E = name_ref e, %e
  1360. // CHECK:STDOUT: %G.ref.loc21_20: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2.d75]
  1361. // CHECK:STDOUT: %impl.elem2.loc21_20: %.ff5 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%G.553]
  1362. // CHECK:STDOUT: %bound_method.loc21_20: <bound method> = bound_method %e.ref.loc21_19, %impl.elem2.loc21_20
  1363. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  1364. // CHECK:STDOUT: %impl.elem0.loc21_23: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  1365. // CHECK:STDOUT: %bound_method.loc21_23.1: <bound method> = bound_method %int_3, %impl.elem0.loc21_23 [concrete = constants.%Convert.bound.b30]
  1366. // CHECK:STDOUT: %specific_fn.loc21_23: <specific function> = specific_function %impl.elem0.loc21_23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  1367. // CHECK:STDOUT: %bound_method.loc21_23.2: <bound method> = bound_method %int_3, %specific_fn.loc21_23 [concrete = constants.%bound_method.047]
  1368. // CHECK:STDOUT: %int.convert_checked.loc21_23: init %i32 = call %bound_method.loc21_23.2(%int_3) [concrete = constants.%int_3.822]
  1369. // CHECK:STDOUT: %.loc21_23.1: %i32 = value_of_initializer %int.convert_checked.loc21_23 [concrete = constants.%int_3.822]
  1370. // CHECK:STDOUT: %.loc21_23.2: %i32 = converted %int_3, %.loc21_23.1 [concrete = constants.%int_3.822]
  1371. // CHECK:STDOUT: %G.call.loc21_24: init %i32 = call %bound_method.loc21_20(%e.ref.loc21_19, %.loc21_23.2)
  1372. // CHECK:STDOUT: %impl.elem1.loc21_17: %.8f4 = impl_witness_access constants.%AddWith.impl_witness.091, element1 [concrete = constants.%Op.04c]
  1373. // CHECK:STDOUT: %bound_method.loc21_17.1: <bound method> = bound_method %F.call.loc21_15, %impl.elem1.loc21_17
  1374. // CHECK:STDOUT: %specific_fn.loc21_17: <specific function> = specific_function %impl.elem1.loc21_17, @Op.6(constants.%int_32) [concrete = constants.%Op.specific_fn.951]
  1375. // CHECK:STDOUT: %bound_method.loc21_17.2: <bound method> = bound_method %F.call.loc21_15, %specific_fn.loc21_17
  1376. // CHECK:STDOUT: %.loc21_15.1: %i32 = value_of_initializer %F.call.loc21_15
  1377. // CHECK:STDOUT: %.loc21_15.2: %i32 = converted %F.call.loc21_15, %.loc21_15.1
  1378. // CHECK:STDOUT: %.loc21_24.1: %i32 = value_of_initializer %G.call.loc21_24
  1379. // CHECK:STDOUT: %.loc21_24.2: %i32 = converted %G.call.loc21_24, %.loc21_24.1
  1380. // CHECK:STDOUT: %int.sadd.loc21_17: init %i32 = call %bound_method.loc21_17.2(%.loc21_15.2, %.loc21_24.2)
  1381. // CHECK:STDOUT: %E.ref.loc21_28: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1382. // CHECK:STDOUT: %F.ref.loc21_29: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572]
  1383. // CHECK:STDOUT: %impl.elem1.loc21_29: %.29b = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%F.b07]
  1384. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  1385. // CHECK:STDOUT: %impl.elem0.loc21_32: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  1386. // CHECK:STDOUT: %bound_method.loc21_32.1: <bound method> = bound_method %int_4, %impl.elem0.loc21_32 [concrete = constants.%Convert.bound.ac3]
  1387. // CHECK:STDOUT: %specific_fn.loc21_32: <specific function> = specific_function %impl.elem0.loc21_32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  1388. // CHECK:STDOUT: %bound_method.loc21_32.2: <bound method> = bound_method %int_4, %specific_fn.loc21_32 [concrete = constants.%bound_method.1da]
  1389. // CHECK:STDOUT: %int.convert_checked.loc21_32: init %i32 = call %bound_method.loc21_32.2(%int_4) [concrete = constants.%int_4.940]
  1390. // CHECK:STDOUT: %.loc21_32.1: %i32 = value_of_initializer %int.convert_checked.loc21_32 [concrete = constants.%int_4.940]
  1391. // CHECK:STDOUT: %.loc21_32.2: %i32 = converted %int_4, %.loc21_32.1 [concrete = constants.%int_4.940]
  1392. // CHECK:STDOUT: %F.call.loc21_33: init %i32 = call %impl.elem1.loc21_29(%.loc21_32.2)
  1393. // CHECK:STDOUT: %impl.elem1.loc21_26: %.8f4 = impl_witness_access constants.%AddWith.impl_witness.091, element1 [concrete = constants.%Op.04c]
  1394. // CHECK:STDOUT: %bound_method.loc21_26.1: <bound method> = bound_method %int.sadd.loc21_17, %impl.elem1.loc21_26
  1395. // CHECK:STDOUT: %specific_fn.loc21_26: <specific function> = specific_function %impl.elem1.loc21_26, @Op.6(constants.%int_32) [concrete = constants.%Op.specific_fn.951]
  1396. // CHECK:STDOUT: %bound_method.loc21_26.2: <bound method> = bound_method %int.sadd.loc21_17, %specific_fn.loc21_26
  1397. // CHECK:STDOUT: %.loc21_17.1: %i32 = value_of_initializer %int.sadd.loc21_17
  1398. // CHECK:STDOUT: %.loc21_17.2: %i32 = converted %int.sadd.loc21_17, %.loc21_17.1
  1399. // CHECK:STDOUT: %.loc21_33.1: %i32 = value_of_initializer %F.call.loc21_33
  1400. // CHECK:STDOUT: %.loc21_33.2: %i32 = converted %F.call.loc21_33, %.loc21_33.1
  1401. // CHECK:STDOUT: %int.sadd.loc21_26: init %i32 = call %bound_method.loc21_26.2(%.loc21_17.2, %.loc21_33.2)
  1402. // CHECK:STDOUT: %e.ref.loc21_37: %E = name_ref e, %e
  1403. // CHECK:STDOUT: %E.ref.loc21_40: type = name_ref E, file.%E.decl [concrete = constants.%E]
  1404. // CHECK:STDOUT: %G.ref.loc21_41: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2.d75]
  1405. // CHECK:STDOUT: %impl.elem2.loc21_41: %.ff5 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%G.553]
  1406. // CHECK:STDOUT: %bound_method.loc21_38: <bound method> = bound_method %e.ref.loc21_37, %impl.elem2.loc21_41
  1407. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
  1408. // CHECK:STDOUT: %impl.elem0.loc21_45: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  1409. // CHECK:STDOUT: %bound_method.loc21_45.1: <bound method> = bound_method %int_5, %impl.elem0.loc21_45 [concrete = constants.%Convert.bound.4e6]
  1410. // CHECK:STDOUT: %specific_fn.loc21_45: <specific function> = specific_function %impl.elem0.loc21_45, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  1411. // CHECK:STDOUT: %bound_method.loc21_45.2: <bound method> = bound_method %int_5, %specific_fn.loc21_45 [concrete = constants.%bound_method.a25]
  1412. // CHECK:STDOUT: %int.convert_checked.loc21_45: init %i32 = call %bound_method.loc21_45.2(%int_5) [concrete = constants.%int_5.0f6]
  1413. // CHECK:STDOUT: %.loc21_45.1: %i32 = value_of_initializer %int.convert_checked.loc21_45 [concrete = constants.%int_5.0f6]
  1414. // CHECK:STDOUT: %.loc21_45.2: %i32 = converted %int_5, %.loc21_45.1 [concrete = constants.%int_5.0f6]
  1415. // CHECK:STDOUT: %G.call.loc21_46: init %i32 = call %bound_method.loc21_38(%e.ref.loc21_37, %.loc21_45.2)
  1416. // CHECK:STDOUT: %impl.elem1.loc21_35: %.8f4 = impl_witness_access constants.%AddWith.impl_witness.091, element1 [concrete = constants.%Op.04c]
  1417. // CHECK:STDOUT: %bound_method.loc21_35.1: <bound method> = bound_method %int.sadd.loc21_26, %impl.elem1.loc21_35
  1418. // CHECK:STDOUT: %specific_fn.loc21_35: <specific function> = specific_function %impl.elem1.loc21_35, @Op.6(constants.%int_32) [concrete = constants.%Op.specific_fn.951]
  1419. // CHECK:STDOUT: %bound_method.loc21_35.2: <bound method> = bound_method %int.sadd.loc21_26, %specific_fn.loc21_35
  1420. // CHECK:STDOUT: %.loc21_26.1: %i32 = value_of_initializer %int.sadd.loc21_26
  1421. // CHECK:STDOUT: %.loc21_26.2: %i32 = converted %int.sadd.loc21_26, %.loc21_26.1
  1422. // CHECK:STDOUT: %.loc21_46.1: %i32 = value_of_initializer %G.call.loc21_46
  1423. // CHECK:STDOUT: %.loc21_46.2: %i32 = converted %G.call.loc21_46, %.loc21_46.1
  1424. // CHECK:STDOUT: %int.sadd.loc21_35: init %i32 = call %bound_method.loc21_35.2(%.loc21_26.2, %.loc21_46.2)
  1425. // CHECK:STDOUT: %e.ref.loc21_50: %E = name_ref e, %e
  1426. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1427. // CHECK:STDOUT: %G.ref.loc21_54: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2.d75]
  1428. // CHECK:STDOUT: %impl.elem2.loc21_51: %.ff5 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%G.553]
  1429. // CHECK:STDOUT: %bound_method.loc21_51: <bound method> = bound_method %e.ref.loc21_50, %impl.elem2.loc21_51
  1430. // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462]
  1431. // CHECK:STDOUT: %impl.elem0.loc21_58: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  1432. // CHECK:STDOUT: %bound_method.loc21_58.1: <bound method> = bound_method %int_6, %impl.elem0.loc21_58 [concrete = constants.%Convert.bound.ce9]
  1433. // CHECK:STDOUT: %specific_fn.loc21_58: <specific function> = specific_function %impl.elem0.loc21_58, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  1434. // CHECK:STDOUT: %bound_method.loc21_58.2: <bound method> = bound_method %int_6, %specific_fn.loc21_58 [concrete = constants.%bound_method.efa]
  1435. // CHECK:STDOUT: %int.convert_checked.loc21_58: init %i32 = call %bound_method.loc21_58.2(%int_6) [concrete = constants.%int_6.e56]
  1436. // CHECK:STDOUT: %.loc21_58.1: %i32 = value_of_initializer %int.convert_checked.loc21_58 [concrete = constants.%int_6.e56]
  1437. // CHECK:STDOUT: %.loc21_58.2: %i32 = converted %int_6, %.loc21_58.1 [concrete = constants.%int_6.e56]
  1438. // CHECK:STDOUT: %G.call.loc21_59: init %i32 = call %bound_method.loc21_51(%e.ref.loc21_50, %.loc21_58.2)
  1439. // CHECK:STDOUT: %impl.elem1.loc21_48: %.8f4 = impl_witness_access constants.%AddWith.impl_witness.091, element1 [concrete = constants.%Op.04c]
  1440. // CHECK:STDOUT: %bound_method.loc21_48.1: <bound method> = bound_method %int.sadd.loc21_35, %impl.elem1.loc21_48
  1441. // CHECK:STDOUT: %specific_fn.loc21_48: <specific function> = specific_function %impl.elem1.loc21_48, @Op.6(constants.%int_32) [concrete = constants.%Op.specific_fn.951]
  1442. // CHECK:STDOUT: %bound_method.loc21_48.2: <bound method> = bound_method %int.sadd.loc21_35, %specific_fn.loc21_48
  1443. // CHECK:STDOUT: %.loc21_35.1: %i32 = value_of_initializer %int.sadd.loc21_35
  1444. // CHECK:STDOUT: %.loc21_35.2: %i32 = converted %int.sadd.loc21_35, %.loc21_35.1
  1445. // CHECK:STDOUT: %.loc21_59.1: %i32 = value_of_initializer %G.call.loc21_59
  1446. // CHECK:STDOUT: %.loc21_59.2: %i32 = converted %G.call.loc21_59, %.loc21_59.1
  1447. // CHECK:STDOUT: %int.sadd.loc21_48: init %i32 = call %bound_method.loc21_48.2(%.loc21_35.2, %.loc21_59.2)
  1448. // CHECK:STDOUT: %.loc21_60.1: %i32 = value_of_initializer %int.sadd.loc21_48
  1449. // CHECK:STDOUT: %.loc21_60.2: %i32 = converted %int.sadd.loc21_48, %.loc21_60.1
  1450. // CHECK:STDOUT: return %.loc21_60.2
  1451. // CHECK:STDOUT: }
  1452. // CHECK:STDOUT:
  1453. // CHECK:STDOUT: generic fn @GenericCallF(%T.loc24_17.1: %J.type) {
  1454. // CHECK:STDOUT: %T.loc24_17.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc24_17.2 (constants.%T.ccd)]
  1455. // CHECK:STDOUT: %T.as_type.loc24_27.2: type = facet_access_type %T.loc24_17.2 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)]
  1456. // CHECK:STDOUT: %pattern_type.loc24_24: type = pattern_type %T.as_type.loc24_27.2 [symbolic = %pattern_type.loc24_24 (constants.%pattern_type.4ca604.2)]
  1457. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc24_17.2, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.2)]
  1458. // CHECK:STDOUT: %impl.elem0.loc24_34.2: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_34.2 (constants.%impl.elem0.11fef0.2)]
  1459. // CHECK:STDOUT: %pattern_type.loc24_30: type = pattern_type %impl.elem0.loc24_34.2 [symbolic = %pattern_type.loc24_30 (constants.%pattern_type.b984e7.2)]
  1460. // CHECK:STDOUT:
  1461. // CHECK:STDOUT: !definition:
  1462. // CHECK:STDOUT: %require_complete.loc24_38: <witness> = require_complete_type %impl.elem0.loc24_34.2 [symbolic = %require_complete.loc24_38 (constants.%require_complete.58f)]
  1463. // CHECK:STDOUT: %require_complete.loc24_25: <witness> = require_complete_type %T.as_type.loc24_27.2 [symbolic = %require_complete.loc24_25 (constants.%require_complete.2a5)]
  1464. // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc24_27.2, (%J.lookup_impl_witness) [symbolic = %J.facet (constants.%J.facet.5210a7.2)]
  1465. // CHECK:STDOUT: %.loc25_11.2: type = fn_type_with_self_type constants.%F.type.c14, %J.facet [symbolic = %.loc25_11.2 (constants.%.d43)]
  1466. // CHECK:STDOUT: %impl.elem1.loc25_11.2: @GenericCallF.%.loc25_11.2 (%.d43) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc25_11.2 (constants.%impl.elem1)]
  1467. // CHECK:STDOUT: %specific_impl_fn.loc25_11.2: <specific function> = specific_impl_function %impl.elem1.loc25_11.2, @F.1(%J.facet) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn.fe8)]
  1468. // CHECK:STDOUT:
  1469. // CHECK:STDOUT: fn(%t.param: @GenericCallF.%T.as_type.loc24_27.2 (%T.as_type.3df), %u.param: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2)) -> @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) {
  1470. // CHECK:STDOUT: !entry:
  1471. // CHECK:STDOUT: %t.ref: @GenericCallF.%T.as_type.loc24_27.2 (%T.as_type.3df) = name_ref t, %t
  1472. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572]
  1473. // CHECK:STDOUT: %T.as_type.loc25: type = facet_access_type constants.%T.ccd [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)]
  1474. // CHECK:STDOUT: %.loc25_11.1: type = converted constants.%T.ccd, %T.as_type.loc25 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)]
  1475. // CHECK:STDOUT: %impl.elem1.loc25_11.1: @GenericCallF.%.loc25_11.2 (%.d43) = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element1 [symbolic = %impl.elem1.loc25_11.2 (constants.%impl.elem1)]
  1476. // CHECK:STDOUT: %u.ref: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = name_ref u, %u
  1477. // CHECK:STDOUT: %specific_impl_fn.loc25_11.1: <specific function> = specific_impl_function %impl.elem1.loc25_11.1, @F.1(constants.%J.facet.5210a7.2) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn.fe8)]
  1478. // CHECK:STDOUT: %.loc25_15: init @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = call %specific_impl_fn.loc25_11.1(%u.ref)
  1479. // CHECK:STDOUT: %.loc25_16.1: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = value_of_initializer %.loc25_15
  1480. // CHECK:STDOUT: %.loc25_16.2: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = converted %.loc25_15, %.loc25_16.1
  1481. // CHECK:STDOUT: return %.loc25_16.2
  1482. // CHECK:STDOUT: }
  1483. // CHECK:STDOUT: }
  1484. // CHECK:STDOUT:
  1485. // CHECK:STDOUT: fn @CallGeneric(%e.param: %E) -> %i32 {
  1486. // CHECK:STDOUT: !entry:
  1487. // CHECK:STDOUT: %GenericCallF.ref: %GenericCallF.type = name_ref GenericCallF, file.%GenericCallF.decl [concrete = constants.%GenericCallF]
  1488. // CHECK:STDOUT: %e.ref: %E = name_ref e, %e
  1489. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  1490. // CHECK:STDOUT: %J.facet.loc29_27.1: %J.type = facet_value constants.%E, (constants.%J.impl_witness) [concrete = constants.%J.facet.ee5]
  1491. // CHECK:STDOUT: %.loc29_27.1: %J.type = converted constants.%E, %J.facet.loc29_27.1 [concrete = constants.%J.facet.ee5]
  1492. // CHECK:STDOUT: %J.facet.loc29_27.2: %J.type = facet_value constants.%E, (constants.%J.impl_witness) [concrete = constants.%J.facet.ee5]
  1493. // CHECK:STDOUT: %.loc29_27.2: %J.type = converted constants.%E, %J.facet.loc29_27.2 [concrete = constants.%J.facet.ee5]
  1494. // CHECK:STDOUT: %GenericCallF.specific_fn: <specific function> = specific_function %GenericCallF.ref, @GenericCallF(constants.%J.facet.ee5) [concrete = constants.%GenericCallF.specific_fn]
  1495. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  1496. // CHECK:STDOUT: %bound_method.loc29_26.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9]
  1497. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  1498. // CHECK:STDOUT: %bound_method.loc29_26.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.b92]
  1499. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc29_26.2(%int_2) [concrete = constants.%int_2.ef8]
  1500. // CHECK:STDOUT: %.loc29_26.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8]
  1501. // CHECK:STDOUT: %.loc29_26.2: %i32 = converted %int_2, %.loc29_26.1 [concrete = constants.%int_2.ef8]
  1502. // CHECK:STDOUT: %GenericCallF.call: init %i32 = call %GenericCallF.specific_fn(%e.ref, %.loc29_26.2)
  1503. // CHECK:STDOUT: %.loc29_28.1: %i32 = value_of_initializer %GenericCallF.call
  1504. // CHECK:STDOUT: %.loc29_28.2: %i32 = converted %GenericCallF.call, %.loc29_28.1
  1505. // CHECK:STDOUT: return %.loc29_28.2
  1506. // CHECK:STDOUT: }
  1507. // CHECK:STDOUT:
  1508. // CHECK:STDOUT: specific @U(constants.%Self.ccd) {}
  1509. // CHECK:STDOUT:
  1510. // CHECK:STDOUT: specific @U(constants.%J.facet.5210a7.1) {}
  1511. // CHECK:STDOUT:
  1512. // CHECK:STDOUT: specific @F.1(constants.%Self.ccd) {
  1513. // CHECK:STDOUT: %Self => constants.%Self.ccd
  1514. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.1
  1515. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.11fef0.1
  1516. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b984e7.1
  1517. // CHECK:STDOUT: }
  1518. // CHECK:STDOUT:
  1519. // CHECK:STDOUT: specific @G.1(constants.%Self.ccd) {
  1520. // CHECK:STDOUT: %Self => constants.%Self.ccd
  1521. // CHECK:STDOUT: %Self.as_type.loc6_14.1 => constants.%Self.as_type.3df
  1522. // CHECK:STDOUT: %pattern_type.loc6_8 => constants.%pattern_type.4ca604.1
  1523. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.1
  1524. // CHECK:STDOUT: %impl.elem0.loc6_23.1 => constants.%impl.elem0.11fef0.1
  1525. // CHECK:STDOUT: %pattern_type.loc6_20 => constants.%pattern_type.b984e7.1
  1526. // CHECK:STDOUT: }
  1527. // CHECK:STDOUT:
  1528. // CHECK:STDOUT: specific @U(constants.%J.facet.330) {}
  1529. // CHECK:STDOUT:
  1530. // CHECK:STDOUT: specific @F.1(constants.%J.facet.ee5) {
  1531. // CHECK:STDOUT: %Self => constants.%J.facet.ee5
  1532. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  1533. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  1534. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  1535. // CHECK:STDOUT: }
  1536. // CHECK:STDOUT:
  1537. // CHECK:STDOUT: specific @G.1(constants.%J.facet.ee5) {
  1538. // CHECK:STDOUT: %Self => constants.%J.facet.ee5
  1539. // CHECK:STDOUT: %Self.as_type.loc6_14.1 => constants.%E
  1540. // CHECK:STDOUT: %pattern_type.loc6_8 => constants.%pattern_type.a4a
  1541. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  1542. // CHECK:STDOUT: %impl.elem0.loc6_23.1 => constants.%i32
  1543. // CHECK:STDOUT: %pattern_type.loc6_20 => constants.%pattern_type.7ce
  1544. // CHECK:STDOUT: }
  1545. // CHECK:STDOUT:
  1546. // CHECK:STDOUT: specific @U(constants.%J.facet.5210a7.2) {}
  1547. // CHECK:STDOUT:
  1548. // CHECK:STDOUT: specific @GenericCallF(constants.%T.ccd) {
  1549. // CHECK:STDOUT: %T.loc24_17.2 => constants.%T.ccd
  1550. // CHECK:STDOUT: %T.as_type.loc24_27.2 => constants.%T.as_type.3df
  1551. // CHECK:STDOUT: %pattern_type.loc24_24 => constants.%pattern_type.4ca604.2
  1552. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.2
  1553. // CHECK:STDOUT: %impl.elem0.loc24_34.2 => constants.%impl.elem0.11fef0.2
  1554. // CHECK:STDOUT: %pattern_type.loc24_30 => constants.%pattern_type.b984e7.2
  1555. // CHECK:STDOUT: }
  1556. // CHECK:STDOUT:
  1557. // CHECK:STDOUT: specific @F.1(constants.%J.facet.5210a7.2) {
  1558. // CHECK:STDOUT: %Self => constants.%J.facet.5210a7.2
  1559. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.2
  1560. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.11fef0.2
  1561. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b984e7.2
  1562. // CHECK:STDOUT: }
  1563. // CHECK:STDOUT:
  1564. // CHECK:STDOUT: specific @GenericCallF(constants.%J.facet.ee5) {
  1565. // CHECK:STDOUT: %T.loc24_17.2 => constants.%J.facet.ee5
  1566. // CHECK:STDOUT: %T.as_type.loc24_27.2 => constants.%E
  1567. // CHECK:STDOUT: %pattern_type.loc24_24 => constants.%pattern_type.a4a
  1568. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  1569. // CHECK:STDOUT: %impl.elem0.loc24_34.2 => constants.%i32
  1570. // CHECK:STDOUT: %pattern_type.loc24_30 => constants.%pattern_type.7ce
  1571. // CHECK:STDOUT:
  1572. // CHECK:STDOUT: !definition:
  1573. // CHECK:STDOUT: %require_complete.loc24_38 => constants.%complete_type.f8a
  1574. // CHECK:STDOUT: %require_complete.loc24_25 => constants.%complete_type.357
  1575. // CHECK:STDOUT: %J.facet => constants.%J.facet.ee5
  1576. // CHECK:STDOUT: %.loc25_11.2 => constants.%.29b
  1577. // CHECK:STDOUT: %impl.elem1.loc25_11.2 => constants.%F.b07
  1578. // CHECK:STDOUT: %specific_impl_fn.loc25_11.2 => constants.%F.b07
  1579. // CHECK:STDOUT: }
  1580. // CHECK:STDOUT:
  1581. // CHECK:STDOUT: --- use_constraint_on_associated_type.carbon
  1582. // CHECK:STDOUT:
  1583. // CHECK:STDOUT: constants {
  1584. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1585. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1586. // CHECK:STDOUT: %Self.as_type.b70: type = facet_access_type %Self.826 [symbolic]
  1587. // CHECK:STDOUT: %pattern_type.6de: type = pattern_type %Self.as_type.b70 [symbolic]
  1588. // CHECK:STDOUT: %Op.type: type = fn_type @Op [concrete]
  1589. // CHECK:STDOUT: %Op: %Op.type = struct_value () [concrete]
  1590. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1591. // CHECK:STDOUT: %assoc0.ea8: %I.assoc_type = assoc_entity element0, @I.%Op.decl [concrete]
  1592. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  1593. // CHECK:STDOUT: %Self.ccd: %J.type = bind_symbolic_name Self, 0 [symbolic]
  1594. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  1595. // CHECK:STDOUT: %assoc0.5be: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  1596. // CHECK:STDOUT: %Self.as_type.3df: type = facet_access_type %Self.ccd [symbolic]
  1597. // CHECK:STDOUT: %J.lookup_impl_witness.64628e.1: <witness> = lookup_impl_witness %Self.ccd, @J [symbolic]
  1598. // CHECK:STDOUT: %J.facet.5210a7.1: %J.type = facet_value %Self.as_type.3df, (%J.lookup_impl_witness.64628e.1) [symbolic]
  1599. // CHECK:STDOUT: %impl.elem0.5205fd.1: %I.type = impl_witness_access %J.lookup_impl_witness.64628e.1, element0 [symbolic]
  1600. // CHECK:STDOUT: %as_type.f5d8f3.1: type = facet_access_type %impl.elem0.5205fd.1 [symbolic]
  1601. // CHECK:STDOUT: %pattern_type.74afd4.1: type = pattern_type %as_type.f5d8f3.1 [symbolic]
  1602. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1603. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1604. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%F.decl [concrete]
  1605. // CHECK:STDOUT: %T: %J.type = bind_symbolic_name T, 0 [symbolic]
  1606. // CHECK:STDOUT: %pattern_type.28e: type = pattern_type %J.type [concrete]
  1607. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  1608. // CHECK:STDOUT: %pattern_type.4ca: type = pattern_type %T.as_type [symbolic]
  1609. // CHECK:STDOUT: %J.lookup_impl_witness.64628e.2: <witness> = lookup_impl_witness %T, @J [symbolic]
  1610. // CHECK:STDOUT: %J.facet.5210a7.2: %J.type = facet_value %T.as_type, (%J.lookup_impl_witness.64628e.2) [symbolic]
  1611. // CHECK:STDOUT: %impl.elem0.5205fd.2: %I.type = impl_witness_access %J.lookup_impl_witness.64628e.2, element0 [symbolic]
  1612. // CHECK:STDOUT: %as_type.f5d8f3.2: type = facet_access_type %impl.elem0.5205fd.2 [symbolic]
  1613. // CHECK:STDOUT: %pattern_type.74afd4.2: type = pattern_type %as_type.f5d8f3.2 [symbolic]
  1614. // CHECK:STDOUT: %GenericResult.type: type = fn_type @GenericResult [concrete]
  1615. // CHECK:STDOUT: %GenericResult: %GenericResult.type = struct_value () [concrete]
  1616. // CHECK:STDOUT: %require_complete.b33: <witness> = require_complete_type %as_type.f5d8f3.2 [symbolic]
  1617. // CHECK:STDOUT: %require_complete.2a5: <witness> = require_complete_type %T.as_type [symbolic]
  1618. // CHECK:STDOUT: %.d43: type = fn_type_with_self_type %F.type, %J.facet.5210a7.2 [symbolic]
  1619. // CHECK:STDOUT: %impl.elem1: %.d43 = impl_witness_access %J.lookup_impl_witness.64628e.2, element1 [symbolic]
  1620. // CHECK:STDOUT: %specific_impl_fn.fe8: <specific function> = specific_impl_function %impl.elem1, @F(%J.facet.5210a7.2) [symbolic]
  1621. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.5205fd.2, @I [symbolic]
  1622. // CHECK:STDOUT: %I.facet: %I.type = facet_value %as_type.f5d8f3.2, (%I.lookup_impl_witness) [symbolic]
  1623. // CHECK:STDOUT: %.c9a: type = fn_type_with_self_type %Op.type, %I.facet [symbolic]
  1624. // CHECK:STDOUT: %impl.elem0.45a: %.c9a = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
  1625. // CHECK:STDOUT: %specific_impl_fn.2ec: <specific function> = specific_impl_function %impl.elem0.45a, @Op(%I.facet) [symbolic]
  1626. // CHECK:STDOUT: }
  1627. // CHECK:STDOUT:
  1628. // CHECK:STDOUT: imports {
  1629. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1630. // CHECK:STDOUT: import Core//prelude
  1631. // CHECK:STDOUT: import Core//prelude/...
  1632. // CHECK:STDOUT: }
  1633. // CHECK:STDOUT: }
  1634. // CHECK:STDOUT:
  1635. // CHECK:STDOUT: file {
  1636. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1637. // CHECK:STDOUT: .Core = imports.%Core
  1638. // CHECK:STDOUT: .I = %I.decl
  1639. // CHECK:STDOUT: .J = %J.decl
  1640. // CHECK:STDOUT: .GenericResult = %GenericResult.decl
  1641. // CHECK:STDOUT: }
  1642. // CHECK:STDOUT: %Core.import = import Core
  1643. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1644. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1645. // CHECK:STDOUT: %GenericResult.decl: %GenericResult.type = fn_decl @GenericResult [concrete = constants.%GenericResult] {
  1646. // CHECK:STDOUT: %T.patt: %pattern_type.28e = symbolic_binding_pattern T, 0 [concrete]
  1647. // CHECK:STDOUT: %t.patt: @GenericResult.%pattern_type.loc12_25 (%pattern_type.4ca) = binding_pattern t [concrete]
  1648. // CHECK:STDOUT: %t.param_patt: @GenericResult.%pattern_type.loc12_25 (%pattern_type.4ca) = value_param_pattern %t.patt, call_param0 [concrete]
  1649. // CHECK:STDOUT: %u.patt: @GenericResult.%pattern_type.loc12_31 (%pattern_type.74afd4.2) = binding_pattern u [concrete]
  1650. // CHECK:STDOUT: %u.param_patt: @GenericResult.%pattern_type.loc12_31 (%pattern_type.74afd4.2) = value_param_pattern %u.patt, call_param1 [concrete]
  1651. // CHECK:STDOUT: %return.patt: @GenericResult.%pattern_type.loc12_31 (%pattern_type.74afd4.2) = return_slot_pattern [concrete]
  1652. // CHECK:STDOUT: %return.param_patt: @GenericResult.%pattern_type.loc12_31 (%pattern_type.74afd4.2) = out_param_pattern %return.patt, call_param2 [concrete]
  1653. // CHECK:STDOUT: } {
  1654. // CHECK:STDOUT: %T.ref.loc12_42: %J.type = name_ref T, %T.loc12_18.1 [symbolic = %T.loc12_18.2 (constants.%T)]
  1655. // CHECK:STDOUT: %U.ref.loc12_43: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.5be]
  1656. // CHECK:STDOUT: %T.as_type.loc12_43: type = facet_access_type %T.ref.loc12_42 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1657. // CHECK:STDOUT: %.loc12_43.1: type = converted %T.ref.loc12_42, %T.as_type.loc12_43 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1658. // CHECK:STDOUT: %impl.elem0.loc12_43: %I.type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc12_35.2 (constants.%impl.elem0.5205fd.2)]
  1659. // CHECK:STDOUT: %as_type.loc12_43: type = facet_access_type %impl.elem0.loc12_43 [symbolic = %as_type.loc12_35.2 (constants.%as_type.f5d8f3.2)]
  1660. // CHECK:STDOUT: %.loc12_43.2: type = converted %impl.elem0.loc12_43, %as_type.loc12_43 [symbolic = %as_type.loc12_35.2 (constants.%as_type.f5d8f3.2)]
  1661. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1662. // CHECK:STDOUT: %T.loc12_18.1: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc12_18.2 (constants.%T)]
  1663. // CHECK:STDOUT: %t.param: @GenericResult.%T.as_type.loc12_28.2 (%T.as_type) = value_param call_param0
  1664. // CHECK:STDOUT: %.loc12_28.1: type = splice_block %.loc12_28.2 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)] {
  1665. // CHECK:STDOUT: %T.ref.loc12_28: %J.type = name_ref T, %T.loc12_18.1 [symbolic = %T.loc12_18.2 (constants.%T)]
  1666. // CHECK:STDOUT: %T.as_type.loc12_28.1: type = facet_access_type %T.ref.loc12_28 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1667. // CHECK:STDOUT: %.loc12_28.2: type = converted %T.ref.loc12_28, %T.as_type.loc12_28.1 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1668. // CHECK:STDOUT: }
  1669. // CHECK:STDOUT: %t: @GenericResult.%T.as_type.loc12_28.2 (%T.as_type) = bind_name t, %t.param
  1670. // CHECK:STDOUT: %u.param: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = value_param call_param1
  1671. // CHECK:STDOUT: %.loc12_35.1: type = splice_block %.loc12_35.3 [symbolic = %as_type.loc12_35.2 (constants.%as_type.f5d8f3.2)] {
  1672. // CHECK:STDOUT: %T.ref.loc12_34: %J.type = name_ref T, %T.loc12_18.1 [symbolic = %T.loc12_18.2 (constants.%T)]
  1673. // CHECK:STDOUT: %U.ref.loc12_35: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.5be]
  1674. // CHECK:STDOUT: %T.as_type.loc12_35: type = facet_access_type %T.ref.loc12_34 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1675. // CHECK:STDOUT: %.loc12_35.2: type = converted %T.ref.loc12_34, %T.as_type.loc12_35 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1676. // CHECK:STDOUT: %impl.elem0.loc12_35.1: %I.type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc12_35.2 (constants.%impl.elem0.5205fd.2)]
  1677. // CHECK:STDOUT: %as_type.loc12_35.1: type = facet_access_type %impl.elem0.loc12_35.1 [symbolic = %as_type.loc12_35.2 (constants.%as_type.f5d8f3.2)]
  1678. // CHECK:STDOUT: %.loc12_35.3: type = converted %impl.elem0.loc12_35.1, %as_type.loc12_35.1 [symbolic = %as_type.loc12_35.2 (constants.%as_type.f5d8f3.2)]
  1679. // CHECK:STDOUT: }
  1680. // CHECK:STDOUT: %u: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = bind_name u, %u.param
  1681. // CHECK:STDOUT: %return.param: ref @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = out_param call_param2
  1682. // CHECK:STDOUT: %return: ref @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = return_slot %return.param
  1683. // CHECK:STDOUT: }
  1684. // CHECK:STDOUT: }
  1685. // CHECK:STDOUT:
  1686. // CHECK:STDOUT: interface @I {
  1687. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  1688. // CHECK:STDOUT: %Op.decl: %Op.type = fn_decl @Op [concrete = constants.%Op] {
  1689. // CHECK:STDOUT: %self.patt: @Op.%pattern_type (%pattern_type.6de) = binding_pattern self [concrete]
  1690. // CHECK:STDOUT: %self.param_patt: @Op.%pattern_type (%pattern_type.6de) = value_param_pattern %self.patt, call_param0 [concrete]
  1691. // CHECK:STDOUT: %b.patt: @Op.%pattern_type (%pattern_type.6de) = binding_pattern b [concrete]
  1692. // CHECK:STDOUT: %b.param_patt: @Op.%pattern_type (%pattern_type.6de) = value_param_pattern %b.patt, call_param1 [concrete]
  1693. // CHECK:STDOUT: %return.patt: @Op.%pattern_type (%pattern_type.6de) = return_slot_pattern [concrete]
  1694. // CHECK:STDOUT: %return.param_patt: @Op.%pattern_type (%pattern_type.6de) = out_param_pattern %return.patt, call_param2 [concrete]
  1695. // CHECK:STDOUT: } {
  1696. // CHECK:STDOUT: %Self.ref.loc4_33: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)]
  1697. // CHECK:STDOUT: %Self.as_type.loc4_33: type = facet_access_type %Self.ref.loc4_33 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.b70)]
  1698. // CHECK:STDOUT: %.loc4_33: type = converted %Self.ref.loc4_33, %Self.as_type.loc4_33 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.b70)]
  1699. // CHECK:STDOUT: %self.param: @Op.%Self.as_type.loc4_15.1 (%Self.as_type.b70) = value_param call_param0
  1700. // CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.b70)] {
  1701. // CHECK:STDOUT: %Self.ref.loc4_15: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)]
  1702. // CHECK:STDOUT: %Self.as_type.loc4_15.2: type = facet_access_type %Self.ref.loc4_15 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.b70)]
  1703. // CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref.loc4_15, %Self.as_type.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.b70)]
  1704. // CHECK:STDOUT: }
  1705. // CHECK:STDOUT: %self: @Op.%Self.as_type.loc4_15.1 (%Self.as_type.b70) = bind_name self, %self.param
  1706. // CHECK:STDOUT: %b.param: @Op.%Self.as_type.loc4_15.1 (%Self.as_type.b70) = value_param call_param1
  1707. // CHECK:STDOUT: %.loc4_24.1: type = splice_block %.loc4_24.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.b70)] {
  1708. // CHECK:STDOUT: %Self.ref.loc4_24: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)]
  1709. // CHECK:STDOUT: %Self.as_type.loc4_24: type = facet_access_type %Self.ref.loc4_24 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.b70)]
  1710. // CHECK:STDOUT: %.loc4_24.2: type = converted %Self.ref.loc4_24, %Self.as_type.loc4_24 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.b70)]
  1711. // CHECK:STDOUT: }
  1712. // CHECK:STDOUT: %b: @Op.%Self.as_type.loc4_15.1 (%Self.as_type.b70) = bind_name b, %b.param
  1713. // CHECK:STDOUT: %return.param: ref @Op.%Self.as_type.loc4_15.1 (%Self.as_type.b70) = out_param call_param2
  1714. // CHECK:STDOUT: %return: ref @Op.%Self.as_type.loc4_15.1 (%Self.as_type.b70) = return_slot %return.param
  1715. // CHECK:STDOUT: }
  1716. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %Op.decl [concrete = constants.%assoc0.ea8]
  1717. // CHECK:STDOUT:
  1718. // CHECK:STDOUT: !members:
  1719. // CHECK:STDOUT: .Self = %Self
  1720. // CHECK:STDOUT: .Op = %assoc0
  1721. // CHECK:STDOUT: witness = (%Op.decl)
  1722. // CHECK:STDOUT: }
  1723. // CHECK:STDOUT:
  1724. // CHECK:STDOUT: interface @J {
  1725. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.ccd]
  1726. // CHECK:STDOUT: %U: %I.type = assoc_const_decl @U [concrete] {
  1727. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.5be]
  1728. // CHECK:STDOUT: }
  1729. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  1730. // CHECK:STDOUT: %u.patt: @F.%pattern_type (%pattern_type.74afd4.1) = binding_pattern u [concrete]
  1731. // CHECK:STDOUT: %u.param_patt: @F.%pattern_type (%pattern_type.74afd4.1) = value_param_pattern %u.patt, call_param0 [concrete]
  1732. // CHECK:STDOUT: %return.patt: @F.%pattern_type (%pattern_type.74afd4.1) = return_slot_pattern [concrete]
  1733. // CHECK:STDOUT: %return.param_patt: @F.%pattern_type (%pattern_type.74afd4.1) = out_param_pattern %return.patt, call_param1 [concrete]
  1734. // CHECK:STDOUT: } {
  1735. // CHECK:STDOUT: %impl.elem0.loc9_17: %I.type = impl_witness_access constants.%J.lookup_impl_witness.64628e.1, element0 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.5205fd.1)]
  1736. // CHECK:STDOUT: %U.ref.loc9_17: %I.type = name_ref U, %impl.elem0.loc9_17 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.5205fd.1)]
  1737. // CHECK:STDOUT: %U.as_type.loc9_17: type = facet_access_type %U.ref.loc9_17 [symbolic = %as_type (constants.%as_type.f5d8f3.1)]
  1738. // CHECK:STDOUT: %.loc9_17: type = converted %U.ref.loc9_17, %U.as_type.loc9_17 [symbolic = %as_type (constants.%as_type.f5d8f3.1)]
  1739. // CHECK:STDOUT: %u.param: @F.%as_type (%as_type.f5d8f3.1) = value_param call_param0
  1740. // CHECK:STDOUT: %.loc9_11.1: type = splice_block %.loc9_11.2 [symbolic = %as_type (constants.%as_type.f5d8f3.1)] {
  1741. // CHECK:STDOUT: %impl.elem0.loc9_11.2: %I.type = impl_witness_access constants.%J.lookup_impl_witness.64628e.1, element0 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.5205fd.1)]
  1742. // CHECK:STDOUT: %U.ref.loc9_11: %I.type = name_ref U, %impl.elem0.loc9_11.2 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.5205fd.1)]
  1743. // CHECK:STDOUT: %U.as_type.loc9_11: type = facet_access_type %U.ref.loc9_11 [symbolic = %as_type (constants.%as_type.f5d8f3.1)]
  1744. // CHECK:STDOUT: %.loc9_11.2: type = converted %U.ref.loc9_11, %U.as_type.loc9_11 [symbolic = %as_type (constants.%as_type.f5d8f3.1)]
  1745. // CHECK:STDOUT: }
  1746. // CHECK:STDOUT: %u: @F.%as_type (%as_type.f5d8f3.1) = bind_name u, %u.param
  1747. // CHECK:STDOUT: %return.param: ref @F.%as_type (%as_type.f5d8f3.1) = out_param call_param1
  1748. // CHECK:STDOUT: %return: ref @F.%as_type (%as_type.f5d8f3.1) = return_slot %return.param
  1749. // CHECK:STDOUT: }
  1750. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1]
  1751. // CHECK:STDOUT:
  1752. // CHECK:STDOUT: !members:
  1753. // CHECK:STDOUT: .Self = %Self
  1754. // CHECK:STDOUT: .I = <poisoned>
  1755. // CHECK:STDOUT: .U = @U.%assoc0
  1756. // CHECK:STDOUT: .F = %assoc1
  1757. // CHECK:STDOUT: witness = (%U, %F.decl)
  1758. // CHECK:STDOUT: }
  1759. // CHECK:STDOUT:
  1760. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  1761. // CHECK:STDOUT: assoc_const U:! %I.type;
  1762. // CHECK:STDOUT: }
  1763. // CHECK:STDOUT:
  1764. // CHECK:STDOUT: generic fn @Op(@I.%Self: %I.type) {
  1765. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.826)]
  1766. // CHECK:STDOUT: %Self.as_type.loc4_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type.b70)]
  1767. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_15.1 [symbolic = %pattern_type (constants.%pattern_type.6de)]
  1768. // CHECK:STDOUT:
  1769. // CHECK:STDOUT: fn(%self.param: @Op.%Self.as_type.loc4_15.1 (%Self.as_type.b70), %b.param: @Op.%Self.as_type.loc4_15.1 (%Self.as_type.b70)) -> @Op.%Self.as_type.loc4_15.1 (%Self.as_type.b70);
  1770. // CHECK:STDOUT: }
  1771. // CHECK:STDOUT:
  1772. // CHECK:STDOUT: generic fn @F(@J.%Self: %J.type) {
  1773. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.ccd)]
  1774. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.1)]
  1775. // CHECK:STDOUT: %impl.elem0.loc9_11.1: %I.type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_11.1 (constants.%impl.elem0.5205fd.1)]
  1776. // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.loc9_11.1 [symbolic = %as_type (constants.%as_type.f5d8f3.1)]
  1777. // CHECK:STDOUT: %pattern_type: type = pattern_type %as_type [symbolic = %pattern_type (constants.%pattern_type.74afd4.1)]
  1778. // CHECK:STDOUT:
  1779. // CHECK:STDOUT: fn(%u.param: @F.%as_type (%as_type.f5d8f3.1)) -> @F.%as_type (%as_type.f5d8f3.1);
  1780. // CHECK:STDOUT: }
  1781. // CHECK:STDOUT:
  1782. // CHECK:STDOUT: generic fn @GenericResult(%T.loc12_18.1: %J.type) {
  1783. // CHECK:STDOUT: %T.loc12_18.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc12_18.2 (constants.%T)]
  1784. // CHECK:STDOUT: %T.as_type.loc12_28.2: type = facet_access_type %T.loc12_18.2 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1785. // CHECK:STDOUT: %pattern_type.loc12_25: type = pattern_type %T.as_type.loc12_28.2 [symbolic = %pattern_type.loc12_25 (constants.%pattern_type.4ca)]
  1786. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc12_18.2, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.2)]
  1787. // CHECK:STDOUT: %impl.elem0.loc12_35.2: %I.type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_35.2 (constants.%impl.elem0.5205fd.2)]
  1788. // CHECK:STDOUT: %as_type.loc12_35.2: type = facet_access_type %impl.elem0.loc12_35.2 [symbolic = %as_type.loc12_35.2 (constants.%as_type.f5d8f3.2)]
  1789. // CHECK:STDOUT: %pattern_type.loc12_31: type = pattern_type %as_type.loc12_35.2 [symbolic = %pattern_type.loc12_31 (constants.%pattern_type.74afd4.2)]
  1790. // CHECK:STDOUT:
  1791. // CHECK:STDOUT: !definition:
  1792. // CHECK:STDOUT: %require_complete.loc12_39: <witness> = require_complete_type %as_type.loc12_35.2 [symbolic = %require_complete.loc12_39 (constants.%require_complete.b33)]
  1793. // CHECK:STDOUT: %require_complete.loc12_26: <witness> = require_complete_type %T.as_type.loc12_28.2 [symbolic = %require_complete.loc12_26 (constants.%require_complete.2a5)]
  1794. // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc12_28.2, (%J.lookup_impl_witness) [symbolic = %J.facet (constants.%J.facet.5210a7.2)]
  1795. // CHECK:STDOUT: %.loc13_11.2: type = fn_type_with_self_type constants.%F.type, %J.facet [symbolic = %.loc13_11.2 (constants.%.d43)]
  1796. // CHECK:STDOUT: %impl.elem1.loc13_11.2: @GenericResult.%.loc13_11.2 (%.d43) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc13_11.2 (constants.%impl.elem1)]
  1797. // CHECK:STDOUT: %specific_impl_fn.loc13_11.2: <specific function> = specific_impl_function %impl.elem1.loc13_11.2, @F(%J.facet) [symbolic = %specific_impl_fn.loc13_11.2 (constants.%specific_impl_fn.fe8)]
  1798. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.loc12_35.2, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
  1799. // CHECK:STDOUT: %I.facet: %I.type = facet_value %as_type.loc12_35.2, (%I.lookup_impl_witness) [symbolic = %I.facet (constants.%I.facet)]
  1800. // CHECK:STDOUT: %.loc13_16: type = fn_type_with_self_type constants.%Op.type, %I.facet [symbolic = %.loc13_16 (constants.%.c9a)]
  1801. // CHECK:STDOUT: %impl.elem0.loc13_16.2: @GenericResult.%.loc13_16 (%.c9a) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_16.2 (constants.%impl.elem0.45a)]
  1802. // CHECK:STDOUT: %specific_impl_fn.loc13_16.2: <specific function> = specific_impl_function %impl.elem0.loc13_16.2, @Op(%I.facet) [symbolic = %specific_impl_fn.loc13_16.2 (constants.%specific_impl_fn.2ec)]
  1803. // CHECK:STDOUT:
  1804. // CHECK:STDOUT: fn(%t.param: @GenericResult.%T.as_type.loc12_28.2 (%T.as_type), %u.param: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2)) -> @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) {
  1805. // CHECK:STDOUT: !entry:
  1806. // CHECK:STDOUT: %t.ref: @GenericResult.%T.as_type.loc12_28.2 (%T.as_type) = name_ref t, %t
  1807. // CHECK:STDOUT: %F.ref.loc13_11: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1]
  1808. // CHECK:STDOUT: %T.as_type.loc13_11: type = facet_access_type constants.%T [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1809. // CHECK:STDOUT: %.loc13_11.1: type = converted constants.%T, %T.as_type.loc13_11 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1810. // CHECK:STDOUT: %impl.elem1.loc13_11.1: @GenericResult.%.loc13_11.2 (%.d43) = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element1 [symbolic = %impl.elem1.loc13_11.2 (constants.%impl.elem1)]
  1811. // CHECK:STDOUT: %u.ref.loc13_14: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = name_ref u, %u
  1812. // CHECK:STDOUT: %.loc13_15.1: %I.type = converted constants.%as_type.f5d8f3.2, constants.%impl.elem0.5205fd.2 [symbolic = %impl.elem0.loc12_35.2 (constants.%impl.elem0.5205fd.2)]
  1813. // CHECK:STDOUT: %.loc13_15.2: %I.type = converted constants.%as_type.f5d8f3.2, constants.%impl.elem0.5205fd.2 [symbolic = %impl.elem0.loc12_35.2 (constants.%impl.elem0.5205fd.2)]
  1814. // CHECK:STDOUT: %specific_impl_fn.loc13_11.1: <specific function> = specific_impl_function %impl.elem1.loc13_11.1, @F(constants.%J.facet.5210a7.2) [symbolic = %specific_impl_fn.loc13_11.2 (constants.%specific_impl_fn.fe8)]
  1815. // CHECK:STDOUT: %.loc13_15.3: init @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = call %specific_impl_fn.loc13_11.1(%u.ref.loc13_14)
  1816. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1817. // CHECK:STDOUT: %Op.ref: %I.assoc_type = name_ref Op, @I.%assoc0 [concrete = constants.%assoc0.ea8]
  1818. // CHECK:STDOUT: %impl.elem0.loc13_16.1: @GenericResult.%.loc13_16 (%.c9a) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_16.2 (constants.%impl.elem0.45a)]
  1819. // CHECK:STDOUT: %bound_method.loc13_16: <bound method> = bound_method %.loc13_15.3, %impl.elem0.loc13_16.1
  1820. // CHECK:STDOUT: %T.ref.loc13: %J.type = name_ref T, %T.loc12_18.1 [symbolic = %T.loc12_18.2 (constants.%T)]
  1821. // CHECK:STDOUT: %F.ref.loc13_25: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1]
  1822. // CHECK:STDOUT: %T.as_type.loc13_25: type = facet_access_type %T.ref.loc13 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1823. // CHECK:STDOUT: %.loc13_25: type = converted %T.ref.loc13, %T.as_type.loc13_25 [symbolic = %T.as_type.loc12_28.2 (constants.%T.as_type)]
  1824. // CHECK:STDOUT: %impl.elem1.loc13_25: @GenericResult.%.loc13_11.2 (%.d43) = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element1 [symbolic = %impl.elem1.loc13_11.2 (constants.%impl.elem1)]
  1825. // CHECK:STDOUT: %u.ref.loc13_28: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = name_ref u, %u
  1826. // CHECK:STDOUT: %.loc13_29.1: %I.type = converted constants.%as_type.f5d8f3.2, constants.%impl.elem0.5205fd.2 [symbolic = %impl.elem0.loc12_35.2 (constants.%impl.elem0.5205fd.2)]
  1827. // CHECK:STDOUT: %.loc13_29.2: %I.type = converted constants.%as_type.f5d8f3.2, constants.%impl.elem0.5205fd.2 [symbolic = %impl.elem0.loc12_35.2 (constants.%impl.elem0.5205fd.2)]
  1828. // CHECK:STDOUT: %specific_impl_fn.loc13_25: <specific function> = specific_impl_function %impl.elem1.loc13_25, @F(constants.%J.facet.5210a7.2) [symbolic = %specific_impl_fn.loc13_11.2 (constants.%specific_impl_fn.fe8)]
  1829. // CHECK:STDOUT: %.loc13_29.3: init @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = call %specific_impl_fn.loc13_25(%u.ref.loc13_28)
  1830. // CHECK:STDOUT: %.loc13_30.1: %I.type = converted constants.%as_type.f5d8f3.2, constants.%impl.elem0.5205fd.2 [symbolic = %impl.elem0.loc12_35.2 (constants.%impl.elem0.5205fd.2)]
  1831. // CHECK:STDOUT: %.loc13_30.2: %I.type = converted constants.%as_type.f5d8f3.2, constants.%impl.elem0.5205fd.2 [symbolic = %impl.elem0.loc12_35.2 (constants.%impl.elem0.5205fd.2)]
  1832. // CHECK:STDOUT: %specific_impl_fn.loc13_16.1: <specific function> = specific_impl_function %impl.elem0.loc13_16.1, @Op(constants.%I.facet) [symbolic = %specific_impl_fn.loc13_16.2 (constants.%specific_impl_fn.2ec)]
  1833. // CHECK:STDOUT: %bound_method.loc13_30: <bound method> = bound_method %.loc13_15.3, %specific_impl_fn.loc13_16.1
  1834. // CHECK:STDOUT: %.loc13_15.4: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = value_of_initializer %.loc13_15.3
  1835. // CHECK:STDOUT: %.loc13_15.5: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = converted %.loc13_15.3, %.loc13_15.4
  1836. // CHECK:STDOUT: %.loc13_29.4: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = value_of_initializer %.loc13_29.3
  1837. // CHECK:STDOUT: %.loc13_29.5: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = converted %.loc13_29.3, %.loc13_29.4
  1838. // CHECK:STDOUT: %.loc13_30.3: init @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = call %bound_method.loc13_30(%.loc13_15.5, %.loc13_29.5)
  1839. // CHECK:STDOUT: %.loc13_31.1: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = value_of_initializer %.loc13_30.3
  1840. // CHECK:STDOUT: %.loc13_31.2: @GenericResult.%as_type.loc12_35.2 (%as_type.f5d8f3.2) = converted %.loc13_30.3, %.loc13_31.1
  1841. // CHECK:STDOUT: return %.loc13_31.2
  1842. // CHECK:STDOUT: }
  1843. // CHECK:STDOUT: }
  1844. // CHECK:STDOUT:
  1845. // CHECK:STDOUT: specific @Op(constants.%Self.826) {
  1846. // CHECK:STDOUT: %Self => constants.%Self.826
  1847. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%Self.as_type.b70
  1848. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6de
  1849. // CHECK:STDOUT: }
  1850. // CHECK:STDOUT:
  1851. // CHECK:STDOUT: specific @U(constants.%Self.ccd) {}
  1852. // CHECK:STDOUT:
  1853. // CHECK:STDOUT: specific @U(constants.%J.facet.5210a7.1) {}
  1854. // CHECK:STDOUT:
  1855. // CHECK:STDOUT: specific @F(constants.%Self.ccd) {
  1856. // CHECK:STDOUT: %Self => constants.%Self.ccd
  1857. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.1
  1858. // CHECK:STDOUT: %impl.elem0.loc9_11.1 => constants.%impl.elem0.5205fd.1
  1859. // CHECK:STDOUT: %as_type => constants.%as_type.f5d8f3.1
  1860. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.74afd4.1
  1861. // CHECK:STDOUT: }
  1862. // CHECK:STDOUT:
  1863. // CHECK:STDOUT: specific @U(constants.%J.facet.5210a7.2) {}
  1864. // CHECK:STDOUT:
  1865. // CHECK:STDOUT: specific @GenericResult(constants.%T) {
  1866. // CHECK:STDOUT: %T.loc12_18.2 => constants.%T
  1867. // CHECK:STDOUT: %T.as_type.loc12_28.2 => constants.%T.as_type
  1868. // CHECK:STDOUT: %pattern_type.loc12_25 => constants.%pattern_type.4ca
  1869. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.2
  1870. // CHECK:STDOUT: %impl.elem0.loc12_35.2 => constants.%impl.elem0.5205fd.2
  1871. // CHECK:STDOUT: %as_type.loc12_35.2 => constants.%as_type.f5d8f3.2
  1872. // CHECK:STDOUT: %pattern_type.loc12_31 => constants.%pattern_type.74afd4.2
  1873. // CHECK:STDOUT: }
  1874. // CHECK:STDOUT:
  1875. // CHECK:STDOUT: specific @F(constants.%J.facet.5210a7.2) {
  1876. // CHECK:STDOUT: %Self => constants.%J.facet.5210a7.2
  1877. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.2
  1878. // CHECK:STDOUT: %impl.elem0.loc9_11.1 => constants.%impl.elem0.5205fd.2
  1879. // CHECK:STDOUT: %as_type => constants.%as_type.f5d8f3.2
  1880. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.74afd4.2
  1881. // CHECK:STDOUT: }
  1882. // CHECK:STDOUT:
  1883. // CHECK:STDOUT: specific @Op(constants.%I.facet) {
  1884. // CHECK:STDOUT: %Self => constants.%I.facet
  1885. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%as_type.f5d8f3.2
  1886. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.74afd4.2
  1887. // CHECK:STDOUT: }
  1888. // CHECK:STDOUT:
  1889. // CHECK:STDOUT: --- interface_qualified.carbon
  1890. // CHECK:STDOUT:
  1891. // CHECK:STDOUT: constants {
  1892. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  1893. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic]
  1894. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  1895. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  1896. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1897. // CHECK:STDOUT: %pattern_type.4ca604.1: type = pattern_type %Self.as_type [symbolic]
  1898. // CHECK:STDOUT: %J.lookup_impl_witness.64628e.1: <witness> = lookup_impl_witness %Self, @J [symbolic]
  1899. // CHECK:STDOUT: %J.facet.5210a7.1: %J.type = facet_value %Self.as_type, (%J.lookup_impl_witness.64628e.1) [symbolic]
  1900. // CHECK:STDOUT: %impl.elem0.11fef0.1: type = impl_witness_access %J.lookup_impl_witness.64628e.1, element0 [symbolic]
  1901. // CHECK:STDOUT: %pattern_type.b984e7.1: type = pattern_type %impl.elem0.11fef0.1 [symbolic]
  1902. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1903. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1904. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%G.decl [concrete]
  1905. // CHECK:STDOUT: %T: %J.type = bind_symbolic_name T, 0 [symbolic]
  1906. // CHECK:STDOUT: %pattern_type.28e: type = pattern_type %J.type [concrete]
  1907. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  1908. // CHECK:STDOUT: %pattern_type.4ca604.2: type = pattern_type %T.as_type [symbolic]
  1909. // CHECK:STDOUT: %J.lookup_impl_witness.64628e.2: <witness> = lookup_impl_witness %T, @J [symbolic]
  1910. // CHECK:STDOUT: %J.facet.5210a7.2: %J.type = facet_value %T.as_type, (%J.lookup_impl_witness.64628e.2) [symbolic]
  1911. // CHECK:STDOUT: %impl.elem0.11fef0.2: type = impl_witness_access %J.lookup_impl_witness.64628e.2, element0 [symbolic]
  1912. // CHECK:STDOUT: %pattern_type.b984e7.2: type = pattern_type %impl.elem0.11fef0.2 [symbolic]
  1913. // CHECK:STDOUT: %GenericCallInterfaceQualified.type: type = fn_type @GenericCallInterfaceQualified [concrete]
  1914. // CHECK:STDOUT: %GenericCallInterfaceQualified: %GenericCallInterfaceQualified.type = struct_value () [concrete]
  1915. // CHECK:STDOUT: %require_complete.58f: <witness> = require_complete_type %impl.elem0.11fef0.2 [symbolic]
  1916. // CHECK:STDOUT: %require_complete.2a5: <witness> = require_complete_type %T.as_type [symbolic]
  1917. // CHECK:STDOUT: %.442: type = fn_type_with_self_type %G.type, %J.facet.5210a7.2 [symbolic]
  1918. // CHECK:STDOUT: %impl.elem1: %.442 = impl_witness_access %J.lookup_impl_witness.64628e.2, element1 [symbolic]
  1919. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem1, @G(%J.facet.5210a7.2) [symbolic]
  1920. // CHECK:STDOUT: }
  1921. // CHECK:STDOUT:
  1922. // CHECK:STDOUT: imports {
  1923. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1924. // CHECK:STDOUT: import Core//prelude
  1925. // CHECK:STDOUT: import Core//prelude/...
  1926. // CHECK:STDOUT: }
  1927. // CHECK:STDOUT: }
  1928. // CHECK:STDOUT:
  1929. // CHECK:STDOUT: file {
  1930. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1931. // CHECK:STDOUT: .Core = imports.%Core
  1932. // CHECK:STDOUT: .J = %J.decl
  1933. // CHECK:STDOUT: .GenericCallInterfaceQualified = %GenericCallInterfaceQualified.decl
  1934. // CHECK:STDOUT: }
  1935. // CHECK:STDOUT: %Core.import = import Core
  1936. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1937. // CHECK:STDOUT: %GenericCallInterfaceQualified.decl: %GenericCallInterfaceQualified.type = fn_decl @GenericCallInterfaceQualified [concrete = constants.%GenericCallInterfaceQualified] {
  1938. // CHECK:STDOUT: %T.patt: %pattern_type.28e = symbolic_binding_pattern T, 0 [concrete]
  1939. // CHECK:STDOUT: %t.patt: @GenericCallInterfaceQualified.%pattern_type.loc8_41 (%pattern_type.4ca604.2) = binding_pattern t [concrete]
  1940. // CHECK:STDOUT: %t.param_patt: @GenericCallInterfaceQualified.%pattern_type.loc8_41 (%pattern_type.4ca604.2) = value_param_pattern %t.patt, call_param0 [concrete]
  1941. // CHECK:STDOUT: %u.patt: @GenericCallInterfaceQualified.%pattern_type.loc8_47 (%pattern_type.b984e7.2) = binding_pattern u [concrete]
  1942. // CHECK:STDOUT: %u.param_patt: @GenericCallInterfaceQualified.%pattern_type.loc8_47 (%pattern_type.b984e7.2) = value_param_pattern %u.patt, call_param1 [concrete]
  1943. // CHECK:STDOUT: %return.patt: @GenericCallInterfaceQualified.%pattern_type.loc8_47 (%pattern_type.b984e7.2) = return_slot_pattern [concrete]
  1944. // CHECK:STDOUT: %return.param_patt: @GenericCallInterfaceQualified.%pattern_type.loc8_47 (%pattern_type.b984e7.2) = out_param_pattern %return.patt, call_param2 [concrete]
  1945. // CHECK:STDOUT: } {
  1946. // CHECK:STDOUT: %T.ref.loc8_58: %J.type = name_ref T, %T.loc8_34.1 [symbolic = %T.loc8_34.2 (constants.%T)]
  1947. // CHECK:STDOUT: %U.ref.loc8_59: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  1948. // CHECK:STDOUT: %T.as_type.loc8_59: type = facet_access_type %T.ref.loc8_58 [symbolic = %T.as_type.loc8_44.2 (constants.%T.as_type)]
  1949. // CHECK:STDOUT: %.loc8_59: type = converted %T.ref.loc8_58, %T.as_type.loc8_59 [symbolic = %T.as_type.loc8_44.2 (constants.%T.as_type)]
  1950. // CHECK:STDOUT: %impl.elem0.loc8_59: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc8_51.2 (constants.%impl.elem0.11fef0.2)]
  1951. // CHECK:STDOUT: %J.ref.loc8: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  1952. // CHECK:STDOUT: %T.loc8_34.1: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_34.2 (constants.%T)]
  1953. // CHECK:STDOUT: %t.param: @GenericCallInterfaceQualified.%T.as_type.loc8_44.2 (%T.as_type) = value_param call_param0
  1954. // CHECK:STDOUT: %.loc8_44.1: type = splice_block %.loc8_44.2 [symbolic = %T.as_type.loc8_44.2 (constants.%T.as_type)] {
  1955. // CHECK:STDOUT: %T.ref.loc8_44: %J.type = name_ref T, %T.loc8_34.1 [symbolic = %T.loc8_34.2 (constants.%T)]
  1956. // CHECK:STDOUT: %T.as_type.loc8_44.1: type = facet_access_type %T.ref.loc8_44 [symbolic = %T.as_type.loc8_44.2 (constants.%T.as_type)]
  1957. // CHECK:STDOUT: %.loc8_44.2: type = converted %T.ref.loc8_44, %T.as_type.loc8_44.1 [symbolic = %T.as_type.loc8_44.2 (constants.%T.as_type)]
  1958. // CHECK:STDOUT: }
  1959. // CHECK:STDOUT: %t: @GenericCallInterfaceQualified.%T.as_type.loc8_44.2 (%T.as_type) = bind_name t, %t.param
  1960. // CHECK:STDOUT: %u.param: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2) = value_param call_param1
  1961. // CHECK:STDOUT: %.loc8_51.1: type = splice_block %impl.elem0.loc8_51.1 [symbolic = %impl.elem0.loc8_51.2 (constants.%impl.elem0.11fef0.2)] {
  1962. // CHECK:STDOUT: %T.ref.loc8_50: %J.type = name_ref T, %T.loc8_34.1 [symbolic = %T.loc8_34.2 (constants.%T)]
  1963. // CHECK:STDOUT: %U.ref.loc8_51: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  1964. // CHECK:STDOUT: %T.as_type.loc8_51: type = facet_access_type %T.ref.loc8_50 [symbolic = %T.as_type.loc8_44.2 (constants.%T.as_type)]
  1965. // CHECK:STDOUT: %.loc8_51.2: type = converted %T.ref.loc8_50, %T.as_type.loc8_51 [symbolic = %T.as_type.loc8_44.2 (constants.%T.as_type)]
  1966. // CHECK:STDOUT: %impl.elem0.loc8_51.1: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc8_51.2 (constants.%impl.elem0.11fef0.2)]
  1967. // CHECK:STDOUT: }
  1968. // CHECK:STDOUT: %u: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2) = bind_name u, %u.param
  1969. // CHECK:STDOUT: %return.param: ref @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2) = out_param call_param2
  1970. // CHECK:STDOUT: %return: ref @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2) = return_slot %return.param
  1971. // CHECK:STDOUT: }
  1972. // CHECK:STDOUT: }
  1973. // CHECK:STDOUT:
  1974. // CHECK:STDOUT: interface @J {
  1975. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1976. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1977. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0]
  1978. // CHECK:STDOUT: }
  1979. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  1980. // CHECK:STDOUT: %self.patt: @G.%pattern_type.loc5_8 (%pattern_type.4ca604.1) = binding_pattern self [concrete]
  1981. // CHECK:STDOUT: %self.param_patt: @G.%pattern_type.loc5_8 (%pattern_type.4ca604.1) = value_param_pattern %self.patt, call_param0 [concrete]
  1982. // CHECK:STDOUT: %v.patt: @G.%pattern_type.loc5_20 (%pattern_type.b984e7.1) = binding_pattern v [concrete]
  1983. // CHECK:STDOUT: %v.param_patt: @G.%pattern_type.loc5_20 (%pattern_type.b984e7.1) = value_param_pattern %v.patt, call_param1 [concrete]
  1984. // CHECK:STDOUT: %return.patt: @G.%pattern_type.loc5_20 (%pattern_type.b984e7.1) = return_slot_pattern [concrete]
  1985. // CHECK:STDOUT: %return.param_patt: @G.%pattern_type.loc5_20 (%pattern_type.b984e7.1) = out_param_pattern %return.patt, call_param2 [concrete]
  1986. // CHECK:STDOUT: } {
  1987. // CHECK:STDOUT: %impl.elem0.loc5_29: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.1, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11fef0.1)]
  1988. // CHECK:STDOUT: %U.ref.loc5_29: type = name_ref U, %impl.elem0.loc5_29 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11fef0.1)]
  1989. // CHECK:STDOUT: %self.param: @G.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0
  1990. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] {
  1991. // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self)]
  1992. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  1993. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  1994. // CHECK:STDOUT: }
  1995. // CHECK:STDOUT: %self: @G.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param
  1996. // CHECK:STDOUT: %v.param: @G.%impl.elem0.loc5_23.1 (%impl.elem0.11fef0.1) = value_param call_param1
  1997. // CHECK:STDOUT: %.loc5_23: type = splice_block %U.ref.loc5_23 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11fef0.1)] {
  1998. // CHECK:STDOUT: %impl.elem0.loc5_23.2: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.1, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11fef0.1)]
  1999. // CHECK:STDOUT: %U.ref.loc5_23: type = name_ref U, %impl.elem0.loc5_23.2 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.11fef0.1)]
  2000. // CHECK:STDOUT: }
  2001. // CHECK:STDOUT: %v: @G.%impl.elem0.loc5_23.1 (%impl.elem0.11fef0.1) = bind_name v, %v.param
  2002. // CHECK:STDOUT: %return.param: ref @G.%impl.elem0.loc5_23.1 (%impl.elem0.11fef0.1) = out_param call_param2
  2003. // CHECK:STDOUT: %return: ref @G.%impl.elem0.loc5_23.1 (%impl.elem0.11fef0.1) = return_slot %return.param
  2004. // CHECK:STDOUT: }
  2005. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %G.decl [concrete = constants.%assoc1]
  2006. // CHECK:STDOUT:
  2007. // CHECK:STDOUT: !members:
  2008. // CHECK:STDOUT: .Self = %Self
  2009. // CHECK:STDOUT: .U = @U.%assoc0
  2010. // CHECK:STDOUT: .G = %assoc1
  2011. // CHECK:STDOUT: witness = (%U, %G.decl)
  2012. // CHECK:STDOUT: }
  2013. // CHECK:STDOUT:
  2014. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  2015. // CHECK:STDOUT: assoc_const U:! type;
  2016. // CHECK:STDOUT: }
  2017. // CHECK:STDOUT:
  2018. // CHECK:STDOUT: generic fn @G(@J.%Self: %J.type) {
  2019. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  2020. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  2021. // CHECK:STDOUT: %pattern_type.loc5_8: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type.loc5_8 (constants.%pattern_type.4ca604.1)]
  2022. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.1)]
  2023. // 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.11fef0.1)]
  2024. // CHECK:STDOUT: %pattern_type.loc5_20: type = pattern_type %impl.elem0.loc5_23.1 [symbolic = %pattern_type.loc5_20 (constants.%pattern_type.b984e7.1)]
  2025. // CHECK:STDOUT:
  2026. // CHECK:STDOUT: fn(%self.param: @G.%Self.as_type.loc5_14.1 (%Self.as_type), %v.param: @G.%impl.elem0.loc5_23.1 (%impl.elem0.11fef0.1)) -> @G.%impl.elem0.loc5_23.1 (%impl.elem0.11fef0.1);
  2027. // CHECK:STDOUT: }
  2028. // CHECK:STDOUT:
  2029. // CHECK:STDOUT: generic fn @GenericCallInterfaceQualified(%T.loc8_34.1: %J.type) {
  2030. // CHECK:STDOUT: %T.loc8_34.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_34.2 (constants.%T)]
  2031. // CHECK:STDOUT: %T.as_type.loc8_44.2: type = facet_access_type %T.loc8_34.2 [symbolic = %T.as_type.loc8_44.2 (constants.%T.as_type)]
  2032. // CHECK:STDOUT: %pattern_type.loc8_41: type = pattern_type %T.as_type.loc8_44.2 [symbolic = %pattern_type.loc8_41 (constants.%pattern_type.4ca604.2)]
  2033. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_34.2, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.2)]
  2034. // CHECK:STDOUT: %impl.elem0.loc8_51.2: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_51.2 (constants.%impl.elem0.11fef0.2)]
  2035. // CHECK:STDOUT: %pattern_type.loc8_47: type = pattern_type %impl.elem0.loc8_51.2 [symbolic = %pattern_type.loc8_47 (constants.%pattern_type.b984e7.2)]
  2036. // CHECK:STDOUT:
  2037. // CHECK:STDOUT: !definition:
  2038. // CHECK:STDOUT: %require_complete.loc8_55: <witness> = require_complete_type %impl.elem0.loc8_51.2 [symbolic = %require_complete.loc8_55 (constants.%require_complete.58f)]
  2039. // CHECK:STDOUT: %require_complete.loc8_42: <witness> = require_complete_type %T.as_type.loc8_44.2 [symbolic = %require_complete.loc8_42 (constants.%require_complete.2a5)]
  2040. // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc8_44.2, (%J.lookup_impl_witness) [symbolic = %J.facet (constants.%J.facet.5210a7.2)]
  2041. // CHECK:STDOUT: %.loc9_11: type = fn_type_with_self_type constants.%G.type, %J.facet [symbolic = %.loc9_11 (constants.%.442)]
  2042. // CHECK:STDOUT: %impl.elem1.loc9_11.2: @GenericCallInterfaceQualified.%.loc9_11 (%.442) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2043. // CHECK:STDOUT: %specific_impl_fn.loc9_11.2: <specific function> = specific_impl_function %impl.elem1.loc9_11.2, @G(%J.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2044. // CHECK:STDOUT:
  2045. // CHECK:STDOUT: fn(%t.param: @GenericCallInterfaceQualified.%T.as_type.loc8_44.2 (%T.as_type), %u.param: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2)) -> @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2) {
  2046. // CHECK:STDOUT: !entry:
  2047. // CHECK:STDOUT: %t.ref: @GenericCallInterfaceQualified.%T.as_type.loc8_44.2 (%T.as_type) = name_ref t, %t
  2048. // CHECK:STDOUT: %J.ref.loc9: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2049. // CHECK:STDOUT: %G.ref: %J.assoc_type = name_ref G, @J.%assoc1 [concrete = constants.%assoc1]
  2050. // CHECK:STDOUT: %impl.elem1.loc9_11.1: @GenericCallInterfaceQualified.%.loc9_11 (%.442) = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2051. // CHECK:STDOUT: %bound_method.loc9_11: <bound method> = bound_method %t.ref, %impl.elem1.loc9_11.1
  2052. // CHECK:STDOUT: %u.ref: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2) = name_ref u, %u
  2053. // CHECK:STDOUT: %specific_impl_fn.loc9_11.1: <specific function> = specific_impl_function %impl.elem1.loc9_11.1, @G(constants.%J.facet.5210a7.2) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn)]
  2054. // CHECK:STDOUT: %bound_method.loc9_19: <bound method> = bound_method %t.ref, %specific_impl_fn.loc9_11.1
  2055. // CHECK:STDOUT: %.loc9_19: init @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2) = call %bound_method.loc9_19(%t.ref, %u.ref)
  2056. // CHECK:STDOUT: %.loc9_20.1: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2) = value_of_initializer %.loc9_19
  2057. // CHECK:STDOUT: %.loc9_20.2: @GenericCallInterfaceQualified.%impl.elem0.loc8_51.2 (%impl.elem0.11fef0.2) = converted %.loc9_19, %.loc9_20.1
  2058. // CHECK:STDOUT: return %.loc9_20.2
  2059. // CHECK:STDOUT: }
  2060. // CHECK:STDOUT: }
  2061. // CHECK:STDOUT:
  2062. // CHECK:STDOUT: specific @U(constants.%Self) {}
  2063. // CHECK:STDOUT:
  2064. // CHECK:STDOUT: specific @U(constants.%J.facet.5210a7.1) {}
  2065. // CHECK:STDOUT:
  2066. // CHECK:STDOUT: specific @G(constants.%Self) {
  2067. // CHECK:STDOUT: %Self => constants.%Self
  2068. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type
  2069. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.4ca604.1
  2070. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.1
  2071. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.11fef0.1
  2072. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.b984e7.1
  2073. // CHECK:STDOUT: }
  2074. // CHECK:STDOUT:
  2075. // CHECK:STDOUT: specific @U(constants.%J.facet.5210a7.2) {}
  2076. // CHECK:STDOUT:
  2077. // CHECK:STDOUT: specific @GenericCallInterfaceQualified(constants.%T) {
  2078. // CHECK:STDOUT: %T.loc8_34.2 => constants.%T
  2079. // CHECK:STDOUT: %T.as_type.loc8_44.2 => constants.%T.as_type
  2080. // CHECK:STDOUT: %pattern_type.loc8_41 => constants.%pattern_type.4ca604.2
  2081. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.2
  2082. // CHECK:STDOUT: %impl.elem0.loc8_51.2 => constants.%impl.elem0.11fef0.2
  2083. // CHECK:STDOUT: %pattern_type.loc8_47 => constants.%pattern_type.b984e7.2
  2084. // CHECK:STDOUT: }
  2085. // CHECK:STDOUT:
  2086. // CHECK:STDOUT: specific @G(constants.%J.facet.5210a7.2) {
  2087. // CHECK:STDOUT: %Self => constants.%J.facet.5210a7.2
  2088. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T.as_type
  2089. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.4ca604.2
  2090. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.2
  2091. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.11fef0.2
  2092. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.b984e7.2
  2093. // CHECK:STDOUT: }
  2094. // CHECK:STDOUT:
  2095. // CHECK:STDOUT: --- use_where.carbon
  2096. // CHECK:STDOUT:
  2097. // CHECK:STDOUT: constants {
  2098. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2099. // CHECK:STDOUT: %Self.ccd: %J.type = bind_symbolic_name Self, 0 [symbolic]
  2100. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2101. // CHECK:STDOUT: %assoc0.411: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  2102. // CHECK:STDOUT: %Self.as_type.3df: type = facet_access_type %Self.ccd [symbolic]
  2103. // CHECK:STDOUT: %J.lookup_impl_witness.646: <witness> = lookup_impl_witness %Self.ccd, @J [symbolic]
  2104. // CHECK:STDOUT: %J.facet.521: %J.type = facet_value %Self.as_type.3df, (%J.lookup_impl_witness.646) [symbolic]
  2105. // CHECK:STDOUT: %impl.elem0.11f: type = impl_witness_access %J.lookup_impl_witness.646, element0 [symbolic]
  2106. // CHECK:STDOUT: %pattern_type.b98: type = pattern_type %impl.elem0.11f [symbolic]
  2107. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  2108. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  2109. // CHECK:STDOUT: %assoc1.572: %J.assoc_type = assoc_entity element1, @J.%F.decl [concrete]
  2110. // CHECK:STDOUT: %.Self.968: %J.type = bind_symbolic_name .Self [symbolic_self]
  2111. // CHECK:STDOUT: %.Self.as_type.78d: type = facet_access_type %.Self.968 [symbolic_self]
  2112. // CHECK:STDOUT: %J.lookup_impl_witness.25c: <witness> = lookup_impl_witness %.Self.968, @J [symbolic_self]
  2113. // CHECK:STDOUT: %J.facet.330: %J.type = facet_value %.Self.as_type.78d, (%J.lookup_impl_witness.25c) [symbolic_self]
  2114. // CHECK:STDOUT: %impl.elem0.83f: type = impl_witness_access %J.lookup_impl_witness.25c, element0 [symbolic_self]
  2115. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  2116. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  2117. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  2118. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  2119. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.83f = %i32> [concrete]
  2120. // CHECK:STDOUT: %T.c74: %J_where.type = bind_symbolic_name T, 0 [symbolic]
  2121. // CHECK:STDOUT: %pattern_type.a22: type = pattern_type %J_where.type [concrete]
  2122. // CHECK:STDOUT: %T.as_type.f20: type = facet_access_type %T.c74 [symbolic]
  2123. // CHECK:STDOUT: %pattern_type.b32: type = pattern_type %T.as_type.f20 [symbolic]
  2124. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  2125. // CHECK:STDOUT: %GenericCallFI32.type: type = fn_type @GenericCallFI32 [concrete]
  2126. // CHECK:STDOUT: %GenericCallFI32: %GenericCallFI32.type = struct_value () [concrete]
  2127. // CHECK:STDOUT: %require_complete.5de: <witness> = require_complete_type %T.as_type.f20 [symbolic]
  2128. // CHECK:STDOUT: %J.lookup_impl_witness.bee: <witness> = lookup_impl_witness %T.c74, @J [symbolic]
  2129. // CHECK:STDOUT: %J.facet.487: %J.type = facet_value %T.as_type.f20, (%J.lookup_impl_witness.bee) [symbolic]
  2130. // CHECK:STDOUT: %.9b0: type = fn_type_with_self_type %F.type, %J.facet.487 [symbolic]
  2131. // CHECK:STDOUT: %impl.elem1: %.9b0 = impl_witness_access %J.lookup_impl_witness.bee, element1 [symbolic]
  2132. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  2133. // CHECK:STDOUT: %specific_impl_fn.30b: <specific function> = specific_impl_function %impl.elem1, @F(%J.facet.487) [symbolic]
  2134. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  2135. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  2136. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  2137. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  2138. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  2139. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.3, @impl.4f9(%To.c80) [symbolic]
  2140. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  2141. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  2142. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.4f9(%int_32) [concrete]
  2143. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  2144. // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  2145. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
  2146. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
  2147. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.3(%int_32) [concrete]
  2148. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
  2149. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  2150. // CHECK:STDOUT: }
  2151. // CHECK:STDOUT:
  2152. // CHECK:STDOUT: imports {
  2153. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2154. // CHECK:STDOUT: .Int = %Core.Int
  2155. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  2156. // CHECK:STDOUT: import Core//prelude
  2157. // CHECK:STDOUT: import Core//prelude/...
  2158. // CHECK:STDOUT: }
  2159. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  2160. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  2161. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  2162. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  2163. // CHECK:STDOUT: }
  2164. // CHECK:STDOUT:
  2165. // CHECK:STDOUT: file {
  2166. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2167. // CHECK:STDOUT: .Core = imports.%Core
  2168. // CHECK:STDOUT: .J = %J.decl
  2169. // CHECK:STDOUT: .GenericCallFI32 = %GenericCallFI32.decl
  2170. // CHECK:STDOUT: }
  2171. // CHECK:STDOUT: %Core.import = import Core
  2172. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2173. // CHECK:STDOUT: %GenericCallFI32.decl: %GenericCallFI32.type = fn_decl @GenericCallFI32 [concrete = constants.%GenericCallFI32] {
  2174. // CHECK:STDOUT: %T.patt: %pattern_type.a22 = symbolic_binding_pattern T, 0 [concrete]
  2175. // CHECK:STDOUT: %t.patt: @GenericCallFI32.%pattern_type (%pattern_type.b32) = binding_pattern t [concrete]
  2176. // CHECK:STDOUT: %t.param_patt: @GenericCallFI32.%pattern_type (%pattern_type.b32) = value_param_pattern %t.patt, call_param0 [concrete]
  2177. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  2178. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  2179. // CHECK:STDOUT: } {
  2180. // CHECK:STDOUT: %int_32.loc8_51: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  2181. // CHECK:STDOUT: %i32.loc8_51: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  2182. // CHECK:STDOUT: %.loc8_26.1: type = splice_block %.loc8_26.2 [concrete = constants.%J_where.type] {
  2183. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2184. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.968]
  2185. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.968]
  2186. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  2187. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type.78d]
  2188. // CHECK:STDOUT: %.loc8_32: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type.78d]
  2189. // CHECK:STDOUT: %impl.elem0.loc8: type = impl_witness_access constants.%J.lookup_impl_witness.25c, element0 [symbolic_self = constants.%impl.elem0.83f]
  2190. // CHECK:STDOUT: %int_32.loc8_37: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  2191. // CHECK:STDOUT: %i32.loc8_37: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  2192. // CHECK:STDOUT: %.loc8_26.2: type = where_expr %.Self [concrete = constants.%J_where.type] {
  2193. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %i32.loc8_37
  2194. // CHECK:STDOUT: }
  2195. // CHECK:STDOUT: }
  2196. // CHECK:STDOUT: %T.loc8_20.1: %J_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_20.2 (constants.%T.c74)]
  2197. // CHECK:STDOUT: %t.param: @GenericCallFI32.%T.as_type.loc8_45.2 (%T.as_type.f20) = value_param call_param0
  2198. // CHECK:STDOUT: %.loc8_45.1: type = splice_block %.loc8_45.2 [symbolic = %T.as_type.loc8_45.2 (constants.%T.as_type.f20)] {
  2199. // CHECK:STDOUT: %T.ref: %J_where.type = name_ref T, %T.loc8_20.1 [symbolic = %T.loc8_20.2 (constants.%T.c74)]
  2200. // CHECK:STDOUT: %T.as_type.loc8_45.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc8_45.2 (constants.%T.as_type.f20)]
  2201. // CHECK:STDOUT: %.loc8_45.2: type = converted %T.ref, %T.as_type.loc8_45.1 [symbolic = %T.as_type.loc8_45.2 (constants.%T.as_type.f20)]
  2202. // CHECK:STDOUT: }
  2203. // CHECK:STDOUT: %t: @GenericCallFI32.%T.as_type.loc8_45.2 (%T.as_type.f20) = bind_name t, %t.param
  2204. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  2205. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  2206. // CHECK:STDOUT: }
  2207. // CHECK:STDOUT: }
  2208. // CHECK:STDOUT:
  2209. // CHECK:STDOUT: interface @J {
  2210. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.ccd]
  2211. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  2212. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.411]
  2213. // CHECK:STDOUT: }
  2214. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  2215. // CHECK:STDOUT: %u.patt: @F.%pattern_type (%pattern_type.b98) = binding_pattern u [concrete]
  2216. // CHECK:STDOUT: %u.param_patt: @F.%pattern_type (%pattern_type.b98) = value_param_pattern %u.patt, call_param0 [concrete]
  2217. // CHECK:STDOUT: %return.patt: @F.%pattern_type (%pattern_type.b98) = return_slot_pattern [concrete]
  2218. // CHECK:STDOUT: %return.param_patt: @F.%pattern_type (%pattern_type.b98) = out_param_pattern %return.patt, call_param1 [concrete]
  2219. // CHECK:STDOUT: } {
  2220. // CHECK:STDOUT: %impl.elem0.loc5_17: type = impl_witness_access constants.%J.lookup_impl_witness.646, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  2221. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  2222. // CHECK:STDOUT: %u.param: @F.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = value_param call_param0
  2223. // CHECK:STDOUT: %.loc5: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)] {
  2224. // CHECK:STDOUT: %impl.elem0.loc5_11.2: type = impl_witness_access constants.%J.lookup_impl_witness.646, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  2225. // CHECK:STDOUT: %U.ref.loc5_11: type = name_ref U, %impl.elem0.loc5_11.2 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  2226. // CHECK:STDOUT: }
  2227. // CHECK:STDOUT: %u: @F.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = bind_name u, %u.param
  2228. // CHECK:STDOUT: %return.param: ref @F.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = out_param call_param1
  2229. // CHECK:STDOUT: %return: ref @F.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = return_slot %return.param
  2230. // CHECK:STDOUT: }
  2231. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1.572]
  2232. // CHECK:STDOUT:
  2233. // CHECK:STDOUT: !members:
  2234. // CHECK:STDOUT: .Self = %Self
  2235. // CHECK:STDOUT: .U = @U.%assoc0
  2236. // CHECK:STDOUT: .F = %assoc1
  2237. // CHECK:STDOUT: witness = (%U, %F.decl)
  2238. // CHECK:STDOUT: }
  2239. // CHECK:STDOUT:
  2240. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  2241. // CHECK:STDOUT: assoc_const U:! type;
  2242. // CHECK:STDOUT: }
  2243. // CHECK:STDOUT:
  2244. // CHECK:STDOUT: generic fn @F(@J.%Self: %J.type) {
  2245. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.ccd)]
  2246. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.646)]
  2247. // 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.11f)]
  2248. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.b98)]
  2249. // CHECK:STDOUT:
  2250. // CHECK:STDOUT: fn(%u.param: @F.%impl.elem0.loc5_11.1 (%impl.elem0.11f)) -> @F.%impl.elem0.loc5_11.1 (%impl.elem0.11f);
  2251. // CHECK:STDOUT: }
  2252. // CHECK:STDOUT:
  2253. // CHECK:STDOUT: generic fn @GenericCallFI32(%T.loc8_20.1: %J_where.type) {
  2254. // CHECK:STDOUT: %T.loc8_20.2: %J_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_20.2 (constants.%T.c74)]
  2255. // CHECK:STDOUT: %T.as_type.loc8_45.2: type = facet_access_type %T.loc8_20.2 [symbolic = %T.as_type.loc8_45.2 (constants.%T.as_type.f20)]
  2256. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc8_45.2 [symbolic = %pattern_type (constants.%pattern_type.b32)]
  2257. // CHECK:STDOUT:
  2258. // CHECK:STDOUT: !definition:
  2259. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc8_45.2 [symbolic = %require_complete (constants.%require_complete.5de)]
  2260. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_20.2, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.bee)]
  2261. // CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc8_45.2, (%J.lookup_impl_witness) [symbolic = %J.facet (constants.%J.facet.487)]
  2262. // CHECK:STDOUT: %.loc9_11.2: type = fn_type_with_self_type constants.%F.type, %J.facet [symbolic = %.loc9_11.2 (constants.%.9b0)]
  2263. // CHECK:STDOUT: %impl.elem1.loc9_11.2: @GenericCallFI32.%.loc9_11.2 (%.9b0) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2264. // CHECK:STDOUT: %specific_impl_fn.loc9_11.2: <specific function> = specific_impl_function %impl.elem1.loc9_11.2, @F(%J.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.30b)]
  2265. // CHECK:STDOUT:
  2266. // CHECK:STDOUT: fn(%t.param: @GenericCallFI32.%T.as_type.loc8_45.2 (%T.as_type.f20)) -> %i32 {
  2267. // CHECK:STDOUT: !entry:
  2268. // CHECK:STDOUT: %t.ref: @GenericCallFI32.%T.as_type.loc8_45.2 (%T.as_type.f20) = name_ref t, %t
  2269. // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572]
  2270. // CHECK:STDOUT: %T.as_type.loc9: type = facet_access_type constants.%T.c74 [symbolic = %T.as_type.loc8_45.2 (constants.%T.as_type.f20)]
  2271. // CHECK:STDOUT: %.loc9_11.1: type = converted constants.%T.c74, %T.as_type.loc9 [symbolic = %T.as_type.loc8_45.2 (constants.%T.as_type.f20)]
  2272. // CHECK:STDOUT: %impl.elem1.loc9_11.1: @GenericCallFI32.%.loc9_11.2 (%.9b0) = impl_witness_access constants.%J.lookup_impl_witness.bee, element1 [symbolic = %impl.elem1.loc9_11.2 (constants.%impl.elem1)]
  2273. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  2274. // CHECK:STDOUT: %specific_impl_fn.loc9_11.1: <specific function> = specific_impl_function %impl.elem1.loc9_11.1, @F(constants.%J.facet.487) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.30b)]
  2275. // CHECK:STDOUT: %impl.elem0.loc9: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  2276. // CHECK:STDOUT: %bound_method.loc9_14.1: <bound method> = bound_method %int_2, %impl.elem0.loc9 [concrete = constants.%Convert.bound]
  2277. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc9, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  2278. // CHECK:STDOUT: %bound_method.loc9_14.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
  2279. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc9_14.2(%int_2) [concrete = constants.%int_2.ef8]
  2280. // CHECK:STDOUT: %.loc9_14.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8]
  2281. // CHECK:STDOUT: %.loc9_14.2: %i32 = converted %int_2, %.loc9_14.1 [concrete = constants.%int_2.ef8]
  2282. // CHECK:STDOUT: %.loc9_15: init %i32 = call %specific_impl_fn.loc9_11.1(%.loc9_14.2)
  2283. // CHECK:STDOUT: %.loc9_16.1: %i32 = value_of_initializer %.loc9_15
  2284. // CHECK:STDOUT: %.loc9_16.2: %i32 = converted %.loc9_15, %.loc9_16.1
  2285. // CHECK:STDOUT: return %.loc9_16.2
  2286. // CHECK:STDOUT: }
  2287. // CHECK:STDOUT: }
  2288. // CHECK:STDOUT:
  2289. // CHECK:STDOUT: specific @U(constants.%Self.ccd) {}
  2290. // CHECK:STDOUT:
  2291. // CHECK:STDOUT: specific @U(constants.%J.facet.521) {}
  2292. // CHECK:STDOUT:
  2293. // CHECK:STDOUT: specific @F(constants.%Self.ccd) {
  2294. // CHECK:STDOUT: %Self => constants.%Self.ccd
  2295. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.646
  2296. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.11f
  2297. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b98
  2298. // CHECK:STDOUT: }
  2299. // CHECK:STDOUT:
  2300. // CHECK:STDOUT: specific @U(constants.%J.facet.330) {}
  2301. // CHECK:STDOUT:
  2302. // CHECK:STDOUT: specific @GenericCallFI32(constants.%T.c74) {
  2303. // CHECK:STDOUT: %T.loc8_20.2 => constants.%T.c74
  2304. // CHECK:STDOUT: %T.as_type.loc8_45.2 => constants.%T.as_type.f20
  2305. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b32
  2306. // CHECK:STDOUT: }
  2307. // CHECK:STDOUT:
  2308. // CHECK:STDOUT: specific @F(constants.%J.facet.487) {
  2309. // CHECK:STDOUT: %Self => constants.%J.facet.487
  2310. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.bee
  2311. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  2312. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  2313. // CHECK:STDOUT: }
  2314. // CHECK:STDOUT:
  2315. // CHECK:STDOUT: --- fail_todo_use_associated_constant_in_impl.carbon
  2316. // CHECK:STDOUT:
  2317. // CHECK:STDOUT: constants {
  2318. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  2319. // CHECK:STDOUT: %Self.ccd: %J.type = bind_symbolic_name Self, 0 [symbolic]
  2320. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  2321. // CHECK:STDOUT: %assoc0.411: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  2322. // CHECK:STDOUT: %Self.as_type.3df: type = facet_access_type %Self.ccd [symbolic]
  2323. // CHECK:STDOUT: %J.lookup_impl_witness.646: <witness> = lookup_impl_witness %Self.ccd, @J [symbolic]
  2324. // CHECK:STDOUT: %J.facet.521: %J.type = facet_value %Self.as_type.3df, (%J.lookup_impl_witness.646) [symbolic]
  2325. // CHECK:STDOUT: %impl.elem0.11f: type = impl_witness_access %J.lookup_impl_witness.646, element0 [symbolic]
  2326. // CHECK:STDOUT: %pattern_type.b98: type = pattern_type %impl.elem0.11f [symbolic]
  2327. // CHECK:STDOUT: %F.type.c14: type = fn_type @F.1 [concrete]
  2328. // CHECK:STDOUT: %F.b71: %F.type.c14 = struct_value () [concrete]
  2329. // CHECK:STDOUT: %assoc1.572: %J.assoc_type = assoc_entity element1, @J.%F.decl [concrete]
  2330. // CHECK:STDOUT: %E: type = class_type @E [concrete]
  2331. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self]
  2332. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  2333. // CHECK:STDOUT: %J.lookup_impl_witness.25c: <witness> = lookup_impl_witness %.Self, @J [symbolic_self]
  2334. // CHECK:STDOUT: %J.facet.330: %J.type = facet_value %.Self.as_type, (%J.lookup_impl_witness.25c) [symbolic_self]
  2335. // CHECK:STDOUT: %impl.elem0.83f: type = impl_witness_access %J.lookup_impl_witness.25c, element0 [symbolic_self]
  2336. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  2337. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  2338. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  2339. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  2340. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.83f = %i32> [concrete]
  2341. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @E.%J.impl_witness_table [concrete]
  2342. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  2343. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  2344. // CHECK:STDOUT: %F.type.b842fd.1: type = fn_type @F.2 [concrete]
  2345. // CHECK:STDOUT: %F.b07d12.1: %F.type.b842fd.1 = struct_value () [concrete]
  2346. // CHECK:STDOUT: %J.facet.f43: %J.type = facet_value %E, (%J.impl_witness) [concrete]
  2347. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  2348. // CHECK:STDOUT: %F.type.b842fd.2: type = fn_type @F.3 [concrete]
  2349. // CHECK:STDOUT: %F.b07d12.2: %F.type.b842fd.2 = struct_value () [concrete]
  2350. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2351. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  2352. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  2353. // CHECK:STDOUT: %AddWith.type.e05: type = generic_interface_type @AddWith [concrete]
  2354. // CHECK:STDOUT: %AddWith.generic: %AddWith.type.e05 = struct_value () [concrete]
  2355. // CHECK:STDOUT: }
  2356. // CHECK:STDOUT:
  2357. // CHECK:STDOUT: imports {
  2358. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2359. // CHECK:STDOUT: .Int = %Core.Int
  2360. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  2361. // CHECK:STDOUT: .AddWith = %Core.AddWith
  2362. // CHECK:STDOUT: import Core//prelude
  2363. // CHECK:STDOUT: import Core//prelude/...
  2364. // CHECK:STDOUT: }
  2365. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  2366. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  2367. // CHECK:STDOUT: %Core.AddWith: %AddWith.type.e05 = import_ref Core//prelude/operators/arithmetic, AddWith, loaded [concrete = constants.%AddWith.generic]
  2368. // CHECK:STDOUT: }
  2369. // CHECK:STDOUT:
  2370. // CHECK:STDOUT: file {
  2371. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2372. // CHECK:STDOUT: .Core = imports.%Core
  2373. // CHECK:STDOUT: .J = %J.decl
  2374. // CHECK:STDOUT: .E = %E.decl
  2375. // CHECK:STDOUT: }
  2376. // CHECK:STDOUT: %Core.import = import Core
  2377. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  2378. // CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
  2379. // CHECK:STDOUT: }
  2380. // CHECK:STDOUT:
  2381. // CHECK:STDOUT: interface @J {
  2382. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.ccd]
  2383. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  2384. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0.411]
  2385. // CHECK:STDOUT: }
  2386. // CHECK:STDOUT: %F.decl: %F.type.c14 = fn_decl @F.1 [concrete = constants.%F.b71] {
  2387. // CHECK:STDOUT: %u.patt: @F.1.%pattern_type (%pattern_type.b98) = binding_pattern u [concrete]
  2388. // CHECK:STDOUT: %u.param_patt: @F.1.%pattern_type (%pattern_type.b98) = value_param_pattern %u.patt, call_param0 [concrete]
  2389. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.b98) = return_slot_pattern [concrete]
  2390. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.b98) = out_param_pattern %return.patt, call_param1 [concrete]
  2391. // CHECK:STDOUT: } {
  2392. // CHECK:STDOUT: %impl.elem0.loc5_17: type = impl_witness_access constants.%J.lookup_impl_witness.646, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  2393. // CHECK:STDOUT: %U.ref.loc5_17: type = name_ref U, %impl.elem0.loc5_17 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  2394. // CHECK:STDOUT: %u.param: @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = value_param call_param0
  2395. // CHECK:STDOUT: %.loc5: type = splice_block %U.ref.loc5_11 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)] {
  2396. // CHECK:STDOUT: %impl.elem0.loc5_11.2: type = impl_witness_access constants.%J.lookup_impl_witness.646, element0 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  2397. // CHECK:STDOUT: %U.ref.loc5_11: type = name_ref U, %impl.elem0.loc5_11.2 [symbolic = %impl.elem0.loc5_11.1 (constants.%impl.elem0.11f)]
  2398. // CHECK:STDOUT: }
  2399. // CHECK:STDOUT: %u: @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = bind_name u, %u.param
  2400. // CHECK:STDOUT: %return.param: ref @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = out_param call_param1
  2401. // CHECK:STDOUT: %return: ref @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = return_slot %return.param
  2402. // CHECK:STDOUT: }
  2403. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1.572]
  2404. // CHECK:STDOUT:
  2405. // CHECK:STDOUT: !members:
  2406. // CHECK:STDOUT: .Self = %Self
  2407. // CHECK:STDOUT: .U = @U.%assoc0
  2408. // CHECK:STDOUT: .F = %assoc1
  2409. // CHECK:STDOUT: witness = (%U, %F.decl)
  2410. // CHECK:STDOUT: }
  2411. // CHECK:STDOUT:
  2412. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  2413. // CHECK:STDOUT: assoc_const U:! type;
  2414. // CHECK:STDOUT: }
  2415. // CHECK:STDOUT:
  2416. // CHECK:STDOUT: impl @impl.939: %Self.ref as %.loc9_20 {
  2417. // CHECK:STDOUT: %F.decl.loc24_21.1: %F.type.b842fd.1 = fn_decl @F.2 [concrete = constants.%F.b07d12.1] {
  2418. // CHECK:STDOUT: %u.patt: <error> = binding_pattern u [concrete]
  2419. // CHECK:STDOUT: %u.param_patt: <error> = value_param_pattern %u.patt, call_param0 [concrete]
  2420. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern [concrete]
  2421. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, call_param1 [concrete]
  2422. // CHECK:STDOUT: } {
  2423. // CHECK:STDOUT: %U.ref.loc24_19: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  2424. // CHECK:STDOUT: %.loc24_19: type = converted %U.ref.loc24_19, <error> [concrete = <error>]
  2425. // CHECK:STDOUT: %u.param: <error> = value_param call_param0
  2426. // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
  2427. // CHECK:STDOUT: %U.ref.loc24_13: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  2428. // CHECK:STDOUT: %.loc24_13: type = converted %U.ref.loc24_13, <error> [concrete = <error>]
  2429. // CHECK:STDOUT: }
  2430. // CHECK:STDOUT: %u: <error> = bind_name u, %u.param [concrete = <error>]
  2431. // CHECK:STDOUT: %return.param: ref <error> = out_param call_param1
  2432. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  2433. // CHECK:STDOUT: }
  2434. // CHECK:STDOUT: %F.decl.loc24_21.2: %F.type.b842fd.2 = fn_decl @F.3 [concrete = constants.%F.b07d12.2] {
  2435. // CHECK:STDOUT: %u.patt: %pattern_type.7ce = binding_pattern u [concrete]
  2436. // CHECK:STDOUT: %u.param_patt: %pattern_type.7ce = value_param_pattern %u.patt, call_param0 [concrete]
  2437. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  2438. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  2439. // CHECK:STDOUT: } {
  2440. // CHECK:STDOUT: %u.param: %i32 = value_param call_param0
  2441. // CHECK:STDOUT: %u: %i32 = bind_name u, %u.param
  2442. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  2443. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  2444. // CHECK:STDOUT: }
  2445. // CHECK:STDOUT:
  2446. // CHECK:STDOUT: !members:
  2447. // CHECK:STDOUT: .U = <poisoned>
  2448. // CHECK:STDOUT: .F = %F.decl.loc24_21.1
  2449. // CHECK:STDOUT: witness = @E.%J.impl_witness
  2450. // CHECK:STDOUT: }
  2451. // CHECK:STDOUT:
  2452. // CHECK:STDOUT: class @E {
  2453. // CHECK:STDOUT: impl_decl @impl.939 [concrete] {} {
  2454. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
  2455. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  2456. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  2457. // CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  2458. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411]
  2459. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  2460. // CHECK:STDOUT: %.loc9_26: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  2461. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness.25c, element0 [symbolic_self = constants.%impl.elem0.83f]
  2462. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  2463. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  2464. // CHECK:STDOUT: %.loc9_20: type = where_expr %.Self [concrete = constants.%J_where.type] {
  2465. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  2466. // CHECK:STDOUT: }
  2467. // CHECK:STDOUT: }
  2468. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @impl.939.%F.decl.loc24_21.2), @impl.939 [concrete]
  2469. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  2470. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
  2471. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  2472. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  2473. // CHECK:STDOUT: complete_type_witness = %complete_type
  2474. // CHECK:STDOUT:
  2475. // CHECK:STDOUT: !members:
  2476. // CHECK:STDOUT: .Self = constants.%E
  2477. // CHECK:STDOUT: .J = <poisoned>
  2478. // CHECK:STDOUT: .U = <poisoned>
  2479. // CHECK:STDOUT: extend @impl.939.%.loc9_20
  2480. // CHECK:STDOUT: }
  2481. // CHECK:STDOUT:
  2482. // CHECK:STDOUT: generic fn @F.1(@J.%Self: %J.type) {
  2483. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.ccd)]
  2484. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.646)]
  2485. // 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.11f)]
  2486. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc5_11.1 [symbolic = %pattern_type (constants.%pattern_type.b98)]
  2487. // CHECK:STDOUT:
  2488. // CHECK:STDOUT: fn(%u.param: @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f)) -> @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f);
  2489. // CHECK:STDOUT: }
  2490. // CHECK:STDOUT:
  2491. // CHECK:STDOUT: fn @F.2(%u.param: <error>) -> <error> {
  2492. // CHECK:STDOUT: !entry:
  2493. // CHECK:STDOUT: %u.ref: <error> = name_ref u, %u [concrete = <error>]
  2494. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  2495. // CHECK:STDOUT: %impl.elem1: <error> = impl_witness_access <error>, element1 [concrete = <error>]
  2496. // CHECK:STDOUT: return <error>
  2497. // CHECK:STDOUT: }
  2498. // CHECK:STDOUT:
  2499. // CHECK:STDOUT: fn @F.3(%u.param: %i32) -> %i32 [thunk @impl.939.%F.decl.loc24_21.1] {
  2500. // CHECK:STDOUT: !entry:
  2501. // CHECK:STDOUT: %F.ref: %F.type.b842fd.1 = name_ref F, @impl.939.%F.decl.loc24_21.1 [concrete = constants.%F.b07d12.1]
  2502. // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u.param
  2503. // CHECK:STDOUT: %return.ref: ref %i32 = name_ref <return slot>, %return.param
  2504. // CHECK:STDOUT: %F.call: init <error> = call %F.ref(<error>)
  2505. // CHECK:STDOUT: return <error>
  2506. // CHECK:STDOUT: }
  2507. // CHECK:STDOUT:
  2508. // CHECK:STDOUT: specific @U(constants.%Self.ccd) {}
  2509. // CHECK:STDOUT:
  2510. // CHECK:STDOUT: specific @U(constants.%J.facet.521) {}
  2511. // CHECK:STDOUT:
  2512. // CHECK:STDOUT: specific @F.1(constants.%Self.ccd) {
  2513. // CHECK:STDOUT: %Self => constants.%Self.ccd
  2514. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.646
  2515. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%impl.elem0.11f
  2516. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b98
  2517. // CHECK:STDOUT: }
  2518. // CHECK:STDOUT:
  2519. // CHECK:STDOUT: specific @U(constants.%J.facet.330) {}
  2520. // CHECK:STDOUT:
  2521. // CHECK:STDOUT: specific @F.1(constants.%J.facet.f43) {
  2522. // CHECK:STDOUT: %Self => constants.%J.facet.f43
  2523. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness
  2524. // CHECK:STDOUT: %impl.elem0.loc5_11.1 => constants.%i32
  2525. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7ce
  2526. // CHECK:STDOUT: }
  2527. // CHECK:STDOUT:
  2528. // CHECK:STDOUT: --- fail_todo_self_period_associated_type.carbon
  2529. // CHECK:STDOUT:
  2530. // CHECK:STDOUT: constants {
  2531. // CHECK:STDOUT: %J2.type: type = facet_type <@J2> [concrete]
  2532. // CHECK:STDOUT: %Self: %J2.type = bind_symbolic_name Self, 0 [symbolic]
  2533. // CHECK:STDOUT: %J2.assoc_type: type = assoc_entity_type @J2 [concrete]
  2534. // CHECK:STDOUT: %assoc0: %J2.assoc_type = assoc_entity element0, @J2.%U2 [concrete]
  2535. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  2536. // CHECK:STDOUT: %pattern_type.969: type = pattern_type %Self.as_type [symbolic]
  2537. // CHECK:STDOUT: %F.type.c41: type = fn_type @F.1 [concrete]
  2538. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2539. // CHECK:STDOUT: %F.932: %F.type.c41 = struct_value () [concrete]
  2540. // CHECK:STDOUT: %assoc1: %J2.assoc_type = assoc_entity element1, @J2.%F.decl [concrete]
  2541. // CHECK:STDOUT: %.Self: %J2.type = bind_symbolic_name .Self [symbolic_self]
  2542. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  2543. // CHECK:STDOUT: %J2.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @J2 [symbolic_self]
  2544. // CHECK:STDOUT: %J2.facet.e30: %J2.type = facet_value %.Self.as_type, (%J2.lookup_impl_witness) [symbolic_self]
  2545. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J2.lookup_impl_witness, element0 [symbolic_self]
  2546. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2547. // CHECK:STDOUT: %J2_where.type.9e1: type = facet_type <@J2 where %impl.elem0 = %empty_struct_type> [concrete]
  2548. // CHECK:STDOUT: %J2.impl_witness.6a9: <witness> = impl_witness file.%J2.impl_witness_table.loc22 [concrete]
  2549. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  2550. // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
  2551. // CHECK:STDOUT: %F.type.f405c5.1: type = fn_type @F.2 [concrete]
  2552. // CHECK:STDOUT: %F.214a71.1: %F.type.f405c5.1 = struct_value () [concrete]
  2553. // CHECK:STDOUT: %J2.facet.86f: %J2.type = facet_value %empty_tuple.type, (%J2.impl_witness.6a9) [concrete]
  2554. // CHECK:STDOUT: %F.type.f405c5.2: type = fn_type @F.3 [concrete]
  2555. // CHECK:STDOUT: %F.214a71.2: %F.type.f405c5.2 = struct_value () [concrete]
  2556. // CHECK:STDOUT: %C2: type = class_type @C2 [concrete]
  2557. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2558. // CHECK:STDOUT: %J2_where.type.df9: type = facet_type <@J2 where %impl.elem0 = %C2> [concrete]
  2559. // CHECK:STDOUT: %J2.impl_witness.267: <witness> = impl_witness file.%J2.impl_witness_table.loc38 [concrete]
  2560. // CHECK:STDOUT: %pattern_type.838: type = pattern_type %C2 [concrete]
  2561. // CHECK:STDOUT: %F.type.05d6a0.1: type = fn_type @F.4 [concrete]
  2562. // CHECK:STDOUT: %F.bfa759.1: %F.type.05d6a0.1 = struct_value () [concrete]
  2563. // CHECK:STDOUT: %J2.facet.c3f: %J2.type = facet_value %C2, (%J2.impl_witness.267) [concrete]
  2564. // CHECK:STDOUT: %F.type.05d6a0.2: type = fn_type @F.5 [concrete]
  2565. // CHECK:STDOUT: %F.bfa759.2: %F.type.05d6a0.2 = struct_value () [concrete]
  2566. // CHECK:STDOUT: }
  2567. // CHECK:STDOUT:
  2568. // CHECK:STDOUT: imports {
  2569. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2570. // CHECK:STDOUT: import Core//prelude
  2571. // CHECK:STDOUT: import Core//prelude/...
  2572. // CHECK:STDOUT: }
  2573. // CHECK:STDOUT: }
  2574. // CHECK:STDOUT:
  2575. // CHECK:STDOUT: file {
  2576. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2577. // CHECK:STDOUT: .Core = imports.%Core
  2578. // CHECK:STDOUT: .J2 = %J2.decl
  2579. // CHECK:STDOUT: .C2 = %C2.decl
  2580. // CHECK:STDOUT: }
  2581. // CHECK:STDOUT: %Core.import = import Core
  2582. // CHECK:STDOUT: %J2.decl: type = interface_decl @J2 [concrete = constants.%J2.type] {} {}
  2583. // CHECK:STDOUT: impl_decl @impl.4e9 [concrete] {} {
  2584. // CHECK:STDOUT: %.loc22_7.1: %empty_tuple.type = tuple_literal ()
  2585. // CHECK:STDOUT: %.loc22_7.2: type = converted %.loc22_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  2586. // CHECK:STDOUT: %J2.ref: type = name_ref J2, file.%J2.decl [concrete = constants.%J2.type]
  2587. // CHECK:STDOUT: %.Self: %J2.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  2588. // CHECK:STDOUT: %.Self.ref: %J2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  2589. // CHECK:STDOUT: %U2.ref: %J2.assoc_type = name_ref U2, @U2.%assoc0 [concrete = constants.%assoc0]
  2590. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  2591. // CHECK:STDOUT: %.loc22_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  2592. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  2593. // CHECK:STDOUT: %.loc22_28.1: %empty_struct_type = struct_literal ()
  2594. // CHECK:STDOUT: %.loc22_28.2: type = converted %.loc22_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  2595. // CHECK:STDOUT: %.loc22_15: type = where_expr %.Self [concrete = constants.%J2_where.type.9e1] {
  2596. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc22_28.2
  2597. // CHECK:STDOUT: }
  2598. // CHECK:STDOUT: }
  2599. // CHECK:STDOUT: %J2.impl_witness_table.loc22 = impl_witness_table (%impl_witness_assoc_constant.loc22, @impl.4e9.%F.decl.loc30_33.2), @impl.4e9 [concrete]
  2600. // CHECK:STDOUT: %J2.impl_witness.loc22: <witness> = impl_witness %J2.impl_witness_table.loc22 [concrete = constants.%J2.impl_witness.6a9]
  2601. // CHECK:STDOUT: %impl_witness_assoc_constant.loc22: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  2602. // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [concrete = constants.%C2] {} {}
  2603. // CHECK:STDOUT: impl_decl @impl.8b3 [concrete] {} {
  2604. // CHECK:STDOUT: %C2.ref.loc38_6: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  2605. // CHECK:STDOUT: %J2.ref: type = name_ref J2, file.%J2.decl [concrete = constants.%J2.type]
  2606. // CHECK:STDOUT: %.Self: %J2.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  2607. // CHECK:STDOUT: %.Self.ref: %J2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  2608. // CHECK:STDOUT: %U2.ref: %J2.assoc_type = name_ref U2, @U2.%assoc0 [concrete = constants.%assoc0]
  2609. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  2610. // CHECK:STDOUT: %.loc38_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  2611. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  2612. // CHECK:STDOUT: %C2.ref.loc38_27: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  2613. // CHECK:STDOUT: %.loc38_15: type = where_expr %.Self [concrete = constants.%J2_where.type.df9] {
  2614. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C2.ref.loc38_27
  2615. // CHECK:STDOUT: }
  2616. // CHECK:STDOUT: }
  2617. // CHECK:STDOUT: %J2.impl_witness_table.loc38 = impl_witness_table (%impl_witness_assoc_constant.loc38, @impl.8b3.%F.decl.loc39_33.2), @impl.8b3 [concrete]
  2618. // CHECK:STDOUT: %J2.impl_witness.loc38: <witness> = impl_witness %J2.impl_witness_table.loc38 [concrete = constants.%J2.impl_witness.267]
  2619. // CHECK:STDOUT: %impl_witness_assoc_constant.loc38: type = impl_witness_assoc_constant constants.%C2 [concrete = constants.%C2]
  2620. // CHECK:STDOUT: }
  2621. // CHECK:STDOUT:
  2622. // CHECK:STDOUT: interface @J2 {
  2623. // CHECK:STDOUT: %Self: %J2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  2624. // CHECK:STDOUT: %U2: type = assoc_const_decl @U2 [concrete] {
  2625. // CHECK:STDOUT: %assoc0: %J2.assoc_type = assoc_entity element0, @J2.%U2 [concrete = constants.%assoc0]
  2626. // CHECK:STDOUT: }
  2627. // CHECK:STDOUT: %F.decl: %F.type.c41 = fn_decl @F.1 [concrete = constants.%F.932] {
  2628. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type (%pattern_type.969) = binding_pattern self [concrete]
  2629. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type (%pattern_type.969) = value_param_pattern %self.patt, call_param0 [concrete]
  2630. // CHECK:STDOUT: %z.patt: <error> = binding_pattern z [concrete]
  2631. // CHECK:STDOUT: %z.param_patt: <error> = value_param_pattern %z.patt, call_param1 [concrete]
  2632. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern [concrete]
  2633. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, call_param2 [concrete]
  2634. // CHECK:STDOUT: } {
  2635. // CHECK:STDOUT: %Self.ref.loc19_35: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)]
  2636. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc19_14.1 (%Self.as_type) = value_param call_param0
  2637. // CHECK:STDOUT: %.loc19_14.1: type = splice_block %.loc19_14.2 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)] {
  2638. // CHECK:STDOUT: %Self.ref.loc19_14: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)]
  2639. // CHECK:STDOUT: %Self.as_type.loc19_14.2: type = facet_access_type %Self.ref.loc19_14 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  2640. // CHECK:STDOUT: %.loc19_14.2: type = converted %Self.ref.loc19_14, %Self.as_type.loc19_14.2 [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  2641. // CHECK:STDOUT: }
  2642. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc19_14.1 (%Self.as_type) = bind_name self, %self.param
  2643. // CHECK:STDOUT: %z.param: <error> = value_param call_param1
  2644. // CHECK:STDOUT: %Self.ref.loc19_23: %J2.type = name_ref Self, @J2.%Self [symbolic = %Self (constants.%Self)]
  2645. // CHECK:STDOUT: %z: <error> = bind_name z, %z.param [concrete = <error>]
  2646. // CHECK:STDOUT: %return.param: ref <error> = out_param call_param2
  2647. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  2648. // CHECK:STDOUT: }
  2649. // CHECK:STDOUT: %assoc1: %J2.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1]
  2650. // CHECK:STDOUT:
  2651. // CHECK:STDOUT: !members:
  2652. // CHECK:STDOUT: .Self = %Self
  2653. // CHECK:STDOUT: .U2 = @U2.%assoc0
  2654. // CHECK:STDOUT: .F = %assoc1
  2655. // CHECK:STDOUT: witness = (%U2, %F.decl)
  2656. // CHECK:STDOUT: }
  2657. // CHECK:STDOUT:
  2658. // CHECK:STDOUT: generic assoc_const @U2(@J2.%Self: %J2.type) {
  2659. // CHECK:STDOUT: assoc_const U2:! type;
  2660. // CHECK:STDOUT: }
  2661. // CHECK:STDOUT:
  2662. // CHECK:STDOUT: impl @impl.4e9: %.loc22_7.2 as %.loc22_15 {
  2663. // CHECK:STDOUT: %F.decl.loc30_33.1: %F.type.f405c5.1 = fn_decl @F.2 [concrete = constants.%F.214a71.1] {
  2664. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
  2665. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  2666. // CHECK:STDOUT: %z.patt: %pattern_type.a96 = binding_pattern z [concrete]
  2667. // CHECK:STDOUT: %z.param_patt: %pattern_type.a96 = value_param_pattern %z.patt, call_param1 [concrete]
  2668. // CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern [concrete]
  2669. // CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern %return.patt, call_param2 [concrete]
  2670. // CHECK:STDOUT: } {
  2671. // CHECK:STDOUT: %.loc30_31.1: %empty_struct_type = struct_literal ()
  2672. // CHECK:STDOUT: %.loc30_31.2: type = converted %.loc30_31.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  2673. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  2674. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.4e9.%.loc22_7.2 [concrete = constants.%empty_tuple.type]
  2675. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  2676. // CHECK:STDOUT: %z.param: %empty_struct_type = value_param call_param1
  2677. // CHECK:STDOUT: %.loc30_24.1: type = splice_block %.loc30_24.3 [concrete = constants.%empty_struct_type] {
  2678. // CHECK:STDOUT: %.loc30_24.2: %empty_struct_type = struct_literal ()
  2679. // CHECK:STDOUT: %.loc30_24.3: type = converted %.loc30_24.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  2680. // CHECK:STDOUT: }
  2681. // CHECK:STDOUT: %z: %empty_struct_type = bind_name z, %z.param
  2682. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param2
  2683. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  2684. // CHECK:STDOUT: }
  2685. // CHECK:STDOUT: %F.decl.loc30_33.2: %F.type.f405c5.2 = fn_decl @F.3 [concrete = constants.%F.214a71.2] {
  2686. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
  2687. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  2688. // CHECK:STDOUT: %.param_patt: <error> = value_param_pattern <error>, call_param1 [concrete]
  2689. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern [concrete]
  2690. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, call_param2 [concrete]
  2691. // CHECK:STDOUT: } {
  2692. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  2693. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  2694. // CHECK:STDOUT: %.param: <error> = value_param call_param1
  2695. // CHECK:STDOUT: %return.param: ref <error> = out_param call_param2
  2696. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  2697. // CHECK:STDOUT: }
  2698. // CHECK:STDOUT:
  2699. // CHECK:STDOUT: !members:
  2700. // CHECK:STDOUT: .F = %F.decl.loc30_33.1
  2701. // CHECK:STDOUT: witness = file.%J2.impl_witness.loc22
  2702. // CHECK:STDOUT: }
  2703. // CHECK:STDOUT:
  2704. // CHECK:STDOUT: impl @impl.8b3: %C2.ref.loc38_6 as %.loc38_15 {
  2705. // CHECK:STDOUT: %F.decl.loc39_33.1: %F.type.05d6a0.1 = fn_decl @F.4 [concrete = constants.%F.bfa759.1] {
  2706. // CHECK:STDOUT: %self.patt: %pattern_type.838 = binding_pattern self [concrete]
  2707. // CHECK:STDOUT: %self.param_patt: %pattern_type.838 = value_param_pattern %self.patt, call_param0 [concrete]
  2708. // CHECK:STDOUT: %z.patt: %pattern_type.838 = binding_pattern z [concrete]
  2709. // CHECK:STDOUT: %z.param_patt: %pattern_type.838 = value_param_pattern %z.patt, call_param1 [concrete]
  2710. // CHECK:STDOUT: %return.patt: %pattern_type.838 = return_slot_pattern [concrete]
  2711. // CHECK:STDOUT: %return.param_patt: %pattern_type.838 = out_param_pattern %return.patt, call_param2 [concrete]
  2712. // CHECK:STDOUT: } {
  2713. // CHECK:STDOUT: %C2.ref.loc39_30: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  2714. // CHECK:STDOUT: %self.param: %C2 = value_param call_param0
  2715. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.8b3.%C2.ref.loc38_6 [concrete = constants.%C2]
  2716. // CHECK:STDOUT: %self: %C2 = bind_name self, %self.param
  2717. // CHECK:STDOUT: %z.param: %C2 = value_param call_param1
  2718. // CHECK:STDOUT: %C2.ref.loc39_23: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  2719. // CHECK:STDOUT: %z: %C2 = bind_name z, %z.param
  2720. // CHECK:STDOUT: %return.param: ref %C2 = out_param call_param2
  2721. // CHECK:STDOUT: %return: ref %C2 = return_slot %return.param
  2722. // CHECK:STDOUT: }
  2723. // CHECK:STDOUT: %F.decl.loc39_33.2: %F.type.05d6a0.2 = fn_decl @F.5 [concrete = constants.%F.bfa759.2] {
  2724. // CHECK:STDOUT: %self.patt: %pattern_type.838 = binding_pattern self [concrete]
  2725. // CHECK:STDOUT: %self.param_patt: %pattern_type.838 = value_param_pattern %self.patt, call_param0 [concrete]
  2726. // CHECK:STDOUT: %.param_patt: <error> = value_param_pattern <error>, call_param1 [concrete]
  2727. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern [concrete]
  2728. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, call_param2 [concrete]
  2729. // CHECK:STDOUT: } {
  2730. // CHECK:STDOUT: %self.param: %C2 = value_param call_param0
  2731. // CHECK:STDOUT: %self: %C2 = bind_name self, %self.param
  2732. // CHECK:STDOUT: %.param: <error> = value_param call_param1
  2733. // CHECK:STDOUT: %return.param: ref <error> = out_param call_param2
  2734. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  2735. // CHECK:STDOUT: }
  2736. // CHECK:STDOUT:
  2737. // CHECK:STDOUT: !members:
  2738. // CHECK:STDOUT: .C2 = <poisoned>
  2739. // CHECK:STDOUT: .F = %F.decl.loc39_33.1
  2740. // CHECK:STDOUT: witness = file.%J2.impl_witness.loc38
  2741. // CHECK:STDOUT: }
  2742. // CHECK:STDOUT:
  2743. // CHECK:STDOUT: class @C2 {
  2744. // CHECK:STDOUT: %.loc35_10: %empty_struct_type = struct_literal ()
  2745. // CHECK:STDOUT: %.loc35_11: type = converted %.loc35_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  2746. // CHECK:STDOUT: adapt_decl %.loc35_11 [concrete]
  2747. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2748. // CHECK:STDOUT: complete_type_witness = %complete_type
  2749. // CHECK:STDOUT:
  2750. // CHECK:STDOUT: !members:
  2751. // CHECK:STDOUT: .Self = constants.%C2
  2752. // CHECK:STDOUT: }
  2753. // CHECK:STDOUT:
  2754. // CHECK:STDOUT: generic fn @F.1(@J2.%Self: %J2.type) {
  2755. // CHECK:STDOUT: %Self: %J2.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  2756. // CHECK:STDOUT: %Self.as_type.loc19_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc19_14.1 (constants.%Self.as_type)]
  2757. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc19_14.1 [symbolic = %pattern_type (constants.%pattern_type.969)]
  2758. // CHECK:STDOUT:
  2759. // CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc19_14.1 (%Self.as_type), %z.param: <error>) -> <error>;
  2760. // CHECK:STDOUT: }
  2761. // CHECK:STDOUT:
  2762. // CHECK:STDOUT: fn @F.2(%self.param: %empty_tuple.type, %z.param: %empty_struct_type) -> %empty_struct_type {
  2763. // CHECK:STDOUT: !entry:
  2764. // CHECK:STDOUT: %z.ref: %empty_struct_type = name_ref z, %z
  2765. // CHECK:STDOUT: return %z.ref
  2766. // CHECK:STDOUT: }
  2767. // CHECK:STDOUT:
  2768. // CHECK:STDOUT: fn @F.3(%self.param: %empty_tuple.type, %.param: <error>) -> <error> [thunk @impl.4e9.%F.decl.loc30_33.1] {
  2769. // CHECK:STDOUT: !entry:
  2770. // CHECK:STDOUT: %F.ref: %F.type.f405c5.1 = name_ref F, @impl.4e9.%F.decl.loc30_33.1 [concrete = constants.%F.214a71.1]
  2771. // CHECK:STDOUT: %self.ref: %empty_tuple.type = name_ref self, %self.param
  2772. // CHECK:STDOUT: %.ref: <error> = name_ref <none>, %.param [concrete = <error>]
  2773. // CHECK:STDOUT: %return.ref: ref <error> = name_ref <return slot>, %return.param [concrete = <error>]
  2774. // CHECK:STDOUT: return <error>
  2775. // CHECK:STDOUT: }
  2776. // CHECK:STDOUT:
  2777. // CHECK:STDOUT: fn @F.4(%self.param: %C2, %z.param: %C2) -> %C2 {
  2778. // CHECK:STDOUT: !entry:
  2779. // CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self
  2780. // CHECK:STDOUT: return %self.ref
  2781. // CHECK:STDOUT: }
  2782. // CHECK:STDOUT:
  2783. // CHECK:STDOUT: fn @F.5(%self.param: %C2, %.param: <error>) -> <error> [thunk @impl.8b3.%F.decl.loc39_33.1] {
  2784. // CHECK:STDOUT: !entry:
  2785. // CHECK:STDOUT: %F.ref: %F.type.05d6a0.1 = name_ref F, @impl.8b3.%F.decl.loc39_33.1 [concrete = constants.%F.bfa759.1]
  2786. // CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self.param
  2787. // CHECK:STDOUT: %.ref: <error> = name_ref <none>, %.param [concrete = <error>]
  2788. // CHECK:STDOUT: %return.ref: ref <error> = name_ref <return slot>, %return.param [concrete = <error>]
  2789. // CHECK:STDOUT: %F.bound: <bound method> = bound_method %self.ref, %F.ref
  2790. // CHECK:STDOUT: %F.call: init %C2 = call %F.bound(%self.ref, <error>)
  2791. // CHECK:STDOUT: return <error>
  2792. // CHECK:STDOUT: }
  2793. // CHECK:STDOUT:
  2794. // CHECK:STDOUT: specific @U2(constants.%Self) {}
  2795. // CHECK:STDOUT:
  2796. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  2797. // CHECK:STDOUT: %Self => constants.%Self
  2798. // CHECK:STDOUT: %Self.as_type.loc19_14.1 => constants.%Self.as_type
  2799. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.969
  2800. // CHECK:STDOUT: }
  2801. // CHECK:STDOUT:
  2802. // CHECK:STDOUT: specific @U2(constants.%J2.facet.e30) {}
  2803. // CHECK:STDOUT:
  2804. // CHECK:STDOUT: specific @F.1(constants.%J2.facet.86f) {
  2805. // CHECK:STDOUT: %Self => constants.%J2.facet.86f
  2806. // CHECK:STDOUT: %Self.as_type.loc19_14.1 => constants.%empty_tuple.type
  2807. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb1
  2808. // CHECK:STDOUT: }
  2809. // CHECK:STDOUT:
  2810. // CHECK:STDOUT: specific @F.1(constants.%J2.facet.c3f) {
  2811. // CHECK:STDOUT: %Self => constants.%J2.facet.c3f
  2812. // CHECK:STDOUT: %Self.as_type.loc19_14.1 => constants.%C2
  2813. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.838
  2814. // CHECK:STDOUT: }
  2815. // CHECK:STDOUT:
  2816. // CHECK:STDOUT: --- fail_associated_type_in_signature_mismatch.carbon
  2817. // CHECK:STDOUT:
  2818. // CHECK:STDOUT: constants {
  2819. // CHECK:STDOUT: %K.type: type = facet_type <@K> [concrete]
  2820. // CHECK:STDOUT: %Self: %K.type = bind_symbolic_name Self, 0 [symbolic]
  2821. // CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type @K [concrete]
  2822. // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.%V [concrete]
  2823. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  2824. // CHECK:STDOUT: %pattern_type.ca1: type = pattern_type %Self.as_type [symbolic]
  2825. // CHECK:STDOUT: %K.lookup_impl_witness.da8: <witness> = lookup_impl_witness %Self, @K [symbolic]
  2826. // CHECK:STDOUT: %K.facet.589: %K.type = facet_value %Self.as_type, (%K.lookup_impl_witness.da8) [symbolic]
  2827. // CHECK:STDOUT: %impl.elem0.75d: type = impl_witness_access %K.lookup_impl_witness.da8, element0 [symbolic]
  2828. // CHECK:STDOUT: %pattern_type.6c7: type = pattern_type %impl.elem0.75d [symbolic]
  2829. // CHECK:STDOUT: %F.type.cf5: type = fn_type @F.1 [concrete]
  2830. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2831. // CHECK:STDOUT: %F.06b: %F.type.cf5 = struct_value () [concrete]
  2832. // CHECK:STDOUT: %assoc1: %K.assoc_type = assoc_entity element1, @K.%F.decl [concrete]
  2833. // CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic_self]
  2834. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  2835. // CHECK:STDOUT: %K.lookup_impl_witness.eb2: <witness> = lookup_impl_witness %.Self, @K [symbolic_self]
  2836. // CHECK:STDOUT: %K.facet.b09: %K.type = facet_value %.Self.as_type, (%K.lookup_impl_witness.eb2) [symbolic_self]
  2837. // CHECK:STDOUT: %impl.elem0.52c: type = impl_witness_access %K.lookup_impl_witness.eb2, element0 [symbolic_self]
  2838. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete]
  2839. // CHECK:STDOUT: %K_where.type: type = facet_type <@K where %impl.elem0.52c = %struct_type.a> [concrete]
  2840. // CHECK:STDOUT: %K.impl_witness: <witness> = impl_witness file.%K.impl_witness_table [concrete]
  2841. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  2842. // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
  2843. // CHECK:STDOUT: %pattern_type.414: type = pattern_type %struct_type.x [concrete]
  2844. // CHECK:STDOUT: %F.type.c5249c.1: type = fn_type @F.2 [concrete]
  2845. // CHECK:STDOUT: %F.5eb4dd.1: %F.type.c5249c.1 = struct_value () [concrete]
  2846. // CHECK:STDOUT: %K.facet.e32: %K.type = facet_value %empty_tuple.type, (%K.impl_witness) [concrete]
  2847. // CHECK:STDOUT: %pattern_type.e85: type = pattern_type %struct_type.a [concrete]
  2848. // CHECK:STDOUT: %F.type.c5249c.2: type = fn_type @F.3 [concrete]
  2849. // CHECK:STDOUT: %F.5eb4dd.2: %F.type.c5249c.2 = struct_value () [concrete]
  2850. // CHECK:STDOUT: }
  2851. // CHECK:STDOUT:
  2852. // CHECK:STDOUT: imports {
  2853. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2854. // CHECK:STDOUT: import Core//prelude
  2855. // CHECK:STDOUT: import Core//prelude/...
  2856. // CHECK:STDOUT: }
  2857. // CHECK:STDOUT: }
  2858. // CHECK:STDOUT:
  2859. // CHECK:STDOUT: file {
  2860. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2861. // CHECK:STDOUT: .Core = imports.%Core
  2862. // CHECK:STDOUT: .K = %K.decl
  2863. // CHECK:STDOUT: }
  2864. // CHECK:STDOUT: %Core.import = import Core
  2865. // CHECK:STDOUT: %K.decl: type = interface_decl @K [concrete = constants.%K.type] {} {}
  2866. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  2867. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  2868. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  2869. // CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [concrete = constants.%K.type]
  2870. // CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  2871. // CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  2872. // CHECK:STDOUT: %V.ref: %K.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0]
  2873. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  2874. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  2875. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%K.lookup_impl_witness.eb2, element0 [symbolic_self = constants.%impl.elem0.52c]
  2876. // CHECK:STDOUT: %.loc8_31.1: %empty_tuple.type = tuple_literal ()
  2877. // CHECK:STDOUT: %.loc8_31.2: type = converted %.loc8_31.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  2878. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete = constants.%struct_type.a]
  2879. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [concrete = constants.%K_where.type] {
  2880. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %struct_type.a
  2881. // CHECK:STDOUT: }
  2882. // CHECK:STDOUT: }
  2883. // CHECK:STDOUT: %K.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @impl.%F.decl.loc16_45.2), @impl [concrete]
  2884. // CHECK:STDOUT: %K.impl_witness: <witness> = impl_witness %K.impl_witness_table [concrete = constants.%K.impl_witness]
  2885. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%struct_type.a [concrete = constants.%struct_type.a]
  2886. // CHECK:STDOUT: }
  2887. // CHECK:STDOUT:
  2888. // CHECK:STDOUT: interface @K {
  2889. // CHECK:STDOUT: %Self: %K.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  2890. // CHECK:STDOUT: %V: type = assoc_const_decl @V [concrete] {
  2891. // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.%V [concrete = constants.%assoc0]
  2892. // CHECK:STDOUT: }
  2893. // CHECK:STDOUT: %F.decl: %F.type.cf5 = fn_decl @F.1 [concrete = constants.%F.06b] {
  2894. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type.loc5_8 (%pattern_type.ca1) = binding_pattern self [concrete]
  2895. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type.loc5_8 (%pattern_type.ca1) = value_param_pattern %self.patt, call_param0 [concrete]
  2896. // CHECK:STDOUT: %v.patt: @F.1.%pattern_type.loc5_20 (%pattern_type.6c7) = binding_pattern v [concrete]
  2897. // CHECK:STDOUT: %v.param_patt: @F.1.%pattern_type.loc5_20 (%pattern_type.6c7) = value_param_pattern %v.patt, call_param1 [concrete]
  2898. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type.loc5_20 (%pattern_type.6c7) = return_slot_pattern [concrete]
  2899. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type.loc5_20 (%pattern_type.6c7) = out_param_pattern %return.patt, call_param2 [concrete]
  2900. // CHECK:STDOUT: } {
  2901. // CHECK:STDOUT: %impl.elem0.loc5_29: type = impl_witness_access constants.%K.lookup_impl_witness.da8, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.75d)]
  2902. // CHECK:STDOUT: %V.ref.loc5_29: type = name_ref V, %impl.elem0.loc5_29 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.75d)]
  2903. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0
  2904. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] {
  2905. // CHECK:STDOUT: %Self.ref: %K.type = name_ref Self, @K.%Self [symbolic = %Self (constants.%Self)]
  2906. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  2907. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  2908. // CHECK:STDOUT: }
  2909. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param
  2910. // CHECK:STDOUT: %v.param: @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.75d) = value_param call_param1
  2911. // CHECK:STDOUT: %.loc5_23: type = splice_block %V.ref.loc5_23 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.75d)] {
  2912. // CHECK:STDOUT: %impl.elem0.loc5_23.2: type = impl_witness_access constants.%K.lookup_impl_witness.da8, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.75d)]
  2913. // CHECK:STDOUT: %V.ref.loc5_23: type = name_ref V, %impl.elem0.loc5_23.2 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.75d)]
  2914. // CHECK:STDOUT: }
  2915. // CHECK:STDOUT: %v: @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.75d) = bind_name v, %v.param
  2916. // CHECK:STDOUT: %return.param: ref @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.75d) = out_param call_param2
  2917. // CHECK:STDOUT: %return: ref @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.75d) = return_slot %return.param
  2918. // CHECK:STDOUT: }
  2919. // CHECK:STDOUT: %assoc1: %K.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1]
  2920. // CHECK:STDOUT:
  2921. // CHECK:STDOUT: !members:
  2922. // CHECK:STDOUT: .Self = %Self
  2923. // CHECK:STDOUT: .V = @V.%assoc0
  2924. // CHECK:STDOUT: .F = %assoc1
  2925. // CHECK:STDOUT: witness = (%V, %F.decl)
  2926. // CHECK:STDOUT: }
  2927. // CHECK:STDOUT:
  2928. // CHECK:STDOUT: generic assoc_const @V(@K.%Self: %K.type) {
  2929. // CHECK:STDOUT: assoc_const V:! type;
  2930. // CHECK:STDOUT: }
  2931. // CHECK:STDOUT:
  2932. // CHECK:STDOUT: impl @impl: %.loc8_7.2 as %.loc8_14 {
  2933. // CHECK:STDOUT: %F.decl.loc16_45.1: %F.type.c5249c.1 = fn_decl @F.2 [concrete = constants.%F.5eb4dd.1] {
  2934. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
  2935. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  2936. // CHECK:STDOUT: %v.patt: %pattern_type.414 = binding_pattern v [concrete]
  2937. // CHECK:STDOUT: %v.param_patt: %pattern_type.414 = value_param_pattern %v.patt, call_param1 [concrete]
  2938. // CHECK:STDOUT: %return.patt: %pattern_type.414 = return_slot_pattern [concrete]
  2939. // CHECK:STDOUT: %return.param_patt: %pattern_type.414 = out_param_pattern %return.patt, call_param2 [concrete]
  2940. // CHECK:STDOUT: } {
  2941. // CHECK:STDOUT: %.loc16_42.1: %empty_tuple.type = tuple_literal ()
  2942. // CHECK:STDOUT: %.loc16_42.2: type = converted %.loc16_42.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  2943. // CHECK:STDOUT: %struct_type.x.loc16_43: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
  2944. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  2945. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  2946. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  2947. // CHECK:STDOUT: %v.param: %struct_type.x = value_param call_param1
  2948. // CHECK:STDOUT: %.loc16_30: type = splice_block %struct_type.x.loc16_30 [concrete = constants.%struct_type.x] {
  2949. // CHECK:STDOUT: %.loc16_29.1: %empty_tuple.type = tuple_literal ()
  2950. // CHECK:STDOUT: %.loc16_29.2: type = converted %.loc16_29.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  2951. // CHECK:STDOUT: %struct_type.x.loc16_30: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
  2952. // CHECK:STDOUT: }
  2953. // CHECK:STDOUT: %v: %struct_type.x = bind_name v, %v.param
  2954. // CHECK:STDOUT: %return.param: ref %struct_type.x = out_param call_param2
  2955. // CHECK:STDOUT: %return: ref %struct_type.x = return_slot %return.param
  2956. // CHECK:STDOUT: }
  2957. // CHECK:STDOUT: %F.decl.loc16_45.2: %F.type.c5249c.2 = fn_decl @F.3 [concrete = constants.%F.5eb4dd.2] {
  2958. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
  2959. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  2960. // CHECK:STDOUT: %v.patt: %pattern_type.e85 = binding_pattern v [concrete]
  2961. // CHECK:STDOUT: %v.param_patt: %pattern_type.e85 = value_param_pattern %v.patt, call_param1 [concrete]
  2962. // CHECK:STDOUT: %return.patt: %pattern_type.e85 = return_slot_pattern [concrete]
  2963. // CHECK:STDOUT: %return.param_patt: %pattern_type.e85 = out_param_pattern %return.patt, call_param2 [concrete]
  2964. // CHECK:STDOUT: } {
  2965. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  2966. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  2967. // CHECK:STDOUT: %v.param: %struct_type.a = value_param call_param1
  2968. // CHECK:STDOUT: %v: %struct_type.a = bind_name v, %v.param
  2969. // CHECK:STDOUT: %return.param: ref %struct_type.a = out_param call_param2
  2970. // CHECK:STDOUT: %return: ref %struct_type.a = return_slot %return.param
  2971. // CHECK:STDOUT: }
  2972. // CHECK:STDOUT:
  2973. // CHECK:STDOUT: !members:
  2974. // CHECK:STDOUT: .F = %F.decl.loc16_45.1
  2975. // CHECK:STDOUT: witness = file.%K.impl_witness
  2976. // CHECK:STDOUT: }
  2977. // CHECK:STDOUT:
  2978. // CHECK:STDOUT: generic fn @F.1(@K.%Self: %K.type) {
  2979. // CHECK:STDOUT: %Self: %K.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  2980. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  2981. // CHECK:STDOUT: %pattern_type.loc5_8: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type.loc5_8 (constants.%pattern_type.ca1)]
  2982. // CHECK:STDOUT: %K.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @K [symbolic = %K.lookup_impl_witness (constants.%K.lookup_impl_witness.da8)]
  2983. // CHECK:STDOUT: %impl.elem0.loc5_23.1: type = impl_witness_access %K.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_23.1 (constants.%impl.elem0.75d)]
  2984. // CHECK:STDOUT: %pattern_type.loc5_20: type = pattern_type %impl.elem0.loc5_23.1 [symbolic = %pattern_type.loc5_20 (constants.%pattern_type.6c7)]
  2985. // CHECK:STDOUT:
  2986. // CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type), %v.param: @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.75d)) -> @F.1.%impl.elem0.loc5_23.1 (%impl.elem0.75d);
  2987. // CHECK:STDOUT: }
  2988. // CHECK:STDOUT:
  2989. // CHECK:STDOUT: fn @F.2(%self.param: %empty_tuple.type, %v.param: %struct_type.x) -> %struct_type.x {
  2990. // CHECK:STDOUT: !entry:
  2991. // CHECK:STDOUT: %v.ref: %struct_type.x = name_ref v, %v
  2992. // CHECK:STDOUT: return %v.ref
  2993. // CHECK:STDOUT: }
  2994. // CHECK:STDOUT:
  2995. // CHECK:STDOUT: fn @F.3(%self.param: %empty_tuple.type, %v.param: %struct_type.a) -> %struct_type.a [thunk @impl.%F.decl.loc16_45.1] {
  2996. // CHECK:STDOUT: !entry:
  2997. // CHECK:STDOUT: %F.ref: %F.type.c5249c.1 = name_ref F, @impl.%F.decl.loc16_45.1 [concrete = constants.%F.5eb4dd.1]
  2998. // CHECK:STDOUT: %self.ref: %empty_tuple.type = name_ref self, %self.param
  2999. // CHECK:STDOUT: %v.ref: %struct_type.a = name_ref v, %v.param
  3000. // CHECK:STDOUT: %return.ref: ref %struct_type.a = name_ref <return slot>, %return.param
  3001. // CHECK:STDOUT: return <error>
  3002. // CHECK:STDOUT: }
  3003. // CHECK:STDOUT:
  3004. // CHECK:STDOUT: specific @V(constants.%Self) {}
  3005. // CHECK:STDOUT:
  3006. // CHECK:STDOUT: specific @V(constants.%K.facet.589) {}
  3007. // CHECK:STDOUT:
  3008. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  3009. // CHECK:STDOUT: %Self => constants.%Self
  3010. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type
  3011. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.ca1
  3012. // CHECK:STDOUT: %K.lookup_impl_witness => constants.%K.lookup_impl_witness.da8
  3013. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%impl.elem0.75d
  3014. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.6c7
  3015. // CHECK:STDOUT: }
  3016. // CHECK:STDOUT:
  3017. // CHECK:STDOUT: specific @V(constants.%K.facet.b09) {}
  3018. // CHECK:STDOUT:
  3019. // CHECK:STDOUT: specific @F.1(constants.%K.facet.e32) {
  3020. // CHECK:STDOUT: %Self => constants.%K.facet.e32
  3021. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_tuple.type
  3022. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.cb1
  3023. // CHECK:STDOUT: %K.lookup_impl_witness => constants.%K.impl_witness
  3024. // CHECK:STDOUT: %impl.elem0.loc5_23.1 => constants.%struct_type.a
  3025. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.e85
  3026. // CHECK:STDOUT: }
  3027. // CHECK:STDOUT:
  3028. // CHECK:STDOUT: --- use_non-type_in_function.carbon
  3029. // CHECK:STDOUT:
  3030. // CHECK:STDOUT: constants {
  3031. // CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete]
  3032. // CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic]
  3033. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3034. // CHECK:STDOUT: %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
  3035. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3036. // CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type @M [concrete]
  3037. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete]
  3038. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_struct_type [concrete]
  3039. // CHECK:STDOUT: %G.type.020: type = fn_type @G.1 [concrete]
  3040. // CHECK:STDOUT: %G.91c: %G.type.020 = struct_value () [concrete]
  3041. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, @M.%G.decl [concrete]
  3042. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self]
  3043. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  3044. // CHECK:STDOUT: %M.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @M [symbolic_self]
  3045. // CHECK:STDOUT: %M.facet.caa: %M.type = facet_value %.Self.as_type, (%M.lookup_impl_witness) [symbolic_self]
  3046. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self]
  3047. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  3048. // CHECK:STDOUT: %struct: %struct_type.b.347 = struct_value (%empty_struct) [concrete]
  3049. // CHECK:STDOUT: %M_where.type: type = facet_type <@M where %impl.elem0 = %struct> [concrete]
  3050. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness file.%M.impl_witness_table [concrete]
  3051. // CHECK:STDOUT: %G.type.8d1: type = fn_type @G.2 [concrete]
  3052. // CHECK:STDOUT: %G.bb3: %G.type.8d1 = struct_value () [concrete]
  3053. // CHECK:STDOUT: %M.facet.56b: %M.type = facet_value %empty_tuple.type, (%M.impl_witness) [concrete]
  3054. // CHECK:STDOUT: }
  3055. // CHECK:STDOUT:
  3056. // CHECK:STDOUT: imports {
  3057. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3058. // CHECK:STDOUT: import Core//prelude
  3059. // CHECK:STDOUT: import Core//prelude/...
  3060. // CHECK:STDOUT: }
  3061. // CHECK:STDOUT: }
  3062. // CHECK:STDOUT:
  3063. // CHECK:STDOUT: file {
  3064. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3065. // CHECK:STDOUT: .Core = imports.%Core
  3066. // CHECK:STDOUT: .M = %M.decl
  3067. // CHECK:STDOUT: }
  3068. // CHECK:STDOUT: %Core.import = import Core
  3069. // CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {}
  3070. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  3071. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  3072. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3073. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3074. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  3075. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3076. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3077. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3078. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3079. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3080. // CHECK:STDOUT: %.loc8_32: %empty_struct_type = struct_literal ()
  3081. // CHECK:STDOUT: %.loc8_33.1: %struct_type.b.347 = struct_literal (%.loc8_32)
  3082. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  3083. // CHECK:STDOUT: %.loc8_33.2: %empty_struct_type = converted %.loc8_32, %empty_struct [concrete = constants.%empty_struct]
  3084. // CHECK:STDOUT: %struct: %struct_type.b.347 = struct_value (%.loc8_33.2) [concrete = constants.%struct]
  3085. // CHECK:STDOUT: %.loc8_33.3: %struct_type.b.347 = converted %.loc8_33.1, %struct [concrete = constants.%struct]
  3086. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [concrete = constants.%M_where.type] {
  3087. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_33.3
  3088. // CHECK:STDOUT: }
  3089. // CHECK:STDOUT: }
  3090. // CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @impl.%G.decl), @impl [concrete]
  3091. // CHECK:STDOUT: %M.impl_witness: <witness> = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness]
  3092. // CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.b.347 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct]
  3093. // CHECK:STDOUT: }
  3094. // CHECK:STDOUT:
  3095. // CHECK:STDOUT: interface @M {
  3096. // CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  3097. // CHECK:STDOUT: %Z: %struct_type.b.347 = assoc_const_decl @Z [concrete] {
  3098. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete = constants.%assoc0]
  3099. // CHECK:STDOUT: }
  3100. // CHECK:STDOUT: %G.decl: %G.type.020 = fn_decl @G.1 [concrete = constants.%G.91c] {
  3101. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  3102. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  3103. // CHECK:STDOUT: } {
  3104. // CHECK:STDOUT: %.loc5_14.1: %empty_struct_type = struct_literal ()
  3105. // CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3106. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
  3107. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  3108. // CHECK:STDOUT: }
  3109. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, %G.decl [concrete = constants.%assoc1]
  3110. // CHECK:STDOUT:
  3111. // CHECK:STDOUT: !members:
  3112. // CHECK:STDOUT: .Self = %Self
  3113. // CHECK:STDOUT: .Z = @Z.%assoc0
  3114. // CHECK:STDOUT: .G = %assoc1
  3115. // CHECK:STDOUT: witness = (%Z, %G.decl)
  3116. // CHECK:STDOUT: }
  3117. // CHECK:STDOUT:
  3118. // CHECK:STDOUT: generic assoc_const @Z(@M.%Self: %M.type) {
  3119. // CHECK:STDOUT: assoc_const Z:! %struct_type.b.347;
  3120. // CHECK:STDOUT: }
  3121. // CHECK:STDOUT:
  3122. // CHECK:STDOUT: impl @impl: %.loc8_7.2 as %.loc8_14 {
  3123. // CHECK:STDOUT: %G.decl: %G.type.8d1 = fn_decl @G.2 [concrete = constants.%G.bb3] {
  3124. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  3125. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  3126. // CHECK:STDOUT: } {
  3127. // CHECK:STDOUT: %.loc9_14.1: %empty_struct_type = struct_literal ()
  3128. // CHECK:STDOUT: %.loc9_14.2: type = converted %.loc9_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3129. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
  3130. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  3131. // CHECK:STDOUT: }
  3132. // CHECK:STDOUT:
  3133. // CHECK:STDOUT: !members:
  3134. // CHECK:STDOUT: .G = %G.decl
  3135. // CHECK:STDOUT: .M = <poisoned>
  3136. // CHECK:STDOUT: witness = file.%M.impl_witness
  3137. // CHECK:STDOUT: }
  3138. // CHECK:STDOUT:
  3139. // CHECK:STDOUT: generic fn @G.1(@M.%Self: %M.type) {
  3140. // CHECK:STDOUT: fn() -> %empty_struct_type;
  3141. // CHECK:STDOUT: }
  3142. // CHECK:STDOUT:
  3143. // CHECK:STDOUT: fn @G.2() -> %empty_struct_type {
  3144. // CHECK:STDOUT: !entry:
  3145. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  3146. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3147. // CHECK:STDOUT: %M.facet: %M.type = facet_value constants.%empty_tuple.type, (constants.%M.impl_witness) [concrete = constants.%M.facet.56b]
  3148. // CHECK:STDOUT: %.loc10_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.56b]
  3149. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3150. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc10_18 [concrete = constants.%empty_tuple.type]
  3151. // CHECK:STDOUT: %.loc10_23: type = converted %.loc10_18, %as_type [concrete = constants.%empty_tuple.type]
  3152. // CHECK:STDOUT: %impl.elem0: %struct_type.b.347 = impl_witness_access constants.%M.impl_witness, element0 [concrete = constants.%struct]
  3153. // CHECK:STDOUT: %.loc10_25: %empty_struct_type = struct_access %impl.elem0, element0 [concrete = constants.%empty_struct]
  3154. // CHECK:STDOUT: return %.loc10_25
  3155. // CHECK:STDOUT: }
  3156. // CHECK:STDOUT:
  3157. // CHECK:STDOUT: specific @Z(constants.%Self) {}
  3158. // CHECK:STDOUT:
  3159. // CHECK:STDOUT: specific @G.1(constants.%Self) {}
  3160. // CHECK:STDOUT:
  3161. // CHECK:STDOUT: specific @Z(constants.%M.facet.caa) {}
  3162. // CHECK:STDOUT:
  3163. // CHECK:STDOUT: specific @G.1(constants.%M.facet.56b) {}
  3164. // CHECK:STDOUT:
  3165. // CHECK:STDOUT: specific @Z(constants.%M.facet.56b) {}
  3166. // CHECK:STDOUT:
  3167. // CHECK:STDOUT: --- self_as_uses_correct_rewrite_constraint.carbon
  3168. // CHECK:STDOUT:
  3169. // CHECK:STDOUT: constants {
  3170. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  3171. // CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete]
  3172. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  3173. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3174. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  3175. // CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic]
  3176. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3177. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  3178. // CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete]
  3179. // CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic]
  3180. // CHECK:STDOUT: %struct_type.b.86f: type = struct_type {.b: type} [concrete]
  3181. // CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type @M [concrete]
  3182. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete]
  3183. // CHECK:STDOUT: %G.type.020: type = fn_type @G.1 [concrete]
  3184. // CHECK:STDOUT: %G.91c: %G.type.020 = struct_value () [concrete]
  3185. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, @M.%G.decl [concrete]
  3186. // CHECK:STDOUT: %C.7a7: type = class_type @C, @C(%empty_struct_type) [concrete]
  3187. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self]
  3188. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  3189. // CHECK:STDOUT: %M.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @M [symbolic_self]
  3190. // CHECK:STDOUT: %M.facet.caa: %M.type = facet_value %.Self.as_type, (%M.lookup_impl_witness) [symbolic_self]
  3191. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self]
  3192. // CHECK:STDOUT: %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
  3193. // CHECK:STDOUT: %struct.0f3: %struct_type.b.86f = struct_value (%empty_struct_type) [concrete]
  3194. // CHECK:STDOUT: %M_where.type.d04: type = facet_type <@M where %impl.elem0 = %struct.0f3> [concrete]
  3195. // CHECK:STDOUT: %M.impl_witness.baa: <witness> = impl_witness file.%M.impl_witness_table.loc10 [concrete]
  3196. // CHECK:STDOUT: %G.type.d92: type = fn_type @G.2 [concrete]
  3197. // CHECK:STDOUT: %G.eac: %G.type.d92 = struct_value () [concrete]
  3198. // CHECK:STDOUT: %M.facet.1dc: %M.type = facet_value %C.7a7, (%M.impl_witness.baa) [concrete]
  3199. // CHECK:STDOUT: %C.3a0: type = class_type @C, @C(%empty_tuple.type) [concrete]
  3200. // CHECK:STDOUT: %struct_type.b.161: type = struct_type {.b: %empty_tuple.type} [concrete]
  3201. // CHECK:STDOUT: %struct.c94: %struct_type.b.86f = struct_value (%empty_tuple.type) [concrete]
  3202. // CHECK:STDOUT: %M_where.type.eda: type = facet_type <@M where %impl.elem0 = %struct.c94> [concrete]
  3203. // CHECK:STDOUT: %M.impl_witness.feb: <witness> = impl_witness file.%M.impl_witness_table.loc16 [concrete]
  3204. // CHECK:STDOUT: %G.type.b29: type = fn_type @G.3 [concrete]
  3205. // CHECK:STDOUT: %G.f3b: %G.type.b29 = struct_value () [concrete]
  3206. // CHECK:STDOUT: %M.facet.80d: %M.type = facet_value %C.3a0, (%M.impl_witness.feb) [concrete]
  3207. // CHECK:STDOUT: }
  3208. // CHECK:STDOUT:
  3209. // CHECK:STDOUT: imports {
  3210. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3211. // CHECK:STDOUT: import Core//prelude
  3212. // CHECK:STDOUT: import Core//prelude/...
  3213. // CHECK:STDOUT: }
  3214. // CHECK:STDOUT: }
  3215. // CHECK:STDOUT:
  3216. // CHECK:STDOUT: file {
  3217. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3218. // CHECK:STDOUT: .Core = imports.%Core
  3219. // CHECK:STDOUT: .C = %C.decl
  3220. // CHECK:STDOUT: .M = %M.decl
  3221. // CHECK:STDOUT: }
  3222. // CHECK:STDOUT: %Core.import = import Core
  3223. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  3224. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  3225. // CHECK:STDOUT: } {
  3226. // CHECK:STDOUT: %T.loc3_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc3_9.2 (constants.%T)]
  3227. // CHECK:STDOUT: }
  3228. // CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {}
  3229. // CHECK:STDOUT: impl_decl @impl.8b4 [concrete] {} {
  3230. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  3231. // CHECK:STDOUT: %.loc10_9: %empty_struct_type = struct_literal ()
  3232. // CHECK:STDOUT: %.loc10_10: type = converted %.loc10_9, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3233. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type) [concrete = constants.%C.7a7]
  3234. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3235. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  3236. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3237. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3238. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3239. // CHECK:STDOUT: %.loc10_23: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3240. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3241. // CHECK:STDOUT: %.loc10_35: %empty_struct_type = struct_literal ()
  3242. // CHECK:STDOUT: %.loc10_36.1: %struct_type.b.347 = struct_literal (%.loc10_35)
  3243. // CHECK:STDOUT: %.loc10_36.2: type = converted %.loc10_35, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  3244. // CHECK:STDOUT: %struct: %struct_type.b.86f = struct_value (%.loc10_36.2) [concrete = constants.%struct.0f3]
  3245. // CHECK:STDOUT: %.loc10_36.3: %struct_type.b.86f = converted %.loc10_36.1, %struct [concrete = constants.%struct.0f3]
  3246. // CHECK:STDOUT: %.loc10_17: type = where_expr %.Self [concrete = constants.%M_where.type.d04] {
  3247. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_36.3
  3248. // CHECK:STDOUT: }
  3249. // CHECK:STDOUT: }
  3250. // CHECK:STDOUT: %M.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant.loc10, @impl.8b4.%G.decl), @impl.8b4 [concrete]
  3251. // CHECK:STDOUT: %M.impl_witness.loc10: <witness> = impl_witness %M.impl_witness_table.loc10 [concrete = constants.%M.impl_witness.baa]
  3252. // CHECK:STDOUT: %impl_witness_assoc_constant.loc10: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.0f3 [concrete = constants.%struct.0f3]
  3253. // CHECK:STDOUT: impl_decl @impl.d97 [concrete] {} {
  3254. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  3255. // CHECK:STDOUT: %.loc16_9: %empty_tuple.type = tuple_literal ()
  3256. // CHECK:STDOUT: %.loc16_10: type = converted %.loc16_9, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3257. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_tuple.type) [concrete = constants.%C.3a0]
  3258. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3259. // CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  3260. // CHECK:STDOUT: %.Self.ref: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3261. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3262. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3263. // CHECK:STDOUT: %.loc16_23: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3264. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3265. // CHECK:STDOUT: %.loc16_35: %empty_tuple.type = tuple_literal ()
  3266. // CHECK:STDOUT: %.loc16_36.1: %struct_type.b.161 = struct_literal (%.loc16_35)
  3267. // CHECK:STDOUT: %.loc16_36.2: type = converted %.loc16_35, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3268. // CHECK:STDOUT: %struct: %struct_type.b.86f = struct_value (%.loc16_36.2) [concrete = constants.%struct.c94]
  3269. // CHECK:STDOUT: %.loc16_36.3: %struct_type.b.86f = converted %.loc16_36.1, %struct [concrete = constants.%struct.c94]
  3270. // CHECK:STDOUT: %.loc16_17: type = where_expr %.Self [concrete = constants.%M_where.type.eda] {
  3271. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc16_36.3
  3272. // CHECK:STDOUT: }
  3273. // CHECK:STDOUT: }
  3274. // CHECK:STDOUT: %M.impl_witness_table.loc16 = impl_witness_table (%impl_witness_assoc_constant.loc16, @impl.d97.%G.decl), @impl.d97 [concrete]
  3275. // CHECK:STDOUT: %M.impl_witness.loc16: <witness> = impl_witness %M.impl_witness_table.loc16 [concrete = constants.%M.impl_witness.feb]
  3276. // CHECK:STDOUT: %impl_witness_assoc_constant.loc16: %struct_type.b.86f = impl_witness_assoc_constant constants.%struct.c94 [concrete = constants.%struct.c94]
  3277. // CHECK:STDOUT: }
  3278. // CHECK:STDOUT:
  3279. // CHECK:STDOUT: interface @M {
  3280. // CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  3281. // CHECK:STDOUT: %Z: %struct_type.b.86f = assoc_const_decl @Z [concrete] {
  3282. // CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete = constants.%assoc0]
  3283. // CHECK:STDOUT: }
  3284. // CHECK:STDOUT: %G.decl: %G.type.020 = fn_decl @G.1 [concrete = constants.%G.91c] {
  3285. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  3286. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  3287. // CHECK:STDOUT: } {
  3288. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  3289. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  3290. // CHECK:STDOUT: }
  3291. // CHECK:STDOUT: %assoc1: %M.assoc_type = assoc_entity element1, %G.decl [concrete = constants.%assoc1]
  3292. // CHECK:STDOUT:
  3293. // CHECK:STDOUT: !members:
  3294. // CHECK:STDOUT: .Self = %Self
  3295. // CHECK:STDOUT: .Z = @Z.%assoc0
  3296. // CHECK:STDOUT: .G = %assoc1
  3297. // CHECK:STDOUT: witness = (%Z, %G.decl)
  3298. // CHECK:STDOUT: }
  3299. // CHECK:STDOUT:
  3300. // CHECK:STDOUT: generic assoc_const @Z(@M.%Self: %M.type) {
  3301. // CHECK:STDOUT: assoc_const Z:! %struct_type.b.86f;
  3302. // CHECK:STDOUT: }
  3303. // CHECK:STDOUT:
  3304. // CHECK:STDOUT: impl @impl.8b4: %C as %.loc10_17 {
  3305. // CHECK:STDOUT: %G.decl: %G.type.d92 = fn_decl @G.2 [concrete = constants.%G.eac] {
  3306. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  3307. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  3308. // CHECK:STDOUT: } {
  3309. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  3310. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  3311. // CHECK:STDOUT: }
  3312. // CHECK:STDOUT:
  3313. // CHECK:STDOUT: !members:
  3314. // CHECK:STDOUT: .G = %G.decl
  3315. // CHECK:STDOUT: .M = <poisoned>
  3316. // CHECK:STDOUT: witness = file.%M.impl_witness.loc10
  3317. // CHECK:STDOUT: }
  3318. // CHECK:STDOUT:
  3319. // CHECK:STDOUT: impl @impl.d97: %C as %.loc16_17 {
  3320. // CHECK:STDOUT: %G.decl: %G.type.b29 = fn_decl @G.3 [concrete = constants.%G.f3b] {
  3321. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  3322. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  3323. // CHECK:STDOUT: } {
  3324. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  3325. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  3326. // CHECK:STDOUT: }
  3327. // CHECK:STDOUT:
  3328. // CHECK:STDOUT: !members:
  3329. // CHECK:STDOUT: .G = %G.decl
  3330. // CHECK:STDOUT: .M = <poisoned>
  3331. // CHECK:STDOUT: witness = file.%M.impl_witness.loc16
  3332. // CHECK:STDOUT: }
  3333. // CHECK:STDOUT:
  3334. // CHECK:STDOUT: generic class @C(%T.loc3_9.1: type) {
  3335. // CHECK:STDOUT: %T.loc3_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc3_9.2 (constants.%T)]
  3336. // CHECK:STDOUT:
  3337. // CHECK:STDOUT: !definition:
  3338. // CHECK:STDOUT:
  3339. // CHECK:STDOUT: class {
  3340. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  3341. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  3342. // CHECK:STDOUT: complete_type_witness = %complete_type
  3343. // CHECK:STDOUT:
  3344. // CHECK:STDOUT: !members:
  3345. // CHECK:STDOUT: .Self = constants.%C.f2e
  3346. // CHECK:STDOUT: }
  3347. // CHECK:STDOUT: }
  3348. // CHECK:STDOUT:
  3349. // CHECK:STDOUT: generic fn @G.1(@M.%Self: %M.type) {
  3350. // CHECK:STDOUT: fn() -> type;
  3351. // CHECK:STDOUT: }
  3352. // CHECK:STDOUT:
  3353. // CHECK:STDOUT: fn @G.2() -> type {
  3354. // CHECK:STDOUT: !entry:
  3355. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.8b4.%C [concrete = constants.%C.7a7]
  3356. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3357. // CHECK:STDOUT: %M.facet: %M.type = facet_value constants.%C.7a7, (constants.%M.impl_witness.baa) [concrete = constants.%M.facet.1dc]
  3358. // CHECK:STDOUT: %.loc12_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.1dc]
  3359. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3360. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc12_18 [concrete = constants.%C.7a7]
  3361. // CHECK:STDOUT: %.loc12_23: type = converted %.loc12_18, %as_type [concrete = constants.%C.7a7]
  3362. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access constants.%M.impl_witness.baa, element0 [concrete = constants.%struct.0f3]
  3363. // CHECK:STDOUT: %.loc12_25: type = struct_access %impl.elem0, element0 [concrete = constants.%empty_struct_type]
  3364. // CHECK:STDOUT: return %.loc12_25
  3365. // CHECK:STDOUT: }
  3366. // CHECK:STDOUT:
  3367. // CHECK:STDOUT: fn @G.3() -> type {
  3368. // CHECK:STDOUT: !entry:
  3369. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.d97.%C [concrete = constants.%C.3a0]
  3370. // CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
  3371. // CHECK:STDOUT: %M.facet: %M.type = facet_value constants.%C.3a0, (constants.%M.impl_witness.feb) [concrete = constants.%M.facet.80d]
  3372. // CHECK:STDOUT: %.loc18_18: %M.type = converted %Self.ref, %M.facet [concrete = constants.%M.facet.80d]
  3373. // CHECK:STDOUT: %Z.ref: %M.assoc_type = name_ref Z, @Z.%assoc0 [concrete = constants.%assoc0]
  3374. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc18_18 [concrete = constants.%C.3a0]
  3375. // CHECK:STDOUT: %.loc18_23: type = converted %.loc18_18, %as_type [concrete = constants.%C.3a0]
  3376. // CHECK:STDOUT: %impl.elem0: %struct_type.b.86f = impl_witness_access constants.%M.impl_witness.feb, element0 [concrete = constants.%struct.c94]
  3377. // CHECK:STDOUT: %.loc18_25: type = struct_access %impl.elem0, element0 [concrete = constants.%empty_tuple.type]
  3378. // CHECK:STDOUT: return %.loc18_25
  3379. // CHECK:STDOUT: }
  3380. // CHECK:STDOUT:
  3381. // CHECK:STDOUT: specific @C(constants.%T) {
  3382. // CHECK:STDOUT: %T.loc3_9.2 => constants.%T
  3383. // CHECK:STDOUT: }
  3384. // CHECK:STDOUT:
  3385. // CHECK:STDOUT: specific @Z(constants.%Self) {}
  3386. // CHECK:STDOUT:
  3387. // CHECK:STDOUT: specific @G.1(constants.%Self) {}
  3388. // CHECK:STDOUT:
  3389. // CHECK:STDOUT: specific @C(constants.%empty_struct_type) {
  3390. // CHECK:STDOUT: %T.loc3_9.2 => constants.%empty_struct_type
  3391. // CHECK:STDOUT: }
  3392. // CHECK:STDOUT:
  3393. // CHECK:STDOUT: specific @Z(constants.%M.facet.caa) {}
  3394. // CHECK:STDOUT:
  3395. // CHECK:STDOUT: specific @G.1(constants.%M.facet.1dc) {}
  3396. // CHECK:STDOUT:
  3397. // CHECK:STDOUT: specific @Z(constants.%M.facet.1dc) {}
  3398. // CHECK:STDOUT:
  3399. // CHECK:STDOUT: specific @C(constants.%empty_tuple.type) {
  3400. // CHECK:STDOUT: %T.loc3_9.2 => constants.%empty_tuple.type
  3401. // CHECK:STDOUT: }
  3402. // CHECK:STDOUT:
  3403. // CHECK:STDOUT: specific @G.1(constants.%M.facet.80d) {}
  3404. // CHECK:STDOUT:
  3405. // CHECK:STDOUT: specific @Z(constants.%M.facet.80d) {}
  3406. // CHECK:STDOUT:
  3407. // CHECK:STDOUT: --- associated_int_in_array.carbon
  3408. // CHECK:STDOUT:
  3409. // CHECK:STDOUT: constants {
  3410. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  3411. // CHECK:STDOUT: %Self.8268: %I.type = bind_symbolic_name Self, 0 [symbolic]
  3412. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  3413. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  3414. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3415. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  3416. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  3417. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  3418. // CHECK:STDOUT: %assoc0.995: %I.assoc_type = assoc_entity element0, @I.%N [concrete]
  3419. // CHECK:STDOUT: %Self.as_type.b70: type = facet_access_type %Self.8268 [symbolic]
  3420. // CHECK:STDOUT: %pattern_type.6de: type = pattern_type %Self.as_type.b70 [symbolic]
  3421. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  3422. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  3423. // CHECK:STDOUT: %I.lookup_impl_witness.5d6: <witness> = lookup_impl_witness %Self.8268, @I [symbolic]
  3424. // CHECK:STDOUT: %I.facet.93d: %I.type = facet_value %Self.as_type.b70, (%I.lookup_impl_witness.5d6) [symbolic]
  3425. // CHECK:STDOUT: %impl.elem0.fab: %i32 = impl_witness_access %I.lookup_impl_witness.5d6, element0 [symbolic]
  3426. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  3427. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  3428. // CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  3429. // CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [concrete]
  3430. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  3431. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.3, @impl.4f9(%To.c80) [symbolic]
  3432. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  3433. // CHECK:STDOUT: %From: Core.IntLiteral = bind_symbolic_name From, 0 [symbolic]
  3434. // CHECK:STDOUT: %Convert.type.708: type = fn_type @Convert.4, @impl.971(%From) [symbolic]
  3435. // CHECK:STDOUT: %Convert.c68: %Convert.type.708 = struct_value () [symbolic]
  3436. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  3437. // CHECK:STDOUT: %ImplicitAs.impl_witness.a11: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.1d9, @impl.971(%int_32) [concrete]
  3438. // CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.4, @impl.971(%int_32) [concrete]
  3439. // CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [concrete]
  3440. // CHECK:STDOUT: %ImplicitAs.facet.f49: %ImplicitAs.type.2fd = facet_value %i32, (%ImplicitAs.impl_witness.a11) [concrete]
  3441. // CHECK:STDOUT: %.0ea: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.f49 [concrete]
  3442. // CHECK:STDOUT: %Convert.bound.44d: <bound method> = bound_method %impl.elem0.fab, %Convert.960 [symbolic]
  3443. // CHECK:STDOUT: %Convert.specific_fn.8a8: <specific function> = specific_function %Convert.960, @Convert.4(%int_32) [concrete]
  3444. // CHECK:STDOUT: %bound_method.81c: <bound method> = bound_method %impl.elem0.fab, %Convert.specific_fn.8a8 [symbolic]
  3445. // CHECK:STDOUT: %int.convert_checked.acf: init Core.IntLiteral = call %bound_method.81c(%impl.elem0.fab) [symbolic]
  3446. // CHECK:STDOUT: %array_type.377: type = array_type %int.convert_checked.acf, bool [symbolic]
  3447. // CHECK:STDOUT: %pattern_type.bc6: type = pattern_type %array_type.377 [symbolic]
  3448. // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
  3449. // CHECK:STDOUT: %F.bc6: %F.type.cf0 = struct_value () [concrete]
  3450. // CHECK:STDOUT: %assoc1.dfe: %I.assoc_type = assoc_entity element1, @I.%F.decl [concrete]
  3451. // CHECK:STDOUT: %.Self.258: %I.type = bind_symbolic_name .Self [symbolic_self]
  3452. // CHECK:STDOUT: %.Self.as_type.541: type = facet_access_type %.Self.258 [symbolic_self]
  3453. // CHECK:STDOUT: %I.lookup_impl_witness.5f5: <witness> = lookup_impl_witness %.Self.258, @I [symbolic_self]
  3454. // CHECK:STDOUT: %I.facet.74c: %I.type = facet_value %.Self.as_type.541, (%I.lookup_impl_witness.5f5) [symbolic_self]
  3455. // CHECK:STDOUT: %impl.elem0.d4d: %i32 = impl_witness_access %I.lookup_impl_witness.5f5, element0 [symbolic_self]
  3456. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  3457. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  3458. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  3459. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  3460. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.4f9(%int_32) [concrete]
  3461. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  3462. // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  3463. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
  3464. // CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
  3465. // CHECK:STDOUT: %Convert.specific_fn.b6f: <specific function> = specific_function %Convert.956, @Convert.3(%int_32) [concrete]
  3466. // CHECK:STDOUT: %bound_method.b92: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn.b6f [concrete]
  3467. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  3468. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0.d4d = %int_2.ef8> [concrete]
  3469. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  3470. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  3471. // CHECK:STDOUT: %array_type.c9b: type = array_type %int_2.ecc, bool [concrete]
  3472. // CHECK:STDOUT: %pattern_type.5d5: type = pattern_type %array_type.c9b [concrete]
  3473. // CHECK:STDOUT: %F.type.2c7: type = fn_type @F.2 [concrete]
  3474. // CHECK:STDOUT: %F.0b4: %F.type.2c7 = struct_value () [concrete]
  3475. // CHECK:STDOUT: %I.facet.85d: %I.type = facet_value %empty_tuple.type, (%I.impl_witness) [concrete]
  3476. // CHECK:STDOUT: %Convert.bound.fbf: <bound method> = bound_method %int_2.ef8, %Convert.960 [concrete]
  3477. // CHECK:STDOUT: %bound_method.992: <bound method> = bound_method %int_2.ef8, %Convert.specific_fn.8a8 [concrete]
  3478. // CHECK:STDOUT: %true: bool = bool_literal true [concrete]
  3479. // CHECK:STDOUT: %false: bool = bool_literal false [concrete]
  3480. // CHECK:STDOUT: %tuple.type: type = tuple_type (bool, bool) [concrete]
  3481. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  3482. // CHECK:STDOUT: %array: %array_type.c9b = tuple_value (%true, %false) [concrete]
  3483. // CHECK:STDOUT: }
  3484. // CHECK:STDOUT:
  3485. // CHECK:STDOUT: imports {
  3486. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3487. // CHECK:STDOUT: .Int = %Core.Int
  3488. // CHECK:STDOUT: .Bool = %Core.Bool
  3489. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  3490. // CHECK:STDOUT: import Core//prelude
  3491. // CHECK:STDOUT: import Core//prelude/...
  3492. // CHECK:STDOUT: }
  3493. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  3494. // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
  3495. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  3496. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  3497. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  3498. // CHECK:STDOUT: %Core.import_ref.85c: @impl.971.%Convert.type (%Convert.type.708) = import_ref Core//prelude/types/int, loc23_44, loaded [symbolic = @impl.971.%Convert (constants.%Convert.c68)]
  3499. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1d9 = impl_witness_table (%Core.import_ref.85c), @impl.971 [concrete]
  3500. // CHECK:STDOUT: }
  3501. // CHECK:STDOUT:
  3502. // CHECK:STDOUT: file {
  3503. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3504. // CHECK:STDOUT: .Core = imports.%Core
  3505. // CHECK:STDOUT: .I = %I.decl
  3506. // CHECK:STDOUT: }
  3507. // CHECK:STDOUT: %Core.import = import Core
  3508. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  3509. // CHECK:STDOUT: impl_decl @impl.9a6 [concrete] {} {
  3510. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  3511. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  3512. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  3513. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.258]
  3514. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.258]
  3515. // CHECK:STDOUT: %N.ref: %I.assoc_type = name_ref N, @N.%assoc0 [concrete = constants.%assoc0.995]
  3516. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type.541]
  3517. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type.541]
  3518. // CHECK:STDOUT: %impl.elem0.loc8_20: %i32 = impl_witness_access constants.%I.lookup_impl_witness.5f5, element0 [symbolic_self = constants.%impl.elem0.d4d]
  3519. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  3520. // CHECK:STDOUT: %impl.elem0.loc8_25: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  3521. // CHECK:STDOUT: %bound_method.loc8_25.1: <bound method> = bound_method %int_2, %impl.elem0.loc8_25 [concrete = constants.%Convert.bound.ef9]
  3522. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc8_25, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f]
  3523. // CHECK:STDOUT: %bound_method.loc8_25.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.b92]
  3524. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc8_25.2(%int_2) [concrete = constants.%int_2.ef8]
  3525. // CHECK:STDOUT: %.loc8_25.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8]
  3526. // CHECK:STDOUT: %.loc8_25.2: %i32 = converted %int_2, %.loc8_25.1 [concrete = constants.%int_2.ef8]
  3527. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [concrete = constants.%I_where.type] {
  3528. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8_20, %.loc8_25.2
  3529. // CHECK:STDOUT: }
  3530. // CHECK:STDOUT: }
  3531. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @impl.9a6.%F.decl), @impl.9a6 [concrete]
  3532. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  3533. // CHECK:STDOUT: %impl_witness_assoc_constant: %i32 = impl_witness_assoc_constant constants.%int_2.ef8 [concrete = constants.%int_2.ef8]
  3534. // CHECK:STDOUT: }
  3535. // CHECK:STDOUT:
  3536. // CHECK:STDOUT: interface @I {
  3537. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.8268]
  3538. // CHECK:STDOUT: %N: %i32 = assoc_const_decl @N [concrete] {
  3539. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%N [concrete = constants.%assoc0.995]
  3540. // CHECK:STDOUT: }
  3541. // CHECK:STDOUT: %F.decl: %F.type.cf0 = fn_decl @F.1 [concrete = constants.%F.bc6] {
  3542. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type.loc5_8 (%pattern_type.6de) = binding_pattern self [concrete]
  3543. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type.loc5_8 (%pattern_type.6de) = value_param_pattern %self.patt, call_param0 [concrete]
  3544. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type.loc5_22 (%pattern_type.bc6) = return_slot_pattern [concrete]
  3545. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type.loc5_22 (%pattern_type.bc6) = out_param_pattern %return.patt, call_param1 [concrete]
  3546. // CHECK:STDOUT: } {
  3547. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  3548. // CHECK:STDOUT: %impl.elem0.loc5_37.2: %i32 = impl_witness_access constants.%I.lookup_impl_witness.5d6, element0 [symbolic = %impl.elem0.loc5_37.1 (constants.%impl.elem0.fab)]
  3549. // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %impl.elem0.loc5_37.2 [symbolic = %impl.elem0.loc5_37.1 (constants.%impl.elem0.fab)]
  3550. // CHECK:STDOUT: %.loc5_31.1: type = value_of_initializer %bool.make_type [concrete = bool]
  3551. // CHECK:STDOUT: %.loc5_31.2: type = converted %bool.make_type, %.loc5_31.1 [concrete = bool]
  3552. // CHECK:STDOUT: %impl.elem0.loc5_37.3: %.0ea = impl_witness_access constants.%ImplicitAs.impl_witness.a11, element0 [concrete = constants.%Convert.960]
  3553. // CHECK:STDOUT: %bound_method.loc5_37.2: <bound method> = bound_method %N.ref, %impl.elem0.loc5_37.3 [symbolic = %Convert.bound (constants.%Convert.bound.44d)]
  3554. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc5_37.3, @Convert.4(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8]
  3555. // CHECK:STDOUT: %bound_method.loc5_37.3: <bound method> = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc5_37.1 (constants.%bound_method.81c)]
  3556. // CHECK:STDOUT: %int.convert_checked.loc5_37.2: init Core.IntLiteral = call %bound_method.loc5_37.3(%N.ref) [symbolic = %int.convert_checked.loc5_37.1 (constants.%int.convert_checked.acf)]
  3557. // CHECK:STDOUT: %.loc5_37.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc5_37.2 [symbolic = %int.convert_checked.loc5_37.1 (constants.%int.convert_checked.acf)]
  3558. // CHECK:STDOUT: %.loc5_37.2: Core.IntLiteral = converted %N.ref, %.loc5_37.1 [symbolic = %int.convert_checked.loc5_37.1 (constants.%int.convert_checked.acf)]
  3559. // 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.377)]
  3560. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type.b70) = value_param call_param0
  3561. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b70)] {
  3562. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.8268)]
  3563. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b70)]
  3564. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b70)]
  3565. // CHECK:STDOUT: }
  3566. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type.b70) = bind_name self, %self.param
  3567. // CHECK:STDOUT: %return.param: ref @F.1.%array_type.loc5_38.1 (%array_type.377) = out_param call_param1
  3568. // CHECK:STDOUT: %return: ref @F.1.%array_type.loc5_38.1 (%array_type.377) = return_slot %return.param
  3569. // CHECK:STDOUT: }
  3570. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1.dfe]
  3571. // CHECK:STDOUT:
  3572. // CHECK:STDOUT: !members:
  3573. // CHECK:STDOUT: .Self = %Self
  3574. // CHECK:STDOUT: .N = @N.%assoc0
  3575. // CHECK:STDOUT: .F = %assoc1
  3576. // CHECK:STDOUT: witness = (%N, %F.decl)
  3577. // CHECK:STDOUT: }
  3578. // CHECK:STDOUT:
  3579. // CHECK:STDOUT: generic assoc_const @N(@I.%Self: %I.type) {
  3580. // CHECK:STDOUT: assoc_const N:! %i32;
  3581. // CHECK:STDOUT: }
  3582. // CHECK:STDOUT:
  3583. // CHECK:STDOUT: impl @impl.9a6: %.loc8_7.2 as %.loc8_14 {
  3584. // CHECK:STDOUT: %F.decl: %F.type.2c7 = fn_decl @F.2 [concrete = constants.%F.0b4] {
  3585. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
  3586. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  3587. // CHECK:STDOUT: %return.patt: %pattern_type.5d5 = return_slot_pattern [concrete]
  3588. // CHECK:STDOUT: %return.param_patt: %pattern_type.5d5 = out_param_pattern %return.patt, call_param1 [concrete]
  3589. // CHECK:STDOUT: } {
  3590. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  3591. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  3592. // CHECK:STDOUT: %.loc9_31.1: type = value_of_initializer %bool.make_type [concrete = bool]
  3593. // CHECK:STDOUT: %.loc9_31.2: type = converted %bool.make_type, %.loc9_31.1 [concrete = bool]
  3594. // CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc9_31.2 [concrete = constants.%array_type.c9b]
  3595. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  3596. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.9a6.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
  3597. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  3598. // CHECK:STDOUT: %return.param: ref %array_type.c9b = out_param call_param1
  3599. // CHECK:STDOUT: %return: ref %array_type.c9b = return_slot %return.param
  3600. // CHECK:STDOUT: }
  3601. // CHECK:STDOUT:
  3602. // CHECK:STDOUT: !members:
  3603. // CHECK:STDOUT: .F = %F.decl
  3604. // CHECK:STDOUT: witness = file.%I.impl_witness
  3605. // CHECK:STDOUT: }
  3606. // CHECK:STDOUT:
  3607. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  3608. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.8268)]
  3609. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b70)]
  3610. // CHECK:STDOUT: %pattern_type.loc5_8: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type.loc5_8 (constants.%pattern_type.6de)]
  3611. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness.5d6)]
  3612. // 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.fab)]
  3613. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %impl.elem0.loc5_37.1, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound.44d)]
  3614. // CHECK:STDOUT: %bound_method.loc5_37.1: <bound method> = bound_method %impl.elem0.loc5_37.1, constants.%Convert.specific_fn.8a8 [symbolic = %bound_method.loc5_37.1 (constants.%bound_method.81c)]
  3615. // CHECK:STDOUT: %int.convert_checked.loc5_37.1: init Core.IntLiteral = call %bound_method.loc5_37.1(%impl.elem0.loc5_37.1) [symbolic = %int.convert_checked.loc5_37.1 (constants.%int.convert_checked.acf)]
  3616. // CHECK:STDOUT: %array_type.loc5_38.1: type = array_type %int.convert_checked.loc5_37.1, bool [symbolic = %array_type.loc5_38.1 (constants.%array_type.377)]
  3617. // CHECK:STDOUT: %pattern_type.loc5_22: type = pattern_type %array_type.loc5_38.1 [symbolic = %pattern_type.loc5_22 (constants.%pattern_type.bc6)]
  3618. // CHECK:STDOUT:
  3619. // CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type.b70)) -> @F.1.%array_type.loc5_38.1 (%array_type.377);
  3620. // CHECK:STDOUT: }
  3621. // CHECK:STDOUT:
  3622. // CHECK:STDOUT: fn @F.2(%self.param: %empty_tuple.type) -> %return.param: %array_type.c9b {
  3623. // CHECK:STDOUT: !entry:
  3624. // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
  3625. // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false]
  3626. // CHECK:STDOUT: %.loc9_61.1: %tuple.type = tuple_literal (%true, %false)
  3627. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  3628. // CHECK:STDOUT: %.loc9_61.2: ref bool = array_index %return, %int_0
  3629. // CHECK:STDOUT: %.loc9_61.3: init bool = initialize_from %true to %.loc9_61.2 [concrete = constants.%true]
  3630. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  3631. // CHECK:STDOUT: %.loc9_61.4: ref bool = array_index %return, %int_1
  3632. // CHECK:STDOUT: %.loc9_61.5: init bool = initialize_from %false to %.loc9_61.4 [concrete = constants.%false]
  3633. // CHECK:STDOUT: %.loc9_61.6: init %array_type.c9b = array_init (%.loc9_61.3, %.loc9_61.5) to %return [concrete = constants.%array]
  3634. // CHECK:STDOUT: %.loc9_62: init %array_type.c9b = converted %.loc9_61.1, %.loc9_61.6 [concrete = constants.%array]
  3635. // CHECK:STDOUT: return %.loc9_62 to %return
  3636. // CHECK:STDOUT: }
  3637. // CHECK:STDOUT:
  3638. // CHECK:STDOUT: specific @N(constants.%Self.8268) {}
  3639. // CHECK:STDOUT:
  3640. // CHECK:STDOUT: specific @N(constants.%I.facet.93d) {}
  3641. // CHECK:STDOUT:
  3642. // CHECK:STDOUT: specific @F.1(constants.%Self.8268) {
  3643. // CHECK:STDOUT: %Self => constants.%Self.8268
  3644. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.b70
  3645. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.6de
  3646. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness.5d6
  3647. // CHECK:STDOUT: %impl.elem0.loc5_37.1 => constants.%impl.elem0.fab
  3648. // CHECK:STDOUT: %Convert.bound => constants.%Convert.bound.44d
  3649. // CHECK:STDOUT: %bound_method.loc5_37.1 => constants.%bound_method.81c
  3650. // CHECK:STDOUT: %int.convert_checked.loc5_37.1 => constants.%int.convert_checked.acf
  3651. // CHECK:STDOUT: %array_type.loc5_38.1 => constants.%array_type.377
  3652. // CHECK:STDOUT: %pattern_type.loc5_22 => constants.%pattern_type.bc6
  3653. // CHECK:STDOUT: }
  3654. // CHECK:STDOUT:
  3655. // CHECK:STDOUT: specific @N(constants.%I.facet.74c) {}
  3656. // CHECK:STDOUT:
  3657. // CHECK:STDOUT: specific @F.1(constants.%I.facet.85d) {
  3658. // CHECK:STDOUT: %Self => constants.%I.facet.85d
  3659. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_tuple.type
  3660. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.cb1
  3661. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.impl_witness
  3662. // CHECK:STDOUT: %impl.elem0.loc5_37.1 => constants.%int_2.ef8
  3663. // CHECK:STDOUT: %Convert.bound => constants.%Convert.bound.fbf
  3664. // CHECK:STDOUT: %bound_method.loc5_37.1 => constants.%bound_method.992
  3665. // CHECK:STDOUT: %int.convert_checked.loc5_37.1 => constants.%int_2.ecc
  3666. // CHECK:STDOUT: %array_type.loc5_38.1 => constants.%array_type.c9b
  3667. // CHECK:STDOUT: %pattern_type.loc5_22 => constants.%pattern_type.5d5
  3668. // CHECK:STDOUT: }
  3669. // CHECK:STDOUT:
  3670. // CHECK:STDOUT: --- symbolic_associated_type_in_concrete_context.carbon
  3671. // CHECK:STDOUT:
  3672. // CHECK:STDOUT: constants {
  3673. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  3674. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic]
  3675. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  3676. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, @Z.%X [concrete]
  3677. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  3678. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  3679. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  3680. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  3681. // CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic]
  3682. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  3683. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  3684. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  3685. // CHECK:STDOUT: %.Self: %Z.type = bind_symbolic_name .Self [symbolic_self]
  3686. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  3687. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @Z [symbolic_self]
  3688. // CHECK:STDOUT: %Z.facet.2a2: %Z.type = facet_value %.Self.as_type, (%Z.lookup_impl_witness) [symbolic_self]
  3689. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic_self]
  3690. // CHECK:STDOUT: %Z_where.type.585: type = facet_type <@Z where %impl.elem0 = %C.f2e> [symbolic]
  3691. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Z_where.type.585 [symbolic]
  3692. // CHECK:STDOUT: %Z.impl_witness.8bc: <witness> = impl_witness file.%Z.impl_witness_table, @impl(%T) [symbolic]
  3693. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  3694. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  3695. // CHECK:STDOUT: %C.131: type = class_type @C, @C(%D) [concrete]
  3696. // CHECK:STDOUT: %Z_where.type.1a6: type = facet_type <@Z where %impl.elem0 = %C.131> [concrete]
  3697. // CHECK:STDOUT: %complete_type.00b: <witness> = complete_type_witness %Z_where.type.1a6 [concrete]
  3698. // CHECK:STDOUT: %Z.impl_witness.19e: <witness> = impl_witness file.%Z.impl_witness_table, @impl(%D) [concrete]
  3699. // CHECK:STDOUT: %Z.facet.f2a: %Z.type = facet_value %D, (%Z.impl_witness.19e) [concrete]
  3700. // CHECK:STDOUT: %pattern_type.7f8: type = pattern_type %C.131 [concrete]
  3701. // CHECK:STDOUT: %C.val: %C.131 = struct_value () [concrete]
  3702. // CHECK:STDOUT: }
  3703. // CHECK:STDOUT:
  3704. // CHECK:STDOUT: imports {
  3705. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  3706. // CHECK:STDOUT: import Core//prelude
  3707. // CHECK:STDOUT: import Core//prelude/...
  3708. // CHECK:STDOUT: }
  3709. // CHECK:STDOUT: }
  3710. // CHECK:STDOUT:
  3711. // CHECK:STDOUT: file {
  3712. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  3713. // CHECK:STDOUT: .Core = imports.%Core
  3714. // CHECK:STDOUT: .Z = %Z.decl
  3715. // CHECK:STDOUT: .C = %C.decl
  3716. // CHECK:STDOUT: .D = %D.decl
  3717. // CHECK:STDOUT: .F = %F.decl
  3718. // CHECK:STDOUT: }
  3719. // CHECK:STDOUT: %Core.import = import Core
  3720. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  3721. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
  3722. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  3723. // CHECK:STDOUT: } {
  3724. // CHECK:STDOUT: %T.loc6_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)]
  3725. // CHECK:STDOUT: }
  3726. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  3727. // CHECK:STDOUT: impl_decl @impl [concrete] {
  3728. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  3729. // CHECK:STDOUT: } {
  3730. // CHECK:STDOUT: %T.ref.loc9_24: type = name_ref T, %T.loc9_14.1 [symbolic = %T.loc9_14.2 (constants.%T)]
  3731. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  3732. // CHECK:STDOUT: %.Self: %Z.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  3733. // CHECK:STDOUT: %.Self.ref: %Z.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  3734. // CHECK:STDOUT: %X.ref: %Z.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0]
  3735. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  3736. // CHECK:STDOUT: %.loc9_37: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  3737. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  3738. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  3739. // CHECK:STDOUT: %T.ref.loc9_44: type = name_ref T, %T.loc9_14.1 [symbolic = %T.loc9_14.2 (constants.%T)]
  3740. // CHECK:STDOUT: %C.loc9_45.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc9_45.2 (constants.%C.f2e)]
  3741. // CHECK:STDOUT: %.loc9_31: type = where_expr %.Self [symbolic = %Z_where.type (constants.%Z_where.type.585)] {
  3742. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.loc9_45.1
  3743. // CHECK:STDOUT: }
  3744. // CHECK:STDOUT: %T.loc9_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc9_14.2 (constants.%T)]
  3745. // CHECK:STDOUT: }
  3746. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete]
  3747. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness %Z.impl_witness_table, @impl(constants.%T) [symbolic = @impl.%Z.impl_witness (constants.%Z.impl_witness.8bc)]
  3748. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C.f2e [symbolic = @impl.%C.loc9_45.2 (constants.%C.f2e)]
  3749. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  3750. // CHECK:STDOUT: }
  3751. // CHECK:STDOUT:
  3752. // CHECK:STDOUT: interface @Z {
  3753. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  3754. // CHECK:STDOUT: %X: type = assoc_const_decl @X [concrete] {
  3755. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, @Z.%X [concrete = constants.%assoc0]
  3756. // CHECK:STDOUT: }
  3757. // CHECK:STDOUT:
  3758. // CHECK:STDOUT: !members:
  3759. // CHECK:STDOUT: .Self = %Self
  3760. // CHECK:STDOUT: .X = @X.%assoc0
  3761. // CHECK:STDOUT: witness = (%X)
  3762. // CHECK:STDOUT: }
  3763. // CHECK:STDOUT:
  3764. // CHECK:STDOUT: generic assoc_const @X(@Z.%Self: %Z.type) {
  3765. // CHECK:STDOUT: assoc_const X:! type;
  3766. // CHECK:STDOUT: }
  3767. // CHECK:STDOUT:
  3768. // CHECK:STDOUT: generic impl @impl(%T.loc9_14.1: type) {
  3769. // CHECK:STDOUT: %T.loc9_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc9_14.2 (constants.%T)]
  3770. // CHECK:STDOUT: %C.loc9_45.2: type = class_type @C, @C(%T.loc9_14.2) [symbolic = %C.loc9_45.2 (constants.%C.f2e)]
  3771. // 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.585)]
  3772. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Z_where.type [symbolic = %require_complete (constants.%require_complete)]
  3773. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table, @impl(%T.loc9_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.8bc)]
  3774. // CHECK:STDOUT:
  3775. // CHECK:STDOUT: !definition:
  3776. // CHECK:STDOUT:
  3777. // CHECK:STDOUT: impl: %T.ref.loc9_24 as %.loc9_31 {
  3778. // CHECK:STDOUT: !members:
  3779. // CHECK:STDOUT: witness = file.%Z.impl_witness
  3780. // CHECK:STDOUT: }
  3781. // CHECK:STDOUT: }
  3782. // CHECK:STDOUT:
  3783. // CHECK:STDOUT: generic class @C(%T.loc6_9.1: type) {
  3784. // CHECK:STDOUT: %T.loc6_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)]
  3785. // CHECK:STDOUT:
  3786. // CHECK:STDOUT: !definition:
  3787. // CHECK:STDOUT:
  3788. // CHECK:STDOUT: class {
  3789. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  3790. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  3791. // CHECK:STDOUT: complete_type_witness = %complete_type
  3792. // CHECK:STDOUT:
  3793. // CHECK:STDOUT: !members:
  3794. // CHECK:STDOUT: .Self = constants.%C.f2e
  3795. // CHECK:STDOUT: }
  3796. // CHECK:STDOUT: }
  3797. // CHECK:STDOUT:
  3798. // CHECK:STDOUT: class @D {
  3799. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  3800. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  3801. // CHECK:STDOUT: complete_type_witness = %complete_type
  3802. // CHECK:STDOUT:
  3803. // CHECK:STDOUT: !members:
  3804. // CHECK:STDOUT: .Self = constants.%D
  3805. // CHECK:STDOUT: }
  3806. // CHECK:STDOUT:
  3807. // CHECK:STDOUT: fn @F() {
  3808. // CHECK:STDOUT: !entry:
  3809. // CHECK:STDOUT: name_binding_decl {
  3810. // CHECK:STDOUT: %a.patt: %pattern_type.7f8 = binding_pattern a [concrete]
  3811. // CHECK:STDOUT: }
  3812. // CHECK:STDOUT: %.loc12_21.1: %empty_struct_type = struct_literal ()
  3813. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  3814. // CHECK:STDOUT: %D.ref.loc12_28: type = name_ref D, file.%D.decl [concrete = constants.%D]
  3815. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%D) [concrete = constants.%C.131]
  3816. // CHECK:STDOUT: %.loc12_21.2: ref %C.131 = temporary_storage
  3817. // CHECK:STDOUT: %.loc12_21.3: init %C.131 = class_init (), %.loc12_21.2 [concrete = constants.%C.val]
  3818. // CHECK:STDOUT: %.loc12_21.4: ref %C.131 = temporary %.loc12_21.2, %.loc12_21.3
  3819. // CHECK:STDOUT: %.loc12_23.1: ref %C.131 = converted %.loc12_21.1, %.loc12_21.4
  3820. // CHECK:STDOUT: %.loc12_11.1: type = splice_block %impl.elem0 [concrete = constants.%C.131] {
  3821. // CHECK:STDOUT: %D.ref.loc12_10: type = name_ref D, file.%D.decl [concrete = constants.%D]
  3822. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  3823. // CHECK:STDOUT: %X.ref: %Z.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0]
  3824. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value constants.%D, (constants.%Z.impl_witness.19e) [concrete = constants.%Z.facet.f2a]
  3825. // CHECK:STDOUT: %.loc12_11.2: %Z.type = converted %D.ref.loc12_10, %Z.facet [concrete = constants.%Z.facet.f2a]
  3826. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.impl_witness.19e, element0 [concrete = constants.%C.131]
  3827. // CHECK:STDOUT: }
  3828. // CHECK:STDOUT: %.loc12_23.2: %C.131 = bind_value %.loc12_23.1
  3829. // CHECK:STDOUT: %a: %C.131 = bind_name a, %.loc12_23.2
  3830. // CHECK:STDOUT: return
  3831. // CHECK:STDOUT: }
  3832. // CHECK:STDOUT:
  3833. // CHECK:STDOUT: specific @X(constants.%Self) {}
  3834. // CHECK:STDOUT:
  3835. // CHECK:STDOUT: specific @C(constants.%T) {
  3836. // CHECK:STDOUT: %T.loc6_9.2 => constants.%T
  3837. // CHECK:STDOUT: }
  3838. // CHECK:STDOUT:
  3839. // CHECK:STDOUT: specific @X(constants.%Z.facet.2a2) {}
  3840. // CHECK:STDOUT:
  3841. // CHECK:STDOUT: specific @impl(constants.%T) {
  3842. // CHECK:STDOUT: %T.loc9_14.2 => constants.%T
  3843. // CHECK:STDOUT: %C.loc9_45.2 => constants.%C.f2e
  3844. // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.585
  3845. // CHECK:STDOUT: %require_complete => constants.%require_complete
  3846. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.8bc
  3847. // CHECK:STDOUT: }
  3848. // CHECK:STDOUT:
  3849. // CHECK:STDOUT: specific @impl(constants.%D) {
  3850. // CHECK:STDOUT: %T.loc9_14.2 => constants.%D
  3851. // CHECK:STDOUT: %C.loc9_45.2 => constants.%C.131
  3852. // CHECK:STDOUT: %Z_where.type => constants.%Z_where.type.1a6
  3853. // CHECK:STDOUT: %require_complete => constants.%complete_type.00b
  3854. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.19e
  3855. // CHECK:STDOUT:
  3856. // CHECK:STDOUT: !definition:
  3857. // CHECK:STDOUT: }
  3858. // CHECK:STDOUT:
  3859. // CHECK:STDOUT: specific @C(constants.%D) {
  3860. // CHECK:STDOUT: %T.loc6_9.2 => constants.%D
  3861. // CHECK:STDOUT:
  3862. // CHECK:STDOUT: !definition:
  3863. // CHECK:STDOUT: }
  3864. // CHECK:STDOUT:
  3865. // CHECK:STDOUT: specific @X(constants.%Z.facet.f2a) {}
  3866. // CHECK:STDOUT: