import.carbon 170 KB

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