forward_decls.carbon 122 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/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 facet of incomplete type `I` [IncompleteTypeInMemberAccessOfFacet]
  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` [MemberNameNotFoundInSpecificScope]
  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(unused 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(_:! 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(_:! X) {}
  175. fn G[U:! X](unused 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: %empty_struct: %empty_struct_type = struct_value () [concrete]
  228. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete]
  229. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  230. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_struct_type, (%I.impl_witness) [concrete]
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT:
  233. // CHECK:STDOUT: imports {
  234. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  235. // CHECK:STDOUT: import Core//prelude
  236. // CHECK:STDOUT: import Core//prelude/...
  237. // CHECK:STDOUT: }
  238. // CHECK:STDOUT: }
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: file {
  241. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  242. // CHECK:STDOUT: .Core = imports.%Core
  243. // CHECK:STDOUT: .I = %I.decl.loc3
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT: %Core.import = import Core
  246. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  247. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  248. // CHECK:STDOUT: %.loc4_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  249. // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  250. // CHECK:STDOUT: %I.ref.loc4: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  251. // CHECK:STDOUT: }
  252. // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {}
  253. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  254. // CHECK:STDOUT: %.loc7_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  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 = symbolic_binding Self, 0 [symbolic = constants.%Self]
  262. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: !members:
  265. // CHECK:STDOUT: .Self = %Self
  266. // CHECK:STDOUT: witness = ()
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: !requires:
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT:
  271. // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc4_7.2 as %I.ref.loc4 {
  272. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete]
  273. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: !members:
  276. // CHECK:STDOUT: witness = %I.impl_witness
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  280. // CHECK:STDOUT: !definition:
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  284. // CHECK:STDOUT: !definition:
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: --- method.carbon
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: constants {
  290. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  291. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  292. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  293. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete]
  294. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  295. // CHECK:STDOUT: %I.WithSelf.G.type.047: type = fn_type @I.WithSelf.G, @I.WithSelf(%Self) [symbolic]
  296. // CHECK:STDOUT: %I.WithSelf.G.8c4: %I.WithSelf.G.type.047 = struct_value () [symbolic]
  297. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  298. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.G.decl [concrete]
  299. // CHECK:STDOUT: %empty_struct_type.as.I.impl.G.type: type = fn_type @empty_struct_type.as.I.impl.G [concrete]
  300. // CHECK:STDOUT: %empty_struct_type.as.I.impl.G: %empty_struct_type.as.I.impl.G.type = struct_value () [concrete]
  301. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_struct_type, (%I.impl_witness) [concrete]
  302. // CHECK:STDOUT: %I.WithSelf.G.type.ed6: type = fn_type @I.WithSelf.G, @I.WithSelf(%I.facet) [concrete]
  303. // CHECK:STDOUT: %I.WithSelf.G.42b: %I.WithSelf.G.type.ed6 = struct_value () [concrete]
  304. // CHECK:STDOUT: }
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: imports {
  307. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  308. // CHECK:STDOUT: import Core//prelude
  309. // CHECK:STDOUT: import Core//prelude/...
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT:
  313. // CHECK:STDOUT: file {
  314. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  315. // CHECK:STDOUT: .Core = imports.%Core
  316. // CHECK:STDOUT: .I = %I.decl.loc3
  317. // CHECK:STDOUT: }
  318. // CHECK:STDOUT: %Core.import = import Core
  319. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  320. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  321. // CHECK:STDOUT: %.loc4_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  322. // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  323. // CHECK:STDOUT: %I.ref.loc4: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  324. // CHECK:STDOUT: }
  325. // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {}
  326. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  327. // CHECK:STDOUT: %.loc9_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  328. // CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  329. // CHECK:STDOUT: %I.ref.loc9: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  330. // CHECK:STDOUT: }
  331. // CHECK:STDOUT: }
  332. // CHECK:STDOUT:
  333. // CHECK:STDOUT: interface @I {
  334. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  335. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  336. // CHECK:STDOUT:
  337. // CHECK:STDOUT: !with Self:
  338. // CHECK:STDOUT: %I.WithSelf.G.decl: @I.WithSelf.%I.WithSelf.G.type (%I.WithSelf.G.type.047) = fn_decl @I.WithSelf.G [symbolic = @I.WithSelf.%I.WithSelf.G (constants.%I.WithSelf.G.8c4)] {} {}
  339. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.G.decl [concrete = constants.%assoc0]
  340. // CHECK:STDOUT:
  341. // CHECK:STDOUT: !members:
  342. // CHECK:STDOUT: .Self = %Self
  343. // CHECK:STDOUT: .G = @I.WithSelf.%assoc0
  344. // CHECK:STDOUT: witness = (@I.WithSelf.%I.WithSelf.G.decl)
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: !requires:
  347. // CHECK:STDOUT: }
  348. // CHECK:STDOUT:
  349. // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc4_7.2 as %I.ref.loc4 {
  350. // CHECK:STDOUT: %empty_struct_type.as.I.impl.G.decl: %empty_struct_type.as.I.impl.G.type = fn_decl @empty_struct_type.as.I.impl.G [concrete = constants.%empty_struct_type.as.I.impl.G] {} {}
  351. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%empty_struct_type.as.I.impl.G.decl), @empty_struct_type.as.I.impl [concrete]
  352. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  353. // CHECK:STDOUT:
  354. // CHECK:STDOUT: !members:
  355. // CHECK:STDOUT: .G = %empty_struct_type.as.I.impl.G.decl
  356. // CHECK:STDOUT: witness = %I.impl_witness
  357. // CHECK:STDOUT: }
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: generic fn @I.WithSelf.G(@I.%Self: %I.type) {
  360. // CHECK:STDOUT: fn();
  361. // CHECK:STDOUT: }
  362. // CHECK:STDOUT:
  363. // CHECK:STDOUT: fn @empty_struct_type.as.I.impl.G() {
  364. // CHECK:STDOUT: !entry:
  365. // CHECK:STDOUT: return
  366. // CHECK:STDOUT: }
  367. // CHECK:STDOUT:
  368. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  369. // CHECK:STDOUT: !definition:
  370. // CHECK:STDOUT: %Self => constants.%Self
  371. // CHECK:STDOUT: %I.WithSelf.G.type => constants.%I.WithSelf.G.type.047
  372. // CHECK:STDOUT: %I.WithSelf.G => constants.%I.WithSelf.G.8c4
  373. // CHECK:STDOUT: }
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: specific @I.WithSelf.G(constants.%Self) {}
  376. // CHECK:STDOUT:
  377. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  378. // CHECK:STDOUT: !definition:
  379. // CHECK:STDOUT: %Self => constants.%I.facet
  380. // CHECK:STDOUT: %I.WithSelf.G.type => constants.%I.WithSelf.G.type.ed6
  381. // CHECK:STDOUT: %I.WithSelf.G => constants.%I.WithSelf.G.42b
  382. // CHECK:STDOUT: }
  383. // CHECK:STDOUT:
  384. // CHECK:STDOUT: specific @I.WithSelf.G(constants.%I.facet) {}
  385. // CHECK:STDOUT:
  386. // CHECK:STDOUT: --- combine.carbon
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: constants {
  389. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  390. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  391. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  392. // CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete]
  393. // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete]
  394. // CHECK:STDOUT: %BitAndWith.type.b10: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete]
  395. // CHECK:STDOUT: %BitAndWith.impl_witness: <witness> = impl_witness imports.%BitAndWith.impl_witness_table [concrete]
  396. // CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.b10 = facet_value type, (%BitAndWith.impl_witness) [concrete]
  397. // CHECK:STDOUT: %BitAndWith.WithSelf.Op.type.4bd: type = fn_type @BitAndWith.WithSelf.Op, @BitAndWith.WithSelf(type, %BitAndWith.facet) [concrete]
  398. // CHECK:STDOUT: %.d15: type = fn_type_with_self_type %BitAndWith.WithSelf.Op.type.4bd, %BitAndWith.facet [concrete]
  399. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete]
  400. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete]
  401. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: <bound method> = bound_method %I.type, %type.as.BitAndWith.impl.Op [concrete]
  402. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete]
  403. // CHECK:STDOUT: %Self.ab9: %I.type = symbolic_binding Self, 0 [symbolic]
  404. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_struct_type, (%I.impl_witness) [concrete]
  405. // CHECK:STDOUT: }
  406. // CHECK:STDOUT:
  407. // CHECK:STDOUT: imports {
  408. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  409. // CHECK:STDOUT: .BitAndWith = %Core.BitAndWith
  410. // CHECK:STDOUT: import Core//prelude
  411. // CHECK:STDOUT: import Core//prelude/...
  412. // CHECK:STDOUT: }
  413. // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic]
  414. // CHECK:STDOUT: %Core.import_ref.8d3: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op]
  415. // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.8d3), @type.as.BitAndWith.impl [concrete]
  416. // CHECK:STDOUT: }
  417. // CHECK:STDOUT:
  418. // CHECK:STDOUT: file {
  419. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  420. // CHECK:STDOUT: .Core = imports.%Core
  421. // CHECK:STDOUT: .I = %I.decl.loc3
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT: %Core.import = import Core
  424. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  425. // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer @empty_struct_type.as.I.impl.%type.as.BitAndWith.impl.Op.call.loc4 [concrete = constants.%I.type]
  426. // CHECK:STDOUT: %.loc4_14.2: type = converted @empty_struct_type.as.I.impl.%type.as.BitAndWith.impl.Op.call.loc4, %.loc4_14.1 [concrete = constants.%I.type]
  427. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  428. // CHECK:STDOUT: %.loc4_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  429. // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  430. // CHECK:STDOUT: %I.ref.loc4_12: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  431. // CHECK:STDOUT: %I.ref.loc4_16: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  432. // CHECK:STDOUT: %impl.elem0.loc4: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  433. // CHECK:STDOUT: %bound_method.loc4: <bound method> = bound_method %I.ref.loc4_12, %impl.elem0.loc4 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  434. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc4: init type = call %bound_method.loc4(%I.ref.loc4_12, %I.ref.loc4_16) [concrete = constants.%I.type]
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {}
  437. // CHECK:STDOUT: %.loc7_14.1: type = value_of_initializer @empty_struct_type.as.I.impl.%type.as.BitAndWith.impl.Op.call.loc7 [concrete = constants.%I.type]
  438. // CHECK:STDOUT: %.loc7_14.2: type = converted @empty_struct_type.as.I.impl.%type.as.BitAndWith.impl.Op.call.loc7, %.loc7_14.1 [concrete = constants.%I.type]
  439. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  440. // CHECK:STDOUT: %.loc7_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  441. // CHECK:STDOUT: %.loc7_7.2: type = converted %.loc7_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  442. // CHECK:STDOUT: %I.ref.loc7_12: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  443. // CHECK:STDOUT: %I.ref.loc7_16: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  444. // CHECK:STDOUT: %impl.elem0.loc7: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  445. // CHECK:STDOUT: %bound_method.loc7: <bound method> = bound_method %I.ref.loc7_12, %impl.elem0.loc7 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  446. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc7: init type = call %bound_method.loc7(%I.ref.loc7_12, %I.ref.loc7_16) [concrete = constants.%I.type]
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT: }
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: interface @I {
  451. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.ab9]
  452. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  453. // CHECK:STDOUT:
  454. // CHECK:STDOUT: !members:
  455. // CHECK:STDOUT: .Self = %Self
  456. // CHECK:STDOUT: witness = ()
  457. // CHECK:STDOUT:
  458. // CHECK:STDOUT: !requires:
  459. // CHECK:STDOUT: }
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc4_7.2 as file.%.loc4_14.2 {
  462. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete]
  463. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  464. // CHECK:STDOUT:
  465. // CHECK:STDOUT: !members:
  466. // CHECK:STDOUT: witness = %I.impl_witness
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT:
  469. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self.ab9) {
  470. // CHECK:STDOUT: !definition:
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT:
  473. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  474. // CHECK:STDOUT: !definition:
  475. // CHECK:STDOUT: }
  476. // CHECK:STDOUT:
  477. // CHECK:STDOUT: --- associated_const.carbon
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: constants {
  480. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  481. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  482. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  483. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete]
  484. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  485. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  486. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  487. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  488. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  489. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  490. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  491. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  492. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  493. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @empty_struct_type.as.I.impl.%I.impl_witness_table [concrete]
  494. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_struct_type, (%I.impl_witness) [concrete]
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: imports {
  498. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  499. // CHECK:STDOUT: import Core//prelude
  500. // CHECK:STDOUT: import Core//prelude/...
  501. // CHECK:STDOUT: }
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: file {
  505. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  506. // CHECK:STDOUT: .Core = imports.%Core
  507. // CHECK:STDOUT: .I = %I.decl
  508. // CHECK:STDOUT: }
  509. // CHECK:STDOUT: %Core.import = import Core
  510. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  511. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  512. // CHECK:STDOUT: %.loc6_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  513. // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  514. // CHECK:STDOUT: %I.ref.loc6: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  515. // CHECK:STDOUT: %.Self.2: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  516. // CHECK:STDOUT: %.Self.ref.loc6: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  517. // CHECK:STDOUT: %.Self.as_type.loc6: type = facet_access_type %.Self.ref.loc6 [symbolic_self = constants.%.Self.as_type]
  518. // CHECK:STDOUT: %.loc6_20: type = converted %.Self.ref.loc6, %.Self.as_type.loc6 [symbolic_self = constants.%.Self.as_type]
  519. // CHECK:STDOUT: %T.ref.loc6: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  520. // CHECK:STDOUT: %impl.elem0.loc6: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  521. // CHECK:STDOUT: %.loc6_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  522. // CHECK:STDOUT: %.loc6_26.2: type = converted %.loc6_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  523. // CHECK:STDOUT: %.loc6_14: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  524. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  525. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6, %.loc6_26.2
  526. // CHECK:STDOUT: }
  527. // CHECK:STDOUT: }
  528. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  529. // CHECK:STDOUT: %.loc8_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  530. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  531. // CHECK:STDOUT: %I.ref.loc8: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  532. // CHECK:STDOUT: %.Self.1: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  533. // CHECK:STDOUT: %.Self.ref.loc8: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  534. // CHECK:STDOUT: %.Self.as_type.loc8: type = facet_access_type %.Self.ref.loc8 [symbolic_self = constants.%.Self.as_type]
  535. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref.loc8, %.Self.as_type.loc8 [symbolic_self = constants.%.Self.as_type]
  536. // CHECK:STDOUT: %T.ref.loc8: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  537. // CHECK:STDOUT: %impl.elem0.loc8: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  538. // CHECK:STDOUT: %.loc8_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  539. // CHECK:STDOUT: %.loc8_26.2: type = converted %.loc8_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  540. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  541. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  542. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %.loc8_26.2
  543. // CHECK:STDOUT: }
  544. // CHECK:STDOUT: }
  545. // CHECK:STDOUT: }
  546. // CHECK:STDOUT:
  547. // CHECK:STDOUT: interface @I {
  548. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  549. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  550. // CHECK:STDOUT:
  551. // CHECK:STDOUT: !with Self:
  552. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  553. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete = constants.%assoc0]
  554. // CHECK:STDOUT: }
  555. // CHECK:STDOUT:
  556. // CHECK:STDOUT: !members:
  557. // CHECK:STDOUT: .Self = %Self
  558. // CHECK:STDOUT: .T = @T.%assoc0
  559. // CHECK:STDOUT: witness = (@I.WithSelf.%T)
  560. // CHECK:STDOUT:
  561. // CHECK:STDOUT: !requires:
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc6_7.2 as %.loc6_14 {
  565. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_struct_type.as.I.impl [concrete]
  566. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  567. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  568. // CHECK:STDOUT:
  569. // CHECK:STDOUT: !members:
  570. // CHECK:STDOUT: witness = %I.impl_witness
  571. // CHECK:STDOUT: }
  572. // CHECK:STDOUT:
  573. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  574. // CHECK:STDOUT: !definition:
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: specific @I.WithSelf(constants.%.Self) {
  578. // CHECK:STDOUT: !definition:
  579. // CHECK:STDOUT: }
  580. // CHECK:STDOUT:
  581. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  582. // CHECK:STDOUT: !definition:
  583. // CHECK:STDOUT: }
  584. // CHECK:STDOUT:
  585. // CHECK:STDOUT: --- associated_const_compound_member_access.carbon
  586. // CHECK:STDOUT:
  587. // CHECK:STDOUT: constants {
  588. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  589. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  590. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  591. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete]
  592. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  593. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  594. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  595. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  596. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  597. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  598. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  599. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  600. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  601. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  602. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete]
  603. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  604. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
  605. // CHECK:STDOUT: }
  606. // CHECK:STDOUT:
  607. // CHECK:STDOUT: imports {
  608. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  609. // CHECK:STDOUT: import Core//prelude
  610. // CHECK:STDOUT: import Core//prelude/...
  611. // CHECK:STDOUT: }
  612. // CHECK:STDOUT: }
  613. // CHECK:STDOUT:
  614. // CHECK:STDOUT: file {
  615. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  616. // CHECK:STDOUT: .Core = imports.%Core
  617. // CHECK:STDOUT: .I = %I.decl
  618. // CHECK:STDOUT: .C = %C.decl
  619. // CHECK:STDOUT: .x = %x
  620. // CHECK:STDOUT: }
  621. // CHECK:STDOUT: %Core.import = import Core
  622. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  623. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  624. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  625. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  626. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  627. // CHECK:STDOUT: %.Self.2: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  628. // CHECK:STDOUT: %.Self.ref.loc7: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  629. // CHECK:STDOUT: %.Self.as_type.loc7: type = facet_access_type %.Self.ref.loc7 [symbolic_self = constants.%.Self.as_type]
  630. // CHECK:STDOUT: %.loc7_19: type = converted %.Self.ref.loc7, %.Self.as_type.loc7 [symbolic_self = constants.%.Self.as_type]
  631. // CHECK:STDOUT: %T.ref.loc7: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  632. // CHECK:STDOUT: %impl.elem0.loc7: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  633. // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  634. // CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  635. // CHECK:STDOUT: %.loc7_13: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  636. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  637. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc7, %.loc7_25.2
  638. // CHECK:STDOUT: }
  639. // CHECK:STDOUT: }
  640. // CHECK:STDOUT: name_binding_decl {
  641. // CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete]
  642. // CHECK:STDOUT: }
  643. // CHECK:STDOUT: %.loc9_9.1: type = splice_block %impl.elem0 [concrete = constants.%empty_tuple.type] {
  644. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  645. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  646. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  647. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C.ref, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  648. // CHECK:STDOUT: %.loc9_9.2: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
  649. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%empty_tuple.type]
  650. // CHECK:STDOUT: }
  651. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  652. // CHECK:STDOUT: %.loc9_19: %empty_tuple.type = converted @__global_init.%.loc9, %empty_tuple [concrete = constants.%empty_tuple]
  653. // CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %.loc9_19
  654. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  655. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  656. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  657. // CHECK:STDOUT: %.Self.1: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  658. // CHECK:STDOUT: %.Self.ref.loc11: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  659. // CHECK:STDOUT: %.Self.as_type.loc11: type = facet_access_type %.Self.ref.loc11 [symbolic_self = constants.%.Self.as_type]
  660. // CHECK:STDOUT: %.loc11_19: type = converted %.Self.ref.loc11, %.Self.as_type.loc11 [symbolic_self = constants.%.Self.as_type]
  661. // CHECK:STDOUT: %T.ref.loc11: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  662. // CHECK:STDOUT: %impl.elem0.loc11: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  663. // CHECK:STDOUT: %.loc11_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  664. // CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  665. // CHECK:STDOUT: %.loc11_13: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  666. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  667. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11, %.loc11_25.2
  668. // CHECK:STDOUT: }
  669. // CHECK:STDOUT: }
  670. // CHECK:STDOUT: }
  671. // CHECK:STDOUT:
  672. // CHECK:STDOUT: interface @I {
  673. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  674. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  675. // CHECK:STDOUT:
  676. // CHECK:STDOUT: !with Self:
  677. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  678. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete = constants.%assoc0]
  679. // CHECK:STDOUT: }
  680. // CHECK:STDOUT:
  681. // CHECK:STDOUT: !members:
  682. // CHECK:STDOUT: .Self = %Self
  683. // CHECK:STDOUT: .T = @T.%assoc0
  684. // CHECK:STDOUT: witness = (@I.WithSelf.%T)
  685. // CHECK:STDOUT:
  686. // CHECK:STDOUT: !requires:
  687. // CHECK:STDOUT: }
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc7 as %.loc7_13 {
  690. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete]
  691. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  692. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  693. // CHECK:STDOUT:
  694. // CHECK:STDOUT: !members:
  695. // CHECK:STDOUT: witness = %I.impl_witness
  696. // CHECK:STDOUT: }
  697. // CHECK:STDOUT:
  698. // CHECK:STDOUT: class @C {
  699. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  700. // CHECK:STDOUT: complete_type_witness = %complete_type
  701. // CHECK:STDOUT:
  702. // CHECK:STDOUT: !members:
  703. // CHECK:STDOUT: .Self = constants.%C
  704. // CHECK:STDOUT: }
  705. // CHECK:STDOUT:
  706. // CHECK:STDOUT: fn @__global_init() {
  707. // CHECK:STDOUT: !entry:
  708. // CHECK:STDOUT: %.loc9: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  709. // CHECK:STDOUT: return
  710. // CHECK:STDOUT: }
  711. // CHECK:STDOUT:
  712. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  713. // CHECK:STDOUT: !definition:
  714. // CHECK:STDOUT: }
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: specific @I.WithSelf(constants.%.Self) {
  717. // CHECK:STDOUT: !definition:
  718. // CHECK:STDOUT: }
  719. // CHECK:STDOUT:
  720. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  721. // CHECK:STDOUT: !definition:
  722. // CHECK:STDOUT: }
  723. // CHECK:STDOUT:
  724. // CHECK:STDOUT: --- associated_const_of_facet.carbon
  725. // CHECK:STDOUT:
  726. // CHECK:STDOUT: constants {
  727. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  728. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  729. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  730. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete]
  731. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  732. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  733. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  734. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  735. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  736. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  737. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  738. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  739. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  740. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  741. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete]
  742. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  743. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
  744. // CHECK:STDOUT: }
  745. // CHECK:STDOUT:
  746. // CHECK:STDOUT: imports {
  747. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  748. // CHECK:STDOUT: import Core//prelude
  749. // CHECK:STDOUT: import Core//prelude/...
  750. // CHECK:STDOUT: }
  751. // CHECK:STDOUT: }
  752. // CHECK:STDOUT:
  753. // CHECK:STDOUT: file {
  754. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  755. // CHECK:STDOUT: .Core = imports.%Core
  756. // CHECK:STDOUT: .I = %I.decl
  757. // CHECK:STDOUT: .C = %C.decl
  758. // CHECK:STDOUT: .x = %x
  759. // CHECK:STDOUT: }
  760. // CHECK:STDOUT: %Core.import = import Core
  761. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  762. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  763. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  764. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  765. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  766. // CHECK:STDOUT: %.Self.2: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  767. // CHECK:STDOUT: %.Self.ref.loc7: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  768. // CHECK:STDOUT: %.Self.as_type.loc7: type = facet_access_type %.Self.ref.loc7 [symbolic_self = constants.%.Self.as_type]
  769. // CHECK:STDOUT: %.loc7_19: type = converted %.Self.ref.loc7, %.Self.as_type.loc7 [symbolic_self = constants.%.Self.as_type]
  770. // CHECK:STDOUT: %T.ref.loc7: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  771. // CHECK:STDOUT: %impl.elem0.loc7: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  772. // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  773. // CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  774. // CHECK:STDOUT: %.loc7_13: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  775. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  776. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc7, %.loc7_25.2
  777. // CHECK:STDOUT: }
  778. // CHECK:STDOUT: }
  779. // CHECK:STDOUT: name_binding_decl {
  780. // CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete]
  781. // CHECK:STDOUT: }
  782. // CHECK:STDOUT: %.loc9_16.1: type = splice_block %impl.elem0 [concrete = constants.%empty_tuple.type] {
  783. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  784. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  785. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C.ref, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  786. // CHECK:STDOUT: %.loc9_11: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
  787. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc9_11 [concrete = constants.%C]
  788. // CHECK:STDOUT: %.loc9_16.2: type = converted %.loc9_11, %as_type [concrete = constants.%C]
  789. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  790. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%empty_tuple.type]
  791. // CHECK:STDOUT: }
  792. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  793. // CHECK:STDOUT: %.loc9_22: %empty_tuple.type = converted @__global_init.%.loc9, %empty_tuple [concrete = constants.%empty_tuple]
  794. // CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %.loc9_22
  795. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  796. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  797. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  798. // CHECK:STDOUT: %.Self.1: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  799. // CHECK:STDOUT: %.Self.ref.loc11: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  800. // CHECK:STDOUT: %.Self.as_type.loc11: type = facet_access_type %.Self.ref.loc11 [symbolic_self = constants.%.Self.as_type]
  801. // CHECK:STDOUT: %.loc11_19: type = converted %.Self.ref.loc11, %.Self.as_type.loc11 [symbolic_self = constants.%.Self.as_type]
  802. // CHECK:STDOUT: %T.ref.loc11: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  803. // CHECK:STDOUT: %impl.elem0.loc11: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  804. // CHECK:STDOUT: %.loc11_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  805. // CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  806. // CHECK:STDOUT: %.loc11_13: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  807. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  808. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11, %.loc11_25.2
  809. // CHECK:STDOUT: }
  810. // CHECK:STDOUT: }
  811. // CHECK:STDOUT: }
  812. // CHECK:STDOUT:
  813. // CHECK:STDOUT: interface @I {
  814. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  815. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  816. // CHECK:STDOUT:
  817. // CHECK:STDOUT: !with Self:
  818. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  819. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete = constants.%assoc0]
  820. // CHECK:STDOUT: }
  821. // CHECK:STDOUT:
  822. // CHECK:STDOUT: !members:
  823. // CHECK:STDOUT: .Self = %Self
  824. // CHECK:STDOUT: .T = @T.%assoc0
  825. // CHECK:STDOUT: witness = (@I.WithSelf.%T)
  826. // CHECK:STDOUT:
  827. // CHECK:STDOUT: !requires:
  828. // CHECK:STDOUT: }
  829. // CHECK:STDOUT:
  830. // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc7 as %.loc7_13 {
  831. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete]
  832. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  833. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  834. // CHECK:STDOUT:
  835. // CHECK:STDOUT: !members:
  836. // CHECK:STDOUT: witness = %I.impl_witness
  837. // CHECK:STDOUT: }
  838. // CHECK:STDOUT:
  839. // CHECK:STDOUT: class @C {
  840. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  841. // CHECK:STDOUT: complete_type_witness = %complete_type
  842. // CHECK:STDOUT:
  843. // CHECK:STDOUT: !members:
  844. // CHECK:STDOUT: .Self = constants.%C
  845. // CHECK:STDOUT: }
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: fn @__global_init() {
  848. // CHECK:STDOUT: !entry:
  849. // CHECK:STDOUT: %.loc9: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  850. // CHECK:STDOUT: return
  851. // CHECK:STDOUT: }
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  854. // CHECK:STDOUT: !definition:
  855. // CHECK:STDOUT: }
  856. // CHECK:STDOUT:
  857. // CHECK:STDOUT: specific @I.WithSelf(constants.%.Self) {
  858. // CHECK:STDOUT: !definition:
  859. // CHECK:STDOUT: }
  860. // CHECK:STDOUT:
  861. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  862. // CHECK:STDOUT: !definition:
  863. // CHECK:STDOUT: }
  864. // CHECK:STDOUT:
  865. // CHECK:STDOUT: --- fail_unset_associated_const.carbon
  866. // CHECK:STDOUT:
  867. // CHECK:STDOUT: constants {
  868. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  869. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  870. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  871. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete]
  872. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  873. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  874. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  875. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete]
  876. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  877. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  878. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  879. // CHECK:STDOUT: }
  880. // CHECK:STDOUT:
  881. // CHECK:STDOUT: imports {
  882. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  883. // CHECK:STDOUT: import Core//prelude
  884. // CHECK:STDOUT: import Core//prelude/...
  885. // CHECK:STDOUT: }
  886. // CHECK:STDOUT: }
  887. // CHECK:STDOUT:
  888. // CHECK:STDOUT: file {
  889. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  890. // CHECK:STDOUT: .Core = imports.%Core
  891. // CHECK:STDOUT: .I = %I.decl
  892. // CHECK:STDOUT: .C = %C.decl
  893. // CHECK:STDOUT: .x = %x
  894. // CHECK:STDOUT: }
  895. // CHECK:STDOUT: %Core.import = import Core
  896. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  897. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  898. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  899. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  900. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  901. // CHECK:STDOUT: }
  902. // CHECK:STDOUT: name_binding_decl {
  903. // CHECK:STDOUT: %x.patt: <error> = value_binding_pattern x [concrete]
  904. // CHECK:STDOUT: }
  905. // CHECK:STDOUT: %.loc13_16.1: type = splice_block %impl.elem0 [concrete = <error>] {
  906. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  907. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  908. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C.ref, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  909. // CHECK:STDOUT: %.loc13_11: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
  910. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc13_11 [concrete = constants.%C]
  911. // CHECK:STDOUT: %.loc13_16.2: type = converted %.loc13_11, %as_type [concrete = constants.%C]
  912. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  913. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.impl_witness, element0 [concrete = <error>]
  914. // CHECK:STDOUT: }
  915. // CHECK:STDOUT: %x: <error> = value_binding x, <error> [concrete = <error>]
  916. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  917. // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [concrete = constants.%C]
  918. // CHECK:STDOUT: %I.ref.loc22: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  919. // CHECK:STDOUT: }
  920. // CHECK:STDOUT: }
  921. // CHECK:STDOUT:
  922. // CHECK:STDOUT: interface @I {
  923. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  924. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  925. // CHECK:STDOUT:
  926. // CHECK:STDOUT: !with Self:
  927. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  928. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete = constants.%assoc0]
  929. // CHECK:STDOUT: }
  930. // CHECK:STDOUT:
  931. // CHECK:STDOUT: !members:
  932. // CHECK:STDOUT: .Self = %Self
  933. // CHECK:STDOUT: .T = @T.%assoc0
  934. // CHECK:STDOUT: witness = (@I.WithSelf.%T)
  935. // CHECK:STDOUT:
  936. // CHECK:STDOUT: !requires:
  937. // CHECK:STDOUT: }
  938. // CHECK:STDOUT:
  939. // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc7 as %I.ref.loc7 {
  940. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (<error>), @C.as.I.impl [concrete]
  941. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: !members:
  944. // CHECK:STDOUT: witness = %I.impl_witness
  945. // CHECK:STDOUT: }
  946. // CHECK:STDOUT:
  947. // CHECK:STDOUT: class @C {
  948. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  949. // CHECK:STDOUT: complete_type_witness = %complete_type
  950. // CHECK:STDOUT:
  951. // CHECK:STDOUT: !members:
  952. // CHECK:STDOUT: .Self = constants.%C
  953. // CHECK:STDOUT: }
  954. // CHECK:STDOUT:
  955. // CHECK:STDOUT: fn @__global_init() {
  956. // CHECK:STDOUT: !entry:
  957. // CHECK:STDOUT: %.loc13: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  958. // CHECK:STDOUT: return
  959. // CHECK:STDOUT: }
  960. // CHECK:STDOUT:
  961. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  962. // CHECK:STDOUT: !definition:
  963. // CHECK:STDOUT: }
  964. // CHECK:STDOUT:
  965. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  966. // CHECK:STDOUT: !definition:
  967. // CHECK:STDOUT: }
  968. // CHECK:STDOUT:
  969. // CHECK:STDOUT: --- fail_associated_const_before_interface_definition.carbon
  970. // CHECK:STDOUT:
  971. // CHECK:STDOUT: constants {
  972. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  973. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  974. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  975. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  976. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  977. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  978. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  979. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  980. // CHECK:STDOUT: }
  981. // CHECK:STDOUT:
  982. // CHECK:STDOUT: imports {
  983. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  984. // CHECK:STDOUT: import Core//prelude
  985. // CHECK:STDOUT: import Core//prelude/...
  986. // CHECK:STDOUT: }
  987. // CHECK:STDOUT: }
  988. // CHECK:STDOUT:
  989. // CHECK:STDOUT: file {
  990. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  991. // CHECK:STDOUT: .Core = imports.%Core
  992. // CHECK:STDOUT: .I = %I.decl.loc3
  993. // CHECK:STDOUT: .C = %C.decl.loc4
  994. // CHECK:STDOUT: .D = %D.decl
  995. // CHECK:STDOUT: }
  996. // CHECK:STDOUT: %Core.import = import Core
  997. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  998. // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [concrete = constants.%C] {} {}
  999. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1000. // CHECK:STDOUT: impl_decl @D.as.<error>.impl [concrete] {} {
  1001. // CHECK:STDOUT: %D.ref.loc13: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1002. // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1003. // CHECK:STDOUT: %.Self.2: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1004. // CHECK:STDOUT: %.Self.ref.loc13: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  1005. // CHECK:STDOUT: %.Self.as_type.loc13: type = facet_access_type %.Self.ref.loc13 [symbolic_self = constants.%.Self.as_type]
  1006. // CHECK:STDOUT: %.loc13_19: type = converted %.Self.ref.loc13, %.Self.as_type.loc13 [symbolic_self = constants.%.Self.as_type]
  1007. // CHECK:STDOUT: %T.ref.loc13: <error> = name_ref T, <error> [concrete = <error>]
  1008. // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C]
  1009. // CHECK:STDOUT: %.loc13_13: type = where_expr %.Self.2 [concrete = <error>] {
  1010. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1011. // CHECK:STDOUT: requirement_rewrite %T.ref.loc13, <error>
  1012. // CHECK:STDOUT: }
  1013. // CHECK:STDOUT: }
  1014. // CHECK:STDOUT: %I.decl.loc15: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1015. // CHECK:STDOUT: %C.decl.loc16: type = class_decl @C [concrete = constants.%C] {} {}
  1016. // CHECK:STDOUT: impl_decl @D.as.<error>.impl [concrete] {} {
  1017. // CHECK:STDOUT: %D.ref.loc21: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1018. // CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1019. // CHECK:STDOUT: %.Self.1: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1020. // CHECK:STDOUT: %.Self.ref.loc21: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  1021. // CHECK:STDOUT: %.Self.as_type.loc21: type = facet_access_type %.Self.ref.loc21 [symbolic_self = constants.%.Self.as_type]
  1022. // CHECK:STDOUT: %.loc21_19: type = converted %.Self.ref.loc21, %.Self.as_type.loc21 [symbolic_self = constants.%.Self.as_type]
  1023. // CHECK:STDOUT: %T.ref.loc21: <error> = name_ref T, <error> [concrete = <error>]
  1024. // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C]
  1025. // CHECK:STDOUT: %.loc21_13: type = where_expr %.Self.1 [concrete = <error>] {
  1026. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1027. // CHECK:STDOUT: requirement_rewrite %T.ref.loc21, <error>
  1028. // CHECK:STDOUT: }
  1029. // CHECK:STDOUT: }
  1030. // CHECK:STDOUT: }
  1031. // CHECK:STDOUT:
  1032. // CHECK:STDOUT: interface @I {
  1033. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  1034. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  1035. // CHECK:STDOUT:
  1036. // CHECK:STDOUT: !members:
  1037. // CHECK:STDOUT: .Self = %Self
  1038. // CHECK:STDOUT: .T = <poisoned>
  1039. // CHECK:STDOUT: witness = ()
  1040. // CHECK:STDOUT:
  1041. // CHECK:STDOUT: !requires:
  1042. // CHECK:STDOUT: }
  1043. // CHECK:STDOUT:
  1044. // CHECK:STDOUT: impl @D.as.<error>.impl: %D.ref.loc13 as %.loc13_13 {
  1045. // CHECK:STDOUT: !members:
  1046. // CHECK:STDOUT: witness = <error>
  1047. // CHECK:STDOUT: }
  1048. // CHECK:STDOUT:
  1049. // CHECK:STDOUT: class @C {
  1050. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1051. // CHECK:STDOUT: complete_type_witness = %complete_type
  1052. // CHECK:STDOUT:
  1053. // CHECK:STDOUT: !members:
  1054. // CHECK:STDOUT: .Self = constants.%C
  1055. // CHECK:STDOUT: }
  1056. // CHECK:STDOUT:
  1057. // CHECK:STDOUT: class @D {
  1058. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1059. // CHECK:STDOUT: complete_type_witness = %complete_type
  1060. // CHECK:STDOUT:
  1061. // CHECK:STDOUT: !members:
  1062. // CHECK:STDOUT: .Self = constants.%D
  1063. // CHECK:STDOUT: }
  1064. // CHECK:STDOUT:
  1065. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  1066. // CHECK:STDOUT: !definition:
  1067. // CHECK:STDOUT: }
  1068. // CHECK:STDOUT:
  1069. // CHECK:STDOUT: specific @I.WithSelf(constants.%.Self) {
  1070. // CHECK:STDOUT: !definition:
  1071. // CHECK:STDOUT: }
  1072. // CHECK:STDOUT:
  1073. // CHECK:STDOUT: --- associated_const_of_parameterized.carbon
  1074. // CHECK:STDOUT:
  1075. // CHECK:STDOUT: constants {
  1076. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1077. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  1078. // CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete]
  1079. // CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic]
  1080. // CHECK:STDOUT: %I.type.609: type = generic_interface_type @I [concrete]
  1081. // CHECK:STDOUT: %I.generic: %I.type.609 = struct_value () [concrete]
  1082. // CHECK:STDOUT: %I.type.1ab: type = facet_type <@I, @I(%U)> [symbolic]
  1083. // CHECK:STDOUT: %Self.fdb: %I.type.1ab = symbolic_binding Self, 1 [symbolic]
  1084. // CHECK:STDOUT: %I.assoc_type.76c: type = assoc_entity_type @I, @I(%U) [symbolic]
  1085. // CHECK:STDOUT: %assoc0.eea: %I.assoc_type.76c = assoc_entity element0, @I.WithSelf.%T [symbolic]
  1086. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1087. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  1088. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1089. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1090. // CHECK:STDOUT: %I.type.807: type = facet_type <@I, @I(%C)> [concrete]
  1091. // CHECK:STDOUT: %.Self.9dc: %I.type.807 = symbolic_binding .Self [symbolic_self]
  1092. // CHECK:STDOUT: %Self.b60: %I.type.807 = symbolic_binding Self, 1 [symbolic]
  1093. // CHECK:STDOUT: %I.assoc_type.2e0: type = assoc_entity_type @I, @I(%C) [concrete]
  1094. // CHECK:STDOUT: %assoc0.501: %I.assoc_type.2e0 = assoc_entity element0, @I.WithSelf.%T [concrete]
  1095. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.9dc [symbolic_self]
  1096. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.9dc, @I, @I(%C) [symbolic_self]
  1097. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1098. // CHECK:STDOUT: %I_where.type: type = facet_type <@I, @I(%C) where %impl.elem0 = %C> [concrete]
  1099. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @D.as.I.impl.%I.impl_witness_table [concrete]
  1100. // CHECK:STDOUT: %I.facet: %I.type.807 = facet_value %D, (%I.impl_witness) [concrete]
  1101. // CHECK:STDOUT: }
  1102. // CHECK:STDOUT:
  1103. // CHECK:STDOUT: imports {
  1104. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1105. // CHECK:STDOUT: import Core//prelude
  1106. // CHECK:STDOUT: import Core//prelude/...
  1107. // CHECK:STDOUT: }
  1108. // CHECK:STDOUT: }
  1109. // CHECK:STDOUT:
  1110. // CHECK:STDOUT: file {
  1111. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1112. // CHECK:STDOUT: .Core = imports.%Core
  1113. // CHECK:STDOUT: .I = %I.decl
  1114. // CHECK:STDOUT: .C = %C.decl.loc6
  1115. // CHECK:STDOUT: .D = %D.decl
  1116. // CHECK:STDOUT: }
  1117. // CHECK:STDOUT: %Core.import = import Core
  1118. // CHECK:STDOUT: %I.decl: %I.type.609 = interface_decl @I [concrete = constants.%I.generic] {
  1119. // CHECK:STDOUT: %U.patt: %pattern_type = symbolic_binding_pattern U, 0 [concrete]
  1120. // CHECK:STDOUT: } {
  1121. // CHECK:STDOUT: %.loc3_17.1: type = splice_block %.loc3_17.2 [concrete = type] {
  1122. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  1123. // CHECK:STDOUT: %.loc3_17.2: type = type_literal type [concrete = type]
  1124. // CHECK:STDOUT: }
  1125. // CHECK:STDOUT: %U.loc3_14.2: type = symbolic_binding U, 0 [symbolic = %U.loc3_14.1 (constants.%U)]
  1126. // CHECK:STDOUT: }
  1127. // CHECK:STDOUT: %C.decl.loc6: type = class_decl @C [concrete = constants.%C] {} {}
  1128. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1129. // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {} {
  1130. // CHECK:STDOUT: %D.ref.loc8: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1131. // CHECK:STDOUT: %I.ref.loc8: %I.type.609 = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  1132. // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1133. // CHECK:STDOUT: %I.type.loc8: type = facet_type <@I, @I(constants.%C)> [concrete = constants.%I.type.807]
  1134. // CHECK:STDOUT: %.Self.2: %I.type.807 = symbolic_binding .Self [symbolic_self = constants.%.Self.9dc]
  1135. // CHECK:STDOUT: %.Self.ref.loc8: %I.type.807 = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.9dc]
  1136. // CHECK:STDOUT: %.Self.as_type.loc8: type = facet_access_type %.Self.ref.loc8 [symbolic_self = constants.%.Self.as_type]
  1137. // CHECK:STDOUT: %.loc8_22.1: type = converted %.Self.ref.loc8, %.Self.as_type.loc8 [symbolic_self = constants.%.Self.as_type]
  1138. // CHECK:STDOUT: %.loc8_22.2: %I.assoc_type.2e0 = specific_constant @T.%assoc0, @I.WithSelf(constants.%C, constants.%.Self.9dc) [concrete = constants.%assoc0.501]
  1139. // CHECK:STDOUT: %T.ref.loc8: %I.assoc_type.2e0 = name_ref T, %.loc8_22.2 [concrete = constants.%assoc0.501]
  1140. // CHECK:STDOUT: %impl.elem0.loc8: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1141. // CHECK:STDOUT: %C.ref.loc8_27: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1142. // CHECK:STDOUT: %.loc8_16: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  1143. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type.807
  1144. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %C.ref.loc8_27
  1145. // CHECK:STDOUT: }
  1146. // CHECK:STDOUT: }
  1147. // CHECK:STDOUT: %C.decl.loc10: type = class_decl @C [concrete = constants.%C] {} {}
  1148. // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {} {
  1149. // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1150. // CHECK:STDOUT: %I.ref.loc11: %I.type.609 = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  1151. // CHECK:STDOUT: %C.ref.loc11_13: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1152. // CHECK:STDOUT: %I.type.loc11: type = facet_type <@I, @I(constants.%C)> [concrete = constants.%I.type.807]
  1153. // CHECK:STDOUT: %.Self.1: %I.type.807 = symbolic_binding .Self [symbolic_self = constants.%.Self.9dc]
  1154. // CHECK:STDOUT: %.Self.ref.loc11: %I.type.807 = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self.9dc]
  1155. // CHECK:STDOUT: %.Self.as_type.loc11: type = facet_access_type %.Self.ref.loc11 [symbolic_self = constants.%.Self.as_type]
  1156. // CHECK:STDOUT: %.loc11_22.1: type = converted %.Self.ref.loc11, %.Self.as_type.loc11 [symbolic_self = constants.%.Self.as_type]
  1157. // CHECK:STDOUT: %.loc11_22.2: %I.assoc_type.2e0 = specific_constant @T.%assoc0, @I.WithSelf(constants.%C, constants.%.Self.9dc) [concrete = constants.%assoc0.501]
  1158. // CHECK:STDOUT: %T.ref.loc11: %I.assoc_type.2e0 = name_ref T, %.loc11_22.2 [concrete = constants.%assoc0.501]
  1159. // CHECK:STDOUT: %impl.elem0.loc11: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1160. // CHECK:STDOUT: %C.ref.loc11_27: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1161. // CHECK:STDOUT: %.loc11_16: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  1162. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type.807
  1163. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11, %C.ref.loc11_27
  1164. // CHECK:STDOUT: }
  1165. // CHECK:STDOUT: }
  1166. // CHECK:STDOUT: }
  1167. // CHECK:STDOUT:
  1168. // CHECK:STDOUT: generic interface @I(%U.loc3_14.2: type) {
  1169. // CHECK:STDOUT: %U.loc3_14.1: type = symbolic_binding U, 0 [symbolic = %U.loc3_14.1 (constants.%U)]
  1170. // CHECK:STDOUT:
  1171. // CHECK:STDOUT: !definition:
  1172. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U.loc3_14.1)> [symbolic = %I.type (constants.%I.type.1ab)]
  1173. // CHECK:STDOUT: %Self.loc3_23.2: @I.%I.type (%I.type.1ab) = symbolic_binding Self, 1 [symbolic = %Self.loc3_23.2 (constants.%Self.fdb)]
  1174. // CHECK:STDOUT:
  1175. // CHECK:STDOUT: interface {
  1176. // CHECK:STDOUT: %Self.loc3_23.1: @I.%I.type (%I.type.1ab) = symbolic_binding Self, 1 [symbolic = %Self.loc3_23.2 (constants.%Self.fdb)]
  1177. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  1178. // CHECK:STDOUT:
  1179. // CHECK:STDOUT: !with Self:
  1180. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  1181. // CHECK:STDOUT: %assoc0: @I.WithSelf.%I.assoc_type (%I.assoc_type.76c) = assoc_entity element0, @I.WithSelf.%T [symbolic = @I.WithSelf.%assoc0 (constants.%assoc0.eea)]
  1182. // CHECK:STDOUT: }
  1183. // CHECK:STDOUT:
  1184. // CHECK:STDOUT: !members:
  1185. // CHECK:STDOUT: .Self = %Self.loc3_23.1
  1186. // CHECK:STDOUT: .T = @T.%assoc0
  1187. // CHECK:STDOUT: witness = (@I.WithSelf.%T)
  1188. // CHECK:STDOUT:
  1189. // CHECK:STDOUT: !requires:
  1190. // CHECK:STDOUT: }
  1191. // CHECK:STDOUT: }
  1192. // CHECK:STDOUT:
  1193. // CHECK:STDOUT: impl @D.as.I.impl: %D.ref.loc8 as %.loc8_16 {
  1194. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @D.as.I.impl [concrete]
  1195. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1196. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C]
  1197. // CHECK:STDOUT:
  1198. // CHECK:STDOUT: !members:
  1199. // CHECK:STDOUT: witness = %I.impl_witness
  1200. // CHECK:STDOUT: }
  1201. // CHECK:STDOUT:
  1202. // CHECK:STDOUT: class @C {
  1203. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1204. // CHECK:STDOUT: complete_type_witness = %complete_type
  1205. // CHECK:STDOUT:
  1206. // CHECK:STDOUT: !members:
  1207. // CHECK:STDOUT: .Self = constants.%C
  1208. // CHECK:STDOUT: }
  1209. // CHECK:STDOUT:
  1210. // CHECK:STDOUT: class @D {
  1211. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1212. // CHECK:STDOUT: complete_type_witness = %complete_type
  1213. // CHECK:STDOUT:
  1214. // CHECK:STDOUT: !members:
  1215. // CHECK:STDOUT: .Self = constants.%D
  1216. // CHECK:STDOUT: }
  1217. // CHECK:STDOUT:
  1218. // CHECK:STDOUT: specific @I(constants.%U) {
  1219. // CHECK:STDOUT: %U.loc3_14.1 => constants.%U
  1220. // CHECK:STDOUT: }
  1221. // CHECK:STDOUT:
  1222. // CHECK:STDOUT: specific @I.WithSelf(constants.%U, constants.%Self.fdb) {}
  1223. // CHECK:STDOUT:
  1224. // CHECK:STDOUT: specific @I(constants.%C) {
  1225. // CHECK:STDOUT: %U.loc3_14.1 => constants.%C
  1226. // CHECK:STDOUT:
  1227. // CHECK:STDOUT: !definition:
  1228. // CHECK:STDOUT: %I.type => constants.%I.type.807
  1229. // CHECK:STDOUT: %Self.loc3_23.2 => constants.%Self.b60
  1230. // CHECK:STDOUT: }
  1231. // CHECK:STDOUT:
  1232. // CHECK:STDOUT: specific @I.WithSelf(constants.%C, constants.%Self.fdb) {
  1233. // CHECK:STDOUT: !definition:
  1234. // CHECK:STDOUT: %U => constants.%C
  1235. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.2e0
  1236. // CHECK:STDOUT: %assoc0 => constants.%assoc0.501
  1237. // CHECK:STDOUT: }
  1238. // CHECK:STDOUT:
  1239. // CHECK:STDOUT: specific @I.WithSelf(constants.%C, constants.%.Self.9dc) {
  1240. // CHECK:STDOUT: !definition:
  1241. // CHECK:STDOUT: %U => constants.%C
  1242. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.2e0
  1243. // CHECK:STDOUT: %assoc0 => constants.%assoc0.501
  1244. // CHECK:STDOUT: }
  1245. // CHECK:STDOUT:
  1246. // CHECK:STDOUT: specific @I.WithSelf(constants.%C, constants.%I.facet) {
  1247. // CHECK:STDOUT: !definition:
  1248. // CHECK:STDOUT: %U => constants.%C
  1249. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.2e0
  1250. // CHECK:STDOUT: %assoc0 => constants.%assoc0.501
  1251. // CHECK:STDOUT: }
  1252. // CHECK:STDOUT:
  1253. // CHECK:STDOUT: --- find_incomplete_impl.carbon
  1254. // CHECK:STDOUT:
  1255. // CHECK:STDOUT: constants {
  1256. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1257. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  1258. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1259. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1260. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @D.as.I.impl.%I.impl_witness_table [concrete]
  1261. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1262. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1263. // CHECK:STDOUT: %pattern_type.9d9: type = pattern_type %I.type [concrete]
  1264. // CHECK:STDOUT: %T: %I.type = symbolic_binding T, 0 [symbolic]
  1265. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  1266. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  1267. // CHECK:STDOUT: %C.bba: type = class_type @C, @C(%T) [symbolic]
  1268. // CHECK:STDOUT: %I.facet: %I.type = facet_value %D, (%I.impl_witness) [concrete]
  1269. // CHECK:STDOUT: %C.229: type = class_type @C, @C(%I.facet) [concrete]
  1270. // CHECK:STDOUT: %pattern_type.b40: type = pattern_type %C.229 [concrete]
  1271. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1272. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1273. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  1274. // CHECK:STDOUT: }
  1275. // CHECK:STDOUT:
  1276. // CHECK:STDOUT: imports {
  1277. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1278. // CHECK:STDOUT: import Core//prelude
  1279. // CHECK:STDOUT: import Core//prelude/...
  1280. // CHECK:STDOUT: }
  1281. // CHECK:STDOUT: }
  1282. // CHECK:STDOUT:
  1283. // CHECK:STDOUT: file {
  1284. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1285. // CHECK:STDOUT: .Core = imports.%Core
  1286. // CHECK:STDOUT: .I = %I.decl.loc3
  1287. // CHECK:STDOUT: .D = %D.decl
  1288. // CHECK:STDOUT: .C = %C.decl.loc6
  1289. // CHECK:STDOUT: .F = %F.decl.loc8
  1290. // CHECK:STDOUT: }
  1291. // CHECK:STDOUT: %Core.import = import Core
  1292. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1293. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1294. // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {} {
  1295. // CHECK:STDOUT: %D.ref.loc5: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1296. // CHECK:STDOUT: %I.ref.loc5: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1297. // CHECK:STDOUT: }
  1298. // CHECK:STDOUT: %C.decl.loc6: %C.type = class_decl @C [concrete = constants.%C.generic] {
  1299. // CHECK:STDOUT: %T.patt: %pattern_type.9d9 = symbolic_binding_pattern T, 0 [concrete]
  1300. // CHECK:STDOUT: } {
  1301. // CHECK:STDOUT: %.loc6: type = splice_block %I.ref.loc6 [concrete = constants.%I.type] {
  1302. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1303. // CHECK:STDOUT: %I.ref.loc6: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1304. // CHECK:STDOUT: }
  1305. // CHECK:STDOUT: %T.loc6_10.2: %I.type = symbolic_binding T, 0 [symbolic = %T.loc6_10.1 (constants.%T)]
  1306. // CHECK:STDOUT: }
  1307. // CHECK:STDOUT: %F.decl.loc8: %F.type = fn_decl @F [concrete = constants.%F] {
  1308. // CHECK:STDOUT: %x.param_patt: %pattern_type.b40 = value_param_pattern [concrete]
  1309. // CHECK:STDOUT: %x.patt: %pattern_type.b40 = at_binding_pattern x, %x.param_patt [concrete]
  1310. // CHECK:STDOUT: } {
  1311. // CHECK:STDOUT: %x.param.loc8: %C.229 = value_param call_param0
  1312. // CHECK:STDOUT: %.loc8_12.1: type = splice_block %C.loc8 [concrete = constants.%C.229] {
  1313. // CHECK:STDOUT: %C.ref.loc8: %C.type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C.generic]
  1314. // CHECK:STDOUT: %D.ref.loc8: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1315. // CHECK:STDOUT: %I.facet.loc8: %I.type = facet_value %D.ref.loc8, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  1316. // CHECK:STDOUT: %.loc8_12.2: %I.type = converted %D.ref.loc8, %I.facet.loc8 [concrete = constants.%I.facet]
  1317. // CHECK:STDOUT: %C.loc8: type = class_type @C, @C(constants.%I.facet) [concrete = constants.%C.229]
  1318. // CHECK:STDOUT: }
  1319. // CHECK:STDOUT: %x.loc8: %C.229 = value_binding x, %x.param.loc8
  1320. // CHECK:STDOUT: }
  1321. // CHECK:STDOUT: %I.decl.loc10: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1322. // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {} {
  1323. // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1324. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1325. // CHECK:STDOUT: }
  1326. // CHECK:STDOUT: %C.decl.loc12: %C.type = class_decl @C [concrete = constants.%C.generic] {
  1327. // CHECK:STDOUT: %T.patt: %pattern_type.9d9 = symbolic_binding_pattern T, 0 [concrete]
  1328. // CHECK:STDOUT: } {
  1329. // CHECK:STDOUT: %.loc12: type = splice_block %I.ref.loc12 [concrete = constants.%I.type] {
  1330. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1331. // CHECK:STDOUT: %I.ref.loc12: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1332. // CHECK:STDOUT: }
  1333. // CHECK:STDOUT: %T.loc12: %I.type = symbolic_binding T, 0 [symbolic = %T.loc6_10.1 (constants.%T)]
  1334. // CHECK:STDOUT: }
  1335. // CHECK:STDOUT: %F.decl.loc14: %F.type = fn_decl @F [concrete = constants.%F] {
  1336. // CHECK:STDOUT: %x.param_patt: %pattern_type.b40 = value_param_pattern [concrete]
  1337. // CHECK:STDOUT: %x.patt: %pattern_type.b40 = at_binding_pattern x, %x.param_patt [concrete]
  1338. // CHECK:STDOUT: } {
  1339. // CHECK:STDOUT: %x.param.loc14: %C.229 = value_param call_param0
  1340. // CHECK:STDOUT: %.loc14_19.1: type = splice_block %C.loc14 [concrete = constants.%C.229] {
  1341. // CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C.generic]
  1342. // CHECK:STDOUT: %D.ref.loc14: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1343. // CHECK:STDOUT: %I.facet.loc14: %I.type = facet_value %D.ref.loc14, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  1344. // CHECK:STDOUT: %.loc14_19.2: %I.type = converted %D.ref.loc14, %I.facet.loc14 [concrete = constants.%I.facet]
  1345. // CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%I.facet) [concrete = constants.%C.229]
  1346. // CHECK:STDOUT: }
  1347. // CHECK:STDOUT: %x.loc14: %C.229 = value_binding x, %x.param.loc14
  1348. // CHECK:STDOUT: }
  1349. // CHECK:STDOUT: }
  1350. // CHECK:STDOUT:
  1351. // CHECK:STDOUT: interface @I {
  1352. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  1353. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  1354. // CHECK:STDOUT:
  1355. // CHECK:STDOUT: !members:
  1356. // CHECK:STDOUT: .Self = %Self
  1357. // CHECK:STDOUT: witness = ()
  1358. // CHECK:STDOUT:
  1359. // CHECK:STDOUT: !requires:
  1360. // CHECK:STDOUT: }
  1361. // CHECK:STDOUT:
  1362. // CHECK:STDOUT: impl @D.as.I.impl: %D.ref.loc5 as %I.ref.loc5 {
  1363. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @D.as.I.impl [concrete]
  1364. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1365. // CHECK:STDOUT:
  1366. // CHECK:STDOUT: !members:
  1367. // CHECK:STDOUT: witness = %I.impl_witness
  1368. // CHECK:STDOUT: }
  1369. // CHECK:STDOUT:
  1370. // CHECK:STDOUT: class @D {
  1371. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1372. // CHECK:STDOUT: complete_type_witness = %complete_type
  1373. // CHECK:STDOUT:
  1374. // CHECK:STDOUT: !members:
  1375. // CHECK:STDOUT: .Self = constants.%D
  1376. // CHECK:STDOUT: }
  1377. // CHECK:STDOUT:
  1378. // CHECK:STDOUT: generic class @C(%T.loc6_10.2: %I.type) {
  1379. // CHECK:STDOUT: %T.loc6_10.1: %I.type = symbolic_binding T, 0 [symbolic = %T.loc6_10.1 (constants.%T)]
  1380. // CHECK:STDOUT:
  1381. // CHECK:STDOUT: !definition:
  1382. // CHECK:STDOUT:
  1383. // CHECK:STDOUT: class {
  1384. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1385. // CHECK:STDOUT: complete_type_witness = %complete_type
  1386. // CHECK:STDOUT:
  1387. // CHECK:STDOUT: !members:
  1388. // CHECK:STDOUT: .Self = constants.%C.bba
  1389. // CHECK:STDOUT: }
  1390. // CHECK:STDOUT: }
  1391. // CHECK:STDOUT:
  1392. // CHECK:STDOUT: fn @F(%x.param.loc14: %C.229) {
  1393. // CHECK:STDOUT: !entry:
  1394. // CHECK:STDOUT: return
  1395. // CHECK:STDOUT: }
  1396. // CHECK:STDOUT:
  1397. // CHECK:STDOUT: specific @C(constants.%T) {
  1398. // CHECK:STDOUT: %T.loc6_10.1 => constants.%T
  1399. // CHECK:STDOUT: }
  1400. // CHECK:STDOUT:
  1401. // CHECK:STDOUT: specific @C(constants.%I.facet) {
  1402. // CHECK:STDOUT: %T.loc6_10.1 => constants.%I.facet
  1403. // CHECK:STDOUT:
  1404. // CHECK:STDOUT: !definition:
  1405. // CHECK:STDOUT: }
  1406. // CHECK:STDOUT:
  1407. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  1408. // CHECK:STDOUT: !definition:
  1409. // CHECK:STDOUT: }
  1410. // CHECK:STDOUT:
  1411. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  1412. // CHECK:STDOUT: !definition:
  1413. // CHECK:STDOUT: }
  1414. // CHECK:STDOUT:
  1415. // CHECK:STDOUT: --- fail_todo_two_interfaces.carbon
  1416. // CHECK:STDOUT:
  1417. // CHECK:STDOUT: constants {
  1418. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1419. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  1420. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1421. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  1422. // CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete]
  1423. // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete]
  1424. // CHECK:STDOUT: %BitAndWith.type.b10: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete]
  1425. // CHECK:STDOUT: %BitAndWith.impl_witness: <witness> = impl_witness imports.%BitAndWith.impl_witness_table [concrete]
  1426. // CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.b10 = facet_value type, (%BitAndWith.impl_witness) [concrete]
  1427. // CHECK:STDOUT: %BitAndWith.WithSelf.Op.type.4bd: type = fn_type @BitAndWith.WithSelf.Op, @BitAndWith.WithSelf(type, %BitAndWith.facet) [concrete]
  1428. // CHECK:STDOUT: %.d15: type = fn_type_with_self_type %BitAndWith.WithSelf.Op.type.4bd, %BitAndWith.facet [concrete]
  1429. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete]
  1430. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete]
  1431. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: <bound method> = bound_method %I.type, %type.as.BitAndWith.impl.Op [concrete]
  1432. // CHECK:STDOUT: %facet_type: type = facet_type <@I & @J> [concrete]
  1433. // CHECK:STDOUT: %Self.ab9: %I.type = symbolic_binding Self, 0 [symbolic]
  1434. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  1435. // CHECK:STDOUT: }
  1436. // CHECK:STDOUT:
  1437. // CHECK:STDOUT: imports {
  1438. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1439. // CHECK:STDOUT: .BitAndWith = %Core.BitAndWith
  1440. // CHECK:STDOUT: import Core//prelude
  1441. // CHECK:STDOUT: import Core//prelude/...
  1442. // CHECK:STDOUT: }
  1443. // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic]
  1444. // CHECK:STDOUT: %Core.import_ref.8d3: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op]
  1445. // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.8d3), @type.as.BitAndWith.impl [concrete]
  1446. // CHECK:STDOUT: }
  1447. // CHECK:STDOUT:
  1448. // CHECK:STDOUT: file {
  1449. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1450. // CHECK:STDOUT: .Core = imports.%Core
  1451. // CHECK:STDOUT: .I = %I.decl.loc3
  1452. // CHECK:STDOUT: .J = %J.decl.loc4
  1453. // CHECK:STDOUT: }
  1454. // CHECK:STDOUT: %Core.import = import Core
  1455. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1456. // CHECK:STDOUT: %J.decl.loc4: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1457. // CHECK:STDOUT: %.loc10_14.1: type = value_of_initializer @empty_struct_type.as.<error>.impl.%type.as.BitAndWith.impl.Op.call [concrete = constants.%facet_type]
  1458. // CHECK:STDOUT: %.loc10_14.2: type = converted @empty_struct_type.as.<error>.impl.%type.as.BitAndWith.impl.Op.call, %.loc10_14.1 [concrete = constants.%facet_type]
  1459. // CHECK:STDOUT: impl_decl @empty_struct_type.as.<error>.impl [concrete] {} {
  1460. // CHECK:STDOUT: %.loc10_7.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1461. // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1462. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1463. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl.loc4 [concrete = constants.%J.type]
  1464. // CHECK:STDOUT: %impl.elem0: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1465. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %I.ref, %impl.elem0 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1466. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call: init type = call %bound_method(%I.ref, %J.ref) [concrete = constants.%facet_type]
  1467. // CHECK:STDOUT: }
  1468. // CHECK:STDOUT: %I.decl.loc12: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1469. // CHECK:STDOUT: %J.decl.loc13: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1470. // CHECK:STDOUT: }
  1471. // CHECK:STDOUT:
  1472. // CHECK:STDOUT: interface @I {
  1473. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.ab9]
  1474. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  1475. // CHECK:STDOUT:
  1476. // CHECK:STDOUT: !members:
  1477. // CHECK:STDOUT: .Self = %Self
  1478. // CHECK:STDOUT: witness = ()
  1479. // CHECK:STDOUT:
  1480. // CHECK:STDOUT: !requires:
  1481. // CHECK:STDOUT: }
  1482. // CHECK:STDOUT:
  1483. // CHECK:STDOUT: interface @J {
  1484. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  1485. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  1486. // CHECK:STDOUT:
  1487. // CHECK:STDOUT: !members:
  1488. // CHECK:STDOUT: .Self = %Self
  1489. // CHECK:STDOUT: witness = ()
  1490. // CHECK:STDOUT:
  1491. // CHECK:STDOUT: !requires:
  1492. // CHECK:STDOUT: }
  1493. // CHECK:STDOUT:
  1494. // CHECK:STDOUT: impl @empty_struct_type.as.<error>.impl: %.loc10_7.2 as file.%.loc10_14.2;
  1495. // CHECK:STDOUT:
  1496. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self.ab9) {}
  1497. // CHECK:STDOUT:
  1498. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self.8a1) {}
  1499. // CHECK:STDOUT:
  1500. // CHECK:STDOUT: --- fail_never_assigned_associated_const.carbon
  1501. // CHECK:STDOUT:
  1502. // CHECK:STDOUT: constants {
  1503. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1504. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  1505. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1506. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete]
  1507. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.WithSelf.%U [concrete]
  1508. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1509. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1510. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1511. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  1512. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1513. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  1514. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  1515. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1516. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  1517. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  1518. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete]
  1519. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  1520. // CHECK:STDOUT: }
  1521. // CHECK:STDOUT:
  1522. // CHECK:STDOUT: imports {
  1523. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1524. // CHECK:STDOUT: import Core//prelude
  1525. // CHECK:STDOUT: import Core//prelude/...
  1526. // CHECK:STDOUT: }
  1527. // CHECK:STDOUT: }
  1528. // CHECK:STDOUT:
  1529. // CHECK:STDOUT: file {
  1530. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1531. // CHECK:STDOUT: .Core = imports.%Core
  1532. // CHECK:STDOUT: .I = %I.decl
  1533. // CHECK:STDOUT: .C = %C.decl
  1534. // CHECK:STDOUT: }
  1535. // CHECK:STDOUT: %Core.import = import Core
  1536. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1537. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1538. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  1539. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1540. // CHECK:STDOUT: %I.ref.loc9: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1541. // CHECK:STDOUT: %.Self.2: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1542. // CHECK:STDOUT: %.Self.ref.loc9: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  1543. // CHECK:STDOUT: %.Self.as_type.loc9: type = facet_access_type %.Self.ref.loc9 [symbolic_self = constants.%.Self.as_type]
  1544. // CHECK:STDOUT: %.loc9_19: type = converted %.Self.ref.loc9, %.Self.as_type.loc9 [symbolic_self = constants.%.Self.as_type]
  1545. // CHECK:STDOUT: %T.ref.loc9: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  1546. // CHECK:STDOUT: %impl.elem0.loc9: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1547. // CHECK:STDOUT: %.loc9_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  1548. // CHECK:STDOUT: %.loc9_25.2: type = converted %.loc9_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1549. // CHECK:STDOUT: %.loc9_13: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  1550. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1551. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9, %.loc9_25.2
  1552. // CHECK:STDOUT: }
  1553. // CHECK:STDOUT: }
  1554. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  1555. // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1556. // CHECK:STDOUT: %I.ref.loc18: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1557. // CHECK:STDOUT: %.Self.1: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1558. // CHECK:STDOUT: %.Self.ref.loc18: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  1559. // CHECK:STDOUT: %.Self.as_type.loc18: type = facet_access_type %.Self.ref.loc18 [symbolic_self = constants.%.Self.as_type]
  1560. // CHECK:STDOUT: %.loc18_19: type = converted %.Self.ref.loc18, %.Self.as_type.loc18 [symbolic_self = constants.%.Self.as_type]
  1561. // CHECK:STDOUT: %T.ref.loc18: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  1562. // CHECK:STDOUT: %impl.elem0.loc18: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1563. // CHECK:STDOUT: %.loc18_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  1564. // CHECK:STDOUT: %.loc18_25.2: type = converted %.loc18_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1565. // CHECK:STDOUT: %.loc18_13: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  1566. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1567. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc18, %.loc18_25.2
  1568. // CHECK:STDOUT: }
  1569. // CHECK:STDOUT: }
  1570. // CHECK:STDOUT: }
  1571. // CHECK:STDOUT:
  1572. // CHECK:STDOUT: interface @I {
  1573. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  1574. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  1575. // CHECK:STDOUT:
  1576. // CHECK:STDOUT: !with Self:
  1577. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  1578. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete = constants.%assoc0]
  1579. // CHECK:STDOUT: }
  1580. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1581. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.WithSelf.%U [concrete = constants.%assoc1]
  1582. // CHECK:STDOUT: }
  1583. // CHECK:STDOUT:
  1584. // CHECK:STDOUT: !members:
  1585. // CHECK:STDOUT: .Self = %Self
  1586. // CHECK:STDOUT: .T = @T.%assoc0
  1587. // CHECK:STDOUT: .U = @U.%assoc1
  1588. // CHECK:STDOUT: witness = (@I.WithSelf.%T, @I.WithSelf.%U)
  1589. // CHECK:STDOUT:
  1590. // CHECK:STDOUT: !requires:
  1591. // CHECK:STDOUT: }
  1592. // CHECK:STDOUT:
  1593. // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc9 as %.loc9_13 {
  1594. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, <error>), @C.as.I.impl [concrete]
  1595. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1596. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1597. // CHECK:STDOUT:
  1598. // CHECK:STDOUT: !members:
  1599. // CHECK:STDOUT: witness = %I.impl_witness
  1600. // CHECK:STDOUT: }
  1601. // CHECK:STDOUT:
  1602. // CHECK:STDOUT: class @C {
  1603. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1604. // CHECK:STDOUT: complete_type_witness = %complete_type
  1605. // CHECK:STDOUT:
  1606. // CHECK:STDOUT: !members:
  1607. // CHECK:STDOUT: .Self = constants.%C
  1608. // CHECK:STDOUT: }
  1609. // CHECK:STDOUT:
  1610. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  1611. // CHECK:STDOUT: !definition:
  1612. // CHECK:STDOUT: }
  1613. // CHECK:STDOUT:
  1614. // CHECK:STDOUT: specific @I.WithSelf(constants.%.Self) {
  1615. // CHECK:STDOUT: !definition:
  1616. // CHECK:STDOUT: }
  1617. // CHECK:STDOUT:
  1618. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  1619. // CHECK:STDOUT: !definition:
  1620. // CHECK:STDOUT: }
  1621. // CHECK:STDOUT:
  1622. // CHECK:STDOUT: --- example_from_proposal_5168.carbon
  1623. // CHECK:STDOUT:
  1624. // CHECK:STDOUT: constants {
  1625. // CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
  1626. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1627. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1628. // CHECK:STDOUT: %pattern_type.b4b: type = pattern_type %X.type [concrete]
  1629. // CHECK:STDOUT: %_: %X.type = symbolic_binding _, 0 [symbolic]
  1630. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1631. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1632. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1633. // CHECK:STDOUT: %U: %X.type = symbolic_binding U, 0 [symbolic]
  1634. // CHECK:STDOUT: %U.as_type: type = facet_access_type %U [symbolic]
  1635. // CHECK:STDOUT: %pattern_type.78b: type = pattern_type %U.as_type [symbolic]
  1636. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1637. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1638. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1639. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness @C.as.X.impl.%X.impl_witness_table [concrete]
  1640. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  1641. // CHECK:STDOUT: %Self.e52: %X.type = symbolic_binding Self, 0 [symbolic]
  1642. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1643. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1644. // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete]
  1645. // CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
  1646. // CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
  1647. // CHECK:STDOUT: %X.facet: %X.type = facet_value %C, (%X.impl_witness) [concrete]
  1648. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%X.facet) [concrete]
  1649. // CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G, @G(%X.facet) [concrete]
  1650. // CHECK:STDOUT: %Self.162: %Y.type = symbolic_binding Self, 0 [symbolic]
  1651. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %U.as_type [symbolic]
  1652. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness @C.as.Y.impl.%Y.impl_witness_table [concrete]
  1653. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %C, (%Y.impl_witness) [concrete]
  1654. // CHECK:STDOUT: }
  1655. // CHECK:STDOUT:
  1656. // CHECK:STDOUT: imports {
  1657. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1658. // CHECK:STDOUT: import Core//prelude
  1659. // CHECK:STDOUT: import Core//prelude/...
  1660. // CHECK:STDOUT: }
  1661. // CHECK:STDOUT: }
  1662. // CHECK:STDOUT:
  1663. // CHECK:STDOUT: file {
  1664. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1665. // CHECK:STDOUT: .Core = imports.%Core
  1666. // CHECK:STDOUT: .X = %X.decl.loc3
  1667. // CHECK:STDOUT: .F = %F.decl.loc6
  1668. // CHECK:STDOUT: .G = %G.decl.loc7
  1669. // CHECK:STDOUT: .C = %C.decl.loc9
  1670. // CHECK:STDOUT: .Y = %Y.decl.loc14
  1671. // CHECK:STDOUT: .H = %H.decl
  1672. // CHECK:STDOUT: }
  1673. // CHECK:STDOUT: %Core.import = import Core
  1674. // CHECK:STDOUT: %X.decl.loc3: type = interface_decl @X [concrete = constants.%X.type] {} {}
  1675. // CHECK:STDOUT: %F.decl.loc6: %F.type = fn_decl @F [concrete = constants.%F] {
  1676. // CHECK:STDOUT: %_.patt: %pattern_type.b4b = symbolic_binding_pattern _, 0 [concrete]
  1677. // CHECK:STDOUT: } {
  1678. // CHECK:STDOUT: %.loc6: type = splice_block %X.ref.loc6 [concrete = constants.%X.type] {
  1679. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1680. // CHECK:STDOUT: %X.ref.loc6: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1681. // CHECK:STDOUT: }
  1682. // CHECK:STDOUT: %_.loc6_7.2: %X.type = symbolic_binding _, 0 [symbolic = %_.loc6_7.1 (constants.%_)]
  1683. // CHECK:STDOUT: }
  1684. // CHECK:STDOUT: %G.decl.loc7: %G.type = fn_decl @G [concrete = constants.%G] {
  1685. // CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete]
  1686. // CHECK:STDOUT: %u.param_patt: @G.%pattern_type (%pattern_type.78b) = value_param_pattern [concrete]
  1687. // CHECK:STDOUT: %u.patt: @G.%pattern_type (%pattern_type.78b) = at_binding_pattern u, %u.param_patt [concrete]
  1688. // CHECK:STDOUT: } {
  1689. // CHECK:STDOUT: %.loc7_10: type = splice_block %X.ref.loc7 [concrete = constants.%X.type] {
  1690. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1691. // CHECK:STDOUT: %X.ref.loc7: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1692. // CHECK:STDOUT: }
  1693. // CHECK:STDOUT: %U.loc7_7.2: %X.type = symbolic_binding U, 0 [symbolic = %U.loc7_7.1 (constants.%U)]
  1694. // CHECK:STDOUT: %u.param.loc7: @G.%U.as_type.loc7_16.1 (%U.as_type) = value_param call_param0
  1695. // CHECK:STDOUT: %.loc7_16.1: type = splice_block %.loc7_16.2 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)] {
  1696. // CHECK:STDOUT: %U.ref.loc7: %X.type = name_ref U, %U.loc7_7.2 [symbolic = %U.loc7_7.1 (constants.%U)]
  1697. // CHECK:STDOUT: %U.as_type.loc7_16.2: type = facet_access_type %U.ref.loc7 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)]
  1698. // CHECK:STDOUT: %.loc7_16.2: type = converted %U.ref.loc7, %U.as_type.loc7_16.2 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)]
  1699. // CHECK:STDOUT: }
  1700. // CHECK:STDOUT: %u.loc7: @G.%U.as_type.loc7_16.1 (%U.as_type) = value_binding u, %u.param.loc7
  1701. // CHECK:STDOUT: }
  1702. // CHECK:STDOUT: %C.decl.loc9: type = class_decl @C [concrete = constants.%C] {} {}
  1703. // CHECK:STDOUT: impl_decl @C.as.X.impl [concrete] {} {
  1704. // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1705. // CHECK:STDOUT: %X.ref.loc12: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1706. // CHECK:STDOUT: }
  1707. // CHECK:STDOUT: %Y.decl.loc14: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
  1708. // CHECK:STDOUT: %X.decl.loc16: type = interface_decl @X [concrete = constants.%X.type] {} {}
  1709. // CHECK:STDOUT: %C.decl.loc23: type = class_decl @C [concrete = constants.%C] {} {}
  1710. // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {
  1711. // CHECK:STDOUT: %c.param_patt: %pattern_type.7c7 = value_param_pattern [concrete]
  1712. // CHECK:STDOUT: %c.patt: %pattern_type.7c7 = at_binding_pattern c, %c.param_patt [concrete]
  1713. // CHECK:STDOUT: } {
  1714. // CHECK:STDOUT: %c.param: %C = value_param call_param0
  1715. // CHECK:STDOUT: %C.ref.loc25: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1716. // CHECK:STDOUT: %c: %C = value_binding c, %c.param
  1717. // CHECK:STDOUT: }
  1718. // CHECK:STDOUT: %Y.decl.loc33: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
  1719. // CHECK:STDOUT: %F.decl.loc34: %F.type = fn_decl @F [concrete = constants.%F] {
  1720. // CHECK:STDOUT: %_.patt: %pattern_type.b4b = symbolic_binding_pattern _, 0 [concrete]
  1721. // CHECK:STDOUT: } {
  1722. // CHECK:STDOUT: %.loc34: type = splice_block %X.ref.loc34 [concrete = constants.%X.type] {
  1723. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1724. // CHECK:STDOUT: %X.ref.loc34: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1725. // CHECK:STDOUT: }
  1726. // CHECK:STDOUT: %_.loc34: %X.type = symbolic_binding _, 0 [symbolic = %_.loc6_7.1 (constants.%_)]
  1727. // CHECK:STDOUT: }
  1728. // CHECK:STDOUT: %G.decl.loc35: %G.type = fn_decl @G [concrete = constants.%G] {
  1729. // CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete]
  1730. // CHECK:STDOUT: %u.param_patt: @G.%pattern_type (%pattern_type.78b) = value_param_pattern [concrete]
  1731. // CHECK:STDOUT: %u.patt: @G.%pattern_type (%pattern_type.78b) = at_binding_pattern u, %u.param_patt [concrete]
  1732. // CHECK:STDOUT: } {
  1733. // CHECK:STDOUT: %.loc35_10: type = splice_block %X.ref.loc35 [concrete = constants.%X.type] {
  1734. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1735. // CHECK:STDOUT: %X.ref.loc35: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1736. // CHECK:STDOUT: }
  1737. // CHECK:STDOUT: %U.loc35: %X.type = symbolic_binding U, 0 [symbolic = %U.loc7_7.1 (constants.%U)]
  1738. // CHECK:STDOUT: %u.param.loc35: @G.%U.as_type.loc7_16.1 (%U.as_type) = value_param call_param0
  1739. // CHECK:STDOUT: %.loc35_23.1: type = splice_block %.loc35_23.2 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)] {
  1740. // CHECK:STDOUT: %U.ref.loc35: %X.type = name_ref U, %U.loc35 [symbolic = %U.loc7_7.1 (constants.%U)]
  1741. // CHECK:STDOUT: %U.as_type.loc35: type = facet_access_type %U.ref.loc35 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)]
  1742. // CHECK:STDOUT: %.loc35_23.2: type = converted %U.ref.loc35, %U.as_type.loc35 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)]
  1743. // CHECK:STDOUT: }
  1744. // CHECK:STDOUT: %u.loc35: @G.%U.as_type.loc7_16.1 (%U.as_type) = value_binding u, %u.param.loc35
  1745. // CHECK:STDOUT: }
  1746. // CHECK:STDOUT: impl_decl @C.as.Y.impl [concrete] {} {
  1747. // CHECK:STDOUT: %C.ref.loc36: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1748. // CHECK:STDOUT: %Y.ref.loc36: type = name_ref Y, file.%Y.decl.loc14 [concrete = constants.%Y.type]
  1749. // CHECK:STDOUT: }
  1750. // CHECK:STDOUT: impl_decl @C.as.X.impl [concrete] {} {
  1751. // CHECK:STDOUT: %C.ref.loc37: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1752. // CHECK:STDOUT: %X.ref.loc37: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1753. // CHECK:STDOUT: }
  1754. // CHECK:STDOUT: impl_decl @C.as.Y.impl [concrete] {} {
  1755. // CHECK:STDOUT: %C.ref.loc38: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1756. // CHECK:STDOUT: %Y.ref.loc38: type = name_ref Y, file.%Y.decl.loc14 [concrete = constants.%Y.type]
  1757. // CHECK:STDOUT: }
  1758. // CHECK:STDOUT: }
  1759. // CHECK:STDOUT:
  1760. // CHECK:STDOUT: interface @X {
  1761. // CHECK:STDOUT: %Self: %X.type = symbolic_binding Self, 0 [symbolic = constants.%Self.e52]
  1762. // CHECK:STDOUT: %X.WithSelf.decl = interface_with_self_decl @X [concrete]
  1763. // CHECK:STDOUT:
  1764. // CHECK:STDOUT: !members:
  1765. // CHECK:STDOUT: .Self = %Self
  1766. // CHECK:STDOUT: witness = ()
  1767. // CHECK:STDOUT:
  1768. // CHECK:STDOUT: !requires:
  1769. // CHECK:STDOUT: }
  1770. // CHECK:STDOUT:
  1771. // CHECK:STDOUT: interface @Y {
  1772. // CHECK:STDOUT: %Self: %Y.type = symbolic_binding Self, 0 [symbolic = constants.%Self.162]
  1773. // CHECK:STDOUT: %Y.WithSelf.decl = interface_with_self_decl @Y [concrete]
  1774. // CHECK:STDOUT:
  1775. // CHECK:STDOUT: !members:
  1776. // CHECK:STDOUT: .Self = %Self
  1777. // CHECK:STDOUT: witness = ()
  1778. // CHECK:STDOUT:
  1779. // CHECK:STDOUT: !requires:
  1780. // CHECK:STDOUT: }
  1781. // CHECK:STDOUT:
  1782. // CHECK:STDOUT: impl @C.as.X.impl: %C.ref.loc12 as %X.ref.loc12 {
  1783. // CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (), @C.as.X.impl [concrete]
  1784. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness]
  1785. // CHECK:STDOUT:
  1786. // CHECK:STDOUT: !members:
  1787. // CHECK:STDOUT: witness = %X.impl_witness
  1788. // CHECK:STDOUT: }
  1789. // CHECK:STDOUT:
  1790. // CHECK:STDOUT: impl @C.as.Y.impl: %C.ref.loc36 as %Y.ref.loc36 {
  1791. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @C.as.Y.impl [concrete]
  1792. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness]
  1793. // CHECK:STDOUT:
  1794. // CHECK:STDOUT: !members:
  1795. // CHECK:STDOUT: witness = %Y.impl_witness
  1796. // CHECK:STDOUT: }
  1797. // CHECK:STDOUT:
  1798. // CHECK:STDOUT: class @C {
  1799. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1800. // CHECK:STDOUT: complete_type_witness = %complete_type
  1801. // CHECK:STDOUT:
  1802. // CHECK:STDOUT: !members:
  1803. // CHECK:STDOUT: .Self = constants.%C
  1804. // CHECK:STDOUT: }
  1805. // CHECK:STDOUT:
  1806. // CHECK:STDOUT: generic fn @F(%_.loc6_7.2: %X.type) {
  1807. // CHECK:STDOUT: %_.loc6_7.1: %X.type = symbolic_binding _, 0 [symbolic = %_.loc6_7.1 (constants.%_)]
  1808. // CHECK:STDOUT:
  1809. // CHECK:STDOUT: !definition:
  1810. // CHECK:STDOUT:
  1811. // CHECK:STDOUT: fn() {
  1812. // CHECK:STDOUT: !entry:
  1813. // CHECK:STDOUT: return
  1814. // CHECK:STDOUT: }
  1815. // CHECK:STDOUT: }
  1816. // CHECK:STDOUT:
  1817. // CHECK:STDOUT: generic fn @G(%U.loc7_7.2: %X.type) {
  1818. // CHECK:STDOUT: %U.loc7_7.1: %X.type = symbolic_binding U, 0 [symbolic = %U.loc7_7.1 (constants.%U)]
  1819. // CHECK:STDOUT: %U.as_type.loc7_16.1: type = facet_access_type %U.loc7_7.1 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)]
  1820. // CHECK:STDOUT: %pattern_type: type = pattern_type %U.as_type.loc7_16.1 [symbolic = %pattern_type (constants.%pattern_type.78b)]
  1821. // CHECK:STDOUT:
  1822. // CHECK:STDOUT: !definition:
  1823. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %U.as_type.loc7_16.1 [symbolic = %require_complete (constants.%require_complete)]
  1824. // CHECK:STDOUT:
  1825. // CHECK:STDOUT: fn(%u.param.loc35: @G.%U.as_type.loc7_16.1 (%U.as_type)) {
  1826. // CHECK:STDOUT: !entry:
  1827. // CHECK:STDOUT: return
  1828. // CHECK:STDOUT: }
  1829. // CHECK:STDOUT: }
  1830. // CHECK:STDOUT:
  1831. // CHECK:STDOUT: fn @H(%c.param: %C) {
  1832. // CHECK:STDOUT: !entry:
  1833. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl.loc6 [concrete = constants.%F]
  1834. // CHECK:STDOUT: %C.ref.loc27: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1835. // CHECK:STDOUT: %X.facet.loc27: %X.type = facet_value %C.ref.loc27, (constants.%X.impl_witness) [concrete = constants.%X.facet]
  1836. // CHECK:STDOUT: %.loc27: %X.type = converted %C.ref.loc27, %X.facet.loc27 [concrete = constants.%X.facet]
  1837. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%X.facet) [concrete = constants.%F.specific_fn]
  1838. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
  1839. // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl.loc7 [concrete = constants.%G]
  1840. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  1841. // CHECK:STDOUT: %X.facet.loc28: %X.type = facet_value constants.%C, (constants.%X.impl_witness) [concrete = constants.%X.facet]
  1842. // CHECK:STDOUT: %.loc28: %X.type = converted constants.%C, %X.facet.loc28 [concrete = constants.%X.facet]
  1843. // CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G.ref, @G(constants.%X.facet) [concrete = constants.%G.specific_fn]
  1844. // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn(%c.ref)
  1845. // CHECK:STDOUT: return
  1846. // CHECK:STDOUT: }
  1847. // CHECK:STDOUT:
  1848. // CHECK:STDOUT: specific @F(constants.%_) {
  1849. // CHECK:STDOUT: %_.loc6_7.1 => constants.%_
  1850. // CHECK:STDOUT: }
  1851. // CHECK:STDOUT:
  1852. // CHECK:STDOUT: specific @G(constants.%U) {
  1853. // CHECK:STDOUT: %U.loc7_7.1 => constants.%U
  1854. // CHECK:STDOUT: %U.as_type.loc7_16.1 => constants.%U.as_type
  1855. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.78b
  1856. // CHECK:STDOUT: }
  1857. // CHECK:STDOUT:
  1858. // CHECK:STDOUT: specific @X.WithSelf(constants.%Self.e52) {
  1859. // CHECK:STDOUT: !definition:
  1860. // CHECK:STDOUT: }
  1861. // CHECK:STDOUT:
  1862. // CHECK:STDOUT: specific @F(constants.%X.facet) {
  1863. // CHECK:STDOUT: %_.loc6_7.1 => constants.%X.facet
  1864. // CHECK:STDOUT:
  1865. // CHECK:STDOUT: !definition:
  1866. // CHECK:STDOUT: }
  1867. // CHECK:STDOUT:
  1868. // CHECK:STDOUT: specific @G(constants.%X.facet) {
  1869. // CHECK:STDOUT: %U.loc7_7.1 => constants.%X.facet
  1870. // CHECK:STDOUT: %U.as_type.loc7_16.1 => constants.%C
  1871. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7c7
  1872. // CHECK:STDOUT:
  1873. // CHECK:STDOUT: !definition:
  1874. // CHECK:STDOUT: %require_complete => constants.%complete_type
  1875. // CHECK:STDOUT: }
  1876. // CHECK:STDOUT:
  1877. // CHECK:STDOUT: specific @Y.WithSelf(constants.%Self.162) {
  1878. // CHECK:STDOUT: !definition:
  1879. // CHECK:STDOUT: }
  1880. // CHECK:STDOUT:
  1881. // CHECK:STDOUT: specific @X.WithSelf(constants.%X.facet) {
  1882. // CHECK:STDOUT: !definition:
  1883. // CHECK:STDOUT: }
  1884. // CHECK:STDOUT:
  1885. // CHECK:STDOUT: specific @Y.WithSelf(constants.%Y.facet) {
  1886. // CHECK:STDOUT: !definition:
  1887. // CHECK:STDOUT: }
  1888. // CHECK:STDOUT:
  1889. // CHECK:STDOUT: --- fail_todo_impl_in_interface_definition.carbon
  1890. // CHECK:STDOUT:
  1891. // CHECK:STDOUT: constants {
  1892. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1893. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  1894. // CHECK:STDOUT: %I.WithSelf.F.type.08c: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self) [symbolic]
  1895. // CHECK:STDOUT: %I.WithSelf.F.705: %I.WithSelf.F.type.08c = struct_value () [symbolic]
  1896. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1897. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.F.decl [concrete]
  1898. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic]
  1899. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1900. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1901. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic]
  1902. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [symbolic]
  1903. // CHECK:STDOUT: %I.WithSelf.F.type.5dd: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet) [symbolic]
  1904. // CHECK:STDOUT: %I.WithSelf.F.f5e: %I.WithSelf.F.type.5dd = struct_value () [symbolic]
  1905. // CHECK:STDOUT: }
  1906. // CHECK:STDOUT:
  1907. // CHECK:STDOUT: imports {
  1908. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1909. // CHECK:STDOUT: import Core//prelude
  1910. // CHECK:STDOUT: import Core//prelude/...
  1911. // CHECK:STDOUT: }
  1912. // CHECK:STDOUT: }
  1913. // CHECK:STDOUT:
  1914. // CHECK:STDOUT: file {
  1915. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1916. // CHECK:STDOUT: .Core = imports.%Core
  1917. // CHECK:STDOUT: .I = %I.decl
  1918. // CHECK:STDOUT: }
  1919. // CHECK:STDOUT: %Core.import = import Core
  1920. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1921. // CHECK:STDOUT: }
  1922. // CHECK:STDOUT:
  1923. // CHECK:STDOUT: interface @I {
  1924. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  1925. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  1926. // CHECK:STDOUT:
  1927. // CHECK:STDOUT: !with Self:
  1928. // CHECK:STDOUT: %I.WithSelf.F.decl: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.08c) = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.705)] {} {}
  1929. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0]
  1930. // CHECK:STDOUT:
  1931. // CHECK:STDOUT: !members:
  1932. // CHECK:STDOUT: .Self = %Self
  1933. // CHECK:STDOUT: .I = <poisoned>
  1934. // CHECK:STDOUT: .F = @I.WithSelf.%assoc0
  1935. // CHECK:STDOUT: .I = <poisoned>
  1936. // CHECK:STDOUT: witness = (@I.WithSelf.%I.WithSelf.F.decl)
  1937. // CHECK:STDOUT:
  1938. // CHECK:STDOUT: !requires:
  1939. // CHECK:STDOUT: }
  1940. // CHECK:STDOUT:
  1941. // CHECK:STDOUT: generic impl @C.as.I.impl(@I.%Self: %I.type) {
  1942. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  1943. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  1944. // CHECK:STDOUT: %I.impl_witness.loc11_16.2: <witness> = impl_witness %I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness.loc11_16.2 (constants.%I.impl_witness)]
  1945. // CHECK:STDOUT:
  1946. // CHECK:STDOUT: !definition:
  1947. // CHECK:STDOUT:
  1948. // CHECK:STDOUT: impl: %C.ref.loc11 as %I.ref.loc11 {
  1949. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (<error>), @C.as.I.impl [concrete]
  1950. // CHECK:STDOUT: %I.impl_witness.loc11_16.1: <witness> = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Self) [symbolic = %I.impl_witness.loc11_16.2 (constants.%I.impl_witness)]
  1951. // CHECK:STDOUT:
  1952. // CHECK:STDOUT: !members:
  1953. // CHECK:STDOUT: .F = <poisoned>
  1954. // CHECK:STDOUT: witness = %I.impl_witness.loc11_16.1
  1955. // CHECK:STDOUT: }
  1956. // CHECK:STDOUT: }
  1957. // CHECK:STDOUT:
  1958. // CHECK:STDOUT: generic class @C(@I.%Self: %I.type) {
  1959. // CHECK:STDOUT: !definition:
  1960. // CHECK:STDOUT:
  1961. // CHECK:STDOUT: class {
  1962. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1963. // CHECK:STDOUT: complete_type_witness = %complete_type
  1964. // CHECK:STDOUT:
  1965. // CHECK:STDOUT: !members:
  1966. // CHECK:STDOUT: .Self = constants.%C
  1967. // CHECK:STDOUT: }
  1968. // CHECK:STDOUT: }
  1969. // CHECK:STDOUT:
  1970. // CHECK:STDOUT: generic fn @I.WithSelf.F(@I.%Self: %I.type) {
  1971. // CHECK:STDOUT: !definition:
  1972. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  1973. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  1974. // CHECK:STDOUT:
  1975. // CHECK:STDOUT: fn() {
  1976. // CHECK:STDOUT: !entry:
  1977. // CHECK:STDOUT: %C.decl: type = class_decl @C [symbolic = @I.WithSelf.F.%C (constants.%C)] {} {}
  1978. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  1979. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, @I.WithSelf.F.%C.decl [symbolic = %C (constants.%C)]
  1980. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1981. // CHECK:STDOUT: }
  1982. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  1983. // CHECK:STDOUT: %C.ref.loc20: type = name_ref C, @I.WithSelf.F.%C.decl [symbolic = %C (constants.%C)]
  1984. // CHECK:STDOUT: %I.ref.loc20: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1985. // CHECK:STDOUT: }
  1986. // CHECK:STDOUT: return
  1987. // CHECK:STDOUT: }
  1988. // CHECK:STDOUT: }
  1989. // CHECK:STDOUT:
  1990. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  1991. // CHECK:STDOUT: !definition:
  1992. // CHECK:STDOUT: %Self => constants.%Self
  1993. // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.08c
  1994. // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.705
  1995. // CHECK:STDOUT: }
  1996. // CHECK:STDOUT:
  1997. // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self) {}
  1998. // CHECK:STDOUT:
  1999. // CHECK:STDOUT: specific @C(constants.%Self) {}
  2000. // CHECK:STDOUT:
  2001. // CHECK:STDOUT: specific @C.as.I.impl(constants.%Self) {
  2002. // CHECK:STDOUT: %Self => constants.%Self
  2003. // CHECK:STDOUT: %C => constants.%C
  2004. // CHECK:STDOUT: %I.impl_witness.loc11_16.2 => constants.%I.impl_witness
  2005. // CHECK:STDOUT: }
  2006. // CHECK:STDOUT:
  2007. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  2008. // CHECK:STDOUT: !definition:
  2009. // CHECK:STDOUT: %Self => constants.%I.facet
  2010. // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.5dd
  2011. // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.f5e
  2012. // CHECK:STDOUT: }
  2013. // CHECK:STDOUT:
  2014. // CHECK:STDOUT: --- fail_todo_impl_in_interface_definition_with_associated.carbon
  2015. // CHECK:STDOUT:
  2016. // CHECK:STDOUT: constants {
  2017. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  2018. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  2019. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  2020. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%U [concrete]
  2021. // CHECK:STDOUT: %I.WithSelf.F.type.08c: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self) [symbolic]
  2022. // CHECK:STDOUT: %I.WithSelf.F.705: %I.WithSelf.F.type.08c = struct_value () [symbolic]
  2023. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.WithSelf.%I.WithSelf.F.decl [concrete]
  2024. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic]
  2025. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2026. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2027. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  2028. // CHECK:STDOUT: %I.WithSelf.F.type.29d: type = fn_type @I.WithSelf.F, @I.WithSelf(%.Self) [symbolic_self]
  2029. // CHECK:STDOUT: %I.WithSelf.F.8ec: %I.WithSelf.F.type.29d = struct_value () [symbolic_self]
  2030. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  2031. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  2032. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  2033. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %C> [symbolic]
  2034. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic]
  2035. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %I_where.type [symbolic]
  2036. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [symbolic]
  2037. // CHECK:STDOUT: %I.WithSelf.F.type.000: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet) [symbolic]
  2038. // CHECK:STDOUT: %I.WithSelf.F.a8c: %I.WithSelf.F.type.000 = struct_value () [symbolic]
  2039. // CHECK:STDOUT: }
  2040. // CHECK:STDOUT:
  2041. // CHECK:STDOUT: imports {
  2042. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2043. // CHECK:STDOUT: import Core//prelude
  2044. // CHECK:STDOUT: import Core//prelude/...
  2045. // CHECK:STDOUT: }
  2046. // CHECK:STDOUT: }
  2047. // CHECK:STDOUT:
  2048. // CHECK:STDOUT: file {
  2049. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2050. // CHECK:STDOUT: .Core = imports.%Core
  2051. // CHECK:STDOUT: .I = %I.decl
  2052. // CHECK:STDOUT: }
  2053. // CHECK:STDOUT: %Core.import = import Core
  2054. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  2055. // CHECK:STDOUT: }
  2056. // CHECK:STDOUT:
  2057. // CHECK:STDOUT: interface @I {
  2058. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  2059. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  2060. // CHECK:STDOUT:
  2061. // CHECK:STDOUT: !with Self:
  2062. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  2063. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%U [concrete = constants.%assoc0]
  2064. // CHECK:STDOUT: }
  2065. // CHECK:STDOUT: %I.WithSelf.F.decl: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.08c) = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.705)] {} {}
  2066. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %I.WithSelf.F.decl [concrete = constants.%assoc1]
  2067. // CHECK:STDOUT:
  2068. // CHECK:STDOUT: !members:
  2069. // CHECK:STDOUT: .Self = %Self
  2070. // CHECK:STDOUT: .I = <poisoned>
  2071. // CHECK:STDOUT: .U = @U.%assoc0
  2072. // CHECK:STDOUT: .F = @I.WithSelf.%assoc1
  2073. // CHECK:STDOUT: .I = <poisoned>
  2074. // CHECK:STDOUT: witness = (@I.WithSelf.%U, @I.WithSelf.%I.WithSelf.F.decl)
  2075. // CHECK:STDOUT:
  2076. // CHECK:STDOUT: !requires:
  2077. // CHECK:STDOUT: }
  2078. // CHECK:STDOUT:
  2079. // CHECK:STDOUT: generic impl @C.as.I.impl(@I.%Self: %I.type) {
  2080. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  2081. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2082. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where constants.%impl.elem0 = %C> [symbolic = %I_where.type (constants.%I_where.type)]
  2083. // CHECK:STDOUT: %I.impl_witness.loc12_29.2: <witness> = impl_witness %I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness.loc12_29.2 (constants.%I.impl_witness)]
  2084. // CHECK:STDOUT:
  2085. // CHECK:STDOUT: !definition:
  2086. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %I_where.type [symbolic = %require_complete (constants.%require_complete)]
  2087. // CHECK:STDOUT:
  2088. // CHECK:STDOUT: impl: %C.ref.loc12_10 as %.loc12_17 {
  2089. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, <error>), @C.as.I.impl [concrete]
  2090. // CHECK:STDOUT: %I.impl_witness.loc12_29.1: <witness> = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Self) [symbolic = %I.impl_witness.loc12_29.2 (constants.%I.impl_witness)]
  2091. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [symbolic = %C (constants.%C)]
  2092. // CHECK:STDOUT:
  2093. // CHECK:STDOUT: !members:
  2094. // CHECK:STDOUT: .F = <poisoned>
  2095. // CHECK:STDOUT: witness = %I.impl_witness.loc12_29.1
  2096. // CHECK:STDOUT: }
  2097. // CHECK:STDOUT: }
  2098. // CHECK:STDOUT:
  2099. // CHECK:STDOUT: generic class @C(@I.%Self: %I.type) {
  2100. // CHECK:STDOUT: !definition:
  2101. // CHECK:STDOUT:
  2102. // CHECK:STDOUT: class {
  2103. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2104. // CHECK:STDOUT: complete_type_witness = %complete_type
  2105. // CHECK:STDOUT:
  2106. // CHECK:STDOUT: !members:
  2107. // CHECK:STDOUT: .Self = constants.%C
  2108. // CHECK:STDOUT: }
  2109. // CHECK:STDOUT: }
  2110. // CHECK:STDOUT:
  2111. // CHECK:STDOUT: generic fn @I.WithSelf.F(@I.%Self: %I.type) {
  2112. // CHECK:STDOUT: !definition:
  2113. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  2114. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2115. // CHECK:STDOUT:
  2116. // CHECK:STDOUT: fn() {
  2117. // CHECK:STDOUT: !entry:
  2118. // CHECK:STDOUT: %C.decl: type = class_decl @C [symbolic = @I.WithSelf.F.%C (constants.%C)] {} {}
  2119. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  2120. // CHECK:STDOUT: %C.ref.loc12_10: type = name_ref C, @I.WithSelf.F.%C.decl [symbolic = %C (constants.%C)]
  2121. // CHECK:STDOUT: %I.ref.loc12: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  2122. // CHECK:STDOUT: %.Self.2: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  2123. // CHECK:STDOUT: %.Self.ref.loc12: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  2124. // CHECK:STDOUT: %.Self.as_type.loc12: type = facet_access_type %.Self.ref.loc12 [symbolic_self = constants.%.Self.as_type]
  2125. // CHECK:STDOUT: %.loc12_23: type = converted %.Self.ref.loc12, %.Self.as_type.loc12 [symbolic_self = constants.%.Self.as_type]
  2126. // CHECK:STDOUT: %U.ref.loc12: %I.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  2127. // CHECK:STDOUT: %impl.elem0.loc12: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  2128. // CHECK:STDOUT: %C.ref.loc12_28: type = name_ref C, @I.WithSelf.F.%C.decl [symbolic = %C (constants.%C)]
  2129. // CHECK:STDOUT: %.loc12_17: type = where_expr %.Self.2 [symbolic = %I_where.type (constants.%I_where.type)] {
  2130. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  2131. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc12, %C.ref.loc12_28
  2132. // CHECK:STDOUT: }
  2133. // CHECK:STDOUT: }
  2134. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  2135. // CHECK:STDOUT: %C.ref.loc21_10: type = name_ref C, @I.WithSelf.F.%C.decl [symbolic = %C (constants.%C)]
  2136. // CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  2137. // CHECK:STDOUT: %.Self.1: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  2138. // CHECK:STDOUT: %.Self.ref.loc21: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  2139. // CHECK:STDOUT: %.Self.as_type.loc21: type = facet_access_type %.Self.ref.loc21 [symbolic_self = constants.%.Self.as_type]
  2140. // CHECK:STDOUT: %.loc21_23: type = converted %.Self.ref.loc21, %.Self.as_type.loc21 [symbolic_self = constants.%.Self.as_type]
  2141. // CHECK:STDOUT: %U.ref.loc21: %I.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  2142. // CHECK:STDOUT: %impl.elem0.loc21: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  2143. // CHECK:STDOUT: %C.ref.loc21_28: type = name_ref C, @I.WithSelf.F.%C.decl [symbolic = %C (constants.%C)]
  2144. // CHECK:STDOUT: %.loc21_17: type = where_expr %.Self.1 [symbolic = %I_where.type (constants.%I_where.type)] {
  2145. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  2146. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc21, %C.ref.loc21_28
  2147. // CHECK:STDOUT: }
  2148. // CHECK:STDOUT: }
  2149. // CHECK:STDOUT: return
  2150. // CHECK:STDOUT: }
  2151. // CHECK:STDOUT: }
  2152. // CHECK:STDOUT:
  2153. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
  2154. // CHECK:STDOUT: !definition:
  2155. // CHECK:STDOUT: %Self => constants.%Self
  2156. // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.08c
  2157. // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.705
  2158. // CHECK:STDOUT: }
  2159. // CHECK:STDOUT:
  2160. // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self) {}
  2161. // CHECK:STDOUT:
  2162. // CHECK:STDOUT: specific @C(constants.%Self) {}
  2163. // CHECK:STDOUT:
  2164. // CHECK:STDOUT: specific @I.WithSelf(constants.%.Self) {
  2165. // CHECK:STDOUT: !definition:
  2166. // CHECK:STDOUT: %Self => constants.%.Self
  2167. // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.29d
  2168. // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.8ec
  2169. // CHECK:STDOUT: }
  2170. // CHECK:STDOUT:
  2171. // CHECK:STDOUT: specific @C.as.I.impl(constants.%Self) {
  2172. // CHECK:STDOUT: %Self => constants.%Self
  2173. // CHECK:STDOUT: %C => constants.%C
  2174. // CHECK:STDOUT: %I_where.type => constants.%I_where.type
  2175. // CHECK:STDOUT: %I.impl_witness.loc12_29.2 => constants.%I.impl_witness
  2176. // CHECK:STDOUT: }
  2177. // CHECK:STDOUT:
  2178. // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
  2179. // CHECK:STDOUT: !definition:
  2180. // CHECK:STDOUT: %Self => constants.%I.facet
  2181. // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.000
  2182. // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.a8c
  2183. // CHECK:STDOUT: }
  2184. // CHECK:STDOUT: