forward_decls.carbon 108 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/facet_types.carbon
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/forward_decls.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/forward_decls.carbon
  14. // --- empty.carbon
  15. library "[[@TEST_NAME]]";
  16. interface I;
  17. impl {} as I;
  18. interface I {}
  19. impl {} as I {}
  20. // --- method.carbon
  21. library "[[@TEST_NAME]]";
  22. interface I;
  23. impl {} as I;
  24. interface I {
  25. fn G();
  26. }
  27. impl {} as I {
  28. fn G() {}
  29. }
  30. // --- combine.carbon
  31. library "[[@TEST_NAME]]";
  32. interface I;
  33. impl {} as I & I;
  34. interface I {}
  35. impl {} as I & I {}
  36. // --- associated_const.carbon
  37. library "[[@TEST_NAME]]";
  38. interface I {
  39. let T:! type;
  40. }
  41. impl {} as I where .T = ();
  42. impl {} as I where .T = () {}
  43. // --- associated_const_compound_member_access.carbon
  44. library "[[@TEST_NAME]]";
  45. interface I {
  46. let T:! type;
  47. }
  48. class C {}
  49. impl C as I where .T = ();
  50. let x: C.(I.T) = ();
  51. impl C as I where .T = () {}
  52. // --- associated_const_of_facet.carbon
  53. library "[[@TEST_NAME]]";
  54. interface I {
  55. let T:! type;
  56. }
  57. class C {}
  58. impl C as I where .T = ();
  59. let x: (C as I).T = ();
  60. impl C as I where .T = () {}
  61. // --- fail_unset_associated_const.carbon
  62. library "[[@TEST_NAME]]";
  63. interface I {
  64. let T:! type;
  65. }
  66. class C {}
  67. impl C as I;
  68. // CHECK:STDERR: fail_unset_associated_const.carbon:[[@LINE+4]]:8: error: accessing member from impl before it has a defined value [ImplAccessMemberBeforeSet]
  69. // CHECK:STDERR: let x: (C as I).T = ();
  70. // CHECK:STDERR: ^~~~~~~~~~
  71. // CHECK:STDERR:
  72. let x: (C as I).T = ();
  73. // CHECK:STDERR: fail_unset_associated_const.carbon:[[@LINE+7]]:1: error: associated constant T not given a value in impl of interface I [ImplAssociatedConstantNeedsValue]
  74. // CHECK:STDERR: impl C as I {}
  75. // CHECK:STDERR: ^~~~~~~~~~~~~
  76. // CHECK:STDERR: fail_unset_associated_const.carbon:[[@LINE-14]]:7: note: associated constant declared here [AssociatedConstantHere]
  77. // CHECK:STDERR: let T:! type;
  78. // CHECK:STDERR: ^~~~~~~~
  79. // CHECK:STDERR:
  80. impl C as I {}
  81. // --- fail_associated_const_before_interface_definition.carbon
  82. library "[[@TEST_NAME]]";
  83. interface I;
  84. class C;
  85. class D {}
  86. // CHECK:STDERR: fail_associated_const_before_interface_definition.carbon:[[@LINE+7]]:19: error: member access into object of incomplete type `I` [IncompleteTypeInMemberAccess]
  87. // CHECK:STDERR: impl D as I where .T = C;
  88. // CHECK:STDERR: ^~
  89. // CHECK:STDERR: fail_associated_const_before_interface_definition.carbon:[[@LINE-6]]:1: note: interface was forward declared here [InterfaceForwardDeclaredHere]
  90. // CHECK:STDERR: interface I;
  91. // CHECK:STDERR: ^~~~~~~~~~~~
  92. // CHECK:STDERR:
  93. impl D as I where .T = C;
  94. interface I {}
  95. class C {}
  96. // CHECK:STDERR: fail_associated_const_before_interface_definition.carbon:[[@LINE+4]]:19: error: member name `T` not found in `I` [MemberNameNotFoundInInstScope]
  97. // CHECK:STDERR: impl D as I where .T = C {}
  98. // CHECK:STDERR: ^~
  99. // CHECK:STDERR:
  100. impl D as I where .T = C {}
  101. // --- associated_const_of_parameterized.carbon
  102. library "[[@TEST_NAME]]";
  103. interface I(U:! type) {
  104. let T:! type;
  105. }
  106. class C;
  107. class D {}
  108. impl D as I(C) where .T = C;
  109. class C {}
  110. impl D as I(C) where .T = C {}
  111. // --- find_incomplete_impl.carbon
  112. library "[[@TEST_NAME]]";
  113. interface I;
  114. class D {}
  115. impl D as I;
  116. class C(T:! I);
  117. fn F(x: C(D));
  118. interface I {}
  119. impl D as I {}
  120. class C(T:! I) {}
  121. fn F(x: C(D)) {}
  122. // --- fail_todo_two_interfaces.carbon
  123. library "[[@TEST_NAME]]";
  124. interface I;
  125. interface J;
  126. // CHECK:STDERR: fail_todo_two_interfaces.carbon:[[@LINE+4]]:1: error: impl as 2 interfaces, expected 1 [ImplOfNotOneInterface]
  127. // CHECK:STDERR: impl {} as I & J;
  128. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  129. // CHECK:STDERR:
  130. impl {} as I & J;
  131. interface I {}
  132. interface J {}
  133. // --- fail_never_assigned_associated_const.carbon
  134. library "[[@TEST_NAME]]";
  135. interface I {
  136. let T:! type;
  137. let U:! type;
  138. }
  139. class C {}
  140. impl C as I where .T = ();
  141. // CHECK:STDERR: fail_never_assigned_associated_const.carbon:[[@LINE+7]]:1: error: associated constant U not given a value in impl of interface I [ImplAssociatedConstantNeedsValue]
  142. // CHECK:STDERR: impl C as I where .T = () {}
  143. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  144. // CHECK:STDERR: fail_never_assigned_associated_const.carbon:[[@LINE-9]]:7: note: associated constant declared here [AssociatedConstantHere]
  145. // CHECK:STDERR: let U:! type;
  146. // CHECK:STDERR: ^~~~~~~~
  147. // CHECK:STDERR:
  148. impl C as I where .T = () {}
  149. // --- example_from_proposal_5168.carbon
  150. library "[[@TEST_NAME]]";
  151. interface X;
  152. // Allowed to use incomplete interfaces in function declarations.
  153. fn F(U:! X);
  154. fn G[U:! X](u: U);
  155. class C;
  156. // Allowed to use incomplete types and interfaces in impl declarations.
  157. impl C as X;
  158. interface Y;
  159. interface X {
  160. // TODO: Should be allowed to use an incomplete interface here,
  161. // but `require Self impls` is not supported yet.
  162. // require Self impls Y;
  163. }
  164. // Classes must be defined before being used in a function definition.
  165. class C {}
  166. fn H(c: C) {
  167. // Allowed since C is complete and we have a declaration `impl C as X;`
  168. F(C);
  169. G(c);
  170. }
  171. // The above declarations require that `interface Y`, `fn F` (since it is
  172. // generic), and `impl C as X` are defined in the same file.
  173. interface Y {}
  174. fn F(U:! X) {}
  175. fn G[U:! X](u: U) {}
  176. impl C as Y;
  177. impl C as X {}
  178. impl C as Y {}
  179. // --- fail_todo_impl_in_interface_definition.carbon
  180. library "[[@TEST_NAME]]";
  181. // This test uses many unsupported features, and is expected to change.
  182. interface I {
  183. // CHECK:STDERR: fail_todo_impl_in_interface_definition.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo]
  184. // CHECK:STDERR: default fn F() {
  185. // CHECK:STDERR: ^~~~~~~
  186. // CHECK:STDERR:
  187. default fn F() {
  188. class C {}
  189. impl C as I;
  190. // CHECK:STDERR: fail_todo_impl_in_interface_definition.carbon:[[@LINE+7]]:5: error: missing implementation of F in impl of interface I [ImplMissingFunction]
  191. // CHECK:STDERR: impl C as I {}
  192. // CHECK:STDERR: ^~~~~~~~~~~~~
  193. // CHECK:STDERR: fail_todo_impl_in_interface_definition.carbon:[[@LINE-7]]:3: note: associated function F declared here [AssociatedFunctionHere]
  194. // CHECK:STDERR: default fn F() {
  195. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  196. // CHECK:STDERR:
  197. impl C as I {}
  198. }
  199. }
  200. // --- fail_todo_impl_in_interface_definition_with_associated.carbon
  201. library "[[@TEST_NAME]]";
  202. // This test uses many unsupported features, and is expected to change.
  203. interface I {
  204. let U:! type;
  205. // CHECK:STDERR: fail_todo_impl_in_interface_definition_with_associated.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo]
  206. // CHECK:STDERR: default fn F() {
  207. // CHECK:STDERR: ^~~~~~~
  208. // CHECK:STDERR:
  209. default fn F() {
  210. class C {}
  211. impl C as I where .U = C;
  212. // CHECK:STDERR: fail_todo_impl_in_interface_definition_with_associated.carbon:[[@LINE+7]]:5: error: missing implementation of F in impl of interface I [ImplMissingFunction]
  213. // CHECK:STDERR: impl C as I where .U = C {}
  214. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  215. // CHECK:STDERR: fail_todo_impl_in_interface_definition_with_associated.carbon:[[@LINE-7]]:3: note: associated function F declared here [AssociatedFunctionHere]
  216. // CHECK:STDERR: default fn F() {
  217. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  218. // CHECK:STDERR:
  219. impl C as I where .U = C {}
  220. }
  221. }
  222. // CHECK:STDOUT: --- empty.carbon
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: constants {
  225. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  226. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  227. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  228. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: imports {
  232. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  233. // CHECK:STDOUT: import Core//prelude
  234. // CHECK:STDOUT: import Core//prelude/...
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: file {
  239. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  240. // CHECK:STDOUT: .Core = imports.%Core
  241. // CHECK:STDOUT: .I = %I.decl.loc3
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT: %Core.import = import Core
  244. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  245. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  246. // CHECK:STDOUT: %.loc4_7.1: %empty_struct_type = struct_literal ()
  247. // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  248. // CHECK:STDOUT: %I.ref.loc4: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @impl [concrete]
  251. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  252. // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {}
  253. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  254. // CHECK:STDOUT: %.loc7_7.1: %empty_struct_type = struct_literal ()
  255. // CHECK:STDOUT: %.loc7_7.2: type = converted %.loc7_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  256. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: interface @I {
  261. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: !members:
  264. // CHECK:STDOUT: .Self = %Self
  265. // CHECK:STDOUT: witness = ()
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: impl @impl: %.loc4_7.2 as %I.ref.loc4 {
  269. // CHECK:STDOUT: !members:
  270. // CHECK:STDOUT: witness = file.%I.impl_witness
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT:
  273. // CHECK:STDOUT: --- method.carbon
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: constants {
  276. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  277. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  278. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  279. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  280. // CHECK:STDOUT: %G.type.ccd: type = fn_type @G.1 [concrete]
  281. // CHECK:STDOUT: %G.600: %G.type.ccd = struct_value () [concrete]
  282. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  283. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%G.decl [concrete]
  284. // CHECK:STDOUT: %G.type.d6f: type = fn_type @G.2 [concrete]
  285. // CHECK:STDOUT: %G.d07: %G.type.d6f = struct_value () [concrete]
  286. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_struct_type, (%I.impl_witness) [concrete]
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: imports {
  290. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  291. // CHECK:STDOUT: import Core//prelude
  292. // CHECK:STDOUT: import Core//prelude/...
  293. // CHECK:STDOUT: }
  294. // CHECK:STDOUT: }
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: file {
  297. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  298. // CHECK:STDOUT: .Core = imports.%Core
  299. // CHECK:STDOUT: .I = %I.decl.loc3
  300. // CHECK:STDOUT: }
  301. // CHECK:STDOUT: %Core.import = import Core
  302. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  303. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  304. // CHECK:STDOUT: %.loc4_7.1: %empty_struct_type = struct_literal ()
  305. // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  306. // CHECK:STDOUT: %I.ref.loc4: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.%G.decl), @impl [concrete]
  309. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  310. // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {}
  311. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  312. // CHECK:STDOUT: %.loc9_7.1: %empty_struct_type = struct_literal ()
  313. // CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  314. // CHECK:STDOUT: %I.ref.loc9: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT: }
  317. // CHECK:STDOUT:
  318. // CHECK:STDOUT: interface @I {
  319. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  320. // CHECK:STDOUT: %G.decl: %G.type.ccd = fn_decl @G.1 [concrete = constants.%G.600] {} {}
  321. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %G.decl [concrete = constants.%assoc0]
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: !members:
  324. // CHECK:STDOUT: .Self = %Self
  325. // CHECK:STDOUT: .G = %assoc0
  326. // CHECK:STDOUT: witness = (%G.decl)
  327. // CHECK:STDOUT: }
  328. // CHECK:STDOUT:
  329. // CHECK:STDOUT: impl @impl: %.loc4_7.2 as %I.ref.loc4 {
  330. // CHECK:STDOUT: %G.decl: %G.type.d6f = fn_decl @G.2 [concrete = constants.%G.d07] {} {}
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: !members:
  333. // CHECK:STDOUT: .G = %G.decl
  334. // CHECK:STDOUT: witness = file.%I.impl_witness
  335. // CHECK:STDOUT: }
  336. // CHECK:STDOUT:
  337. // CHECK:STDOUT: generic fn @G.1(@I.%Self: %I.type) {
  338. // CHECK:STDOUT: fn();
  339. // CHECK:STDOUT: }
  340. // CHECK:STDOUT:
  341. // CHECK:STDOUT: fn @G.2() {
  342. // CHECK:STDOUT: !entry:
  343. // CHECK:STDOUT: return
  344. // CHECK:STDOUT: }
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: specific @G.1(constants.%Self) {}
  347. // CHECK:STDOUT:
  348. // CHECK:STDOUT: specific @G.1(constants.%I.facet) {}
  349. // CHECK:STDOUT:
  350. // CHECK:STDOUT: --- combine.carbon
  351. // CHECK:STDOUT:
  352. // CHECK:STDOUT: constants {
  353. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  354. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  355. // CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
  356. // CHECK:STDOUT: %Op.type.27a: type = fn_type @Op.1 [concrete]
  357. // CHECK:STDOUT: %BitAnd.impl_witness: <witness> = impl_witness imports.%BitAnd.impl_witness_table [concrete]
  358. // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, (%BitAnd.impl_witness) [concrete]
  359. // CHECK:STDOUT: %.6bf: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete]
  360. // CHECK:STDOUT: %Op.type.c1b: type = fn_type @Op.2 [concrete]
  361. // CHECK:STDOUT: %Op.0a6: %Op.type.c1b = struct_value () [concrete]
  362. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %I.type, %Op.0a6 [concrete]
  363. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  364. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  365. // CHECK:STDOUT: }
  366. // CHECK:STDOUT:
  367. // CHECK:STDOUT: imports {
  368. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  369. // CHECK:STDOUT: .BitAnd = %Core.BitAnd
  370. // CHECK:STDOUT: import Core//prelude
  371. // CHECK:STDOUT: import Core//prelude/...
  372. // CHECK:STDOUT: }
  373. // CHECK:STDOUT: %Core.BitAnd: type = import_ref Core//prelude, BitAnd, loaded [concrete = constants.%BitAnd.type]
  374. // CHECK:STDOUT: %Core.import_ref.d90: %Op.type.c1b = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%Op.0a6]
  375. // CHECK:STDOUT: %BitAnd.impl_witness_table = impl_witness_table (%Core.import_ref.d90), @impl.13c [concrete]
  376. // CHECK:STDOUT: }
  377. // CHECK:STDOUT:
  378. // CHECK:STDOUT: file {
  379. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  380. // CHECK:STDOUT: .Core = imports.%Core
  381. // CHECK:STDOUT: .I = %I.decl.loc3
  382. // CHECK:STDOUT: }
  383. // CHECK:STDOUT: %Core.import = import Core
  384. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  385. // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer @impl.8dc.%type.and.loc4 [concrete = constants.%I.type]
  386. // CHECK:STDOUT: %.loc4_14.2: type = converted @impl.8dc.%type.and.loc4, %.loc4_14.1 [concrete = constants.%I.type]
  387. // CHECK:STDOUT: impl_decl @impl.8dc [concrete] {} {
  388. // CHECK:STDOUT: %.loc4_7.1: %empty_struct_type = struct_literal ()
  389. // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  390. // CHECK:STDOUT: %I.ref.loc4_12: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  391. // CHECK:STDOUT: %I.ref.loc4_16: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  392. // CHECK:STDOUT: %impl.elem0.loc4: %.6bf = impl_witness_access constants.%BitAnd.impl_witness, element0 [concrete = constants.%Op.0a6]
  393. // CHECK:STDOUT: %bound_method.loc4: <bound method> = bound_method %I.ref.loc4_12, %impl.elem0.loc4 [concrete = constants.%Op.bound]
  394. // CHECK:STDOUT: %type.and.loc4: init type = call %bound_method.loc4(%I.ref.loc4_12, %I.ref.loc4_16) [concrete = constants.%I.type]
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @impl.8dc [concrete]
  397. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  398. // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {}
  399. // CHECK:STDOUT: %.loc7_14.1: type = value_of_initializer @impl.8dc.%type.and.loc7 [concrete = constants.%I.type]
  400. // CHECK:STDOUT: %.loc7_14.2: type = converted @impl.8dc.%type.and.loc7, %.loc7_14.1 [concrete = constants.%I.type]
  401. // CHECK:STDOUT: impl_decl @impl.8dc [concrete] {} {
  402. // CHECK:STDOUT: %.loc7_7.1: %empty_struct_type = struct_literal ()
  403. // CHECK:STDOUT: %.loc7_7.2: type = converted %.loc7_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  404. // CHECK:STDOUT: %I.ref.loc7_12: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  405. // CHECK:STDOUT: %I.ref.loc7_16: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  406. // CHECK:STDOUT: %impl.elem0.loc7: %.6bf = impl_witness_access constants.%BitAnd.impl_witness, element0 [concrete = constants.%Op.0a6]
  407. // CHECK:STDOUT: %bound_method.loc7: <bound method> = bound_method %I.ref.loc7_12, %impl.elem0.loc7 [concrete = constants.%Op.bound]
  408. // CHECK:STDOUT: %type.and.loc7: init type = call %bound_method.loc7(%I.ref.loc7_12, %I.ref.loc7_16) [concrete = constants.%I.type]
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT: }
  411. // CHECK:STDOUT:
  412. // CHECK:STDOUT: interface @I {
  413. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  414. // CHECK:STDOUT:
  415. // CHECK:STDOUT: !members:
  416. // CHECK:STDOUT: .Self = %Self
  417. // CHECK:STDOUT: witness = ()
  418. // CHECK:STDOUT: }
  419. // CHECK:STDOUT:
  420. // CHECK:STDOUT: impl @impl.8dc: %.loc4_7.2 as file.%.loc4_14.2 {
  421. // CHECK:STDOUT: !members:
  422. // CHECK:STDOUT: witness = file.%I.impl_witness
  423. // CHECK:STDOUT: }
  424. // CHECK:STDOUT:
  425. // CHECK:STDOUT: --- associated_const.carbon
  426. // CHECK:STDOUT:
  427. // CHECK:STDOUT: constants {
  428. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  429. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  430. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  431. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  432. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  433. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  434. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  435. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  436. // CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  437. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  438. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  439. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  440. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  441. // CHECK:STDOUT: }
  442. // CHECK:STDOUT:
  443. // CHECK:STDOUT: imports {
  444. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  445. // CHECK:STDOUT: import Core//prelude
  446. // CHECK:STDOUT: import Core//prelude/...
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT: }
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: file {
  451. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  452. // CHECK:STDOUT: .Core = imports.%Core
  453. // CHECK:STDOUT: .I = %I.decl
  454. // CHECK:STDOUT: }
  455. // CHECK:STDOUT: %Core.import = import Core
  456. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  457. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  458. // CHECK:STDOUT: %.loc6_7.1: %empty_struct_type = struct_literal ()
  459. // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  460. // CHECK:STDOUT: %I.ref.loc6: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  461. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  462. // CHECK:STDOUT: %.Self.ref.loc6: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  463. // CHECK:STDOUT: %T.ref.loc6: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  464. // CHECK:STDOUT: %.Self.as_type.loc6: type = facet_access_type %.Self.ref.loc6 [symbolic_self = constants.%.Self.as_type]
  465. // CHECK:STDOUT: %.loc6_20: type = converted %.Self.ref.loc6, %.Self.as_type.loc6 [symbolic_self = constants.%.Self.as_type]
  466. // CHECK:STDOUT: %impl.elem0.loc6: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  467. // CHECK:STDOUT: %.loc6_26.1: %empty_tuple.type = tuple_literal ()
  468. // CHECK:STDOUT: %.loc6_26.2: type = converted %.loc6_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  469. // CHECK:STDOUT: %.loc6_14: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  470. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6, %.loc6_26.2
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT: }
  473. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete]
  474. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  475. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  476. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  477. // CHECK:STDOUT: %.loc8_7.1: %empty_struct_type = struct_literal ()
  478. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  479. // CHECK:STDOUT: %I.ref.loc8: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  480. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  481. // CHECK:STDOUT: %.Self.ref.loc8: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  482. // CHECK:STDOUT: %T.ref.loc8: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  483. // CHECK:STDOUT: %.Self.as_type.loc8: type = facet_access_type %.Self.ref.loc8 [symbolic_self = constants.%.Self.as_type]
  484. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref.loc8, %.Self.as_type.loc8 [symbolic_self = constants.%.Self.as_type]
  485. // CHECK:STDOUT: %impl.elem0.loc8: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  486. // CHECK:STDOUT: %.loc8_26.1: %empty_tuple.type = tuple_literal ()
  487. // CHECK:STDOUT: %.loc8_26.2: type = converted %.loc8_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  488. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  489. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %.loc8_26.2
  490. // CHECK:STDOUT: }
  491. // CHECK:STDOUT: }
  492. // CHECK:STDOUT: }
  493. // CHECK:STDOUT:
  494. // CHECK:STDOUT: interface @I {
  495. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  496. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  497. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: !members:
  501. // CHECK:STDOUT: .Self = %Self
  502. // CHECK:STDOUT: .T = @T.%assoc0
  503. // CHECK:STDOUT: witness = (%T)
  504. // CHECK:STDOUT: }
  505. // CHECK:STDOUT:
  506. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  507. // CHECK:STDOUT: assoc_const T:! type;
  508. // CHECK:STDOUT: }
  509. // CHECK:STDOUT:
  510. // CHECK:STDOUT: impl @impl: %.loc6_7.2 as %.loc6_14 {
  511. // CHECK:STDOUT: !members:
  512. // CHECK:STDOUT: witness = file.%I.impl_witness
  513. // CHECK:STDOUT: }
  514. // CHECK:STDOUT:
  515. // CHECK:STDOUT: specific @T(constants.%Self) {}
  516. // CHECK:STDOUT:
  517. // CHECK:STDOUT: specific @T(constants.%I.facet) {}
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: --- associated_const_compound_member_access.carbon
  520. // CHECK:STDOUT:
  521. // CHECK:STDOUT: constants {
  522. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  523. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  524. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  525. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  526. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  527. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  528. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  529. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  530. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  531. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  532. // CHECK:STDOUT: %I.facet.74c: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  533. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  534. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  535. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  536. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  537. // CHECK:STDOUT: %I.facet.880: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  538. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
  539. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  540. // CHECK:STDOUT: }
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: imports {
  543. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  544. // CHECK:STDOUT: import Core//prelude
  545. // CHECK:STDOUT: import Core//prelude/...
  546. // CHECK:STDOUT: }
  547. // CHECK:STDOUT: }
  548. // CHECK:STDOUT:
  549. // CHECK:STDOUT: file {
  550. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  551. // CHECK:STDOUT: .Core = imports.%Core
  552. // CHECK:STDOUT: .I = %I.decl
  553. // CHECK:STDOUT: .C = %C.decl
  554. // CHECK:STDOUT: .x = %x
  555. // CHECK:STDOUT: }
  556. // CHECK:STDOUT: %Core.import = import Core
  557. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  558. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  559. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  560. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  561. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  562. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  563. // CHECK:STDOUT: %.Self.ref.loc7: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  564. // CHECK:STDOUT: %T.ref.loc7: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  565. // CHECK:STDOUT: %.Self.as_type.loc7: type = facet_access_type %.Self.ref.loc7 [symbolic_self = constants.%.Self.as_type]
  566. // CHECK:STDOUT: %.loc7_19: type = converted %.Self.ref.loc7, %.Self.as_type.loc7 [symbolic_self = constants.%.Self.as_type]
  567. // CHECK:STDOUT: %impl.elem0.loc7: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  568. // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal ()
  569. // CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  570. // CHECK:STDOUT: %.loc7_13: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  571. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc7, %.loc7_25.2
  572. // CHECK:STDOUT: }
  573. // CHECK:STDOUT: }
  574. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete]
  575. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  576. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  577. // CHECK:STDOUT: name_binding_decl {
  578. // CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
  579. // CHECK:STDOUT: }
  580. // CHECK:STDOUT: %.loc9_9.1: type = splice_block %impl.elem0 [concrete = constants.%empty_tuple.type] {
  581. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  582. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  583. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  584. // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet.880]
  585. // CHECK:STDOUT: %.loc9_9.2: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet.880]
  586. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%empty_tuple.type]
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  589. // CHECK:STDOUT: %.loc9_19: %empty_tuple.type = converted @__global_init.%.loc9, %empty_tuple [concrete = constants.%empty_tuple]
  590. // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %.loc9_19
  591. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  592. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  593. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  594. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  595. // CHECK:STDOUT: %.Self.ref.loc11: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  596. // CHECK:STDOUT: %T.ref.loc11: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  597. // CHECK:STDOUT: %.Self.as_type.loc11: type = facet_access_type %.Self.ref.loc11 [symbolic_self = constants.%.Self.as_type]
  598. // CHECK:STDOUT: %.loc11_19: type = converted %.Self.ref.loc11, %.Self.as_type.loc11 [symbolic_self = constants.%.Self.as_type]
  599. // CHECK:STDOUT: %impl.elem0.loc11: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  600. // CHECK:STDOUT: %.loc11_25.1: %empty_tuple.type = tuple_literal ()
  601. // CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  602. // CHECK:STDOUT: %.loc11_13: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  603. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11, %.loc11_25.2
  604. // CHECK:STDOUT: }
  605. // CHECK:STDOUT: }
  606. // CHECK:STDOUT: }
  607. // CHECK:STDOUT:
  608. // CHECK:STDOUT: interface @I {
  609. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  610. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  611. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  612. // CHECK:STDOUT: }
  613. // CHECK:STDOUT:
  614. // CHECK:STDOUT: !members:
  615. // CHECK:STDOUT: .Self = %Self
  616. // CHECK:STDOUT: .T = @T.%assoc0
  617. // CHECK:STDOUT: witness = (%T)
  618. // CHECK:STDOUT: }
  619. // CHECK:STDOUT:
  620. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  621. // CHECK:STDOUT: assoc_const T:! type;
  622. // CHECK:STDOUT: }
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: impl @impl: %C.ref.loc7 as %.loc7_13 {
  625. // CHECK:STDOUT: !members:
  626. // CHECK:STDOUT: witness = file.%I.impl_witness
  627. // CHECK:STDOUT: }
  628. // CHECK:STDOUT:
  629. // CHECK:STDOUT: class @C {
  630. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  631. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  632. // CHECK:STDOUT: complete_type_witness = %complete_type
  633. // CHECK:STDOUT:
  634. // CHECK:STDOUT: !members:
  635. // CHECK:STDOUT: .Self = constants.%C
  636. // CHECK:STDOUT: }
  637. // CHECK:STDOUT:
  638. // CHECK:STDOUT: fn @__global_init() {
  639. // CHECK:STDOUT: !entry:
  640. // CHECK:STDOUT: %.loc9: %empty_tuple.type = tuple_literal ()
  641. // CHECK:STDOUT: return
  642. // CHECK:STDOUT: }
  643. // CHECK:STDOUT:
  644. // CHECK:STDOUT: specific @T(constants.%Self) {}
  645. // CHECK:STDOUT:
  646. // CHECK:STDOUT: specific @T(constants.%I.facet.74c) {}
  647. // CHECK:STDOUT:
  648. // CHECK:STDOUT: specific @T(constants.%I.facet.880) {}
  649. // CHECK:STDOUT:
  650. // CHECK:STDOUT: --- associated_const_of_facet.carbon
  651. // CHECK:STDOUT:
  652. // CHECK:STDOUT: constants {
  653. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  654. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  655. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  656. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  657. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  658. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  659. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  660. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  661. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  662. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  663. // CHECK:STDOUT: %I.facet.74c: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  664. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  665. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  666. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  667. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  668. // CHECK:STDOUT: %I.facet.880: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  669. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
  670. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  671. // CHECK:STDOUT: }
  672. // CHECK:STDOUT:
  673. // CHECK:STDOUT: imports {
  674. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  675. // CHECK:STDOUT: import Core//prelude
  676. // CHECK:STDOUT: import Core//prelude/...
  677. // CHECK:STDOUT: }
  678. // CHECK:STDOUT: }
  679. // CHECK:STDOUT:
  680. // CHECK:STDOUT: file {
  681. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  682. // CHECK:STDOUT: .Core = imports.%Core
  683. // CHECK:STDOUT: .I = %I.decl
  684. // CHECK:STDOUT: .C = %C.decl
  685. // CHECK:STDOUT: .x = %x
  686. // CHECK:STDOUT: }
  687. // CHECK:STDOUT: %Core.import = import Core
  688. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  689. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  690. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  691. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  692. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  693. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  694. // CHECK:STDOUT: %.Self.ref.loc7: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  695. // CHECK:STDOUT: %T.ref.loc7: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  696. // CHECK:STDOUT: %.Self.as_type.loc7: type = facet_access_type %.Self.ref.loc7 [symbolic_self = constants.%.Self.as_type]
  697. // CHECK:STDOUT: %.loc7_19: type = converted %.Self.ref.loc7, %.Self.as_type.loc7 [symbolic_self = constants.%.Self.as_type]
  698. // CHECK:STDOUT: %impl.elem0.loc7: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  699. // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal ()
  700. // CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  701. // CHECK:STDOUT: %.loc7_13: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  702. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc7, %.loc7_25.2
  703. // CHECK:STDOUT: }
  704. // CHECK:STDOUT: }
  705. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete]
  706. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  707. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  708. // CHECK:STDOUT: name_binding_decl {
  709. // CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
  710. // CHECK:STDOUT: }
  711. // CHECK:STDOUT: %.loc9_16.1: type = splice_block %impl.elem0 [concrete = constants.%empty_tuple.type] {
  712. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  713. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  714. // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet.880]
  715. // CHECK:STDOUT: %.loc9_11: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet.880]
  716. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  717. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc9_11 [concrete = constants.%C]
  718. // CHECK:STDOUT: %.loc9_16.2: type = converted %.loc9_11, %as_type [concrete = constants.%C]
  719. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%empty_tuple.type]
  720. // CHECK:STDOUT: }
  721. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  722. // CHECK:STDOUT: %.loc9_22: %empty_tuple.type = converted @__global_init.%.loc9, %empty_tuple [concrete = constants.%empty_tuple]
  723. // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %.loc9_22
  724. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  725. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  726. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  727. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  728. // CHECK:STDOUT: %.Self.ref.loc11: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  729. // CHECK:STDOUT: %T.ref.loc11: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  730. // CHECK:STDOUT: %.Self.as_type.loc11: type = facet_access_type %.Self.ref.loc11 [symbolic_self = constants.%.Self.as_type]
  731. // CHECK:STDOUT: %.loc11_19: type = converted %.Self.ref.loc11, %.Self.as_type.loc11 [symbolic_self = constants.%.Self.as_type]
  732. // CHECK:STDOUT: %impl.elem0.loc11: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  733. // CHECK:STDOUT: %.loc11_25.1: %empty_tuple.type = tuple_literal ()
  734. // CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  735. // CHECK:STDOUT: %.loc11_13: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  736. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11, %.loc11_25.2
  737. // CHECK:STDOUT: }
  738. // CHECK:STDOUT: }
  739. // CHECK:STDOUT: }
  740. // CHECK:STDOUT:
  741. // CHECK:STDOUT: interface @I {
  742. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  743. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  744. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  745. // CHECK:STDOUT: }
  746. // CHECK:STDOUT:
  747. // CHECK:STDOUT: !members:
  748. // CHECK:STDOUT: .Self = %Self
  749. // CHECK:STDOUT: .T = @T.%assoc0
  750. // CHECK:STDOUT: witness = (%T)
  751. // CHECK:STDOUT: }
  752. // CHECK:STDOUT:
  753. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  754. // CHECK:STDOUT: assoc_const T:! type;
  755. // CHECK:STDOUT: }
  756. // CHECK:STDOUT:
  757. // CHECK:STDOUT: impl @impl: %C.ref.loc7 as %.loc7_13 {
  758. // CHECK:STDOUT: !members:
  759. // CHECK:STDOUT: witness = file.%I.impl_witness
  760. // CHECK:STDOUT: }
  761. // CHECK:STDOUT:
  762. // CHECK:STDOUT: class @C {
  763. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  764. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  765. // CHECK:STDOUT: complete_type_witness = %complete_type
  766. // CHECK:STDOUT:
  767. // CHECK:STDOUT: !members:
  768. // CHECK:STDOUT: .Self = constants.%C
  769. // CHECK:STDOUT: }
  770. // CHECK:STDOUT:
  771. // CHECK:STDOUT: fn @__global_init() {
  772. // CHECK:STDOUT: !entry:
  773. // CHECK:STDOUT: %.loc9: %empty_tuple.type = tuple_literal ()
  774. // CHECK:STDOUT: return
  775. // CHECK:STDOUT: }
  776. // CHECK:STDOUT:
  777. // CHECK:STDOUT: specific @T(constants.%Self) {}
  778. // CHECK:STDOUT:
  779. // CHECK:STDOUT: specific @T(constants.%I.facet.74c) {}
  780. // CHECK:STDOUT:
  781. // CHECK:STDOUT: specific @T(constants.%I.facet.880) {}
  782. // CHECK:STDOUT:
  783. // CHECK:STDOUT: --- fail_unset_associated_const.carbon
  784. // CHECK:STDOUT:
  785. // CHECK:STDOUT: constants {
  786. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  787. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  788. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  789. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  790. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  791. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  792. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  793. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  794. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  795. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  796. // CHECK:STDOUT: }
  797. // CHECK:STDOUT:
  798. // CHECK:STDOUT: imports {
  799. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  800. // CHECK:STDOUT: import Core//prelude
  801. // CHECK:STDOUT: import Core//prelude/...
  802. // CHECK:STDOUT: }
  803. // CHECK:STDOUT: }
  804. // CHECK:STDOUT:
  805. // CHECK:STDOUT: file {
  806. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  807. // CHECK:STDOUT: .Core = imports.%Core
  808. // CHECK:STDOUT: .I = %I.decl
  809. // CHECK:STDOUT: .C = %C.decl
  810. // CHECK:STDOUT: .x = %x
  811. // CHECK:STDOUT: }
  812. // CHECK:STDOUT: %Core.import = import Core
  813. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  814. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  815. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  816. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  817. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  818. // CHECK:STDOUT: }
  819. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (<error>), @impl [concrete]
  820. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  821. // CHECK:STDOUT: name_binding_decl {
  822. // CHECK:STDOUT: %x.patt: <error> = binding_pattern x [concrete]
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT: %.loc13_16.1: type = splice_block %impl.elem0 [concrete = <error>] {
  825. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  826. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  827. // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  828. // CHECK:STDOUT: %.loc13_11: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
  829. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  830. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc13_11 [concrete = constants.%C]
  831. // CHECK:STDOUT: %.loc13_16.2: type = converted %.loc13_11, %as_type [concrete = constants.%C]
  832. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.impl_witness, element0 [concrete = <error>]
  833. // CHECK:STDOUT: }
  834. // CHECK:STDOUT: %x: <error> = bind_name x, <error> [concrete = <error>]
  835. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  836. // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [concrete = constants.%C]
  837. // CHECK:STDOUT: %I.ref.loc22: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  838. // CHECK:STDOUT: }
  839. // CHECK:STDOUT: }
  840. // CHECK:STDOUT:
  841. // CHECK:STDOUT: interface @I {
  842. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  843. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  844. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  845. // CHECK:STDOUT: }
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: !members:
  848. // CHECK:STDOUT: .Self = %Self
  849. // CHECK:STDOUT: .T = @T.%assoc0
  850. // CHECK:STDOUT: witness = (%T)
  851. // CHECK:STDOUT: }
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  854. // CHECK:STDOUT: assoc_const T:! type;
  855. // CHECK:STDOUT: }
  856. // CHECK:STDOUT:
  857. // CHECK:STDOUT: impl @impl: %C.ref.loc7 as %I.ref.loc7 {
  858. // CHECK:STDOUT: !members:
  859. // CHECK:STDOUT: witness = file.%I.impl_witness
  860. // CHECK:STDOUT: }
  861. // CHECK:STDOUT:
  862. // CHECK:STDOUT: class @C {
  863. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  864. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  865. // CHECK:STDOUT: complete_type_witness = %complete_type
  866. // CHECK:STDOUT:
  867. // CHECK:STDOUT: !members:
  868. // CHECK:STDOUT: .Self = constants.%C
  869. // CHECK:STDOUT: }
  870. // CHECK:STDOUT:
  871. // CHECK:STDOUT: fn @__global_init() {
  872. // CHECK:STDOUT: !entry:
  873. // CHECK:STDOUT: %.loc13: %empty_tuple.type = tuple_literal ()
  874. // CHECK:STDOUT: return
  875. // CHECK:STDOUT: }
  876. // CHECK:STDOUT:
  877. // CHECK:STDOUT: specific @T(constants.%Self) {}
  878. // CHECK:STDOUT:
  879. // CHECK:STDOUT: specific @T(constants.%I.facet) {}
  880. // CHECK:STDOUT:
  881. // CHECK:STDOUT: --- fail_associated_const_before_interface_definition.carbon
  882. // CHECK:STDOUT:
  883. // CHECK:STDOUT: constants {
  884. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  885. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  886. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  887. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  888. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  889. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  890. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  891. // CHECK:STDOUT: }
  892. // CHECK:STDOUT:
  893. // CHECK:STDOUT: imports {
  894. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  895. // CHECK:STDOUT: import Core//prelude
  896. // CHECK:STDOUT: import Core//prelude/...
  897. // CHECK:STDOUT: }
  898. // CHECK:STDOUT: }
  899. // CHECK:STDOUT:
  900. // CHECK:STDOUT: file {
  901. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  902. // CHECK:STDOUT: .Core = imports.%Core
  903. // CHECK:STDOUT: .I = %I.decl.loc3
  904. // CHECK:STDOUT: .C = %C.decl.loc4
  905. // CHECK:STDOUT: .D = %D.decl
  906. // CHECK:STDOUT: }
  907. // CHECK:STDOUT: %Core.import = import Core
  908. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  909. // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [concrete = constants.%C] {} {}
  910. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  911. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  912. // CHECK:STDOUT: %D.ref.loc13: type = name_ref D, file.%D.decl [concrete = constants.%D]
  913. // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  914. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  915. // CHECK:STDOUT: %.Self.ref.loc13: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  916. // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C]
  917. // CHECK:STDOUT: %.loc13: type = where_expr %.Self.1 [concrete = <error>] {
  918. // CHECK:STDOUT: requirement_rewrite <error>, <error>
  919. // CHECK:STDOUT: }
  920. // CHECK:STDOUT: }
  921. // CHECK:STDOUT: %I.decl.loc15: type = interface_decl @I [concrete = constants.%I.type] {} {}
  922. // CHECK:STDOUT: %C.decl.loc16: type = class_decl @C [concrete = constants.%C] {} {}
  923. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  924. // CHECK:STDOUT: %D.ref.loc21: type = name_ref D, file.%D.decl [concrete = constants.%D]
  925. // CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  926. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  927. // CHECK:STDOUT: %.Self.ref.loc21: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  928. // CHECK:STDOUT: %T.ref: <error> = name_ref T, <error> [concrete = <error>]
  929. // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C]
  930. // CHECK:STDOUT: %.loc21: type = where_expr %.Self.2 [concrete = <error>] {
  931. // CHECK:STDOUT: requirement_rewrite %T.ref, <error>
  932. // CHECK:STDOUT: }
  933. // CHECK:STDOUT: }
  934. // CHECK:STDOUT: }
  935. // CHECK:STDOUT:
  936. // CHECK:STDOUT: interface @I {
  937. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  938. // CHECK:STDOUT:
  939. // CHECK:STDOUT: !members:
  940. // CHECK:STDOUT: .Self = %Self
  941. // CHECK:STDOUT: .T = <poisoned>
  942. // CHECK:STDOUT: witness = ()
  943. // CHECK:STDOUT: }
  944. // CHECK:STDOUT:
  945. // CHECK:STDOUT: impl @impl: %D.ref.loc13 as %.loc13 {
  946. // CHECK:STDOUT: !members:
  947. // CHECK:STDOUT: witness = <error>
  948. // CHECK:STDOUT: }
  949. // CHECK:STDOUT:
  950. // CHECK:STDOUT: class @C {
  951. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  952. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  953. // CHECK:STDOUT: complete_type_witness = %complete_type
  954. // CHECK:STDOUT:
  955. // CHECK:STDOUT: !members:
  956. // CHECK:STDOUT: .Self = constants.%C
  957. // CHECK:STDOUT: }
  958. // CHECK:STDOUT:
  959. // CHECK:STDOUT: class @D {
  960. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  961. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  962. // CHECK:STDOUT: complete_type_witness = %complete_type
  963. // CHECK:STDOUT:
  964. // CHECK:STDOUT: !members:
  965. // CHECK:STDOUT: .Self = constants.%D
  966. // CHECK:STDOUT: }
  967. // CHECK:STDOUT:
  968. // CHECK:STDOUT: --- associated_const_of_parameterized.carbon
  969. // CHECK:STDOUT:
  970. // CHECK:STDOUT: constants {
  971. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  972. // CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete]
  973. // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [concrete]
  974. // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [concrete]
  975. // CHECK:STDOUT: %I.type.325: type = facet_type <@I, @I(%U)> [symbolic]
  976. // CHECK:STDOUT: %Self.209: %I.type.325 = bind_symbolic_name Self, 1 [symbolic]
  977. // CHECK:STDOUT: %I.assoc_type.1e5: type = assoc_entity_type @I, @I(%U) [symbolic]
  978. // CHECK:STDOUT: %assoc0.7f3: %I.assoc_type.1e5 = assoc_entity element0, @I.%T [symbolic]
  979. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  980. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  981. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  982. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  983. // CHECK:STDOUT: %I.type.e7a: type = facet_type <@I, @I(%C)> [concrete]
  984. // CHECK:STDOUT: %.Self: %I.type.e7a = bind_symbolic_name .Self [symbolic_self]
  985. // CHECK:STDOUT: %Self.b1d: %I.type.e7a = bind_symbolic_name Self, 1 [symbolic]
  986. // CHECK:STDOUT: %I.assoc_type.b3c: type = assoc_entity_type @I, @I(%C) [concrete]
  987. // CHECK:STDOUT: %assoc0.3e4: %I.assoc_type.b3c = assoc_entity element0, @I.%T [concrete]
  988. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  989. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I, @I(%C) [symbolic_self]
  990. // CHECK:STDOUT: %I.facet: %I.type.e7a = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  991. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  992. // CHECK:STDOUT: %I_where.type: type = facet_type <@I, @I(%C) where %impl.elem0 = %C> [concrete]
  993. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  994. // CHECK:STDOUT: }
  995. // CHECK:STDOUT:
  996. // CHECK:STDOUT: imports {
  997. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  998. // CHECK:STDOUT: import Core//prelude
  999. // CHECK:STDOUT: import Core//prelude/...
  1000. // CHECK:STDOUT: }
  1001. // CHECK:STDOUT: }
  1002. // CHECK:STDOUT:
  1003. // CHECK:STDOUT: file {
  1004. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1005. // CHECK:STDOUT: .Core = imports.%Core
  1006. // CHECK:STDOUT: .I = %I.decl
  1007. // CHECK:STDOUT: .C = %C.decl.loc6
  1008. // CHECK:STDOUT: .D = %D.decl
  1009. // CHECK:STDOUT: }
  1010. // CHECK:STDOUT: %Core.import = import Core
  1011. // CHECK:STDOUT: %I.decl: %I.type.dac = interface_decl @I [concrete = constants.%I.generic] {
  1012. // CHECK:STDOUT: %U.patt: %pattern_type = symbolic_binding_pattern U, 0 [concrete]
  1013. // CHECK:STDOUT: } {
  1014. // CHECK:STDOUT: %U.loc3_13.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc3_13.2 (constants.%U)]
  1015. // CHECK:STDOUT: }
  1016. // CHECK:STDOUT: %C.decl.loc6: type = class_decl @C [concrete = constants.%C] {} {}
  1017. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1018. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1019. // CHECK:STDOUT: %D.ref.loc8: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1020. // CHECK:STDOUT: %I.ref.loc8: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  1021. // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1022. // CHECK:STDOUT: %I.type.loc8: type = facet_type <@I, @I(constants.%C)> [concrete = constants.%I.type.e7a]
  1023. // CHECK:STDOUT: %.Self.1: %I.type.e7a = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1024. // CHECK:STDOUT: %.Self.ref.loc8: %I.type.e7a = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  1025. // CHECK:STDOUT: %.loc8_22.1: %I.assoc_type.b3c = specific_constant @T.%assoc0, @I(constants.%C) [concrete = constants.%assoc0.3e4]
  1026. // CHECK:STDOUT: %T.ref.loc8: %I.assoc_type.b3c = name_ref T, %.loc8_22.1 [concrete = constants.%assoc0.3e4]
  1027. // CHECK:STDOUT: %.Self.as_type.loc8: type = facet_access_type %.Self.ref.loc8 [symbolic_self = constants.%.Self.as_type]
  1028. // CHECK:STDOUT: %.loc8_22.2: type = converted %.Self.ref.loc8, %.Self.as_type.loc8 [symbolic_self = constants.%.Self.as_type]
  1029. // CHECK:STDOUT: %impl.elem0.loc8: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1030. // CHECK:STDOUT: %C.ref.loc8_27: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1031. // CHECK:STDOUT: %.loc8_16: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  1032. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %C.ref.loc8_27
  1033. // CHECK:STDOUT: }
  1034. // CHECK:STDOUT: }
  1035. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete]
  1036. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1037. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C]
  1038. // CHECK:STDOUT: %C.decl.loc10: type = class_decl @C [concrete = constants.%C] {} {}
  1039. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1040. // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1041. // CHECK:STDOUT: %I.ref.loc11: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  1042. // CHECK:STDOUT: %C.ref.loc11_13: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1043. // CHECK:STDOUT: %I.type.loc11: type = facet_type <@I, @I(constants.%C)> [concrete = constants.%I.type.e7a]
  1044. // CHECK:STDOUT: %.Self.2: %I.type.e7a = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1045. // CHECK:STDOUT: %.Self.ref.loc11: %I.type.e7a = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  1046. // CHECK:STDOUT: %.loc11_22.1: %I.assoc_type.b3c = specific_constant @T.%assoc0, @I(constants.%C) [concrete = constants.%assoc0.3e4]
  1047. // CHECK:STDOUT: %T.ref.loc11: %I.assoc_type.b3c = name_ref T, %.loc11_22.1 [concrete = constants.%assoc0.3e4]
  1048. // CHECK:STDOUT: %.Self.as_type.loc11: type = facet_access_type %.Self.ref.loc11 [symbolic_self = constants.%.Self.as_type]
  1049. // CHECK:STDOUT: %.loc11_22.2: type = converted %.Self.ref.loc11, %.Self.as_type.loc11 [symbolic_self = constants.%.Self.as_type]
  1050. // CHECK:STDOUT: %impl.elem0.loc11: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1051. // CHECK:STDOUT: %C.ref.loc11_27: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1052. // CHECK:STDOUT: %.loc11_16: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  1053. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11, %C.ref.loc11_27
  1054. // CHECK:STDOUT: }
  1055. // CHECK:STDOUT: }
  1056. // CHECK:STDOUT: }
  1057. // CHECK:STDOUT:
  1058. // CHECK:STDOUT: generic interface @I(%U.loc3_13.1: type) {
  1059. // CHECK:STDOUT: %U.loc3_13.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc3_13.2 (constants.%U)]
  1060. // CHECK:STDOUT:
  1061. // CHECK:STDOUT: !definition:
  1062. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U.loc3_13.2)> [symbolic = %I.type (constants.%I.type.325)]
  1063. // CHECK:STDOUT: %Self.2: @I.%I.type (%I.type.325) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209)]
  1064. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%U.loc3_13.2) [symbolic = %I.assoc_type (constants.%I.assoc_type.1e5)]
  1065. // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.1e5) = assoc_entity element0, %T [symbolic = %assoc0 (constants.%assoc0.7f3)]
  1066. // CHECK:STDOUT:
  1067. // CHECK:STDOUT: interface {
  1068. // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.325) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209)]
  1069. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  1070. // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.1e5) = assoc_entity element0, @I.%T [symbolic = @I.%assoc0 (constants.%assoc0.7f3)]
  1071. // CHECK:STDOUT: }
  1072. // CHECK:STDOUT:
  1073. // CHECK:STDOUT: !members:
  1074. // CHECK:STDOUT: .Self = %Self.1
  1075. // CHECK:STDOUT: .T = @T.%assoc0
  1076. // CHECK:STDOUT: witness = (%T)
  1077. // CHECK:STDOUT: }
  1078. // CHECK:STDOUT: }
  1079. // CHECK:STDOUT:
  1080. // CHECK:STDOUT: generic assoc_const @T(@I.%U.loc3_13.1: type, @I.%Self.1: @I.%I.type (%I.type.325)) {
  1081. // CHECK:STDOUT: assoc_const T:! type;
  1082. // CHECK:STDOUT: }
  1083. // CHECK:STDOUT:
  1084. // CHECK:STDOUT: impl @impl: %D.ref.loc8 as %.loc8_16 {
  1085. // CHECK:STDOUT: !members:
  1086. // CHECK:STDOUT: witness = file.%I.impl_witness
  1087. // CHECK:STDOUT: }
  1088. // CHECK:STDOUT:
  1089. // CHECK:STDOUT: class @C {
  1090. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1091. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1092. // CHECK:STDOUT: complete_type_witness = %complete_type
  1093. // CHECK:STDOUT:
  1094. // CHECK:STDOUT: !members:
  1095. // CHECK:STDOUT: .Self = constants.%C
  1096. // CHECK:STDOUT: }
  1097. // CHECK:STDOUT:
  1098. // CHECK:STDOUT: class @D {
  1099. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1100. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1101. // CHECK:STDOUT: complete_type_witness = %complete_type
  1102. // CHECK:STDOUT:
  1103. // CHECK:STDOUT: !members:
  1104. // CHECK:STDOUT: .Self = constants.%D
  1105. // CHECK:STDOUT: }
  1106. // CHECK:STDOUT:
  1107. // CHECK:STDOUT: specific @I(constants.%U) {
  1108. // CHECK:STDOUT: %U.loc3_13.2 => constants.%U
  1109. // CHECK:STDOUT: }
  1110. // CHECK:STDOUT:
  1111. // CHECK:STDOUT: specific @T(constants.%U, constants.%Self.209) {}
  1112. // CHECK:STDOUT:
  1113. // CHECK:STDOUT: specific @I(constants.%C) {
  1114. // CHECK:STDOUT: %U.loc3_13.2 => constants.%C
  1115. // CHECK:STDOUT:
  1116. // CHECK:STDOUT: !definition:
  1117. // CHECK:STDOUT: %I.type => constants.%I.type.e7a
  1118. // CHECK:STDOUT: %Self.2 => constants.%Self.b1d
  1119. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.b3c
  1120. // CHECK:STDOUT: %assoc0 => constants.%assoc0.3e4
  1121. // CHECK:STDOUT: }
  1122. // CHECK:STDOUT:
  1123. // CHECK:STDOUT: specific @T(constants.%C, constants.%I.facet) {}
  1124. // CHECK:STDOUT:
  1125. // CHECK:STDOUT: --- find_incomplete_impl.carbon
  1126. // CHECK:STDOUT:
  1127. // CHECK:STDOUT: constants {
  1128. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1129. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  1130. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1131. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1132. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  1133. // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic]
  1134. // CHECK:STDOUT: %pattern_type.2b5: type = pattern_type %I.type [concrete]
  1135. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  1136. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  1137. // CHECK:STDOUT: %C.54e: type = class_type @C, @C(%T) [symbolic]
  1138. // CHECK:STDOUT: %I.facet: %I.type = facet_value %D, (%I.impl_witness) [concrete]
  1139. // CHECK:STDOUT: %C.8b1: type = class_type @C, @C(%I.facet) [concrete]
  1140. // CHECK:STDOUT: %pattern_type.da9: type = pattern_type %C.8b1 [concrete]
  1141. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1142. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1143. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1144. // CHECK:STDOUT: }
  1145. // CHECK:STDOUT:
  1146. // CHECK:STDOUT: imports {
  1147. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1148. // CHECK:STDOUT: import Core//prelude
  1149. // CHECK:STDOUT: import Core//prelude/...
  1150. // CHECK:STDOUT: }
  1151. // CHECK:STDOUT: }
  1152. // CHECK:STDOUT:
  1153. // CHECK:STDOUT: file {
  1154. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1155. // CHECK:STDOUT: .Core = imports.%Core
  1156. // CHECK:STDOUT: .I = %I.decl.loc3
  1157. // CHECK:STDOUT: .D = %D.decl
  1158. // CHECK:STDOUT: .C = %C.decl.loc6
  1159. // CHECK:STDOUT: .F = %F.decl.loc8
  1160. // CHECK:STDOUT: }
  1161. // CHECK:STDOUT: %Core.import = import Core
  1162. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1163. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1164. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1165. // CHECK:STDOUT: %D.ref.loc5: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1166. // CHECK:STDOUT: %I.ref.loc5: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1167. // CHECK:STDOUT: }
  1168. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @impl [concrete]
  1169. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1170. // CHECK:STDOUT: %C.decl.loc6: %C.type = class_decl @C [concrete = constants.%C.generic] {
  1171. // CHECK:STDOUT: %T.patt: %pattern_type.2b5 = symbolic_binding_pattern T, 0 [concrete]
  1172. // CHECK:STDOUT: } {
  1173. // CHECK:STDOUT: %I.ref.loc6: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1174. // CHECK:STDOUT: %T.loc6_9.1: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)]
  1175. // CHECK:STDOUT: }
  1176. // CHECK:STDOUT: %F.decl.loc8: %F.type = fn_decl @F [concrete = constants.%F] {
  1177. // CHECK:STDOUT: %x.patt: %pattern_type.da9 = binding_pattern x [concrete]
  1178. // CHECK:STDOUT: %x.param_patt: %pattern_type.da9 = value_param_pattern %x.patt, call_param0 [concrete]
  1179. // CHECK:STDOUT: } {
  1180. // CHECK:STDOUT: %x.param.loc8: %C.8b1 = value_param call_param0
  1181. // CHECK:STDOUT: %.loc8_12.1: type = splice_block %C.loc8 [concrete = constants.%C.8b1] {
  1182. // CHECK:STDOUT: %C.ref.loc8: %C.type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C.generic]
  1183. // CHECK:STDOUT: %D.ref.loc8: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1184. // CHECK:STDOUT: %I.facet.loc8: %I.type = facet_value constants.%D, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  1185. // CHECK:STDOUT: %.loc8_12.2: %I.type = converted %D.ref.loc8, %I.facet.loc8 [concrete = constants.%I.facet]
  1186. // CHECK:STDOUT: %C.loc8: type = class_type @C, @C(constants.%I.facet) [concrete = constants.%C.8b1]
  1187. // CHECK:STDOUT: }
  1188. // CHECK:STDOUT: %x.loc8: %C.8b1 = bind_name x, %x.param.loc8
  1189. // CHECK:STDOUT: }
  1190. // CHECK:STDOUT: %I.decl.loc10: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1191. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1192. // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1193. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1194. // CHECK:STDOUT: }
  1195. // CHECK:STDOUT: %C.decl.loc12: %C.type = class_decl @C [concrete = constants.%C.generic] {
  1196. // CHECK:STDOUT: %T.patt: %pattern_type.2b5 = symbolic_binding_pattern T, 0 [concrete]
  1197. // CHECK:STDOUT: } {
  1198. // CHECK:STDOUT: %I.ref.loc12: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1199. // CHECK:STDOUT: %T.loc12: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)]
  1200. // CHECK:STDOUT: }
  1201. // CHECK:STDOUT: %F.decl.loc14: %F.type = fn_decl @F [concrete = constants.%F] {
  1202. // CHECK:STDOUT: %x.patt: %pattern_type.da9 = binding_pattern x [concrete]
  1203. // CHECK:STDOUT: %x.param_patt: %pattern_type.da9 = value_param_pattern %x.patt, call_param0 [concrete]
  1204. // CHECK:STDOUT: } {
  1205. // CHECK:STDOUT: %x.param.loc14: %C.8b1 = value_param call_param0
  1206. // CHECK:STDOUT: %.loc14_12.1: type = splice_block %C.loc14 [concrete = constants.%C.8b1] {
  1207. // CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C.generic]
  1208. // CHECK:STDOUT: %D.ref.loc14: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1209. // CHECK:STDOUT: %I.facet.loc14: %I.type = facet_value constants.%D, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  1210. // CHECK:STDOUT: %.loc14_12.2: %I.type = converted %D.ref.loc14, %I.facet.loc14 [concrete = constants.%I.facet]
  1211. // CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%I.facet) [concrete = constants.%C.8b1]
  1212. // CHECK:STDOUT: }
  1213. // CHECK:STDOUT: %x.loc14: %C.8b1 = bind_name x, %x.param.loc14
  1214. // CHECK:STDOUT: }
  1215. // CHECK:STDOUT: }
  1216. // CHECK:STDOUT:
  1217. // CHECK:STDOUT: interface @I {
  1218. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1219. // CHECK:STDOUT:
  1220. // CHECK:STDOUT: !members:
  1221. // CHECK:STDOUT: .Self = %Self
  1222. // CHECK:STDOUT: witness = ()
  1223. // CHECK:STDOUT: }
  1224. // CHECK:STDOUT:
  1225. // CHECK:STDOUT: impl @impl: %D.ref.loc5 as %I.ref.loc5 {
  1226. // CHECK:STDOUT: !members:
  1227. // CHECK:STDOUT: witness = file.%I.impl_witness
  1228. // CHECK:STDOUT: }
  1229. // CHECK:STDOUT:
  1230. // CHECK:STDOUT: class @D {
  1231. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1232. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1233. // CHECK:STDOUT: complete_type_witness = %complete_type
  1234. // CHECK:STDOUT:
  1235. // CHECK:STDOUT: !members:
  1236. // CHECK:STDOUT: .Self = constants.%D
  1237. // CHECK:STDOUT: }
  1238. // CHECK:STDOUT:
  1239. // CHECK:STDOUT: generic class @C(%T.loc6_9.1: %I.type) {
  1240. // CHECK:STDOUT: %T.loc6_9.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)]
  1241. // CHECK:STDOUT:
  1242. // CHECK:STDOUT: !definition:
  1243. // CHECK:STDOUT:
  1244. // CHECK:STDOUT: class {
  1245. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1246. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1247. // CHECK:STDOUT: complete_type_witness = %complete_type
  1248. // CHECK:STDOUT:
  1249. // CHECK:STDOUT: !members:
  1250. // CHECK:STDOUT: .Self = constants.%C.54e
  1251. // CHECK:STDOUT: }
  1252. // CHECK:STDOUT: }
  1253. // CHECK:STDOUT:
  1254. // CHECK:STDOUT: fn @F(%x.param.loc14: %C.8b1) {
  1255. // CHECK:STDOUT: !entry:
  1256. // CHECK:STDOUT: return
  1257. // CHECK:STDOUT: }
  1258. // CHECK:STDOUT:
  1259. // CHECK:STDOUT: specific @C(constants.%T) {
  1260. // CHECK:STDOUT: %T.loc6_9.2 => constants.%T
  1261. // CHECK:STDOUT: }
  1262. // CHECK:STDOUT:
  1263. // CHECK:STDOUT: specific @C(constants.%I.facet) {
  1264. // CHECK:STDOUT: %T.loc6_9.2 => constants.%I.facet
  1265. // CHECK:STDOUT:
  1266. // CHECK:STDOUT: !definition:
  1267. // CHECK:STDOUT: }
  1268. // CHECK:STDOUT:
  1269. // CHECK:STDOUT: --- fail_todo_two_interfaces.carbon
  1270. // CHECK:STDOUT:
  1271. // CHECK:STDOUT: constants {
  1272. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1273. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  1274. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1275. // CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
  1276. // CHECK:STDOUT: %Op.type.27a: type = fn_type @Op.1 [concrete]
  1277. // CHECK:STDOUT: %BitAnd.impl_witness: <witness> = impl_witness imports.%BitAnd.impl_witness_table [concrete]
  1278. // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, (%BitAnd.impl_witness) [concrete]
  1279. // CHECK:STDOUT: %.6bf: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete]
  1280. // CHECK:STDOUT: %Op.type.c1b: type = fn_type @Op.2 [concrete]
  1281. // CHECK:STDOUT: %Op.0a6: %Op.type.c1b = struct_value () [concrete]
  1282. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %I.type, %Op.0a6 [concrete]
  1283. // CHECK:STDOUT: %facet_type: type = facet_type <@I & @J> [concrete]
  1284. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1285. // CHECK:STDOUT: %Self.ccd: %J.type = bind_symbolic_name Self, 0 [symbolic]
  1286. // CHECK:STDOUT: }
  1287. // CHECK:STDOUT:
  1288. // CHECK:STDOUT: imports {
  1289. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1290. // CHECK:STDOUT: .BitAnd = %Core.BitAnd
  1291. // CHECK:STDOUT: import Core//prelude
  1292. // CHECK:STDOUT: import Core//prelude/...
  1293. // CHECK:STDOUT: }
  1294. // CHECK:STDOUT: %Core.BitAnd: type = import_ref Core//prelude, BitAnd, loaded [concrete = constants.%BitAnd.type]
  1295. // CHECK:STDOUT: %Core.import_ref.d90: %Op.type.c1b = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%Op.0a6]
  1296. // CHECK:STDOUT: %BitAnd.impl_witness_table = impl_witness_table (%Core.import_ref.d90), @impl.13c [concrete]
  1297. // CHECK:STDOUT: }
  1298. // CHECK:STDOUT:
  1299. // CHECK:STDOUT: file {
  1300. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1301. // CHECK:STDOUT: .Core = imports.%Core
  1302. // CHECK:STDOUT: .I = %I.decl.loc3
  1303. // CHECK:STDOUT: .J = %J.decl.loc4
  1304. // CHECK:STDOUT: }
  1305. // CHECK:STDOUT: %Core.import = import Core
  1306. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1307. // CHECK:STDOUT: %J.decl.loc4: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1308. // CHECK:STDOUT: %.loc10_14.1: type = value_of_initializer @impl.be3.%type.and [concrete = constants.%facet_type]
  1309. // CHECK:STDOUT: %.loc10_14.2: type = converted @impl.be3.%type.and, %.loc10_14.1 [concrete = constants.%facet_type]
  1310. // CHECK:STDOUT: impl_decl @impl.be3 [concrete] {} {
  1311. // CHECK:STDOUT: %.loc10_7.1: %empty_struct_type = struct_literal ()
  1312. // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1313. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1314. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl.loc4 [concrete = constants.%J.type]
  1315. // CHECK:STDOUT: %impl.elem0: %.6bf = impl_witness_access constants.%BitAnd.impl_witness, element0 [concrete = constants.%Op.0a6]
  1316. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %I.ref, %impl.elem0 [concrete = constants.%Op.bound]
  1317. // CHECK:STDOUT: %type.and: init type = call %bound_method(%I.ref, %J.ref) [concrete = constants.%facet_type]
  1318. // CHECK:STDOUT: }
  1319. // CHECK:STDOUT: %I.decl.loc12: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1320. // CHECK:STDOUT: %J.decl.loc13: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1321. // CHECK:STDOUT: }
  1322. // CHECK:STDOUT:
  1323. // CHECK:STDOUT: interface @I {
  1324. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  1325. // CHECK:STDOUT:
  1326. // CHECK:STDOUT: !members:
  1327. // CHECK:STDOUT: .Self = %Self
  1328. // CHECK:STDOUT: witness = ()
  1329. // CHECK:STDOUT: }
  1330. // CHECK:STDOUT:
  1331. // CHECK:STDOUT: interface @J {
  1332. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.ccd]
  1333. // CHECK:STDOUT:
  1334. // CHECK:STDOUT: !members:
  1335. // CHECK:STDOUT: .Self = %Self
  1336. // CHECK:STDOUT: witness = ()
  1337. // CHECK:STDOUT: }
  1338. // CHECK:STDOUT:
  1339. // CHECK:STDOUT: impl @impl.be3: %.loc10_7.2 as file.%.loc10_14.2;
  1340. // CHECK:STDOUT:
  1341. // CHECK:STDOUT: --- fail_never_assigned_associated_const.carbon
  1342. // CHECK:STDOUT:
  1343. // CHECK:STDOUT: constants {
  1344. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1345. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1346. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1347. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  1348. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%U [concrete]
  1349. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1350. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1351. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1352. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  1353. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  1354. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  1355. // CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  1356. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1357. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1358. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  1359. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  1360. // CHECK:STDOUT: }
  1361. // CHECK:STDOUT:
  1362. // CHECK:STDOUT: imports {
  1363. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1364. // CHECK:STDOUT: import Core//prelude
  1365. // CHECK:STDOUT: import Core//prelude/...
  1366. // CHECK:STDOUT: }
  1367. // CHECK:STDOUT: }
  1368. // CHECK:STDOUT:
  1369. // CHECK:STDOUT: file {
  1370. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1371. // CHECK:STDOUT: .Core = imports.%Core
  1372. // CHECK:STDOUT: .I = %I.decl
  1373. // CHECK:STDOUT: .C = %C.decl
  1374. // CHECK:STDOUT: }
  1375. // CHECK:STDOUT: %Core.import = import Core
  1376. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1377. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1378. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1379. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1380. // CHECK:STDOUT: %I.ref.loc9: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1381. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1382. // CHECK:STDOUT: %.Self.ref.loc9: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  1383. // CHECK:STDOUT: %T.ref.loc9: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  1384. // CHECK:STDOUT: %.Self.as_type.loc9: type = facet_access_type %.Self.ref.loc9 [symbolic_self = constants.%.Self.as_type]
  1385. // CHECK:STDOUT: %.loc9_19: type = converted %.Self.ref.loc9, %.Self.as_type.loc9 [symbolic_self = constants.%.Self.as_type]
  1386. // CHECK:STDOUT: %impl.elem0.loc9: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1387. // CHECK:STDOUT: %.loc9_25.1: %empty_tuple.type = tuple_literal ()
  1388. // CHECK:STDOUT: %.loc9_25.2: type = converted %.loc9_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1389. // CHECK:STDOUT: %.loc9_13: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  1390. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9, %.loc9_25.2
  1391. // CHECK:STDOUT: }
  1392. // CHECK:STDOUT: }
  1393. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, <error>), @impl [concrete]
  1394. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1395. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1396. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1397. // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1398. // CHECK:STDOUT: %I.ref.loc18: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1399. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1400. // CHECK:STDOUT: %.Self.ref.loc18: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  1401. // CHECK:STDOUT: %T.ref.loc18: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  1402. // CHECK:STDOUT: %.Self.as_type.loc18: type = facet_access_type %.Self.ref.loc18 [symbolic_self = constants.%.Self.as_type]
  1403. // CHECK:STDOUT: %.loc18_19: type = converted %.Self.ref.loc18, %.Self.as_type.loc18 [symbolic_self = constants.%.Self.as_type]
  1404. // CHECK:STDOUT: %impl.elem0.loc18: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1405. // CHECK:STDOUT: %.loc18_25.1: %empty_tuple.type = tuple_literal ()
  1406. // CHECK:STDOUT: %.loc18_25.2: type = converted %.loc18_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1407. // CHECK:STDOUT: %.loc18_13: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  1408. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc18, %.loc18_25.2
  1409. // CHECK:STDOUT: }
  1410. // CHECK:STDOUT: }
  1411. // CHECK:STDOUT: }
  1412. // CHECK:STDOUT:
  1413. // CHECK:STDOUT: interface @I {
  1414. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1415. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  1416. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  1417. // CHECK:STDOUT: }
  1418. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1419. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%U [concrete = constants.%assoc1]
  1420. // CHECK:STDOUT: }
  1421. // CHECK:STDOUT:
  1422. // CHECK:STDOUT: !members:
  1423. // CHECK:STDOUT: .Self = %Self
  1424. // CHECK:STDOUT: .T = @T.%assoc0
  1425. // CHECK:STDOUT: .U = @U.%assoc1
  1426. // CHECK:STDOUT: witness = (%T, %U)
  1427. // CHECK:STDOUT: }
  1428. // CHECK:STDOUT:
  1429. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  1430. // CHECK:STDOUT: assoc_const T:! type;
  1431. // CHECK:STDOUT: }
  1432. // CHECK:STDOUT:
  1433. // CHECK:STDOUT: generic assoc_const @U(@I.%Self: %I.type) {
  1434. // CHECK:STDOUT: assoc_const U:! type;
  1435. // CHECK:STDOUT: }
  1436. // CHECK:STDOUT:
  1437. // CHECK:STDOUT: impl @impl: %C.ref.loc9 as %.loc9_13 {
  1438. // CHECK:STDOUT: !members:
  1439. // CHECK:STDOUT: witness = file.%I.impl_witness
  1440. // CHECK:STDOUT: }
  1441. // CHECK:STDOUT:
  1442. // CHECK:STDOUT: class @C {
  1443. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1444. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1445. // CHECK:STDOUT: complete_type_witness = %complete_type
  1446. // CHECK:STDOUT:
  1447. // CHECK:STDOUT: !members:
  1448. // CHECK:STDOUT: .Self = constants.%C
  1449. // CHECK:STDOUT: }
  1450. // CHECK:STDOUT:
  1451. // CHECK:STDOUT: specific @T(constants.%Self) {}
  1452. // CHECK:STDOUT:
  1453. // CHECK:STDOUT: specific @U(constants.%Self) {}
  1454. // CHECK:STDOUT:
  1455. // CHECK:STDOUT: specific @T(constants.%I.facet) {}
  1456. // CHECK:STDOUT:
  1457. // CHECK:STDOUT: --- example_from_proposal_5168.carbon
  1458. // CHECK:STDOUT:
  1459. // CHECK:STDOUT: constants {
  1460. // CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
  1461. // CHECK:STDOUT: %U: %X.type = bind_symbolic_name U, 0 [symbolic]
  1462. // CHECK:STDOUT: %pattern_type.08c: type = pattern_type %X.type [concrete]
  1463. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1464. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1465. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1466. // CHECK:STDOUT: %U.as_type: type = facet_access_type %U [symbolic]
  1467. // CHECK:STDOUT: %pattern_type.331: type = pattern_type %U.as_type [symbolic]
  1468. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1469. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1470. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1471. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness file.%X.impl_witness_table [concrete]
  1472. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  1473. // CHECK:STDOUT: %Self.e5e: %X.type = bind_symbolic_name Self, 0 [symbolic]
  1474. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1475. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1476. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  1477. // CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
  1478. // CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
  1479. // CHECK:STDOUT: %X.facet: %X.type = facet_value %C, (%X.impl_witness) [concrete]
  1480. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%X.facet) [concrete]
  1481. // CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G, @G(%X.facet) [concrete]
  1482. // CHECK:STDOUT: %Self.b29: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1483. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %U.as_type [symbolic]
  1484. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table [concrete]
  1485. // CHECK:STDOUT: }
  1486. // CHECK:STDOUT:
  1487. // CHECK:STDOUT: imports {
  1488. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1489. // CHECK:STDOUT: import Core//prelude
  1490. // CHECK:STDOUT: import Core//prelude/...
  1491. // CHECK:STDOUT: }
  1492. // CHECK:STDOUT: }
  1493. // CHECK:STDOUT:
  1494. // CHECK:STDOUT: file {
  1495. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1496. // CHECK:STDOUT: .Core = imports.%Core
  1497. // CHECK:STDOUT: .X = %X.decl.loc3
  1498. // CHECK:STDOUT: .F = %F.decl.loc6
  1499. // CHECK:STDOUT: .G = %G.decl.loc7
  1500. // CHECK:STDOUT: .C = %C.decl.loc9
  1501. // CHECK:STDOUT: .Y = %Y.decl.loc14
  1502. // CHECK:STDOUT: .H = %H.decl
  1503. // CHECK:STDOUT: }
  1504. // CHECK:STDOUT: %Core.import = import Core
  1505. // CHECK:STDOUT: %X.decl.loc3: type = interface_decl @X [concrete = constants.%X.type] {} {}
  1506. // CHECK:STDOUT: %F.decl.loc6: %F.type = fn_decl @F [concrete = constants.%F] {
  1507. // CHECK:STDOUT: %U.patt: %pattern_type.08c = symbolic_binding_pattern U, 0 [concrete]
  1508. // CHECK:STDOUT: } {
  1509. // CHECK:STDOUT: %X.ref.loc6: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1510. // CHECK:STDOUT: %U.loc6_6.1: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc6_6.2 (constants.%U)]
  1511. // CHECK:STDOUT: }
  1512. // CHECK:STDOUT: %G.decl.loc7: %G.type = fn_decl @G [concrete = constants.%G] {
  1513. // CHECK:STDOUT: %U.patt: %pattern_type.08c = symbolic_binding_pattern U, 0 [concrete]
  1514. // CHECK:STDOUT: %u.patt: @G.%pattern_type (%pattern_type.331) = binding_pattern u [concrete]
  1515. // CHECK:STDOUT: %u.param_patt: @G.%pattern_type (%pattern_type.331) = value_param_pattern %u.patt, call_param0 [concrete]
  1516. // CHECK:STDOUT: } {
  1517. // CHECK:STDOUT: %X.ref.loc7: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1518. // CHECK:STDOUT: %U.loc7_6.1: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc7_6.2 (constants.%U)]
  1519. // CHECK:STDOUT: %u.param.loc7: @G.%U.as_type.loc7_16.2 (%U.as_type) = value_param call_param0
  1520. // CHECK:STDOUT: %.loc7_16.1: type = splice_block %.loc7_16.2 [symbolic = %U.as_type.loc7_16.2 (constants.%U.as_type)] {
  1521. // CHECK:STDOUT: %U.ref.loc7: %X.type = name_ref U, %U.loc7_6.1 [symbolic = %U.loc7_6.2 (constants.%U)]
  1522. // CHECK:STDOUT: %U.as_type.loc7_16.1: type = facet_access_type %U.ref.loc7 [symbolic = %U.as_type.loc7_16.2 (constants.%U.as_type)]
  1523. // CHECK:STDOUT: %.loc7_16.2: type = converted %U.ref.loc7, %U.as_type.loc7_16.1 [symbolic = %U.as_type.loc7_16.2 (constants.%U.as_type)]
  1524. // CHECK:STDOUT: }
  1525. // CHECK:STDOUT: %u.loc7: @G.%U.as_type.loc7_16.2 (%U.as_type) = bind_name u, %u.param.loc7
  1526. // CHECK:STDOUT: }
  1527. // CHECK:STDOUT: %C.decl.loc9: type = class_decl @C [concrete = constants.%C] {} {}
  1528. // CHECK:STDOUT: impl_decl @impl.10e [concrete] {} {
  1529. // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1530. // CHECK:STDOUT: %X.ref.loc12: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1531. // CHECK:STDOUT: }
  1532. // CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (), @impl.10e [concrete]
  1533. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness]
  1534. // CHECK:STDOUT: %Y.decl.loc14: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
  1535. // CHECK:STDOUT: %X.decl.loc16: type = interface_decl @X [concrete = constants.%X.type] {} {}
  1536. // CHECK:STDOUT: %C.decl.loc23: type = class_decl @C [concrete = constants.%C] {} {}
  1537. // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {
  1538. // CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete]
  1539. // CHECK:STDOUT: %c.param_patt: %pattern_type.c48 = value_param_pattern %c.patt, call_param0 [concrete]
  1540. // CHECK:STDOUT: } {
  1541. // CHECK:STDOUT: %c.param: %C = value_param call_param0
  1542. // CHECK:STDOUT: %C.ref.loc25: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1543. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  1544. // CHECK:STDOUT: }
  1545. // CHECK:STDOUT: %Y.decl.loc33: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
  1546. // CHECK:STDOUT: %F.decl.loc34: %F.type = fn_decl @F [concrete = constants.%F] {
  1547. // CHECK:STDOUT: %U.patt: %pattern_type.08c = symbolic_binding_pattern U, 0 [concrete]
  1548. // CHECK:STDOUT: } {
  1549. // CHECK:STDOUT: %X.ref.loc34: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1550. // CHECK:STDOUT: %U.loc34: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc6_6.2 (constants.%U)]
  1551. // CHECK:STDOUT: }
  1552. // CHECK:STDOUT: %G.decl.loc35: %G.type = fn_decl @G [concrete = constants.%G] {
  1553. // CHECK:STDOUT: %U.patt: %pattern_type.08c = symbolic_binding_pattern U, 0 [concrete]
  1554. // CHECK:STDOUT: %u.patt: @G.%pattern_type (%pattern_type.331) = binding_pattern u [concrete]
  1555. // CHECK:STDOUT: %u.param_patt: @G.%pattern_type (%pattern_type.331) = value_param_pattern %u.patt, call_param0 [concrete]
  1556. // CHECK:STDOUT: } {
  1557. // CHECK:STDOUT: %X.ref.loc35: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1558. // CHECK:STDOUT: %U.loc35: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc7_6.2 (constants.%U)]
  1559. // CHECK:STDOUT: %u.param.loc35: @G.%U.as_type.loc7_16.2 (%U.as_type) = value_param call_param0
  1560. // CHECK:STDOUT: %.loc35_16.1: type = splice_block %.loc35_16.2 [symbolic = %U.as_type.loc7_16.2 (constants.%U.as_type)] {
  1561. // CHECK:STDOUT: %U.ref.loc35: %X.type = name_ref U, %U.loc35 [symbolic = %U.loc7_6.2 (constants.%U)]
  1562. // CHECK:STDOUT: %U.as_type.loc35: type = facet_access_type %U.ref.loc35 [symbolic = %U.as_type.loc7_16.2 (constants.%U.as_type)]
  1563. // CHECK:STDOUT: %.loc35_16.2: type = converted %U.ref.loc35, %U.as_type.loc35 [symbolic = %U.as_type.loc7_16.2 (constants.%U.as_type)]
  1564. // CHECK:STDOUT: }
  1565. // CHECK:STDOUT: %u.loc35: @G.%U.as_type.loc7_16.2 (%U.as_type) = bind_name u, %u.param.loc35
  1566. // CHECK:STDOUT: }
  1567. // CHECK:STDOUT: impl_decl @impl.a85 [concrete] {} {
  1568. // CHECK:STDOUT: %C.ref.loc36: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1569. // CHECK:STDOUT: %Y.ref.loc36: type = name_ref Y, file.%Y.decl.loc14 [concrete = constants.%Y.type]
  1570. // CHECK:STDOUT: }
  1571. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @impl.a85 [concrete]
  1572. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness]
  1573. // CHECK:STDOUT: impl_decl @impl.10e [concrete] {} {
  1574. // CHECK:STDOUT: %C.ref.loc37: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1575. // CHECK:STDOUT: %X.ref.loc37: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1576. // CHECK:STDOUT: }
  1577. // CHECK:STDOUT: impl_decl @impl.a85 [concrete] {} {
  1578. // CHECK:STDOUT: %C.ref.loc38: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1579. // CHECK:STDOUT: %Y.ref.loc38: type = name_ref Y, file.%Y.decl.loc14 [concrete = constants.%Y.type]
  1580. // CHECK:STDOUT: }
  1581. // CHECK:STDOUT: }
  1582. // CHECK:STDOUT:
  1583. // CHECK:STDOUT: interface @X {
  1584. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.e5e]
  1585. // CHECK:STDOUT:
  1586. // CHECK:STDOUT: !members:
  1587. // CHECK:STDOUT: .Self = %Self
  1588. // CHECK:STDOUT: witness = ()
  1589. // CHECK:STDOUT: }
  1590. // CHECK:STDOUT:
  1591. // CHECK:STDOUT: interface @Y {
  1592. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.b29]
  1593. // CHECK:STDOUT:
  1594. // CHECK:STDOUT: !members:
  1595. // CHECK:STDOUT: .Self = %Self
  1596. // CHECK:STDOUT: witness = ()
  1597. // CHECK:STDOUT: }
  1598. // CHECK:STDOUT:
  1599. // CHECK:STDOUT: impl @impl.10e: %C.ref.loc12 as %X.ref.loc12 {
  1600. // CHECK:STDOUT: !members:
  1601. // CHECK:STDOUT: witness = file.%X.impl_witness
  1602. // CHECK:STDOUT: }
  1603. // CHECK:STDOUT:
  1604. // CHECK:STDOUT: impl @impl.a85: %C.ref.loc36 as %Y.ref.loc36 {
  1605. // CHECK:STDOUT: !members:
  1606. // CHECK:STDOUT: witness = file.%Y.impl_witness
  1607. // CHECK:STDOUT: }
  1608. // CHECK:STDOUT:
  1609. // CHECK:STDOUT: class @C {
  1610. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1611. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1612. // CHECK:STDOUT: complete_type_witness = %complete_type
  1613. // CHECK:STDOUT:
  1614. // CHECK:STDOUT: !members:
  1615. // CHECK:STDOUT: .Self = constants.%C
  1616. // CHECK:STDOUT: }
  1617. // CHECK:STDOUT:
  1618. // CHECK:STDOUT: generic fn @F(%U.loc6_6.1: %X.type) {
  1619. // CHECK:STDOUT: %U.loc6_6.2: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc6_6.2 (constants.%U)]
  1620. // CHECK:STDOUT:
  1621. // CHECK:STDOUT: !definition:
  1622. // CHECK:STDOUT:
  1623. // CHECK:STDOUT: fn() {
  1624. // CHECK:STDOUT: !entry:
  1625. // CHECK:STDOUT: return
  1626. // CHECK:STDOUT: }
  1627. // CHECK:STDOUT: }
  1628. // CHECK:STDOUT:
  1629. // CHECK:STDOUT: generic fn @G(%U.loc7_6.1: %X.type) {
  1630. // CHECK:STDOUT: %U.loc7_6.2: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc7_6.2 (constants.%U)]
  1631. // CHECK:STDOUT: %U.as_type.loc7_16.2: type = facet_access_type %U.loc7_6.2 [symbolic = %U.as_type.loc7_16.2 (constants.%U.as_type)]
  1632. // CHECK:STDOUT: %pattern_type: type = pattern_type %U.as_type.loc7_16.2 [symbolic = %pattern_type (constants.%pattern_type.331)]
  1633. // CHECK:STDOUT:
  1634. // CHECK:STDOUT: !definition:
  1635. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %U.as_type.loc7_16.2 [symbolic = %require_complete (constants.%require_complete)]
  1636. // CHECK:STDOUT:
  1637. // CHECK:STDOUT: fn(%u.param.loc35: @G.%U.as_type.loc7_16.2 (%U.as_type)) {
  1638. // CHECK:STDOUT: !entry:
  1639. // CHECK:STDOUT: return
  1640. // CHECK:STDOUT: }
  1641. // CHECK:STDOUT: }
  1642. // CHECK:STDOUT:
  1643. // CHECK:STDOUT: fn @H(%c.param: %C) {
  1644. // CHECK:STDOUT: !entry:
  1645. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl.loc6 [concrete = constants.%F]
  1646. // CHECK:STDOUT: %C.ref.loc27: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1647. // CHECK:STDOUT: %X.facet.loc27: %X.type = facet_value constants.%C, (constants.%X.impl_witness) [concrete = constants.%X.facet]
  1648. // CHECK:STDOUT: %.loc27: %X.type = converted %C.ref.loc27, %X.facet.loc27 [concrete = constants.%X.facet]
  1649. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%X.facet) [concrete = constants.%F.specific_fn]
  1650. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
  1651. // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl.loc7 [concrete = constants.%G]
  1652. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  1653. // CHECK:STDOUT: %X.facet.loc28_6.1: %X.type = facet_value constants.%C, (constants.%X.impl_witness) [concrete = constants.%X.facet]
  1654. // CHECK:STDOUT: %.loc28_6.1: %X.type = converted constants.%C, %X.facet.loc28_6.1 [concrete = constants.%X.facet]
  1655. // CHECK:STDOUT: %X.facet.loc28_6.2: %X.type = facet_value constants.%C, (constants.%X.impl_witness) [concrete = constants.%X.facet]
  1656. // CHECK:STDOUT: %.loc28_6.2: %X.type = converted constants.%C, %X.facet.loc28_6.2 [concrete = constants.%X.facet]
  1657. // CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G.ref, @G(constants.%X.facet) [concrete = constants.%G.specific_fn]
  1658. // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn(%c.ref)
  1659. // CHECK:STDOUT: return
  1660. // CHECK:STDOUT: }
  1661. // CHECK:STDOUT:
  1662. // CHECK:STDOUT: specific @F(constants.%U) {
  1663. // CHECK:STDOUT: %U.loc6_6.2 => constants.%U
  1664. // CHECK:STDOUT: }
  1665. // CHECK:STDOUT:
  1666. // CHECK:STDOUT: specific @G(constants.%U) {
  1667. // CHECK:STDOUT: %U.loc7_6.2 => constants.%U
  1668. // CHECK:STDOUT: %U.as_type.loc7_16.2 => constants.%U.as_type
  1669. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.331
  1670. // CHECK:STDOUT: }
  1671. // CHECK:STDOUT:
  1672. // CHECK:STDOUT: specific @F(constants.%X.facet) {
  1673. // CHECK:STDOUT: %U.loc6_6.2 => constants.%X.facet
  1674. // CHECK:STDOUT:
  1675. // CHECK:STDOUT: !definition:
  1676. // CHECK:STDOUT: }
  1677. // CHECK:STDOUT:
  1678. // CHECK:STDOUT: specific @G(constants.%X.facet) {
  1679. // CHECK:STDOUT: %U.loc7_6.2 => constants.%X.facet
  1680. // CHECK:STDOUT: %U.as_type.loc7_16.2 => constants.%C
  1681. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c48
  1682. // CHECK:STDOUT:
  1683. // CHECK:STDOUT: !definition:
  1684. // CHECK:STDOUT: %require_complete => constants.%complete_type
  1685. // CHECK:STDOUT: }
  1686. // CHECK:STDOUT:
  1687. // CHECK:STDOUT: --- fail_todo_impl_in_interface_definition.carbon
  1688. // CHECK:STDOUT:
  1689. // CHECK:STDOUT: constants {
  1690. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1691. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1692. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1693. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1694. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1695. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%F.decl [concrete]
  1696. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic]
  1697. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1698. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1699. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @F.%I.impl_witness_table, @impl(%Self) [symbolic]
  1700. // CHECK:STDOUT: }
  1701. // CHECK:STDOUT:
  1702. // CHECK:STDOUT: imports {
  1703. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1704. // CHECK:STDOUT: import Core//prelude
  1705. // CHECK:STDOUT: import Core//prelude/...
  1706. // CHECK:STDOUT: }
  1707. // CHECK:STDOUT: }
  1708. // CHECK:STDOUT:
  1709. // CHECK:STDOUT: file {
  1710. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1711. // CHECK:STDOUT: .Core = imports.%Core
  1712. // CHECK:STDOUT: .I = %I.decl
  1713. // CHECK:STDOUT: }
  1714. // CHECK:STDOUT: %Core.import = import Core
  1715. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1716. // CHECK:STDOUT: }
  1717. // CHECK:STDOUT:
  1718. // CHECK:STDOUT: interface @I {
  1719. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1720. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1721. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  1722. // CHECK:STDOUT:
  1723. // CHECK:STDOUT: !members:
  1724. // CHECK:STDOUT: .Self = %Self
  1725. // CHECK:STDOUT: .F = %assoc0
  1726. // CHECK:STDOUT: .I = <poisoned>
  1727. // CHECK:STDOUT: witness = (%F.decl)
  1728. // CHECK:STDOUT: }
  1729. // CHECK:STDOUT:
  1730. // CHECK:STDOUT: generic impl @impl(@I.%Self: %I.type) {
  1731. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1732. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  1733. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @F.%I.impl_witness_table, @impl(%Self) [symbolic = %I.impl_witness (constants.%I.impl_witness)]
  1734. // CHECK:STDOUT:
  1735. // CHECK:STDOUT: !definition:
  1736. // CHECK:STDOUT:
  1737. // CHECK:STDOUT: impl: %C.ref.loc11 as %I.ref.loc11 {
  1738. // CHECK:STDOUT: !members:
  1739. // CHECK:STDOUT: .F = <poisoned>
  1740. // CHECK:STDOUT: witness = @F.%I.impl_witness
  1741. // CHECK:STDOUT: }
  1742. // CHECK:STDOUT: }
  1743. // CHECK:STDOUT:
  1744. // CHECK:STDOUT: generic class @C(@I.%Self: %I.type) {
  1745. // CHECK:STDOUT: !definition:
  1746. // CHECK:STDOUT:
  1747. // CHECK:STDOUT: class {
  1748. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1749. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1750. // CHECK:STDOUT: complete_type_witness = %complete_type
  1751. // CHECK:STDOUT:
  1752. // CHECK:STDOUT: !members:
  1753. // CHECK:STDOUT: .Self = constants.%C
  1754. // CHECK:STDOUT: }
  1755. // CHECK:STDOUT: }
  1756. // CHECK:STDOUT:
  1757. // CHECK:STDOUT: generic fn @F(@I.%Self: %I.type) {
  1758. // CHECK:STDOUT: !definition:
  1759. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1760. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  1761. // CHECK:STDOUT:
  1762. // CHECK:STDOUT: fn() {
  1763. // CHECK:STDOUT: !entry:
  1764. // CHECK:STDOUT: %C.decl: type = class_decl @C [symbolic = @F.%C (constants.%C)] {} {}
  1765. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1766. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, @F.%C.decl [symbolic = %C (constants.%C)]
  1767. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1768. // CHECK:STDOUT: }
  1769. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (<error>), @impl [concrete]
  1770. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table, @impl(constants.%Self) [symbolic = @impl.%I.impl_witness (constants.%I.impl_witness)]
  1771. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1772. // CHECK:STDOUT: %C.ref.loc20: type = name_ref C, @F.%C.decl [symbolic = %C (constants.%C)]
  1773. // CHECK:STDOUT: %I.ref.loc20: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1774. // CHECK:STDOUT: }
  1775. // CHECK:STDOUT: return
  1776. // CHECK:STDOUT: }
  1777. // CHECK:STDOUT: }
  1778. // CHECK:STDOUT:
  1779. // CHECK:STDOUT: specific @F(constants.%Self) {}
  1780. // CHECK:STDOUT:
  1781. // CHECK:STDOUT: specific @C(constants.%Self) {}
  1782. // CHECK:STDOUT:
  1783. // CHECK:STDOUT: specific @impl(constants.%Self) {
  1784. // CHECK:STDOUT: %Self => constants.%Self
  1785. // CHECK:STDOUT: %C => constants.%C
  1786. // CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness
  1787. // CHECK:STDOUT: }
  1788. // CHECK:STDOUT:
  1789. // CHECK:STDOUT: --- fail_todo_impl_in_interface_definition_with_associated.carbon
  1790. // CHECK:STDOUT:
  1791. // CHECK:STDOUT: constants {
  1792. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1793. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1794. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1795. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%U [concrete]
  1796. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1797. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1798. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%F.decl [concrete]
  1799. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic]
  1800. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1801. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1802. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  1803. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  1804. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  1805. // CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  1806. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1807. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %C> [symbolic]
  1808. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %I_where.type [symbolic]
  1809. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @F.%I.impl_witness_table, @impl(%Self) [symbolic]
  1810. // CHECK:STDOUT: }
  1811. // CHECK:STDOUT:
  1812. // CHECK:STDOUT: imports {
  1813. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1814. // CHECK:STDOUT: import Core//prelude
  1815. // CHECK:STDOUT: import Core//prelude/...
  1816. // CHECK:STDOUT: }
  1817. // CHECK:STDOUT: }
  1818. // CHECK:STDOUT:
  1819. // CHECK:STDOUT: file {
  1820. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1821. // CHECK:STDOUT: .Core = imports.%Core
  1822. // CHECK:STDOUT: .I = %I.decl
  1823. // CHECK:STDOUT: }
  1824. // CHECK:STDOUT: %Core.import = import Core
  1825. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1826. // CHECK:STDOUT: }
  1827. // CHECK:STDOUT:
  1828. // CHECK:STDOUT: interface @I {
  1829. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1830. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1831. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%U [concrete = constants.%assoc0]
  1832. // CHECK:STDOUT: }
  1833. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1834. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1]
  1835. // CHECK:STDOUT:
  1836. // CHECK:STDOUT: !members:
  1837. // CHECK:STDOUT: .Self = %Self
  1838. // CHECK:STDOUT: .U = @U.%assoc0
  1839. // CHECK:STDOUT: .F = %assoc1
  1840. // CHECK:STDOUT: .I = <poisoned>
  1841. // CHECK:STDOUT: witness = (%U, %F.decl)
  1842. // CHECK:STDOUT: }
  1843. // CHECK:STDOUT:
  1844. // CHECK:STDOUT: generic assoc_const @U(@I.%Self: %I.type) {
  1845. // CHECK:STDOUT: assoc_const U:! type;
  1846. // CHECK:STDOUT: }
  1847. // CHECK:STDOUT:
  1848. // CHECK:STDOUT: generic impl @impl(@I.%Self: %I.type) {
  1849. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1850. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  1851. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where constants.%impl.elem0 = %C> [symbolic = %I_where.type (constants.%I_where.type)]
  1852. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %I_where.type [symbolic = %require_complete (constants.%require_complete)]
  1853. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @F.%I.impl_witness_table, @impl(%Self) [symbolic = %I.impl_witness (constants.%I.impl_witness)]
  1854. // CHECK:STDOUT:
  1855. // CHECK:STDOUT: !definition:
  1856. // CHECK:STDOUT:
  1857. // CHECK:STDOUT: impl: %C.ref.loc12_10 as %.loc12_17 {
  1858. // CHECK:STDOUT: !members:
  1859. // CHECK:STDOUT: .F = <poisoned>
  1860. // CHECK:STDOUT: witness = @F.%I.impl_witness
  1861. // CHECK:STDOUT: }
  1862. // CHECK:STDOUT: }
  1863. // CHECK:STDOUT:
  1864. // CHECK:STDOUT: generic class @C(@I.%Self: %I.type) {
  1865. // CHECK:STDOUT: !definition:
  1866. // CHECK:STDOUT:
  1867. // CHECK:STDOUT: class {
  1868. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1869. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1870. // CHECK:STDOUT: complete_type_witness = %complete_type
  1871. // CHECK:STDOUT:
  1872. // CHECK:STDOUT: !members:
  1873. // CHECK:STDOUT: .Self = constants.%C
  1874. // CHECK:STDOUT: }
  1875. // CHECK:STDOUT: }
  1876. // CHECK:STDOUT:
  1877. // CHECK:STDOUT: generic fn @F(@I.%Self: %I.type) {
  1878. // CHECK:STDOUT: !definition:
  1879. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1880. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  1881. // CHECK:STDOUT:
  1882. // CHECK:STDOUT: fn() {
  1883. // CHECK:STDOUT: !entry:
  1884. // CHECK:STDOUT: %C.decl: type = class_decl @C [symbolic = @F.%C (constants.%C)] {} {}
  1885. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1886. // CHECK:STDOUT: %C.ref.loc12_10: type = name_ref C, @F.%C.decl [symbolic = %C (constants.%C)]
  1887. // CHECK:STDOUT: %I.ref.loc12: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1888. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1889. // CHECK:STDOUT: %.Self.ref.loc12: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  1890. // CHECK:STDOUT: %U.ref.loc12: %I.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  1891. // CHECK:STDOUT: %.Self.as_type.loc12: type = facet_access_type %.Self.ref.loc12 [symbolic_self = constants.%.Self.as_type]
  1892. // CHECK:STDOUT: %.loc12_23: type = converted %.Self.ref.loc12, %.Self.as_type.loc12 [symbolic_self = constants.%.Self.as_type]
  1893. // CHECK:STDOUT: %impl.elem0.loc12: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1894. // CHECK:STDOUT: %C.ref.loc12_28: type = name_ref C, @F.%C.decl [symbolic = %C (constants.%C)]
  1895. // CHECK:STDOUT: %.loc12_17: type = where_expr %.Self.1 [symbolic = %I_where.type (constants.%I_where.type)] {
  1896. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc12, %C.ref.loc12_28
  1897. // CHECK:STDOUT: }
  1898. // CHECK:STDOUT: }
  1899. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, <error>), @impl [concrete]
  1900. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table, @impl(constants.%Self) [symbolic = @impl.%I.impl_witness (constants.%I.impl_witness)]
  1901. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [symbolic = @impl.%C (constants.%C)]
  1902. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1903. // CHECK:STDOUT: %C.ref.loc21_10: type = name_ref C, @F.%C.decl [symbolic = %C (constants.%C)]
  1904. // CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1905. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1906. // CHECK:STDOUT: %.Self.ref.loc21: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  1907. // CHECK:STDOUT: %U.ref.loc21: %I.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  1908. // CHECK:STDOUT: %.Self.as_type.loc21: type = facet_access_type %.Self.ref.loc21 [symbolic_self = constants.%.Self.as_type]
  1909. // CHECK:STDOUT: %.loc21_23: type = converted %.Self.ref.loc21, %.Self.as_type.loc21 [symbolic_self = constants.%.Self.as_type]
  1910. // CHECK:STDOUT: %impl.elem0.loc21: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1911. // CHECK:STDOUT: %C.ref.loc21_28: type = name_ref C, @F.%C.decl [symbolic = %C (constants.%C)]
  1912. // CHECK:STDOUT: %.loc21_17: type = where_expr %.Self.2 [symbolic = %I_where.type (constants.%I_where.type)] {
  1913. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc21, %C.ref.loc21_28
  1914. // CHECK:STDOUT: }
  1915. // CHECK:STDOUT: }
  1916. // CHECK:STDOUT: return
  1917. // CHECK:STDOUT: }
  1918. // CHECK:STDOUT: }
  1919. // CHECK:STDOUT:
  1920. // CHECK:STDOUT: specific @U(constants.%Self) {}
  1921. // CHECK:STDOUT:
  1922. // CHECK:STDOUT: specific @F(constants.%Self) {}
  1923. // CHECK:STDOUT:
  1924. // CHECK:STDOUT: specific @C(constants.%Self) {}
  1925. // CHECK:STDOUT:
  1926. // CHECK:STDOUT: specific @U(constants.%I.facet) {}
  1927. // CHECK:STDOUT:
  1928. // CHECK:STDOUT: specific @impl(constants.%Self) {
  1929. // CHECK:STDOUT: %Self => constants.%Self
  1930. // CHECK:STDOUT: %C => constants.%C
  1931. // CHECK:STDOUT: %I_where.type => constants.%I_where.type
  1932. // CHECK:STDOUT: %require_complete => constants.%require_complete
  1933. // CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness
  1934. // CHECK:STDOUT: }
  1935. // CHECK:STDOUT: