import.carbon 188 KB

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