import.carbon 97 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/no_prelude/import.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/no_prelude/import.carbon
  10. // --- package_a.carbon
  11. package PackageA;
  12. interface HasF {
  13. fn F();
  14. }
  15. class C {}
  16. // Same library as the class and interface.
  17. impl C as HasF {
  18. fn F() {}
  19. }
  20. // --- package_b.carbon
  21. package PackageB;
  22. import PackageA;
  23. interface HasG {
  24. fn G();
  25. }
  26. class D {}
  27. // Same library as the interface.
  28. impl PackageA.C as HasG {
  29. fn G() {}
  30. }
  31. // Same library as the class.
  32. impl D as PackageA.HasF {
  33. fn F() {}
  34. }
  35. // Same library as the class and interface.
  36. impl D as HasG {
  37. fn G() {}
  38. }
  39. // --- use_cf.carbon
  40. library "[[@TEST_NAME]]";
  41. import PackageA;
  42. fn TestCF(c: PackageA.C) {
  43. c.(PackageA.HasF.F)();
  44. }
  45. // --- use_df.carbon
  46. library "[[@TEST_NAME]]";
  47. import PackageA;
  48. import PackageB;
  49. fn TestDF(d: PackageB.D) {
  50. d.(PackageA.HasF.F)();
  51. }
  52. // --- use_cg.carbon
  53. library "[[@TEST_NAME]]";
  54. import PackageA;
  55. import PackageB;
  56. fn TestCG(c: PackageA.C) {
  57. c.(PackageB.HasG.G)();
  58. }
  59. // --- use_dg.carbon
  60. library "[[@TEST_NAME]]";
  61. import PackageB;
  62. fn TestDG(d: PackageB.D) {
  63. d.(PackageB.HasG.G)();
  64. }
  65. // --- associated_interface.carbon
  66. package PackageAssociatedInterface;
  67. interface Z {
  68. fn H();
  69. }
  70. impl () as Z {
  71. fn H() {}
  72. }
  73. // --- import_associated_interface.carbon
  74. package PackageImportAssociatedInterface;
  75. import PackageAssociatedInterface;
  76. fn J() {
  77. ().(PackageAssociatedInterface.Z.H)();
  78. }
  79. // --- has_param.carbon
  80. package PackageHasParam;
  81. class AnyParam[T:! type](X:! T) {}
  82. interface Y {
  83. fn K() {}
  84. }
  85. // --- has_generic_interface.carbon
  86. package PackageGenericInterface;
  87. import PackageHasParam;
  88. interface GenericInterface(U:! type) {}
  89. impl PackageHasParam.AnyParam(GenericInterface) as PackageHasParam.Y {
  90. fn K() {}
  91. }
  92. fn L() {
  93. var obj: PackageHasParam.AnyParam(GenericInterface) = {};
  94. obj.(PackageHasParam.Y.K)();
  95. }
  96. // --- use_generic_interface_as_param.carbon
  97. library "[[@TEST_NAME]]";
  98. import PackageHasParam;
  99. import PackageGenericInterface;
  100. fn M() {
  101. var obj: PackageHasParam.AnyParam(
  102. PackageGenericInterface.GenericInterface) = {};
  103. obj.(PackageHasParam.Y.K)();
  104. }
  105. // --- has_extra_interfaces.carbon
  106. package HasExtraInterfaces;
  107. interface Extra1 {}
  108. interface Extra2 {}
  109. interface Extra3 {}
  110. interface Extra4 {}
  111. interface Extra5 {}
  112. interface Extra6 {}
  113. interface Extra7 {}
  114. interface Extra8 {}
  115. class C(T:! type) {}
  116. interface I { fn F(); }
  117. impl C((Extra1, Extra2, Extra3, Extra4, Extra5, Extra6, Extra7, Extra8)) as I {
  118. fn F() {}
  119. }
  120. // --- fail_use_has_extra_interfaces.carbon
  121. package UseHasExtraInterfaces;
  122. import HasExtraInterfaces;
  123. fn Test(c: HasExtraInterfaces.C(type)) {
  124. // This triggers the import of a bunch more interfaces, which reallocates the
  125. // interface ValueStore. Ensure that doesn't result in a use-after-free crash.
  126. // CHECK:STDERR: fail_use_has_extra_interfaces.carbon:[[@LINE+3]]:3: error: cannot access member of interface `HasExtraInterfaces.I` in type `HasExtraInterfaces.C(type)` that does not implement that interface [MissingImplInMemberAccess]
  127. // CHECK:STDERR: c.(HasExtraInterfaces.I.F)();
  128. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  129. c.(HasExtraInterfaces.I.F)();
  130. }
  131. // CHECK:STDOUT: --- package_a.carbon
  132. // CHECK:STDOUT:
  133. // CHECK:STDOUT: constants {
  134. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template]
  135. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  136. // CHECK:STDOUT: %F.type.16d: type = fn_type @F.1 [template]
  137. // CHECK:STDOUT: %F.a20: %F.type.16d = struct_value () [template]
  138. // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %HasF.type, %F.type.16d [template]
  139. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @HasF.%F.decl [template]
  140. // CHECK:STDOUT: %C: type = class_type @C [template]
  141. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  142. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  143. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template]
  144. // CHECK:STDOUT: %F.type.2e0: type = fn_type @F.2 [template]
  145. // CHECK:STDOUT: %F.89c: %F.type.2e0 = struct_value () [template]
  146. // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %C, %impl_witness [template]
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: file {
  150. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  151. // CHECK:STDOUT: .HasF = %HasF.decl
  152. // CHECK:STDOUT: .C = %C.decl
  153. // CHECK:STDOUT: }
  154. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%HasF.type] {} {}
  155. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  156. // CHECK:STDOUT: impl_decl @impl [template] {} {
  157. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  158. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
  159. // CHECK:STDOUT: }
  160. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template = constants.%impl_witness]
  161. // CHECK:STDOUT: }
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: interface @HasF {
  164. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  165. // CHECK:STDOUT: %F.decl: %F.type.16d = fn_decl @F.1 [template = constants.%F.a20] {} {}
  166. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0]
  167. // CHECK:STDOUT:
  168. // CHECK:STDOUT: !members:
  169. // CHECK:STDOUT: .Self = %Self
  170. // CHECK:STDOUT: .F = %assoc0
  171. // CHECK:STDOUT: witness = (%F.decl)
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT:
  174. // CHECK:STDOUT: impl @impl: %C.ref as %HasF.ref {
  175. // CHECK:STDOUT: %F.decl: %F.type.2e0 = fn_decl @F.2 [template = constants.%F.89c] {} {}
  176. // CHECK:STDOUT:
  177. // CHECK:STDOUT: !members:
  178. // CHECK:STDOUT: .F = %F.decl
  179. // CHECK:STDOUT: witness = file.%impl_witness
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT:
  182. // CHECK:STDOUT: class @C {
  183. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  184. // CHECK:STDOUT:
  185. // CHECK:STDOUT: !members:
  186. // CHECK:STDOUT: .Self = constants.%C
  187. // CHECK:STDOUT: complete_type_witness = %complete_type
  188. // CHECK:STDOUT: }
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %HasF.type) {
  191. // CHECK:STDOUT:
  192. // CHECK:STDOUT: fn();
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT:
  195. // CHECK:STDOUT: fn @F.2() {
  196. // CHECK:STDOUT: !entry:
  197. // CHECK:STDOUT: return
  198. // CHECK:STDOUT: }
  199. // CHECK:STDOUT:
  200. // CHECK:STDOUT: specific @F.1(constants.%Self) {}
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {}
  203. // CHECK:STDOUT:
  204. // CHECK:STDOUT: --- package_b.carbon
  205. // CHECK:STDOUT:
  206. // CHECK:STDOUT: constants {
  207. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [template]
  208. // CHECK:STDOUT: %Self.4db: %HasG.type = bind_symbolic_name Self, 0 [symbolic]
  209. // CHECK:STDOUT: %G.type.6fe: type = fn_type @G.1 [template]
  210. // CHECK:STDOUT: %G.0ea: %G.type.6fe = struct_value () [template]
  211. // CHECK:STDOUT: %G.assoc_type: type = assoc_entity_type %HasG.type, %G.type.6fe [template]
  212. // CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, @HasG.%G.decl [template]
  213. // CHECK:STDOUT: %D: type = class_type @D [template]
  214. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  215. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  216. // CHECK:STDOUT: %C: type = class_type @C [template]
  217. // CHECK:STDOUT: %impl_witness.58b: <witness> = impl_witness (@impl.1.%G.decl) [template]
  218. // CHECK:STDOUT: %G.type.407: type = fn_type @G.2 [template]
  219. // CHECK:STDOUT: %G.b4a: %G.type.407 = struct_value () [template]
  220. // CHECK:STDOUT: %HasG.facet.fd4: %HasG.type = facet_value %C, %impl_witness.58b [template]
  221. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template]
  222. // CHECK:STDOUT: %Self.c46: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  223. // CHECK:STDOUT: %F.type.d75: type = fn_type @F.1 [template]
  224. // CHECK:STDOUT: %F.3ac: %F.type.d75 = struct_value () [template]
  225. // CHECK:STDOUT: %impl_witness.ea3: <witness> = impl_witness (@impl.2.%F.decl) [template]
  226. // CHECK:STDOUT: %F.type.e3c: type = fn_type @F.2 [template]
  227. // CHECK:STDOUT: %F.66f: %F.type.e3c = struct_value () [template]
  228. // CHECK:STDOUT: %HasF.facet: %HasF.type = facet_value %D, %impl_witness.ea3 [template]
  229. // CHECK:STDOUT: %impl_witness.88f: <witness> = impl_witness (@impl.3.%G.decl) [template]
  230. // CHECK:STDOUT: %G.type.854: type = fn_type @G.3 [template]
  231. // CHECK:STDOUT: %G.ae6: %G.type.854 = struct_value () [template]
  232. // CHECK:STDOUT: %HasG.facet.bec: %HasG.type = facet_value %D, %impl_witness.88f [template]
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: imports {
  236. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [template] {
  237. // CHECK:STDOUT: .C = %import_ref.0ac
  238. // CHECK:STDOUT: .HasF = %import_ref.2d0
  239. // CHECK:STDOUT: import PackageA//default
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT: %import_ref.0ac: type = import_ref PackageA//default, C, loaded [template = constants.%C]
  242. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type]
  243. // CHECK:STDOUT: %import_ref.2c4 = import_ref PackageA//default, inst25 [no loc], unloaded
  244. // CHECK:STDOUT: %import_ref.2d0: type = import_ref PackageA//default, HasF, loaded [template = constants.%HasF.type]
  245. // CHECK:STDOUT: %import_ref.28d = import_ref PackageA//default, inst15 [no loc], unloaded
  246. // CHECK:STDOUT: %import_ref.cc4 = import_ref PackageA//default, loc5_9, unloaded
  247. // CHECK:STDOUT: %import_ref.ab3: %F.type.d75 = import_ref PackageA//default, F, loaded [template = constants.%F.3ac]
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: file {
  251. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  252. // CHECK:STDOUT: .PackageA = imports.%PackageA
  253. // CHECK:STDOUT: .HasG = %HasG.decl
  254. // CHECK:STDOUT: .D = %D.decl
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT: %PackageA.import = import PackageA
  257. // CHECK:STDOUT: %HasG.decl: type = interface_decl @HasG [template = constants.%HasG.type] {} {}
  258. // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {}
  259. // CHECK:STDOUT: impl_decl @impl.1 [template] {} {
  260. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [template = imports.%PackageA]
  261. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.0ac [template = constants.%C]
  262. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [template = constants.%HasG.type]
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT: %impl_witness.loc13: <witness> = impl_witness (@impl.1.%G.decl) [template = constants.%impl_witness.58b]
  265. // CHECK:STDOUT: impl_decl @impl.2 [template] {} {
  266. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D]
  267. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [template = imports.%PackageA]
  268. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.2d0 [template = constants.%HasF.type]
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: %impl_witness.loc18: <witness> = impl_witness (@impl.2.%F.decl) [template = constants.%impl_witness.ea3]
  271. // CHECK:STDOUT: impl_decl @impl.3 [template] {} {
  272. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D]
  273. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, file.%HasG.decl [template = constants.%HasG.type]
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT: %impl_witness.loc23: <witness> = impl_witness (@impl.3.%G.decl) [template = constants.%impl_witness.88f]
  276. // CHECK:STDOUT: }
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: interface @HasG {
  279. // CHECK:STDOUT: %Self: %HasG.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.4db]
  280. // CHECK:STDOUT: %G.decl: %G.type.6fe = fn_decl @G.1 [template = constants.%G.0ea] {} {}
  281. // CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, %G.decl [template = constants.%assoc0]
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: !members:
  284. // CHECK:STDOUT: .Self = %Self
  285. // CHECK:STDOUT: .G = %assoc0
  286. // CHECK:STDOUT: witness = (%G.decl)
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  290. // CHECK:STDOUT: !members:
  291. // CHECK:STDOUT: .Self = imports.%import_ref.28d
  292. // CHECK:STDOUT: .F = imports.%import_ref.cc4
  293. // CHECK:STDOUT: witness = (imports.%import_ref.ab3)
  294. // CHECK:STDOUT: }
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: impl @impl.1: %C.ref as %HasG.ref {
  297. // CHECK:STDOUT: %G.decl: %G.type.407 = fn_decl @G.2 [template = constants.%G.b4a] {} {}
  298. // CHECK:STDOUT:
  299. // CHECK:STDOUT: !members:
  300. // CHECK:STDOUT: .G = %G.decl
  301. // CHECK:STDOUT: witness = file.%impl_witness.loc13
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT:
  304. // CHECK:STDOUT: impl @impl.2: %D.ref as %HasF.ref {
  305. // CHECK:STDOUT: %F.decl: %F.type.e3c = fn_decl @F.2 [template = constants.%F.66f] {} {}
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: !members:
  308. // CHECK:STDOUT: .F = %F.decl
  309. // CHECK:STDOUT: witness = file.%impl_witness.loc18
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: impl @impl.3: %D.ref as %HasG.ref {
  313. // CHECK:STDOUT: %G.decl: %G.type.854 = fn_decl @G.3 [template = constants.%G.ae6] {} {}
  314. // CHECK:STDOUT:
  315. // CHECK:STDOUT: !members:
  316. // CHECK:STDOUT: .G = %G.decl
  317. // CHECK:STDOUT: witness = file.%impl_witness.loc23
  318. // CHECK:STDOUT: }
  319. // CHECK:STDOUT:
  320. // CHECK:STDOUT: class @D {
  321. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: !members:
  324. // CHECK:STDOUT: .Self = constants.%D
  325. // CHECK:STDOUT: complete_type_witness = %complete_type
  326. // CHECK:STDOUT: }
  327. // CHECK:STDOUT:
  328. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  329. // CHECK:STDOUT: !members:
  330. // CHECK:STDOUT: .Self = imports.%import_ref.2c4
  331. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT:
  334. // CHECK:STDOUT: generic fn @G.1(@HasG.%Self: %HasG.type) {
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: fn();
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: fn @G.2() {
  340. // CHECK:STDOUT: !entry:
  341. // CHECK:STDOUT: return
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: generic fn @F.1(constants.%Self.c46: %HasF.type) [from "package_a.carbon"] {
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: fn();
  347. // CHECK:STDOUT: }
  348. // CHECK:STDOUT:
  349. // CHECK:STDOUT: fn @F.2() {
  350. // CHECK:STDOUT: !entry:
  351. // CHECK:STDOUT: return
  352. // CHECK:STDOUT: }
  353. // CHECK:STDOUT:
  354. // CHECK:STDOUT: fn @G.3() {
  355. // CHECK:STDOUT: !entry:
  356. // CHECK:STDOUT: return
  357. // CHECK:STDOUT: }
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: specific @G.1(constants.%Self.4db) {}
  360. // CHECK:STDOUT:
  361. // CHECK:STDOUT: specific @G.1(constants.%HasG.facet.fd4) {}
  362. // CHECK:STDOUT:
  363. // CHECK:STDOUT: specific @F.1(constants.%Self.c46) {}
  364. // CHECK:STDOUT:
  365. // CHECK:STDOUT: specific @F.1(constants.%HasF.facet) {}
  366. // CHECK:STDOUT:
  367. // CHECK:STDOUT: specific @G.1(constants.%HasG.facet.bec) {}
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: --- use_cf.carbon
  370. // CHECK:STDOUT:
  371. // CHECK:STDOUT: constants {
  372. // CHECK:STDOUT: %C: type = class_type @C [template]
  373. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  374. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  375. // CHECK:STDOUT: %TestCF.type: type = fn_type @TestCF [template]
  376. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  377. // CHECK:STDOUT: %TestCF: %TestCF.type = struct_value () [template]
  378. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template]
  379. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  380. // CHECK:STDOUT: %F.type.d75: type = fn_type @F.1 [template]
  381. // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %HasF.type, %F.type.d75 [template]
  382. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.4a0 [template]
  383. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%import_ref.ac3) [template]
  384. // CHECK:STDOUT: %F.type.c5e: type = fn_type @F.2 [template]
  385. // CHECK:STDOUT: %F.8d0: %F.type.c5e = struct_value () [template]
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: imports {
  389. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [template] {
  390. // CHECK:STDOUT: .C = %import_ref.0ac
  391. // CHECK:STDOUT: .HasF = %import_ref.2d0
  392. // CHECK:STDOUT: import PackageA//default
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT: %import_ref.0ac: type = import_ref PackageA//default, C, loaded [template = constants.%C]
  395. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type]
  396. // CHECK:STDOUT: %import_ref.2c4 = import_ref PackageA//default, inst25 [no loc], unloaded
  397. // CHECK:STDOUT: %import_ref.2d0: type = import_ref PackageA//default, HasF, loaded [template = constants.%HasF.type]
  398. // CHECK:STDOUT: %import_ref.28d = import_ref PackageA//default, inst15 [no loc], unloaded
  399. // CHECK:STDOUT: %import_ref.b67: %F.assoc_type = import_ref PackageA//default, loc5_9, loaded [template = constants.%assoc0]
  400. // CHECK:STDOUT: %import_ref.64f = import_ref PackageA//default, F, unloaded
  401. // CHECK:STDOUT: %import_ref.7a7: <witness> = import_ref PackageA//default, loc11_16, loaded [template = constants.%impl_witness]
  402. // CHECK:STDOUT: %import_ref.3de: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C]
  403. // CHECK:STDOUT: %import_ref.e33: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type]
  404. // CHECK:STDOUT: }
  405. // CHECK:STDOUT:
  406. // CHECK:STDOUT: file {
  407. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  408. // CHECK:STDOUT: .PackageA = imports.%PackageA
  409. // CHECK:STDOUT: .TestCF = %TestCF.decl
  410. // CHECK:STDOUT: }
  411. // CHECK:STDOUT: %PackageA.import = import PackageA
  412. // CHECK:STDOUT: %TestCF.decl: %TestCF.type = fn_decl @TestCF [template = constants.%TestCF] {
  413. // CHECK:STDOUT: %c.patt: %C = binding_pattern c
  414. // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0
  415. // CHECK:STDOUT: } {
  416. // CHECK:STDOUT: %c.param: %C = value_param runtime_param0
  417. // CHECK:STDOUT: %.loc6: type = splice_block %C.ref [template = constants.%C] {
  418. // CHECK:STDOUT: %PackageA.ref.loc6: <namespace> = name_ref PackageA, imports.%PackageA [template = imports.%PackageA]
  419. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.0ac [template = constants.%C]
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT: }
  424. // CHECK:STDOUT:
  425. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  426. // CHECK:STDOUT: !members:
  427. // CHECK:STDOUT: .Self = imports.%import_ref.28d
  428. // CHECK:STDOUT: .F = imports.%import_ref.b67
  429. // CHECK:STDOUT: witness = (imports.%import_ref.64f)
  430. // CHECK:STDOUT: }
  431. // CHECK:STDOUT:
  432. // CHECK:STDOUT: impl @impl: imports.%import_ref.3de as imports.%import_ref.e33 [from "package_a.carbon"] {
  433. // CHECK:STDOUT: !members:
  434. // CHECK:STDOUT: witness = imports.%import_ref.7a7
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  438. // CHECK:STDOUT: !members:
  439. // CHECK:STDOUT: .Self = imports.%import_ref.2c4
  440. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  441. // CHECK:STDOUT: }
  442. // CHECK:STDOUT:
  443. // CHECK:STDOUT: fn @TestCF(%c.param_patt: %C) {
  444. // CHECK:STDOUT: !entry:
  445. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  446. // CHECK:STDOUT: %PackageA.ref.loc7: <namespace> = name_ref PackageA, imports.%PackageA [template = imports.%PackageA]
  447. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.2d0 [template = constants.%HasF.type]
  448. // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.b67 [template = constants.%assoc0]
  449. // CHECK:STDOUT: %impl.elem0: %F.type.d75 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.8d0]
  450. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
  451. // CHECK:STDOUT: return
  452. // CHECK:STDOUT: }
  453. // CHECK:STDOUT:
  454. // CHECK:STDOUT: generic fn @F.1(constants.%Self: %HasF.type) [from "package_a.carbon"] {
  455. // CHECK:STDOUT:
  456. // CHECK:STDOUT: fn();
  457. // CHECK:STDOUT: }
  458. // CHECK:STDOUT:
  459. // CHECK:STDOUT: fn @F.2() [from "package_a.carbon"];
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: specific @F.1(constants.%Self) {}
  462. // CHECK:STDOUT:
  463. // CHECK:STDOUT: --- use_df.carbon
  464. // CHECK:STDOUT:
  465. // CHECK:STDOUT: constants {
  466. // CHECK:STDOUT: %D: type = class_type @D [template]
  467. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  468. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  469. // CHECK:STDOUT: %TestDF.type: type = fn_type @TestDF [template]
  470. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  471. // CHECK:STDOUT: %TestDF: %TestDF.type = struct_value () [template]
  472. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template]
  473. // CHECK:STDOUT: %Self.c46: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  474. // CHECK:STDOUT: %F.type.d75: type = fn_type @F.1 [template]
  475. // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %HasF.type, %F.type.d75 [template]
  476. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.4a0 [template]
  477. // CHECK:STDOUT: %C: type = class_type @C [template]
  478. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [template]
  479. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%import_ref.e33a) [template]
  480. // CHECK:STDOUT: %F.type.975: type = fn_type @F.2 [template]
  481. // CHECK:STDOUT: %F.ec0: %F.type.975 = struct_value () [template]
  482. // CHECK:STDOUT: }
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: imports {
  485. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [template] {
  486. // CHECK:STDOUT: .HasF = %import_ref.2d0
  487. // CHECK:STDOUT: import PackageA//default
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT: %PackageB: <namespace> = namespace file.%PackageB.import, [template] {
  490. // CHECK:STDOUT: .D = %import_ref.275
  491. // CHECK:STDOUT: import PackageB//default
  492. // CHECK:STDOUT: }
  493. // CHECK:STDOUT: %import_ref.275: type = import_ref PackageB//default, D, loaded [template = constants.%D]
  494. // CHECK:STDOUT: %import_ref.8f24d3.1: <witness> = import_ref PackageB//default, loc10_10, loaded [template = constants.%complete_type]
  495. // CHECK:STDOUT: %import_ref.cab = import_ref PackageB//default, inst27 [no loc], unloaded
  496. // CHECK:STDOUT: %import_ref.2d0: type = import_ref PackageA//default, HasF, loaded [template = constants.%HasF.type]
  497. // CHECK:STDOUT: %import_ref.28d = import_ref PackageA//default, inst15 [no loc], unloaded
  498. // CHECK:STDOUT: %import_ref.b67: %F.assoc_type = import_ref PackageA//default, loc5_9, loaded [template = constants.%assoc0]
  499. // CHECK:STDOUT: %import_ref.64f = import_ref PackageA//default, F, unloaded
  500. // CHECK:STDOUT: %import_ref.487 = import_ref PackageA//default, loc11_16, unloaded
  501. // CHECK:STDOUT: %import_ref.8f24d3.2: <witness> = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type]
  502. // CHECK:STDOUT: %import_ref.2c4 = import_ref PackageA//default, inst25 [no loc], unloaded
  503. // CHECK:STDOUT: %import_ref.3de: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C]
  504. // CHECK:STDOUT: %import_ref.e338: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type]
  505. // CHECK:STDOUT: %import_ref.f91 = import_ref PackageB//default, loc13_25, unloaded
  506. // CHECK:STDOUT: %import_ref.f3e = import_ref PackageB//default, inst17 [no loc], unloaded
  507. // CHECK:STDOUT: %import_ref.a79 = import_ref PackageB//default, loc7_9, unloaded
  508. // CHECK:STDOUT: %import_ref.f03 = import_ref PackageB//default, G, unloaded
  509. // CHECK:STDOUT: %import_ref.4a6: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C]
  510. // CHECK:STDOUT: %import_ref.e527c5.1: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type]
  511. // CHECK:STDOUT: %import_ref.dc8: <witness> = import_ref PackageB//default, loc18_25, loaded [template = constants.%impl_witness]
  512. // CHECK:STDOUT: %import_ref.3b992b.1: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D]
  513. // CHECK:STDOUT: %import_ref.9e1: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type]
  514. // CHECK:STDOUT: %import_ref.ebd = import_ref PackageB//default, loc23_16, unloaded
  515. // CHECK:STDOUT: %import_ref.3b992b.2: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D]
  516. // CHECK:STDOUT: %import_ref.e527c5.2: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type]
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: file {
  520. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  521. // CHECK:STDOUT: .PackageA = imports.%PackageA
  522. // CHECK:STDOUT: .PackageB = imports.%PackageB
  523. // CHECK:STDOUT: .TestDF = %TestDF.decl
  524. // CHECK:STDOUT: }
  525. // CHECK:STDOUT: %PackageA.import = import PackageA
  526. // CHECK:STDOUT: %PackageB.import = import PackageB
  527. // CHECK:STDOUT: %TestDF.decl: %TestDF.type = fn_decl @TestDF [template = constants.%TestDF] {
  528. // CHECK:STDOUT: %d.patt: %D = binding_pattern d
  529. // CHECK:STDOUT: %d.param_patt: %D = value_param_pattern %d.patt, runtime_param0
  530. // CHECK:STDOUT: } {
  531. // CHECK:STDOUT: %d.param: %D = value_param runtime_param0
  532. // CHECK:STDOUT: %.loc7: type = splice_block %D.ref [template = constants.%D] {
  533. // CHECK:STDOUT: %PackageB.ref: <namespace> = name_ref PackageB, imports.%PackageB [template = imports.%PackageB]
  534. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.275 [template = constants.%D]
  535. // CHECK:STDOUT: }
  536. // CHECK:STDOUT: %d: %D = bind_name d, %d.param
  537. // CHECK:STDOUT: }
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT:
  540. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  541. // CHECK:STDOUT: !members:
  542. // CHECK:STDOUT: .Self = imports.%import_ref.28d
  543. // CHECK:STDOUT: .F = imports.%import_ref.b67
  544. // CHECK:STDOUT: witness = (imports.%import_ref.64f)
  545. // CHECK:STDOUT: }
  546. // CHECK:STDOUT:
  547. // CHECK:STDOUT: interface @HasG [from "package_b.carbon"] {
  548. // CHECK:STDOUT: !members:
  549. // CHECK:STDOUT: .Self = imports.%import_ref.f3e
  550. // CHECK:STDOUT: .G = imports.%import_ref.a79
  551. // CHECK:STDOUT: witness = (imports.%import_ref.f03)
  552. // CHECK:STDOUT: }
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: impl @impl.1: imports.%import_ref.3de as imports.%import_ref.e338 [from "package_a.carbon"] {
  555. // CHECK:STDOUT: !members:
  556. // CHECK:STDOUT: witness = imports.%import_ref.487
  557. // CHECK:STDOUT: }
  558. // CHECK:STDOUT:
  559. // CHECK:STDOUT: impl @impl.2: imports.%import_ref.4a6 as imports.%import_ref.e527c5.1 [from "package_b.carbon"] {
  560. // CHECK:STDOUT: !members:
  561. // CHECK:STDOUT: witness = imports.%import_ref.f91
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: impl @impl.3: imports.%import_ref.3b992b.1 as imports.%import_ref.9e1 [from "package_b.carbon"] {
  565. // CHECK:STDOUT: !members:
  566. // CHECK:STDOUT: witness = imports.%import_ref.dc8
  567. // CHECK:STDOUT: }
  568. // CHECK:STDOUT:
  569. // CHECK:STDOUT: impl @impl.4: imports.%import_ref.3b992b.2 as imports.%import_ref.e527c5.2 [from "package_b.carbon"] {
  570. // CHECK:STDOUT: !members:
  571. // CHECK:STDOUT: witness = imports.%import_ref.ebd
  572. // CHECK:STDOUT: }
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: class @D [from "package_b.carbon"] {
  575. // CHECK:STDOUT: !members:
  576. // CHECK:STDOUT: .Self = imports.%import_ref.cab
  577. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f24d3.1
  578. // CHECK:STDOUT: }
  579. // CHECK:STDOUT:
  580. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  581. // CHECK:STDOUT: !members:
  582. // CHECK:STDOUT: .Self = imports.%import_ref.2c4
  583. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f24d3.2
  584. // CHECK:STDOUT: }
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: fn @TestDF(%d.param_patt: %D) {
  587. // CHECK:STDOUT: !entry:
  588. // CHECK:STDOUT: %d.ref: %D = name_ref d, %d
  589. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [template = imports.%PackageA]
  590. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.2d0 [template = constants.%HasF.type]
  591. // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.b67 [template = constants.%assoc0]
  592. // CHECK:STDOUT: %impl.elem0: %F.type.d75 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.ec0]
  593. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
  594. // CHECK:STDOUT: return
  595. // CHECK:STDOUT: }
  596. // CHECK:STDOUT:
  597. // CHECK:STDOUT: generic fn @F.1(constants.%Self.c46: %HasF.type) [from "package_a.carbon"] {
  598. // CHECK:STDOUT:
  599. // CHECK:STDOUT: fn();
  600. // CHECK:STDOUT: }
  601. // CHECK:STDOUT:
  602. // CHECK:STDOUT: fn @F.2() [from "package_b.carbon"];
  603. // CHECK:STDOUT:
  604. // CHECK:STDOUT: specific @F.1(constants.%Self.c46) {}
  605. // CHECK:STDOUT:
  606. // CHECK:STDOUT: --- use_cg.carbon
  607. // CHECK:STDOUT:
  608. // CHECK:STDOUT: constants {
  609. // CHECK:STDOUT: %C: type = class_type @C [template]
  610. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  611. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  612. // CHECK:STDOUT: %TestCG.type: type = fn_type @TestCG [template]
  613. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  614. // CHECK:STDOUT: %TestCG: %TestCG.type = struct_value () [template]
  615. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [template]
  616. // CHECK:STDOUT: %Self.102: %HasG.type = bind_symbolic_name Self, 0 [symbolic]
  617. // CHECK:STDOUT: %G.type.813: type = fn_type @G.1 [template]
  618. // CHECK:STDOUT: %G.assoc_type: type = assoc_entity_type %HasG.type, %G.type.813 [template]
  619. // CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, imports.%import_ref.5b2 [template]
  620. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template]
  621. // CHECK:STDOUT: %D: type = class_type @D [template]
  622. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%import_ref.a5c) [template]
  623. // CHECK:STDOUT: %G.type.6c1: type = fn_type @G.2 [template]
  624. // CHECK:STDOUT: %G.b51: %G.type.6c1 = struct_value () [template]
  625. // CHECK:STDOUT: }
  626. // CHECK:STDOUT:
  627. // CHECK:STDOUT: imports {
  628. // CHECK:STDOUT: %PackageA: <namespace> = namespace file.%PackageA.import, [template] {
  629. // CHECK:STDOUT: .C = %import_ref.0ac
  630. // CHECK:STDOUT: import PackageA//default
  631. // CHECK:STDOUT: }
  632. // CHECK:STDOUT: %PackageB: <namespace> = namespace file.%PackageB.import, [template] {
  633. // CHECK:STDOUT: .HasG = %import_ref.9db
  634. // CHECK:STDOUT: import PackageB//default
  635. // CHECK:STDOUT: }
  636. // CHECK:STDOUT: %import_ref.0ac: type = import_ref PackageA//default, C, loaded [template = constants.%C]
  637. // CHECK:STDOUT: %import_ref.8f24d3.1: <witness> = import_ref PackageA//default, loc8_10, loaded [template = constants.%complete_type]
  638. // CHECK:STDOUT: %import_ref.2c4 = import_ref PackageA//default, inst25 [no loc], unloaded
  639. // CHECK:STDOUT: %import_ref.9db: type = import_ref PackageB//default, HasG, loaded [template = constants.%HasG.type]
  640. // CHECK:STDOUT: %import_ref.f3e = import_ref PackageB//default, inst17 [no loc], unloaded
  641. // CHECK:STDOUT: %import_ref.89f: %G.assoc_type = import_ref PackageB//default, loc7_9, loaded [template = constants.%assoc0]
  642. // CHECK:STDOUT: %import_ref.f03 = import_ref PackageB//default, G, unloaded
  643. // CHECK:STDOUT: %import_ref.487 = import_ref PackageA//default, loc11_16, unloaded
  644. // CHECK:STDOUT: %import_ref.28d = import_ref PackageA//default, inst15 [no loc], unloaded
  645. // CHECK:STDOUT: %import_ref.cc4 = import_ref PackageA//default, loc5_9, unloaded
  646. // CHECK:STDOUT: %import_ref.64f = import_ref PackageA//default, F, unloaded
  647. // CHECK:STDOUT: %import_ref.3de: type = import_ref PackageA//default, loc11_6, loaded [template = constants.%C]
  648. // CHECK:STDOUT: %import_ref.e33: type = import_ref PackageA//default, loc11_11, loaded [template = constants.%HasF.type]
  649. // CHECK:STDOUT: %import_ref.38a: <witness> = import_ref PackageB//default, loc13_25, loaded [template = constants.%impl_witness]
  650. // CHECK:STDOUT: %import_ref.4a6: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C]
  651. // CHECK:STDOUT: %import_ref.e527c5.1: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type]
  652. // CHECK:STDOUT: %import_ref.f77 = import_ref PackageB//default, loc18_25, unloaded
  653. // CHECK:STDOUT: %import_ref.8f24d3.2: <witness> = import_ref PackageB//default, loc10_10, loaded [template = constants.%complete_type]
  654. // CHECK:STDOUT: %import_ref.cab = import_ref PackageB//default, inst27 [no loc], unloaded
  655. // CHECK:STDOUT: %import_ref.3b992b.1: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D]
  656. // CHECK:STDOUT: %import_ref.9e1: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type]
  657. // CHECK:STDOUT: %import_ref.ebd = import_ref PackageB//default, loc23_16, unloaded
  658. // CHECK:STDOUT: %import_ref.3b992b.2: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D]
  659. // CHECK:STDOUT: %import_ref.e527c5.2: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type]
  660. // CHECK:STDOUT: }
  661. // CHECK:STDOUT:
  662. // CHECK:STDOUT: file {
  663. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  664. // CHECK:STDOUT: .PackageA = imports.%PackageA
  665. // CHECK:STDOUT: .PackageB = imports.%PackageB
  666. // CHECK:STDOUT: .TestCG = %TestCG.decl
  667. // CHECK:STDOUT: }
  668. // CHECK:STDOUT: %PackageA.import = import PackageA
  669. // CHECK:STDOUT: %PackageB.import = import PackageB
  670. // CHECK:STDOUT: %TestCG.decl: %TestCG.type = fn_decl @TestCG [template = constants.%TestCG] {
  671. // CHECK:STDOUT: %c.patt: %C = binding_pattern c
  672. // CHECK:STDOUT: %c.param_patt: %C = value_param_pattern %c.patt, runtime_param0
  673. // CHECK:STDOUT: } {
  674. // CHECK:STDOUT: %c.param: %C = value_param runtime_param0
  675. // CHECK:STDOUT: %.loc7: type = splice_block %C.ref [template = constants.%C] {
  676. // CHECK:STDOUT: %PackageA.ref: <namespace> = name_ref PackageA, imports.%PackageA [template = imports.%PackageA]
  677. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.0ac [template = constants.%C]
  678. // CHECK:STDOUT: }
  679. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  680. // CHECK:STDOUT: }
  681. // CHECK:STDOUT: }
  682. // CHECK:STDOUT:
  683. // CHECK:STDOUT: interface @HasG [from "package_b.carbon"] {
  684. // CHECK:STDOUT: !members:
  685. // CHECK:STDOUT: .Self = imports.%import_ref.f3e
  686. // CHECK:STDOUT: .G = imports.%import_ref.89f
  687. // CHECK:STDOUT: witness = (imports.%import_ref.f03)
  688. // CHECK:STDOUT: }
  689. // CHECK:STDOUT:
  690. // CHECK:STDOUT: interface @HasF [from "package_a.carbon"] {
  691. // CHECK:STDOUT: !members:
  692. // CHECK:STDOUT: .Self = imports.%import_ref.28d
  693. // CHECK:STDOUT: .F = imports.%import_ref.cc4
  694. // CHECK:STDOUT: witness = (imports.%import_ref.64f)
  695. // CHECK:STDOUT: }
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: impl @impl.1: imports.%import_ref.3de as imports.%import_ref.e33 [from "package_a.carbon"] {
  698. // CHECK:STDOUT: !members:
  699. // CHECK:STDOUT: witness = imports.%import_ref.487
  700. // CHECK:STDOUT: }
  701. // CHECK:STDOUT:
  702. // CHECK:STDOUT: impl @impl.2: imports.%import_ref.4a6 as imports.%import_ref.e527c5.1 [from "package_b.carbon"] {
  703. // CHECK:STDOUT: !members:
  704. // CHECK:STDOUT: witness = imports.%import_ref.38a
  705. // CHECK:STDOUT: }
  706. // CHECK:STDOUT:
  707. // CHECK:STDOUT: impl @impl.3: imports.%import_ref.3b992b.1 as imports.%import_ref.9e1 [from "package_b.carbon"] {
  708. // CHECK:STDOUT: !members:
  709. // CHECK:STDOUT: witness = imports.%import_ref.f77
  710. // CHECK:STDOUT: }
  711. // CHECK:STDOUT:
  712. // CHECK:STDOUT: impl @impl.4: imports.%import_ref.3b992b.2 as imports.%import_ref.e527c5.2 [from "package_b.carbon"] {
  713. // CHECK:STDOUT: !members:
  714. // CHECK:STDOUT: witness = imports.%import_ref.ebd
  715. // CHECK:STDOUT: }
  716. // CHECK:STDOUT:
  717. // CHECK:STDOUT: class @C [from "package_a.carbon"] {
  718. // CHECK:STDOUT: !members:
  719. // CHECK:STDOUT: .Self = imports.%import_ref.2c4
  720. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f24d3.1
  721. // CHECK:STDOUT: }
  722. // CHECK:STDOUT:
  723. // CHECK:STDOUT: class @D [from "package_b.carbon"] {
  724. // CHECK:STDOUT: !members:
  725. // CHECK:STDOUT: .Self = imports.%import_ref.cab
  726. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f24d3.2
  727. // CHECK:STDOUT: }
  728. // CHECK:STDOUT:
  729. // CHECK:STDOUT: fn @TestCG(%c.param_patt: %C) {
  730. // CHECK:STDOUT: !entry:
  731. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  732. // CHECK:STDOUT: %PackageB.ref: <namespace> = name_ref PackageB, imports.%PackageB [template = imports.%PackageB]
  733. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%import_ref.9db [template = constants.%HasG.type]
  734. // CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, imports.%import_ref.89f [template = constants.%assoc0]
  735. // CHECK:STDOUT: %impl.elem0: %G.type.813 = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.b51]
  736. // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %impl.elem0()
  737. // CHECK:STDOUT: return
  738. // CHECK:STDOUT: }
  739. // CHECK:STDOUT:
  740. // CHECK:STDOUT: generic fn @G.1(constants.%Self.102: %HasG.type) [from "package_b.carbon"] {
  741. // CHECK:STDOUT:
  742. // CHECK:STDOUT: fn();
  743. // CHECK:STDOUT: }
  744. // CHECK:STDOUT:
  745. // CHECK:STDOUT: fn @G.2() [from "package_b.carbon"];
  746. // CHECK:STDOUT:
  747. // CHECK:STDOUT: specific @G.1(constants.%Self.102) {}
  748. // CHECK:STDOUT:
  749. // CHECK:STDOUT: --- use_dg.carbon
  750. // CHECK:STDOUT:
  751. // CHECK:STDOUT: constants {
  752. // CHECK:STDOUT: %D: type = class_type @D [template]
  753. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  754. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  755. // CHECK:STDOUT: %TestDG.type: type = fn_type @TestDG [template]
  756. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  757. // CHECK:STDOUT: %TestDG: %TestDG.type = struct_value () [template]
  758. // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [template]
  759. // CHECK:STDOUT: %Self.102: %HasG.type = bind_symbolic_name Self, 0 [symbolic]
  760. // CHECK:STDOUT: %G.type.813: type = fn_type @G.1 [template]
  761. // CHECK:STDOUT: %G.assoc_type: type = assoc_entity_type %HasG.type, %G.type.813 [template]
  762. // CHECK:STDOUT: %assoc0: %G.assoc_type = assoc_entity element0, imports.%import_ref.5b2 [template]
  763. // CHECK:STDOUT: %C: type = class_type @C [template]
  764. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template]
  765. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%import_ref.d18) [template]
  766. // CHECK:STDOUT: %G.type.ec8: type = fn_type @G.2 [template]
  767. // CHECK:STDOUT: %G.e97: %G.type.ec8 = struct_value () [template]
  768. // CHECK:STDOUT: }
  769. // CHECK:STDOUT:
  770. // CHECK:STDOUT: imports {
  771. // CHECK:STDOUT: %PackageB: <namespace> = namespace file.%PackageB.import, [template] {
  772. // CHECK:STDOUT: .D = %import_ref.275
  773. // CHECK:STDOUT: .HasG = %import_ref.9db
  774. // CHECK:STDOUT: import PackageB//default
  775. // CHECK:STDOUT: }
  776. // CHECK:STDOUT: %import_ref.275: type = import_ref PackageB//default, D, loaded [template = constants.%D]
  777. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref PackageB//default, loc10_10, loaded [template = constants.%complete_type]
  778. // CHECK:STDOUT: %import_ref.cab = import_ref PackageB//default, inst27 [no loc], unloaded
  779. // CHECK:STDOUT: %import_ref.9db: type = import_ref PackageB//default, HasG, loaded [template = constants.%HasG.type]
  780. // CHECK:STDOUT: %import_ref.f3e = import_ref PackageB//default, inst17 [no loc], unloaded
  781. // CHECK:STDOUT: %import_ref.89f: %G.assoc_type = import_ref PackageB//default, loc7_9, loaded [template = constants.%assoc0]
  782. // CHECK:STDOUT: %import_ref.f03 = import_ref PackageB//default, G, unloaded
  783. // CHECK:STDOUT: %import_ref.f91 = import_ref PackageB//default, loc13_25, unloaded
  784. // CHECK:STDOUT: %import_ref.8db: <witness> = import_ref PackageB//default, inst35 [indirect], loaded [template = constants.%complete_type]
  785. // CHECK:STDOUT: %import_ref.6a9 = import_ref PackageB//default, inst36 [indirect], unloaded
  786. // CHECK:STDOUT: %import_ref.4a6: type = import_ref PackageB//default, loc13_14, loaded [template = constants.%C]
  787. // CHECK:STDOUT: %import_ref.e527c5.1: type = import_ref PackageB//default, loc13_20, loaded [template = constants.%HasG.type]
  788. // CHECK:STDOUT: %import_ref.f77 = import_ref PackageB//default, loc18_25, unloaded
  789. // CHECK:STDOUT: %import_ref.ccf = import_ref PackageB//default, inst53 [indirect], unloaded
  790. // CHECK:STDOUT: %import_ref.09b = import_ref PackageB//default, inst54 [indirect], unloaded
  791. // CHECK:STDOUT: %import_ref.b4f = import_ref PackageB//default, F, unloaded
  792. // CHECK:STDOUT: %import_ref.3b992b.1: type = import_ref PackageB//default, loc18_6, loaded [template = constants.%D]
  793. // CHECK:STDOUT: %import_ref.9e1: type = import_ref PackageB//default, loc18_19, loaded [template = constants.%HasF.type]
  794. // CHECK:STDOUT: %import_ref.f58: <witness> = import_ref PackageB//default, loc23_16, loaded [template = constants.%impl_witness]
  795. // CHECK:STDOUT: %import_ref.3b992b.2: type = import_ref PackageB//default, loc23_6, loaded [template = constants.%D]
  796. // CHECK:STDOUT: %import_ref.e527c5.2: type = import_ref PackageB//default, loc23_11, loaded [template = constants.%HasG.type]
  797. // CHECK:STDOUT: }
  798. // CHECK:STDOUT:
  799. // CHECK:STDOUT: file {
  800. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  801. // CHECK:STDOUT: .PackageB = imports.%PackageB
  802. // CHECK:STDOUT: .TestDG = %TestDG.decl
  803. // CHECK:STDOUT: }
  804. // CHECK:STDOUT: %PackageB.import = import PackageB
  805. // CHECK:STDOUT: %TestDG.decl: %TestDG.type = fn_decl @TestDG [template = constants.%TestDG] {
  806. // CHECK:STDOUT: %d.patt: %D = binding_pattern d
  807. // CHECK:STDOUT: %d.param_patt: %D = value_param_pattern %d.patt, runtime_param0
  808. // CHECK:STDOUT: } {
  809. // CHECK:STDOUT: %d.param: %D = value_param runtime_param0
  810. // CHECK:STDOUT: %.loc6: type = splice_block %D.ref [template = constants.%D] {
  811. // CHECK:STDOUT: %PackageB.ref.loc6: <namespace> = name_ref PackageB, imports.%PackageB [template = imports.%PackageB]
  812. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.275 [template = constants.%D]
  813. // CHECK:STDOUT: }
  814. // CHECK:STDOUT: %d: %D = bind_name d, %d.param
  815. // CHECK:STDOUT: }
  816. // CHECK:STDOUT: }
  817. // CHECK:STDOUT:
  818. // CHECK:STDOUT: interface @HasG [from "package_b.carbon"] {
  819. // CHECK:STDOUT: !members:
  820. // CHECK:STDOUT: .Self = imports.%import_ref.f3e
  821. // CHECK:STDOUT: .G = imports.%import_ref.89f
  822. // CHECK:STDOUT: witness = (imports.%import_ref.f03)
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT:
  825. // CHECK:STDOUT: interface @HasF [from "package_b.carbon"] {
  826. // CHECK:STDOUT: !members:
  827. // CHECK:STDOUT: .Self = imports.%import_ref.ccf
  828. // CHECK:STDOUT: .F = imports.%import_ref.09b
  829. // CHECK:STDOUT: witness = (imports.%import_ref.b4f)
  830. // CHECK:STDOUT: }
  831. // CHECK:STDOUT:
  832. // CHECK:STDOUT: impl @impl.1: imports.%import_ref.4a6 as imports.%import_ref.e527c5.1 [from "package_b.carbon"] {
  833. // CHECK:STDOUT: !members:
  834. // CHECK:STDOUT: witness = imports.%import_ref.f91
  835. // CHECK:STDOUT: }
  836. // CHECK:STDOUT:
  837. // CHECK:STDOUT: impl @impl.2: imports.%import_ref.3b992b.1 as imports.%import_ref.9e1 [from "package_b.carbon"] {
  838. // CHECK:STDOUT: !members:
  839. // CHECK:STDOUT: witness = imports.%import_ref.f77
  840. // CHECK:STDOUT: }
  841. // CHECK:STDOUT:
  842. // CHECK:STDOUT: impl @impl.3: imports.%import_ref.3b992b.2 as imports.%import_ref.e527c5.2 [from "package_b.carbon"] {
  843. // CHECK:STDOUT: !members:
  844. // CHECK:STDOUT: witness = imports.%import_ref.f58
  845. // CHECK:STDOUT: }
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: class @D [from "package_b.carbon"] {
  848. // CHECK:STDOUT: !members:
  849. // CHECK:STDOUT: .Self = imports.%import_ref.cab
  850. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  851. // CHECK:STDOUT: }
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: class @C [from "package_b.carbon"] {
  854. // CHECK:STDOUT: !members:
  855. // CHECK:STDOUT: .Self = imports.%import_ref.6a9
  856. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8db
  857. // CHECK:STDOUT: }
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: fn @TestDG(%d.param_patt: %D) {
  860. // CHECK:STDOUT: !entry:
  861. // CHECK:STDOUT: %d.ref: %D = name_ref d, %d
  862. // CHECK:STDOUT: %PackageB.ref.loc7: <namespace> = name_ref PackageB, imports.%PackageB [template = imports.%PackageB]
  863. // CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%import_ref.9db [template = constants.%HasG.type]
  864. // CHECK:STDOUT: %G.ref: %G.assoc_type = name_ref G, imports.%import_ref.89f [template = constants.%assoc0]
  865. // CHECK:STDOUT: %impl.elem0: %G.type.813 = impl_witness_access constants.%impl_witness, element0 [template = constants.%G.e97]
  866. // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %impl.elem0()
  867. // CHECK:STDOUT: return
  868. // CHECK:STDOUT: }
  869. // CHECK:STDOUT:
  870. // CHECK:STDOUT: generic fn @G.1(constants.%Self.102: %HasG.type) [from "package_b.carbon"] {
  871. // CHECK:STDOUT:
  872. // CHECK:STDOUT: fn();
  873. // CHECK:STDOUT: }
  874. // CHECK:STDOUT:
  875. // CHECK:STDOUT: fn @G.2() [from "package_b.carbon"];
  876. // CHECK:STDOUT:
  877. // CHECK:STDOUT: specific @G.1(constants.%Self.102) {}
  878. // CHECK:STDOUT:
  879. // CHECK:STDOUT: --- associated_interface.carbon
  880. // CHECK:STDOUT:
  881. // CHECK:STDOUT: constants {
  882. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [template]
  883. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic]
  884. // CHECK:STDOUT: %H.type.5e7: type = fn_type @H.1 [template]
  885. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  886. // CHECK:STDOUT: %H.891: %H.type.5e7 = struct_value () [template]
  887. // CHECK:STDOUT: %H.assoc_type: type = assoc_entity_type %Z.type, %H.type.5e7 [template]
  888. // CHECK:STDOUT: %assoc0: %H.assoc_type = assoc_entity element0, @Z.%H.decl [template]
  889. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%H.decl) [template]
  890. // CHECK:STDOUT: %H.type.fad: type = fn_type @H.2 [template]
  891. // CHECK:STDOUT: %H.bea: %H.type.fad = struct_value () [template]
  892. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %empty_tuple.type, %impl_witness [template]
  893. // CHECK:STDOUT: }
  894. // CHECK:STDOUT:
  895. // CHECK:STDOUT: file {
  896. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  897. // CHECK:STDOUT: .Z = %Z.decl
  898. // CHECK:STDOUT: }
  899. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [template = constants.%Z.type] {} {}
  900. // CHECK:STDOUT: impl_decl @impl [template] {} {
  901. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  902. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  903. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [template = constants.%Z.type]
  904. // CHECK:STDOUT: }
  905. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%H.decl) [template = constants.%impl_witness]
  906. // CHECK:STDOUT: }
  907. // CHECK:STDOUT:
  908. // CHECK:STDOUT: interface @Z {
  909. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  910. // CHECK:STDOUT: %H.decl: %H.type.5e7 = fn_decl @H.1 [template = constants.%H.891] {} {}
  911. // CHECK:STDOUT: %assoc0: %H.assoc_type = assoc_entity element0, %H.decl [template = constants.%assoc0]
  912. // CHECK:STDOUT:
  913. // CHECK:STDOUT: !members:
  914. // CHECK:STDOUT: .Self = %Self
  915. // CHECK:STDOUT: .H = %assoc0
  916. // CHECK:STDOUT: witness = (%H.decl)
  917. // CHECK:STDOUT: }
  918. // CHECK:STDOUT:
  919. // CHECK:STDOUT: impl @impl: %.loc8_7.2 as %Z.ref {
  920. // CHECK:STDOUT: %H.decl: %H.type.fad = fn_decl @H.2 [template = constants.%H.bea] {} {}
  921. // CHECK:STDOUT:
  922. // CHECK:STDOUT: !members:
  923. // CHECK:STDOUT: .H = %H.decl
  924. // CHECK:STDOUT: witness = file.%impl_witness
  925. // CHECK:STDOUT: }
  926. // CHECK:STDOUT:
  927. // CHECK:STDOUT: generic fn @H.1(@Z.%Self: %Z.type) {
  928. // CHECK:STDOUT:
  929. // CHECK:STDOUT: fn();
  930. // CHECK:STDOUT: }
  931. // CHECK:STDOUT:
  932. // CHECK:STDOUT: fn @H.2() {
  933. // CHECK:STDOUT: !entry:
  934. // CHECK:STDOUT: return
  935. // CHECK:STDOUT: }
  936. // CHECK:STDOUT:
  937. // CHECK:STDOUT: specific @H.1(constants.%Self) {}
  938. // CHECK:STDOUT:
  939. // CHECK:STDOUT: specific @H.1(constants.%Z.facet) {}
  940. // CHECK:STDOUT:
  941. // CHECK:STDOUT: --- import_associated_interface.carbon
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: constants {
  944. // CHECK:STDOUT: %J.type: type = fn_type @J [template]
  945. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  946. // CHECK:STDOUT: %J: %J.type = struct_value () [template]
  947. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [template]
  948. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic]
  949. // CHECK:STDOUT: %H.type.594: type = fn_type @H.1 [template]
  950. // CHECK:STDOUT: %H.assoc_type: type = assoc_entity_type %Z.type, %H.type.594 [template]
  951. // CHECK:STDOUT: %assoc0: %H.assoc_type = assoc_entity element0, imports.%import_ref.8f8 [template]
  952. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%import_ref.a75) [template]
  953. // CHECK:STDOUT: %H.type.96e: type = fn_type @H.2 [template]
  954. // CHECK:STDOUT: %H.33c: %H.type.96e = struct_value () [template]
  955. // CHECK:STDOUT: }
  956. // CHECK:STDOUT:
  957. // CHECK:STDOUT: imports {
  958. // CHECK:STDOUT: %PackageAssociatedInterface: <namespace> = namespace file.%PackageAssociatedInterface.import, [template] {
  959. // CHECK:STDOUT: .Z = %import_ref.0ef
  960. // CHECK:STDOUT: import PackageAssociatedInterface//default
  961. // CHECK:STDOUT: }
  962. // CHECK:STDOUT: %import_ref.0ef: type = import_ref PackageAssociatedInterface//default, Z, loaded [template = constants.%Z.type]
  963. // CHECK:STDOUT: %import_ref.54a = import_ref PackageAssociatedInterface//default, inst15 [no loc], unloaded
  964. // CHECK:STDOUT: %import_ref.0ab: %H.assoc_type = import_ref PackageAssociatedInterface//default, loc5_9, loaded [template = constants.%assoc0]
  965. // CHECK:STDOUT: %import_ref.108 = import_ref PackageAssociatedInterface//default, H, unloaded
  966. // CHECK:STDOUT: %import_ref.cc2: <witness> = import_ref PackageAssociatedInterface//default, loc8_14, loaded [template = constants.%impl_witness]
  967. // CHECK:STDOUT: %import_ref.e5c: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [template = constants.%empty_tuple.type]
  968. // CHECK:STDOUT: %import_ref.f0c: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [template = constants.%Z.type]
  969. // CHECK:STDOUT: }
  970. // CHECK:STDOUT:
  971. // CHECK:STDOUT: file {
  972. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  973. // CHECK:STDOUT: .PackageAssociatedInterface = imports.%PackageAssociatedInterface
  974. // CHECK:STDOUT: .J = %J.decl
  975. // CHECK:STDOUT: }
  976. // CHECK:STDOUT: %PackageAssociatedInterface.import = import PackageAssociatedInterface
  977. // CHECK:STDOUT: %J.decl: %J.type = fn_decl @J [template = constants.%J] {} {}
  978. // CHECK:STDOUT: }
  979. // CHECK:STDOUT:
  980. // CHECK:STDOUT: interface @Z [from "associated_interface.carbon"] {
  981. // CHECK:STDOUT: !members:
  982. // CHECK:STDOUT: .Self = imports.%import_ref.54a
  983. // CHECK:STDOUT: .H = imports.%import_ref.0ab
  984. // CHECK:STDOUT: witness = (imports.%import_ref.108)
  985. // CHECK:STDOUT: }
  986. // CHECK:STDOUT:
  987. // CHECK:STDOUT: impl @impl: imports.%import_ref.e5c as imports.%import_ref.f0c [from "associated_interface.carbon"] {
  988. // CHECK:STDOUT: !members:
  989. // CHECK:STDOUT: witness = imports.%import_ref.cc2
  990. // CHECK:STDOUT: }
  991. // CHECK:STDOUT:
  992. // CHECK:STDOUT: fn @J() {
  993. // CHECK:STDOUT: !entry:
  994. // CHECK:STDOUT: %.loc7: %empty_tuple.type = tuple_literal ()
  995. // CHECK:STDOUT: %PackageAssociatedInterface.ref: <namespace> = name_ref PackageAssociatedInterface, imports.%PackageAssociatedInterface [template = imports.%PackageAssociatedInterface]
  996. // CHECK:STDOUT: %Z.ref: type = name_ref Z, imports.%import_ref.0ef [template = constants.%Z.type]
  997. // CHECK:STDOUT: %H.ref: %H.assoc_type = name_ref H, imports.%import_ref.0ab [template = constants.%assoc0]
  998. // CHECK:STDOUT: %impl.elem0: %H.type.594 = impl_witness_access constants.%impl_witness, element0 [template = constants.%H.33c]
  999. // CHECK:STDOUT: %H.call: init %empty_tuple.type = call %impl.elem0()
  1000. // CHECK:STDOUT: return
  1001. // CHECK:STDOUT: }
  1002. // CHECK:STDOUT:
  1003. // CHECK:STDOUT: generic fn @H.1(constants.%Self: %Z.type) [from "associated_interface.carbon"] {
  1004. // CHECK:STDOUT:
  1005. // CHECK:STDOUT: fn();
  1006. // CHECK:STDOUT: }
  1007. // CHECK:STDOUT:
  1008. // CHECK:STDOUT: fn @H.2() [from "associated_interface.carbon"];
  1009. // CHECK:STDOUT:
  1010. // CHECK:STDOUT: specific @H.1(constants.%Self) {}
  1011. // CHECK:STDOUT:
  1012. // CHECK:STDOUT: --- has_param.carbon
  1013. // CHECK:STDOUT:
  1014. // CHECK:STDOUT: constants {
  1015. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1016. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1017. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  1018. // CHECK:STDOUT: %X.patt: %T = symbolic_binding_pattern X, 1 [symbolic]
  1019. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [template]
  1020. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [template]
  1021. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(%T, %X) [symbolic]
  1022. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  1023. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  1024. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [template]
  1025. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1026. // CHECK:STDOUT: %K.type: type = fn_type @K [template]
  1027. // CHECK:STDOUT: %K: %K.type = struct_value () [template]
  1028. // CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type %Y.type, %K.type [template]
  1029. // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @Y.%K.decl [template]
  1030. // CHECK:STDOUT: }
  1031. // CHECK:STDOUT:
  1032. // CHECK:STDOUT: file {
  1033. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1034. // CHECK:STDOUT: .AnyParam = %AnyParam.decl
  1035. // CHECK:STDOUT: .Y = %Y.decl
  1036. // CHECK:STDOUT: }
  1037. // CHECK:STDOUT: %AnyParam.decl: %AnyParam.type = class_decl @AnyParam [template = constants.%AnyParam.generic] {
  1038. // CHECK:STDOUT: %T.patt.loc4_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)]
  1039. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_16.1, runtime_param<invalid> [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)]
  1040. // CHECK:STDOUT: %X.patt.loc4_26.1: @AnyParam.%T.loc4_16.2 (%T) = symbolic_binding_pattern X, 1 [symbolic = %X.patt.loc4_26.2 (constants.%X.patt)]
  1041. // CHECK:STDOUT: %X.param_patt: @AnyParam.%T.loc4_16.2 (%T) = value_param_pattern %X.patt.loc4_26.1, runtime_param<invalid> [symbolic = %X.patt.loc4_26.2 (constants.%X.patt)]
  1042. // CHECK:STDOUT: } {
  1043. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  1044. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_16.2 (constants.%T)]
  1045. // CHECK:STDOUT: %X.param: @AnyParam.%T.loc4_16.2 (%T) = value_param runtime_param<invalid>
  1046. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T)]
  1047. // CHECK:STDOUT: %X.loc4_26.1: @AnyParam.%T.loc4_16.2 (%T) = bind_symbolic_name X, 1, %X.param [symbolic = %X.loc4_26.2 (constants.%X)]
  1048. // CHECK:STDOUT: }
  1049. // CHECK:STDOUT: %Y.decl: type = interface_decl @Y [template = constants.%Y.type] {} {}
  1050. // CHECK:STDOUT: }
  1051. // CHECK:STDOUT:
  1052. // CHECK:STDOUT: interface @Y {
  1053. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1054. // CHECK:STDOUT: %K.decl: %K.type = fn_decl @K [template = constants.%K] {} {}
  1055. // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, %K.decl [template = constants.%assoc0]
  1056. // CHECK:STDOUT:
  1057. // CHECK:STDOUT: !members:
  1058. // CHECK:STDOUT: .Self = %Self
  1059. // CHECK:STDOUT: .K = %assoc0
  1060. // CHECK:STDOUT: witness = (%K.decl)
  1061. // CHECK:STDOUT: }
  1062. // CHECK:STDOUT:
  1063. // CHECK:STDOUT: generic class @AnyParam(%T.loc4_16.1: type, %X.loc4_26.1: @AnyParam.%T.loc4_16.2 (%T)) {
  1064. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)]
  1065. // CHECK:STDOUT: %T.patt.loc4_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)]
  1066. // CHECK:STDOUT: %X.loc4_26.2: %T = bind_symbolic_name X, 1 [symbolic = %X.loc4_26.2 (constants.%X)]
  1067. // CHECK:STDOUT: %X.patt.loc4_26.2: %T = symbolic_binding_pattern X, 1 [symbolic = %X.patt.loc4_26.2 (constants.%X.patt)]
  1068. // CHECK:STDOUT:
  1069. // CHECK:STDOUT: !definition:
  1070. // CHECK:STDOUT:
  1071. // CHECK:STDOUT: class {
  1072. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  1073. // CHECK:STDOUT:
  1074. // CHECK:STDOUT: !members:
  1075. // CHECK:STDOUT: .Self = constants.%AnyParam
  1076. // CHECK:STDOUT: complete_type_witness = %complete_type
  1077. // CHECK:STDOUT: }
  1078. // CHECK:STDOUT: }
  1079. // CHECK:STDOUT:
  1080. // CHECK:STDOUT: generic fn @K(@Y.%Self: %Y.type) {
  1081. // CHECK:STDOUT: !definition:
  1082. // CHECK:STDOUT:
  1083. // CHECK:STDOUT: fn() {
  1084. // CHECK:STDOUT: !entry:
  1085. // CHECK:STDOUT: return
  1086. // CHECK:STDOUT: }
  1087. // CHECK:STDOUT: }
  1088. // CHECK:STDOUT:
  1089. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  1090. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T
  1091. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T
  1092. // CHECK:STDOUT: %X.loc4_26.2 => constants.%X
  1093. // CHECK:STDOUT: %X.patt.loc4_26.2 => constants.%X
  1094. // CHECK:STDOUT: }
  1095. // CHECK:STDOUT:
  1096. // CHECK:STDOUT: specific @K(constants.%Self) {}
  1097. // CHECK:STDOUT:
  1098. // CHECK:STDOUT: --- has_generic_interface.carbon
  1099. // CHECK:STDOUT:
  1100. // CHECK:STDOUT: constants {
  1101. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  1102. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic]
  1103. // CHECK:STDOUT: %GenericInterface.type.c92: type = generic_interface_type @GenericInterface [template]
  1104. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  1105. // CHECK:STDOUT: %GenericInterface.generic: %GenericInterface.type.c92 = struct_value () [template]
  1106. // CHECK:STDOUT: %GenericInterface.type.714: type = facet_type <@GenericInterface, @GenericInterface(%U)> [symbolic]
  1107. // CHECK:STDOUT: %Self.c9a: %GenericInterface.type.714 = bind_symbolic_name Self, 1 [symbolic]
  1108. // CHECK:STDOUT: %AnyParam.type: type = generic_class_type @AnyParam [template]
  1109. // CHECK:STDOUT: %AnyParam.generic: %AnyParam.type = struct_value () [template]
  1110. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  1111. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  1112. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1113. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  1114. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1115. // CHECK:STDOUT: %X.patt.a277d5.2: %T = symbolic_binding_pattern X, 1 [symbolic]
  1116. // CHECK:STDOUT: %AnyParam.422: type = class_type @AnyParam, @AnyParam(%GenericInterface.type.c92, %GenericInterface.generic) [template]
  1117. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [template]
  1118. // CHECK:STDOUT: %Self.ea2: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1119. // CHECK:STDOUT: %K.type.069: type = fn_type @K.1 [template]
  1120. // CHECK:STDOUT: %K.766: %K.type.069 = struct_value () [template]
  1121. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%K.decl) [template]
  1122. // CHECK:STDOUT: %K.type.7be: type = fn_type @K.2 [template]
  1123. // CHECK:STDOUT: %K.328: %K.type.7be = struct_value () [template]
  1124. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.422, %impl_witness [template]
  1125. // CHECK:STDOUT: %L.type: type = fn_type @L [template]
  1126. // CHECK:STDOUT: %L: %L.type = struct_value () [template]
  1127. // CHECK:STDOUT: %AnyParam.val: %AnyParam.422 = struct_value () [template]
  1128. // CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type %Y.type, %K.type.069 [template]
  1129. // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, imports.%import_ref.6d0 [template]
  1130. // CHECK:STDOUT: }
  1131. // CHECK:STDOUT:
  1132. // CHECK:STDOUT: imports {
  1133. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [template] {
  1134. // CHECK:STDOUT: .AnyParam = %import_ref.6c9
  1135. // CHECK:STDOUT: .Y = %import_ref.ca2
  1136. // CHECK:STDOUT: import PackageHasParam//default
  1137. // CHECK:STDOUT: }
  1138. // CHECK:STDOUT: %import_ref.6c9: %AnyParam.type = import_ref PackageHasParam//default, AnyParam, loaded [template = constants.%AnyParam.generic]
  1139. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [template = constants.%complete_type]
  1140. // CHECK:STDOUT: %import_ref.8e4 = import_ref PackageHasParam//default, inst34 [no loc], unloaded
  1141. // CHECK:STDOUT: %import_ref.ca2: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type]
  1142. // CHECK:STDOUT: %import_ref.434 = import_ref PackageHasParam//default, inst40 [no loc], unloaded
  1143. // CHECK:STDOUT: %import_ref.991: %K.assoc_type = import_ref PackageHasParam//default, loc7_10, loaded [template = constants.%assoc0]
  1144. // CHECK:STDOUT: %import_ref.c68: %K.type.069 = import_ref PackageHasParam//default, K, loaded [template = constants.%K.766]
  1145. // CHECK:STDOUT: }
  1146. // CHECK:STDOUT:
  1147. // CHECK:STDOUT: file {
  1148. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1149. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  1150. // CHECK:STDOUT: .GenericInterface = %GenericInterface.decl
  1151. // CHECK:STDOUT: .L = %L.decl
  1152. // CHECK:STDOUT: }
  1153. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  1154. // CHECK:STDOUT: %GenericInterface.decl: %GenericInterface.type.c92 = interface_decl @GenericInterface [template = constants.%GenericInterface.generic] {
  1155. // CHECK:STDOUT: %U.patt.loc6_28.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc6_28.2 (constants.%U.patt)]
  1156. // CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc6_28.1, runtime_param<invalid> [symbolic = %U.patt.loc6_28.2 (constants.%U.patt)]
  1157. // CHECK:STDOUT: } {
  1158. // CHECK:STDOUT: %U.param: type = value_param runtime_param<invalid>
  1159. // CHECK:STDOUT: %U.loc6_28.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc6_28.2 (constants.%U)]
  1160. // CHECK:STDOUT: }
  1161. // CHECK:STDOUT: impl_decl @impl [template] {} {
  1162. // CHECK:STDOUT: %PackageHasParam.ref.loc8_6: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam]
  1163. // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%import_ref.6c9 [template = constants.%AnyParam.generic]
  1164. // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.c92 = name_ref GenericInterface, file.%GenericInterface.decl [template = constants.%GenericInterface.generic]
  1165. // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) [template = constants.%AnyParam.422]
  1166. // CHECK:STDOUT: %PackageHasParam.ref.loc8_52: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam]
  1167. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.ca2 [template = constants.%Y.type]
  1168. // CHECK:STDOUT: }
  1169. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%K.decl) [template = constants.%impl_witness]
  1170. // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [template = constants.%L] {} {}
  1171. // CHECK:STDOUT: }
  1172. // CHECK:STDOUT:
  1173. // CHECK:STDOUT: generic interface @GenericInterface(%U.loc6_28.1: type) {
  1174. // CHECK:STDOUT: %U.loc6_28.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc6_28.2 (constants.%U)]
  1175. // CHECK:STDOUT: %U.patt.loc6_28.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc6_28.2 (constants.%U.patt)]
  1176. // CHECK:STDOUT:
  1177. // CHECK:STDOUT: !definition:
  1178. // CHECK:STDOUT: %GenericInterface.type: type = facet_type <@GenericInterface, @GenericInterface(%U.loc6_28.2)> [symbolic = %GenericInterface.type (constants.%GenericInterface.type.714)]
  1179. // CHECK:STDOUT: %Self.2: %GenericInterface.type.714 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.c9a)]
  1180. // CHECK:STDOUT:
  1181. // CHECK:STDOUT: interface {
  1182. // CHECK:STDOUT: %Self.1: @GenericInterface.%GenericInterface.type (%GenericInterface.type.714) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.c9a)]
  1183. // CHECK:STDOUT:
  1184. // CHECK:STDOUT: !members:
  1185. // CHECK:STDOUT: .Self = %Self.1
  1186. // CHECK:STDOUT: witness = ()
  1187. // CHECK:STDOUT: }
  1188. // CHECK:STDOUT: }
  1189. // CHECK:STDOUT:
  1190. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  1191. // CHECK:STDOUT: !members:
  1192. // CHECK:STDOUT: .Self = imports.%import_ref.434
  1193. // CHECK:STDOUT: .K = imports.%import_ref.991
  1194. // CHECK:STDOUT: witness = (imports.%import_ref.c68)
  1195. // CHECK:STDOUT: }
  1196. // CHECK:STDOUT:
  1197. // CHECK:STDOUT: impl @impl: %AnyParam as %Y.ref {
  1198. // CHECK:STDOUT: %K.decl: %K.type.7be = fn_decl @K.2 [template = constants.%K.328] {} {}
  1199. // CHECK:STDOUT:
  1200. // CHECK:STDOUT: !members:
  1201. // CHECK:STDOUT: .K = %K.decl
  1202. // CHECK:STDOUT: witness = file.%impl_witness
  1203. // CHECK:STDOUT: }
  1204. // CHECK:STDOUT:
  1205. // CHECK:STDOUT: generic class @AnyParam(constants.%T: type, constants.%X: %T) [from "has_param.carbon"] {
  1206. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1207. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  1208. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1209. // CHECK:STDOUT: %X.patt: %T = symbolic_binding_pattern X, 1 [symbolic = %X.patt (constants.%X.patt.a277d5.2)]
  1210. // CHECK:STDOUT:
  1211. // CHECK:STDOUT: !definition:
  1212. // CHECK:STDOUT:
  1213. // CHECK:STDOUT: class {
  1214. // CHECK:STDOUT: !members:
  1215. // CHECK:STDOUT: .Self = imports.%import_ref.8e4
  1216. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  1217. // CHECK:STDOUT: }
  1218. // CHECK:STDOUT: }
  1219. // CHECK:STDOUT:
  1220. // CHECK:STDOUT: generic fn @K.1(constants.%Self.ea2: %Y.type) [from "has_param.carbon"] {
  1221. // CHECK:STDOUT: !definition:
  1222. // CHECK:STDOUT:
  1223. // CHECK:STDOUT: fn();
  1224. // CHECK:STDOUT: }
  1225. // CHECK:STDOUT:
  1226. // CHECK:STDOUT: fn @K.2() {
  1227. // CHECK:STDOUT: !entry:
  1228. // CHECK:STDOUT: return
  1229. // CHECK:STDOUT: }
  1230. // CHECK:STDOUT:
  1231. // CHECK:STDOUT: fn @L() {
  1232. // CHECK:STDOUT: !entry:
  1233. // CHECK:STDOUT: %obj.var: ref %AnyParam.422 = var obj
  1234. // CHECK:STDOUT: %obj: ref %AnyParam.422 = bind_name obj, %obj.var
  1235. // CHECK:STDOUT: %.loc13_58.1: %empty_struct_type = struct_literal ()
  1236. // CHECK:STDOUT: %.loc13_58.2: init %AnyParam.422 = class_init (), %obj.var [template = constants.%AnyParam.val]
  1237. // CHECK:STDOUT: %.loc13_59: init %AnyParam.422 = converted %.loc13_58.1, %.loc13_58.2 [template = constants.%AnyParam.val]
  1238. // CHECK:STDOUT: assign %obj.var, %.loc13_59
  1239. // CHECK:STDOUT: %obj.ref: ref %AnyParam.422 = name_ref obj, %obj
  1240. // CHECK:STDOUT: %PackageHasParam.ref: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam]
  1241. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.ca2 [template = constants.%Y.type]
  1242. // CHECK:STDOUT: %K.ref: %K.assoc_type = name_ref K, imports.%import_ref.991 [template = constants.%assoc0]
  1243. // CHECK:STDOUT: %impl.elem0: %K.type.069 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.328]
  1244. // CHECK:STDOUT: %K.call: init %empty_tuple.type = call %impl.elem0()
  1245. // CHECK:STDOUT: return
  1246. // CHECK:STDOUT: }
  1247. // CHECK:STDOUT:
  1248. // CHECK:STDOUT: specific @GenericInterface(constants.%U) {
  1249. // CHECK:STDOUT: %U.loc6_28.2 => constants.%U
  1250. // CHECK:STDOUT: %U.patt.loc6_28.2 => constants.%U
  1251. // CHECK:STDOUT: }
  1252. // CHECK:STDOUT:
  1253. // CHECK:STDOUT: specific @GenericInterface(%U.loc6_28.2) {}
  1254. // CHECK:STDOUT:
  1255. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  1256. // CHECK:STDOUT: %T => constants.%T
  1257. // CHECK:STDOUT: %T.patt => constants.%T
  1258. // CHECK:STDOUT: %X => constants.%X
  1259. // CHECK:STDOUT: %X.patt => constants.%X
  1260. // CHECK:STDOUT: }
  1261. // CHECK:STDOUT:
  1262. // CHECK:STDOUT: specific @AnyParam(constants.%GenericInterface.type.c92, constants.%GenericInterface.generic) {
  1263. // CHECK:STDOUT: %T => constants.%GenericInterface.type.c92
  1264. // CHECK:STDOUT: %T.patt => constants.%GenericInterface.type.c92
  1265. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  1266. // CHECK:STDOUT: %X.patt => constants.%GenericInterface.generic
  1267. // CHECK:STDOUT:
  1268. // CHECK:STDOUT: !definition:
  1269. // CHECK:STDOUT: }
  1270. // CHECK:STDOUT:
  1271. // CHECK:STDOUT: specific @K.1(constants.%Self.ea2) {}
  1272. // CHECK:STDOUT:
  1273. // CHECK:STDOUT: specific @K.1(constants.%Y.facet) {}
  1274. // CHECK:STDOUT:
  1275. // CHECK:STDOUT: --- use_generic_interface_as_param.carbon
  1276. // CHECK:STDOUT:
  1277. // CHECK:STDOUT: constants {
  1278. // CHECK:STDOUT: %M.type: type = fn_type @M [template]
  1279. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  1280. // CHECK:STDOUT: %M: %M.type = struct_value () [template]
  1281. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  1282. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  1283. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1284. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic]
  1285. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1286. // CHECK:STDOUT: %X.patt.a277d5.2: %T = symbolic_binding_pattern X, 1 [symbolic]
  1287. // CHECK:STDOUT: %GenericInterface.type.0da: type = generic_interface_type @GenericInterface [template]
  1288. // CHECK:STDOUT: %GenericInterface.generic: %GenericInterface.type.0da = struct_value () [template]
  1289. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  1290. // CHECK:STDOUT: %GenericInterface.type.954: type = facet_type <@GenericInterface, @GenericInterface(%U)> [symbolic]
  1291. // CHECK:STDOUT: %Self.ebd: %GenericInterface.type.954 = bind_symbolic_name Self, 1 [symbolic]
  1292. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic]
  1293. // CHECK:STDOUT: %AnyParam.35d: type = class_type @AnyParam, @AnyParam(%GenericInterface.type.0da, %GenericInterface.generic) [template]
  1294. // CHECK:STDOUT: %AnyParam.val: %AnyParam.35d = struct_value () [template]
  1295. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [template]
  1296. // CHECK:STDOUT: %Self.ea2: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1297. // CHECK:STDOUT: %K.type.069: type = fn_type @K.1 [template]
  1298. // CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type %Y.type, %K.type.069 [template]
  1299. // CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, imports.%import_ref.6d0 [template]
  1300. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%import_ref.a9a) [template]
  1301. // CHECK:STDOUT: %K.type.d9f: type = fn_type @K.2 [template]
  1302. // CHECK:STDOUT: %K.4e3: %K.type.d9f = struct_value () [template]
  1303. // CHECK:STDOUT: }
  1304. // CHECK:STDOUT:
  1305. // CHECK:STDOUT: imports {
  1306. // CHECK:STDOUT: %PackageHasParam: <namespace> = namespace file.%PackageHasParam.import, [template] {
  1307. // CHECK:STDOUT: .AnyParam = %import_ref.6c9
  1308. // CHECK:STDOUT: .Y = %import_ref.ca2
  1309. // CHECK:STDOUT: import PackageHasParam//default
  1310. // CHECK:STDOUT: }
  1311. // CHECK:STDOUT: %PackageGenericInterface: <namespace> = namespace file.%PackageGenericInterface.import, [template] {
  1312. // CHECK:STDOUT: .GenericInterface = %import_ref.012
  1313. // CHECK:STDOUT: import PackageGenericInterface//default
  1314. // CHECK:STDOUT: }
  1315. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref PackageHasParam//default, loc4_34, loaded [template = constants.%complete_type]
  1316. // CHECK:STDOUT: %import_ref.8e4 = import_ref PackageHasParam//default, inst34 [no loc], unloaded
  1317. // CHECK:STDOUT: %import_ref.ef8 = import_ref PackageGenericInterface//default, inst28 [no loc], unloaded
  1318. // CHECK:STDOUT: %import_ref.ca2: type = import_ref PackageHasParam//default, Y, loaded [template = constants.%Y.type]
  1319. // CHECK:STDOUT: %import_ref.434 = import_ref PackageHasParam//default, inst40 [no loc], unloaded
  1320. // CHECK:STDOUT: %import_ref.991: %K.assoc_type = import_ref PackageHasParam//default, loc7_10, loaded [template = constants.%assoc0]
  1321. // CHECK:STDOUT: %import_ref.6f6 = import_ref PackageHasParam//default, K, unloaded
  1322. // CHECK:STDOUT: %import_ref.e37: <witness> = import_ref PackageGenericInterface//default, loc8_70, loaded [template = constants.%impl_witness]
  1323. // CHECK:STDOUT: %import_ref.d44: type = import_ref PackageGenericInterface//default, loc8_47, loaded [template = constants.%AnyParam.35d]
  1324. // CHECK:STDOUT: %import_ref.63d: type = import_ref PackageGenericInterface//default, loc8_67, loaded [template = constants.%Y.type]
  1325. // CHECK:STDOUT: }
  1326. // CHECK:STDOUT:
  1327. // CHECK:STDOUT: file {
  1328. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1329. // CHECK:STDOUT: .PackageHasParam = imports.%PackageHasParam
  1330. // CHECK:STDOUT: .PackageGenericInterface = imports.%PackageGenericInterface
  1331. // CHECK:STDOUT: .M = %M.decl
  1332. // CHECK:STDOUT: }
  1333. // CHECK:STDOUT: %PackageHasParam.import = import PackageHasParam
  1334. // CHECK:STDOUT: %PackageGenericInterface.import = import PackageGenericInterface
  1335. // CHECK:STDOUT: %M.decl: %M.type = fn_decl @M [template = constants.%M] {} {}
  1336. // CHECK:STDOUT: }
  1337. // CHECK:STDOUT:
  1338. // CHECK:STDOUT: generic interface @GenericInterface(constants.%U: type) [from "has_generic_interface.carbon"] {
  1339. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  1340. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt (constants.%U.patt)]
  1341. // CHECK:STDOUT:
  1342. // CHECK:STDOUT: !definition:
  1343. // CHECK:STDOUT: %GenericInterface.type: type = facet_type <@GenericInterface, @GenericInterface(%U)> [symbolic = %GenericInterface.type (constants.%GenericInterface.type.954)]
  1344. // CHECK:STDOUT: %Self: %GenericInterface.type.954 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.ebd)]
  1345. // CHECK:STDOUT:
  1346. // CHECK:STDOUT: interface {
  1347. // CHECK:STDOUT: !members:
  1348. // CHECK:STDOUT: .Self = imports.%import_ref.ef8
  1349. // CHECK:STDOUT: witness = ()
  1350. // CHECK:STDOUT: }
  1351. // CHECK:STDOUT: }
  1352. // CHECK:STDOUT:
  1353. // CHECK:STDOUT: interface @Y [from "has_param.carbon"] {
  1354. // CHECK:STDOUT: !members:
  1355. // CHECK:STDOUT: .Self = imports.%import_ref.434
  1356. // CHECK:STDOUT: .K = imports.%import_ref.991
  1357. // CHECK:STDOUT: witness = (imports.%import_ref.6f6)
  1358. // CHECK:STDOUT: }
  1359. // CHECK:STDOUT:
  1360. // CHECK:STDOUT: impl @impl: imports.%import_ref.d44 as imports.%import_ref.63d [from "has_generic_interface.carbon"] {
  1361. // CHECK:STDOUT: !members:
  1362. // CHECK:STDOUT: witness = imports.%import_ref.e37
  1363. // CHECK:STDOUT: }
  1364. // CHECK:STDOUT:
  1365. // CHECK:STDOUT: generic class @AnyParam(constants.%T: type, constants.%X: %T) [from "has_param.carbon"] {
  1366. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1367. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  1368. // CHECK:STDOUT: %X: %T = bind_symbolic_name X, 1 [symbolic = %X (constants.%X)]
  1369. // CHECK:STDOUT: %X.patt: %T = symbolic_binding_pattern X, 1 [symbolic = %X.patt (constants.%X.patt.a277d5.2)]
  1370. // CHECK:STDOUT:
  1371. // CHECK:STDOUT: !definition:
  1372. // CHECK:STDOUT:
  1373. // CHECK:STDOUT: class {
  1374. // CHECK:STDOUT: !members:
  1375. // CHECK:STDOUT: .Self = imports.%import_ref.8e4
  1376. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  1377. // CHECK:STDOUT: }
  1378. // CHECK:STDOUT: }
  1379. // CHECK:STDOUT:
  1380. // CHECK:STDOUT: fn @M() {
  1381. // CHECK:STDOUT: !entry:
  1382. // CHECK:STDOUT: %obj.var: ref %AnyParam.35d = var obj
  1383. // CHECK:STDOUT: %obj: ref %AnyParam.35d = bind_name obj, %obj.var
  1384. // CHECK:STDOUT: %.loc9_50.1: %empty_struct_type = struct_literal ()
  1385. // CHECK:STDOUT: %.loc9_50.2: init %AnyParam.35d = class_init (), %obj.var [template = constants.%AnyParam.val]
  1386. // CHECK:STDOUT: %.loc9_51: init %AnyParam.35d = converted %.loc9_50.1, %.loc9_50.2 [template = constants.%AnyParam.val]
  1387. // CHECK:STDOUT: assign %obj.var, %.loc9_51
  1388. // CHECK:STDOUT: %obj.ref: ref %AnyParam.35d = name_ref obj, %obj
  1389. // CHECK:STDOUT: %PackageHasParam.ref: <namespace> = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam]
  1390. // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.ca2 [template = constants.%Y.type]
  1391. // CHECK:STDOUT: %K.ref: %K.assoc_type = name_ref K, imports.%import_ref.991 [template = constants.%assoc0]
  1392. // CHECK:STDOUT: %impl.elem0: %K.type.069 = impl_witness_access constants.%impl_witness, element0 [template = constants.%K.4e3]
  1393. // CHECK:STDOUT: %K.call: init %empty_tuple.type = call %impl.elem0()
  1394. // CHECK:STDOUT: return
  1395. // CHECK:STDOUT: }
  1396. // CHECK:STDOUT:
  1397. // CHECK:STDOUT: generic fn @K.1(constants.%Self.ea2: %Y.type) [from "has_param.carbon"] {
  1398. // CHECK:STDOUT: !definition:
  1399. // CHECK:STDOUT:
  1400. // CHECK:STDOUT: fn();
  1401. // CHECK:STDOUT: }
  1402. // CHECK:STDOUT:
  1403. // CHECK:STDOUT: fn @K.2() [from "has_generic_interface.carbon"];
  1404. // CHECK:STDOUT:
  1405. // CHECK:STDOUT: specific @AnyParam(constants.%T, constants.%X) {
  1406. // CHECK:STDOUT: %T => constants.%T
  1407. // CHECK:STDOUT: %T.patt => constants.%T
  1408. // CHECK:STDOUT: %X => constants.%X
  1409. // CHECK:STDOUT: %X.patt => constants.%X
  1410. // CHECK:STDOUT: }
  1411. // CHECK:STDOUT:
  1412. // CHECK:STDOUT: specific @GenericInterface(constants.%U) {
  1413. // CHECK:STDOUT: %U => constants.%U
  1414. // CHECK:STDOUT: %U.patt => constants.%U
  1415. // CHECK:STDOUT: }
  1416. // CHECK:STDOUT:
  1417. // CHECK:STDOUT: specific @GenericInterface(%U) {}
  1418. // CHECK:STDOUT:
  1419. // CHECK:STDOUT: specific @AnyParam(constants.%GenericInterface.type.0da, constants.%GenericInterface.generic) {
  1420. // CHECK:STDOUT: %T => constants.%GenericInterface.type.0da
  1421. // CHECK:STDOUT: %T.patt => constants.%GenericInterface.type.0da
  1422. // CHECK:STDOUT: %X => constants.%GenericInterface.generic
  1423. // CHECK:STDOUT: %X.patt => constants.%GenericInterface.generic
  1424. // CHECK:STDOUT:
  1425. // CHECK:STDOUT: !definition:
  1426. // CHECK:STDOUT: }
  1427. // CHECK:STDOUT:
  1428. // CHECK:STDOUT: specific @K.1(constants.%Self.ea2) {}
  1429. // CHECK:STDOUT:
  1430. // CHECK:STDOUT: --- has_extra_interfaces.carbon
  1431. // CHECK:STDOUT:
  1432. // CHECK:STDOUT: constants {
  1433. // CHECK:STDOUT: %Extra1.type: type = facet_type <@Extra1> [template]
  1434. // CHECK:STDOUT: %Self.a02: %Extra1.type = bind_symbolic_name Self, 0 [symbolic]
  1435. // CHECK:STDOUT: %Extra2.type: type = facet_type <@Extra2> [template]
  1436. // CHECK:STDOUT: %Self.f86: %Extra2.type = bind_symbolic_name Self, 0 [symbolic]
  1437. // CHECK:STDOUT: %Extra3.type: type = facet_type <@Extra3> [template]
  1438. // CHECK:STDOUT: %Self.9d3: %Extra3.type = bind_symbolic_name Self, 0 [symbolic]
  1439. // CHECK:STDOUT: %Extra4.type: type = facet_type <@Extra4> [template]
  1440. // CHECK:STDOUT: %Self.4fb: %Extra4.type = bind_symbolic_name Self, 0 [symbolic]
  1441. // CHECK:STDOUT: %Extra5.type: type = facet_type <@Extra5> [template]
  1442. // CHECK:STDOUT: %Self.acd: %Extra5.type = bind_symbolic_name Self, 0 [symbolic]
  1443. // CHECK:STDOUT: %Extra6.type: type = facet_type <@Extra6> [template]
  1444. // CHECK:STDOUT: %Self.27e: %Extra6.type = bind_symbolic_name Self, 0 [symbolic]
  1445. // CHECK:STDOUT: %Extra7.type: type = facet_type <@Extra7> [template]
  1446. // CHECK:STDOUT: %Self.f8e: %Extra7.type = bind_symbolic_name Self, 0 [symbolic]
  1447. // CHECK:STDOUT: %Extra8.type: type = facet_type <@Extra8> [template]
  1448. // CHECK:STDOUT: %Self.0e4: %Extra8.type = bind_symbolic_name Self, 0 [symbolic]
  1449. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1450. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1451. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  1452. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  1453. // CHECK:STDOUT: %C.37e: type = class_type @C, @C(%T) [symbolic]
  1454. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  1455. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  1456. // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
  1457. // CHECK:STDOUT: %Self.fb7: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1458. // CHECK:STDOUT: %F.type.9df: type = fn_type @F.1 [template]
  1459. // CHECK:STDOUT: %F.478: %F.type.9df = struct_value () [template]
  1460. // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.9df [template]
  1461. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template]
  1462. // CHECK:STDOUT: %tuple.type.c53: type = tuple_type (type, type, type, type, type, type, type, type) [template]
  1463. // CHECK:STDOUT: %tuple.type.15d: type = tuple_type (%Extra1.type, %Extra2.type, %Extra3.type, %Extra4.type, %Extra5.type, %Extra6.type, %Extra7.type, %Extra8.type) [template]
  1464. // CHECK:STDOUT: %C.88d: type = class_type @C, @C(%tuple.type.15d) [template]
  1465. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template]
  1466. // CHECK:STDOUT: %F.type.b71: type = fn_type @F.2 [template]
  1467. // CHECK:STDOUT: %F.32b: %F.type.b71 = struct_value () [template]
  1468. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C.88d, %impl_witness [template]
  1469. // CHECK:STDOUT: }
  1470. // CHECK:STDOUT:
  1471. // CHECK:STDOUT: file {
  1472. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1473. // CHECK:STDOUT: .Extra1 = %Extra1.decl
  1474. // CHECK:STDOUT: .Extra2 = %Extra2.decl
  1475. // CHECK:STDOUT: .Extra3 = %Extra3.decl
  1476. // CHECK:STDOUT: .Extra4 = %Extra4.decl
  1477. // CHECK:STDOUT: .Extra5 = %Extra5.decl
  1478. // CHECK:STDOUT: .Extra6 = %Extra6.decl
  1479. // CHECK:STDOUT: .Extra7 = %Extra7.decl
  1480. // CHECK:STDOUT: .Extra8 = %Extra8.decl
  1481. // CHECK:STDOUT: .C = %C.decl
  1482. // CHECK:STDOUT: .I = %I.decl
  1483. // CHECK:STDOUT: }
  1484. // CHECK:STDOUT: %Extra1.decl: type = interface_decl @Extra1 [template = constants.%Extra1.type] {} {}
  1485. // CHECK:STDOUT: %Extra2.decl: type = interface_decl @Extra2 [template = constants.%Extra2.type] {} {}
  1486. // CHECK:STDOUT: %Extra3.decl: type = interface_decl @Extra3 [template = constants.%Extra3.type] {} {}
  1487. // CHECK:STDOUT: %Extra4.decl: type = interface_decl @Extra4 [template = constants.%Extra4.type] {} {}
  1488. // CHECK:STDOUT: %Extra5.decl: type = interface_decl @Extra5 [template = constants.%Extra5.type] {} {}
  1489. // CHECK:STDOUT: %Extra6.decl: type = interface_decl @Extra6 [template = constants.%Extra6.type] {} {}
  1490. // CHECK:STDOUT: %Extra7.decl: type = interface_decl @Extra7 [template = constants.%Extra7.type] {} {}
  1491. // CHECK:STDOUT: %Extra8.decl: type = interface_decl @Extra8 [template = constants.%Extra8.type] {} {}
  1492. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  1493. // CHECK:STDOUT: %T.patt.loc13_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_9.2 (constants.%T.patt)]
  1494. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc13_9.1, runtime_param<invalid> [symbolic = %T.patt.loc13_9.2 (constants.%T.patt)]
  1495. // CHECK:STDOUT: } {
  1496. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  1497. // CHECK:STDOUT: %T.loc13_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc13_9.2 (constants.%T)]
  1498. // CHECK:STDOUT: }
  1499. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
  1500. // CHECK:STDOUT: impl_decl @impl [template] {} {
  1501. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  1502. // CHECK:STDOUT: %Extra1.ref: type = name_ref Extra1, file.%Extra1.decl [template = constants.%Extra1.type]
  1503. // CHECK:STDOUT: %Extra2.ref: type = name_ref Extra2, file.%Extra2.decl [template = constants.%Extra2.type]
  1504. // CHECK:STDOUT: %Extra3.ref: type = name_ref Extra3, file.%Extra3.decl [template = constants.%Extra3.type]
  1505. // CHECK:STDOUT: %Extra4.ref: type = name_ref Extra4, file.%Extra4.decl [template = constants.%Extra4.type]
  1506. // CHECK:STDOUT: %Extra5.ref: type = name_ref Extra5, file.%Extra5.decl [template = constants.%Extra5.type]
  1507. // CHECK:STDOUT: %Extra6.ref: type = name_ref Extra6, file.%Extra6.decl [template = constants.%Extra6.type]
  1508. // CHECK:STDOUT: %Extra7.ref: type = name_ref Extra7, file.%Extra7.decl [template = constants.%Extra7.type]
  1509. // CHECK:STDOUT: %Extra8.ref: type = name_ref Extra8, file.%Extra8.decl [template = constants.%Extra8.type]
  1510. // 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)
  1511. // CHECK:STDOUT: %.loc16_72: type = converted %.loc16_71, constants.%tuple.type.15d [template = constants.%tuple.type.15d]
  1512. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.type.15d) [template = constants.%C.88d]
  1513. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  1514. // CHECK:STDOUT: }
  1515. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template = constants.%impl_witness]
  1516. // CHECK:STDOUT: }
  1517. // CHECK:STDOUT:
  1518. // CHECK:STDOUT: interface @Extra1 {
  1519. // CHECK:STDOUT: %Self: %Extra1.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.a02]
  1520. // CHECK:STDOUT:
  1521. // CHECK:STDOUT: !members:
  1522. // CHECK:STDOUT: .Self = %Self
  1523. // CHECK:STDOUT: witness = ()
  1524. // CHECK:STDOUT: }
  1525. // CHECK:STDOUT:
  1526. // CHECK:STDOUT: interface @Extra2 {
  1527. // CHECK:STDOUT: %Self: %Extra2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.f86]
  1528. // CHECK:STDOUT:
  1529. // CHECK:STDOUT: !members:
  1530. // CHECK:STDOUT: .Self = %Self
  1531. // CHECK:STDOUT: witness = ()
  1532. // CHECK:STDOUT: }
  1533. // CHECK:STDOUT:
  1534. // CHECK:STDOUT: interface @Extra3 {
  1535. // CHECK:STDOUT: %Self: %Extra3.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.9d3]
  1536. // CHECK:STDOUT:
  1537. // CHECK:STDOUT: !members:
  1538. // CHECK:STDOUT: .Self = %Self
  1539. // CHECK:STDOUT: witness = ()
  1540. // CHECK:STDOUT: }
  1541. // CHECK:STDOUT:
  1542. // CHECK:STDOUT: interface @Extra4 {
  1543. // CHECK:STDOUT: %Self: %Extra4.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.4fb]
  1544. // CHECK:STDOUT:
  1545. // CHECK:STDOUT: !members:
  1546. // CHECK:STDOUT: .Self = %Self
  1547. // CHECK:STDOUT: witness = ()
  1548. // CHECK:STDOUT: }
  1549. // CHECK:STDOUT:
  1550. // CHECK:STDOUT: interface @Extra5 {
  1551. // CHECK:STDOUT: %Self: %Extra5.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.acd]
  1552. // CHECK:STDOUT:
  1553. // CHECK:STDOUT: !members:
  1554. // CHECK:STDOUT: .Self = %Self
  1555. // CHECK:STDOUT: witness = ()
  1556. // CHECK:STDOUT: }
  1557. // CHECK:STDOUT:
  1558. // CHECK:STDOUT: interface @Extra6 {
  1559. // CHECK:STDOUT: %Self: %Extra6.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.27e]
  1560. // CHECK:STDOUT:
  1561. // CHECK:STDOUT: !members:
  1562. // CHECK:STDOUT: .Self = %Self
  1563. // CHECK:STDOUT: witness = ()
  1564. // CHECK:STDOUT: }
  1565. // CHECK:STDOUT:
  1566. // CHECK:STDOUT: interface @Extra7 {
  1567. // CHECK:STDOUT: %Self: %Extra7.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.f8e]
  1568. // CHECK:STDOUT:
  1569. // CHECK:STDOUT: !members:
  1570. // CHECK:STDOUT: .Self = %Self
  1571. // CHECK:STDOUT: witness = ()
  1572. // CHECK:STDOUT: }
  1573. // CHECK:STDOUT:
  1574. // CHECK:STDOUT: interface @Extra8 {
  1575. // CHECK:STDOUT: %Self: %Extra8.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.0e4]
  1576. // CHECK:STDOUT:
  1577. // CHECK:STDOUT: !members:
  1578. // CHECK:STDOUT: .Self = %Self
  1579. // CHECK:STDOUT: witness = ()
  1580. // CHECK:STDOUT: }
  1581. // CHECK:STDOUT:
  1582. // CHECK:STDOUT: interface @I {
  1583. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.fb7]
  1584. // CHECK:STDOUT: %F.decl: %F.type.9df = fn_decl @F.1 [template = constants.%F.478] {} {}
  1585. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0]
  1586. // CHECK:STDOUT:
  1587. // CHECK:STDOUT: !members:
  1588. // CHECK:STDOUT: .Self = %Self
  1589. // CHECK:STDOUT: .F = %assoc0
  1590. // CHECK:STDOUT: witness = (%F.decl)
  1591. // CHECK:STDOUT: }
  1592. // CHECK:STDOUT:
  1593. // CHECK:STDOUT: impl @impl: %C as %I.ref {
  1594. // CHECK:STDOUT: %F.decl: %F.type.b71 = fn_decl @F.2 [template = constants.%F.32b] {} {}
  1595. // CHECK:STDOUT:
  1596. // CHECK:STDOUT: !members:
  1597. // CHECK:STDOUT: .F = %F.decl
  1598. // CHECK:STDOUT: witness = file.%impl_witness
  1599. // CHECK:STDOUT: }
  1600. // CHECK:STDOUT:
  1601. // CHECK:STDOUT: generic class @C(%T.loc13_9.1: type) {
  1602. // CHECK:STDOUT: %T.loc13_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc13_9.2 (constants.%T)]
  1603. // CHECK:STDOUT: %T.patt.loc13_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_9.2 (constants.%T.patt)]
  1604. // CHECK:STDOUT:
  1605. // CHECK:STDOUT: !definition:
  1606. // CHECK:STDOUT:
  1607. // CHECK:STDOUT: class {
  1608. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  1609. // CHECK:STDOUT:
  1610. // CHECK:STDOUT: !members:
  1611. // CHECK:STDOUT: .Self = constants.%C.37e
  1612. // CHECK:STDOUT: complete_type_witness = %complete_type
  1613. // CHECK:STDOUT: }
  1614. // CHECK:STDOUT: }
  1615. // CHECK:STDOUT:
  1616. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  1617. // CHECK:STDOUT:
  1618. // CHECK:STDOUT: fn();
  1619. // CHECK:STDOUT: }
  1620. // CHECK:STDOUT:
  1621. // CHECK:STDOUT: fn @F.2() {
  1622. // CHECK:STDOUT: !entry:
  1623. // CHECK:STDOUT: return
  1624. // CHECK:STDOUT: }
  1625. // CHECK:STDOUT:
  1626. // CHECK:STDOUT: specific @C(constants.%T) {
  1627. // CHECK:STDOUT: %T.loc13_9.2 => constants.%T
  1628. // CHECK:STDOUT: %T.patt.loc13_9.2 => constants.%T
  1629. // CHECK:STDOUT: }
  1630. // CHECK:STDOUT:
  1631. // CHECK:STDOUT: specific @F.1(constants.%Self.fb7) {}
  1632. // CHECK:STDOUT:
  1633. // CHECK:STDOUT: specific @C(constants.%tuple.type.15d) {
  1634. // CHECK:STDOUT: %T.loc13_9.2 => constants.%tuple.type.15d
  1635. // CHECK:STDOUT: %T.patt.loc13_9.2 => constants.%tuple.type.15d
  1636. // CHECK:STDOUT: }
  1637. // CHECK:STDOUT:
  1638. // CHECK:STDOUT: specific @F.1(constants.%I.facet) {}
  1639. // CHECK:STDOUT:
  1640. // CHECK:STDOUT: --- fail_use_has_extra_interfaces.carbon
  1641. // CHECK:STDOUT:
  1642. // CHECK:STDOUT: constants {
  1643. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  1644. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  1645. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  1646. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  1647. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1648. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1649. // CHECK:STDOUT: %C.b1d: type = class_type @C, @C(type) [template]
  1650. // CHECK:STDOUT: %Test.type: type = fn_type @Test [template]
  1651. // CHECK:STDOUT: %Test: %Test.type = struct_value () [template]
  1652. // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
  1653. // CHECK:STDOUT: %Self.ce8: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1654. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  1655. // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type [template]
  1656. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.911 [template]
  1657. // CHECK:STDOUT: %Extra8.type: type = facet_type <@Extra8> [template]
  1658. // CHECK:STDOUT: %Extra7.type: type = facet_type <@Extra7> [template]
  1659. // CHECK:STDOUT: %Extra6.type: type = facet_type <@Extra6> [template]
  1660. // CHECK:STDOUT: %Extra5.type: type = facet_type <@Extra5> [template]
  1661. // CHECK:STDOUT: %Extra4.type: type = facet_type <@Extra4> [template]
  1662. // CHECK:STDOUT: %Extra3.type: type = facet_type <@Extra3> [template]
  1663. // CHECK:STDOUT: %Extra2.type: type = facet_type <@Extra2> [template]
  1664. // CHECK:STDOUT: %Extra1.type: type = facet_type <@Extra1> [template]
  1665. // CHECK:STDOUT: %tuple.type: type = tuple_type (%Extra1.type, %Extra2.type, %Extra3.type, %Extra4.type, %Extra5.type, %Extra6.type, %Extra7.type, %Extra8.type) [template]
  1666. // CHECK:STDOUT: %C.d74: type = class_type @C, @C(%tuple.type) [template]
  1667. // CHECK:STDOUT: }
  1668. // CHECK:STDOUT:
  1669. // CHECK:STDOUT: imports {
  1670. // CHECK:STDOUT: %HasExtraInterfaces: <namespace> = namespace file.%HasExtraInterfaces.import, [template] {
  1671. // CHECK:STDOUT: .C = %import_ref.e8a
  1672. // CHECK:STDOUT: .I = %import_ref.9f4
  1673. // CHECK:STDOUT: import HasExtraInterfaces//default
  1674. // CHECK:STDOUT: }
  1675. // CHECK:STDOUT: %import_ref.e8a: %C.type = import_ref HasExtraInterfaces//default, C, loaded [template = constants.%C.generic]
  1676. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref HasExtraInterfaces//default, loc13_20, loaded [template = constants.%complete_type]
  1677. // CHECK:STDOUT: %import_ref.495 = import_ref HasExtraInterfaces//default, inst57 [no loc], unloaded
  1678. // CHECK:STDOUT: %import_ref.9f4: type = import_ref HasExtraInterfaces//default, I, loaded [template = constants.%I.type]
  1679. // CHECK:STDOUT: %import_ref.f8c = import_ref HasExtraInterfaces//default, inst63 [no loc], unloaded
  1680. // CHECK:STDOUT: %import_ref.9b9: %F.assoc_type = import_ref HasExtraInterfaces//default, loc14_21, loaded [template = constants.%assoc0]
  1681. // CHECK:STDOUT: %import_ref.a15 = import_ref HasExtraInterfaces//default, F, unloaded
  1682. // CHECK:STDOUT: %import_ref.92b = import_ref HasExtraInterfaces//default, loc16_79, unloaded
  1683. // CHECK:STDOUT: %import_ref.8b6 = import_ref HasExtraInterfaces//default, inst43 [no loc], unloaded
  1684. // CHECK:STDOUT: %import_ref.8c6 = import_ref HasExtraInterfaces//default, inst39 [no loc], unloaded
  1685. // CHECK:STDOUT: %import_ref.3dd = import_ref HasExtraInterfaces//default, inst35 [no loc], unloaded
  1686. // CHECK:STDOUT: %import_ref.1a7 = import_ref HasExtraInterfaces//default, inst31 [no loc], unloaded
  1687. // CHECK:STDOUT: %import_ref.de2 = import_ref HasExtraInterfaces//default, inst27 [no loc], unloaded
  1688. // CHECK:STDOUT: %import_ref.93a = import_ref HasExtraInterfaces//default, inst23 [no loc], unloaded
  1689. // CHECK:STDOUT: %import_ref.5a8 = import_ref HasExtraInterfaces//default, inst19 [no loc], unloaded
  1690. // CHECK:STDOUT: %import_ref.4be = import_ref HasExtraInterfaces//default, inst15 [no loc], unloaded
  1691. // CHECK:STDOUT: %import_ref.2a6: type = import_ref HasExtraInterfaces//default, loc16_72, loaded [template = constants.%C.d74]
  1692. // CHECK:STDOUT: %import_ref.bd0: type = import_ref HasExtraInterfaces//default, loc16_77, loaded [template = constants.%I.type]
  1693. // CHECK:STDOUT: }
  1694. // CHECK:STDOUT:
  1695. // CHECK:STDOUT: file {
  1696. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1697. // CHECK:STDOUT: .HasExtraInterfaces = imports.%HasExtraInterfaces
  1698. // CHECK:STDOUT: .Test = %Test.decl
  1699. // CHECK:STDOUT: }
  1700. // CHECK:STDOUT: %HasExtraInterfaces.import = import HasExtraInterfaces
  1701. // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {
  1702. // CHECK:STDOUT: %c.patt: %C.b1d = binding_pattern c
  1703. // CHECK:STDOUT: %c.param_patt: %C.b1d = value_param_pattern %c.patt, runtime_param0
  1704. // CHECK:STDOUT: } {
  1705. // CHECK:STDOUT: %c.param: %C.b1d = value_param runtime_param0
  1706. // CHECK:STDOUT: %.loc5: type = splice_block %C [template = constants.%C.b1d] {
  1707. // CHECK:STDOUT: %HasExtraInterfaces.ref.loc5: <namespace> = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [template = imports.%HasExtraInterfaces]
  1708. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.e8a [template = constants.%C.generic]
  1709. // CHECK:STDOUT: %C: type = class_type @C, @C(type) [template = constants.%C.b1d]
  1710. // CHECK:STDOUT: }
  1711. // CHECK:STDOUT: %c: %C.b1d = bind_name c, %c.param
  1712. // CHECK:STDOUT: }
  1713. // CHECK:STDOUT: }
  1714. // CHECK:STDOUT:
  1715. // CHECK:STDOUT: interface @I [from "has_extra_interfaces.carbon"] {
  1716. // CHECK:STDOUT: !members:
  1717. // CHECK:STDOUT: .Self = imports.%import_ref.f8c
  1718. // CHECK:STDOUT: .F = imports.%import_ref.9b9
  1719. // CHECK:STDOUT: witness = (imports.%import_ref.a15)
  1720. // CHECK:STDOUT: }
  1721. // CHECK:STDOUT:
  1722. // CHECK:STDOUT: interface @Extra8 [from "has_extra_interfaces.carbon"] {
  1723. // CHECK:STDOUT: !members:
  1724. // CHECK:STDOUT: .Self = imports.%import_ref.8b6
  1725. // CHECK:STDOUT: witness = ()
  1726. // CHECK:STDOUT: }
  1727. // CHECK:STDOUT:
  1728. // CHECK:STDOUT: interface @Extra7 [from "has_extra_interfaces.carbon"] {
  1729. // CHECK:STDOUT: !members:
  1730. // CHECK:STDOUT: .Self = imports.%import_ref.8c6
  1731. // CHECK:STDOUT: witness = ()
  1732. // CHECK:STDOUT: }
  1733. // CHECK:STDOUT:
  1734. // CHECK:STDOUT: interface @Extra6 [from "has_extra_interfaces.carbon"] {
  1735. // CHECK:STDOUT: !members:
  1736. // CHECK:STDOUT: .Self = imports.%import_ref.3dd
  1737. // CHECK:STDOUT: witness = ()
  1738. // CHECK:STDOUT: }
  1739. // CHECK:STDOUT:
  1740. // CHECK:STDOUT: interface @Extra5 [from "has_extra_interfaces.carbon"] {
  1741. // CHECK:STDOUT: !members:
  1742. // CHECK:STDOUT: .Self = imports.%import_ref.1a7
  1743. // CHECK:STDOUT: witness = ()
  1744. // CHECK:STDOUT: }
  1745. // CHECK:STDOUT:
  1746. // CHECK:STDOUT: interface @Extra4 [from "has_extra_interfaces.carbon"] {
  1747. // CHECK:STDOUT: !members:
  1748. // CHECK:STDOUT: .Self = imports.%import_ref.de2
  1749. // CHECK:STDOUT: witness = ()
  1750. // CHECK:STDOUT: }
  1751. // CHECK:STDOUT:
  1752. // CHECK:STDOUT: interface @Extra3 [from "has_extra_interfaces.carbon"] {
  1753. // CHECK:STDOUT: !members:
  1754. // CHECK:STDOUT: .Self = imports.%import_ref.93a
  1755. // CHECK:STDOUT: witness = ()
  1756. // CHECK:STDOUT: }
  1757. // CHECK:STDOUT:
  1758. // CHECK:STDOUT: interface @Extra2 [from "has_extra_interfaces.carbon"] {
  1759. // CHECK:STDOUT: !members:
  1760. // CHECK:STDOUT: .Self = imports.%import_ref.5a8
  1761. // CHECK:STDOUT: witness = ()
  1762. // CHECK:STDOUT: }
  1763. // CHECK:STDOUT:
  1764. // CHECK:STDOUT: interface @Extra1 [from "has_extra_interfaces.carbon"] {
  1765. // CHECK:STDOUT: !members:
  1766. // CHECK:STDOUT: .Self = imports.%import_ref.4be
  1767. // CHECK:STDOUT: witness = ()
  1768. // CHECK:STDOUT: }
  1769. // CHECK:STDOUT:
  1770. // CHECK:STDOUT: impl @impl: imports.%import_ref.2a6 as imports.%import_ref.bd0 [from "has_extra_interfaces.carbon"] {
  1771. // CHECK:STDOUT: !members:
  1772. // CHECK:STDOUT: witness = imports.%import_ref.92b
  1773. // CHECK:STDOUT: }
  1774. // CHECK:STDOUT:
  1775. // CHECK:STDOUT: generic class @C(constants.%T: type) [from "has_extra_interfaces.carbon"] {
  1776. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1777. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  1778. // CHECK:STDOUT:
  1779. // CHECK:STDOUT: !definition:
  1780. // CHECK:STDOUT:
  1781. // CHECK:STDOUT: class {
  1782. // CHECK:STDOUT: !members:
  1783. // CHECK:STDOUT: .Self = imports.%import_ref.495
  1784. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  1785. // CHECK:STDOUT: }
  1786. // CHECK:STDOUT: }
  1787. // CHECK:STDOUT:
  1788. // CHECK:STDOUT: fn @Test(%c.param_patt: %C.b1d) {
  1789. // CHECK:STDOUT: !entry:
  1790. // CHECK:STDOUT: %c.ref: %C.b1d = name_ref c, %c
  1791. // CHECK:STDOUT: %HasExtraInterfaces.ref.loc11: <namespace> = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [template = imports.%HasExtraInterfaces]
  1792. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.9f4 [template = constants.%I.type]
  1793. // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.9b9 [template = constants.%assoc0]
  1794. // CHECK:STDOUT: return
  1795. // CHECK:STDOUT: }
  1796. // CHECK:STDOUT:
  1797. // CHECK:STDOUT: generic fn @F(constants.%Self.ce8: %I.type) [from "has_extra_interfaces.carbon"] {
  1798. // CHECK:STDOUT:
  1799. // CHECK:STDOUT: fn();
  1800. // CHECK:STDOUT: }
  1801. // CHECK:STDOUT:
  1802. // CHECK:STDOUT: specific @C(constants.%T) {
  1803. // CHECK:STDOUT: %T => constants.%T
  1804. // CHECK:STDOUT: %T.patt => constants.%T
  1805. // CHECK:STDOUT: }
  1806. // CHECK:STDOUT:
  1807. // CHECK:STDOUT: specific @C(type) {
  1808. // CHECK:STDOUT: %T => type
  1809. // CHECK:STDOUT: %T.patt => type
  1810. // CHECK:STDOUT:
  1811. // CHECK:STDOUT: !definition:
  1812. // CHECK:STDOUT: }
  1813. // CHECK:STDOUT:
  1814. // CHECK:STDOUT: specific @F(constants.%Self.ce8) {}
  1815. // CHECK:STDOUT:
  1816. // CHECK:STDOUT: specific @C(constants.%tuple.type) {
  1817. // CHECK:STDOUT: %T => constants.%tuple.type
  1818. // CHECK:STDOUT: %T.patt => constants.%tuple.type
  1819. // CHECK:STDOUT: }
  1820. // CHECK:STDOUT: