forward_decls.carbon 148 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521
  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 object of incomplete type `I` [IncompleteTypeInMemberAccess]
  87. // CHECK:STDERR: impl D as I where .T = C;
  88. // CHECK:STDERR: ^~
  89. // CHECK:STDERR: fail_associated_const_before_interface_definition.carbon:[[@LINE-6]]:1: note: interface was forward declared here [InterfaceForwardDeclaredHere]
  90. // CHECK:STDERR: interface I;
  91. // CHECK:STDERR: ^~~~~~~~~~~~
  92. // CHECK:STDERR:
  93. impl D as I where .T = C;
  94. interface I {}
  95. class C {}
  96. // CHECK:STDERR: fail_associated_const_before_interface_definition.carbon:[[@LINE+4]]:19: error: member name `T` not found in `I` [MemberNameNotFoundInInstScope]
  97. // CHECK:STDERR: impl D as I where .T = C {}
  98. // CHECK:STDERR: ^~
  99. // CHECK:STDERR:
  100. impl D as I where .T = C {}
  101. // --- associated_const_of_parameterized.carbon
  102. library "[[@TEST_NAME]]";
  103. interface I(U:! type) {
  104. let T:! type;
  105. }
  106. class C;
  107. class D {}
  108. impl D as I(C) where .T = C;
  109. class C {}
  110. impl D as I(C) where .T = C {}
  111. // --- find_incomplete_impl.carbon
  112. library "[[@TEST_NAME]]";
  113. interface I;
  114. class D {}
  115. impl D as I;
  116. class C(T:! I);
  117. fn F(x: C(D));
  118. interface I {}
  119. impl D as I {}
  120. class C(T:! I) {}
  121. fn F(x: C(D)) {}
  122. // --- fail_todo_two_interfaces.carbon
  123. library "[[@TEST_NAME]]";
  124. interface I;
  125. interface J;
  126. // CHECK:STDERR: fail_todo_two_interfaces.carbon:[[@LINE+4]]:1: error: impl as 2 interfaces, expected 1 [ImplOfNotOneInterface]
  127. // CHECK:STDERR: impl {} as I & J;
  128. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  129. // CHECK:STDERR:
  130. impl {} as I & J;
  131. interface I {}
  132. interface J {}
  133. // --- fail_never_assigned_associated_const.carbon
  134. library "[[@TEST_NAME]]";
  135. interface I {
  136. let T:! type;
  137. let U:! type;
  138. }
  139. class C {}
  140. impl C as I where .T = ();
  141. // CHECK:STDERR: fail_never_assigned_associated_const.carbon:[[@LINE+7]]:1: error: associated constant U not given a value in impl of interface I [ImplAssociatedConstantNeedsValue]
  142. // CHECK:STDERR: impl C as I where .T = () {}
  143. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  144. // CHECK:STDERR: fail_never_assigned_associated_const.carbon:[[@LINE-9]]:7: note: associated constant declared here [AssociatedConstantHere]
  145. // CHECK:STDERR: let U:! type;
  146. // CHECK:STDERR: ^~~~~~~~
  147. // CHECK:STDERR:
  148. impl C as I where .T = () {}
  149. // --- example_from_proposal_5168.carbon
  150. library "[[@TEST_NAME]]";
  151. interface X;
  152. // Allowed to use incomplete interfaces in function declarations.
  153. fn F(U:! X);
  154. fn G[U:! X](u: U);
  155. class C;
  156. // Allowed to use incomplete types and interfaces in impl declarations.
  157. impl C as X;
  158. interface Y;
  159. interface X {
  160. // TODO: Should be allowed to use an incomplete interface here,
  161. // but `require Self impls` is not supported yet.
  162. // require Self impls Y;
  163. }
  164. // Classes must be defined before being used in a function definition.
  165. class C {}
  166. fn H(c: C) {
  167. // Allowed since C is complete and we have a declaration `impl C as X;`
  168. F(C);
  169. G(c);
  170. }
  171. // The above declarations require that `interface Y`, `fn F` (since it is
  172. // generic), and `impl C as X` are defined in the same file.
  173. interface Y {}
  174. fn F(U:! X) {}
  175. fn G[U:! X](u: U) {}
  176. impl C as Y;
  177. impl C as X {}
  178. impl C as Y {}
  179. // --- fail_todo_impl_in_interface_definition.carbon
  180. library "[[@TEST_NAME]]";
  181. // This test uses many unsupported features, and is expected to change.
  182. interface I {
  183. // CHECK:STDERR: fail_todo_impl_in_interface_definition.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo]
  184. // CHECK:STDERR: default fn F() {
  185. // CHECK:STDERR: ^~~~~~~
  186. // CHECK:STDERR:
  187. default fn F() {
  188. class C {}
  189. impl C as I;
  190. // CHECK:STDERR: fail_todo_impl_in_interface_definition.carbon:[[@LINE+7]]:5: error: missing implementation of F in impl of interface I [ImplMissingFunction]
  191. // CHECK:STDERR: impl C as I {}
  192. // CHECK:STDERR: ^~~~~~~~~~~~~
  193. // CHECK:STDERR: fail_todo_impl_in_interface_definition.carbon:[[@LINE-7]]:3: note: associated function F declared here [AssociatedFunctionHere]
  194. // CHECK:STDERR: default fn F() {
  195. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  196. // CHECK:STDERR:
  197. impl C as I {}
  198. }
  199. }
  200. // --- fail_todo_impl_in_interface_definition_with_associated.carbon
  201. library "[[@TEST_NAME]]";
  202. // This test uses many unsupported features, and is expected to change.
  203. interface I {
  204. let U:! type;
  205. // CHECK:STDERR: fail_todo_impl_in_interface_definition_with_associated.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo]
  206. // CHECK:STDERR: default fn F() {
  207. // CHECK:STDERR: ^~~~~~~
  208. // CHECK:STDERR:
  209. default fn F() {
  210. class C {}
  211. impl C as I where .U = C;
  212. // CHECK:STDERR: fail_todo_impl_in_interface_definition_with_associated.carbon:[[@LINE+7]]:5: error: missing implementation of F in impl of interface I [ImplMissingFunction]
  213. // CHECK:STDERR: impl C as I where .U = C {}
  214. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  215. // CHECK:STDERR: fail_todo_impl_in_interface_definition_with_associated.carbon:[[@LINE-7]]:3: note: associated function F declared here [AssociatedFunctionHere]
  216. // CHECK:STDERR: default fn F() {
  217. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  218. // CHECK:STDERR:
  219. impl C as I where .U = C {}
  220. }
  221. }
  222. // CHECK:STDOUT: --- empty.carbon
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: constants {
  225. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  226. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  227. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  228. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: imports {
  232. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  233. // CHECK:STDOUT: import Core//prelude
  234. // CHECK:STDOUT: import Core//prelude/...
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: file {
  239. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  240. // CHECK:STDOUT: .Core = imports.%Core
  241. // CHECK:STDOUT: .I = %I.decl.loc3
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT: %Core.import = import Core
  244. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  245. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  246. // CHECK:STDOUT: %.loc4_7.1: %empty_struct_type = struct_literal ()
  247. // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  248. // CHECK:STDOUT: %I.ref.loc4: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete]
  251. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  252. // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {}
  253. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  254. // CHECK:STDOUT: %.loc7_7.1: %empty_struct_type = struct_literal ()
  255. // CHECK:STDOUT: %.loc7_7.2: type = converted %.loc7_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  256. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: interface @I {
  261. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: !members:
  264. // CHECK:STDOUT: .Self = %Self
  265. // CHECK:STDOUT: witness = ()
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc4_7.2 as %I.ref.loc4 {
  269. // CHECK:STDOUT: !members:
  270. // CHECK:STDOUT: witness = file.%I.impl_witness
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT:
  273. // CHECK:STDOUT: --- method.carbon
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: constants {
  276. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  277. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  278. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  279. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  280. // CHECK:STDOUT: %I.G.type: type = fn_type @I.G [concrete]
  281. // CHECK:STDOUT: %I.G: %I.G.type = struct_value () [concrete]
  282. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  283. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.G.decl [concrete]
  284. // CHECK:STDOUT: %empty_struct_type.as.I.impl.G.type: type = fn_type @empty_struct_type.as.I.impl.G [concrete]
  285. // CHECK:STDOUT: %empty_struct_type.as.I.impl.G: %empty_struct_type.as.I.impl.G.type = struct_value () [concrete]
  286. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_struct_type, (%I.impl_witness) [concrete]
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: imports {
  290. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  291. // CHECK:STDOUT: import Core//prelude
  292. // CHECK:STDOUT: import Core//prelude/...
  293. // CHECK:STDOUT: }
  294. // CHECK:STDOUT: }
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: file {
  297. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  298. // CHECK:STDOUT: .Core = imports.%Core
  299. // CHECK:STDOUT: .I = %I.decl.loc3
  300. // CHECK:STDOUT: }
  301. // CHECK:STDOUT: %Core.import = import Core
  302. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  303. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  304. // CHECK:STDOUT: %.loc4_7.1: %empty_struct_type = struct_literal ()
  305. // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  306. // CHECK:STDOUT: %I.ref.loc4: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@empty_struct_type.as.I.impl.%empty_struct_type.as.I.impl.G.decl), @empty_struct_type.as.I.impl [concrete]
  309. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  310. // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {}
  311. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  312. // CHECK:STDOUT: %.loc9_7.1: %empty_struct_type = struct_literal ()
  313. // CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  314. // CHECK:STDOUT: %I.ref.loc9: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT: }
  317. // CHECK:STDOUT:
  318. // CHECK:STDOUT: interface @I {
  319. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  320. // CHECK:STDOUT: %I.G.decl: %I.G.type = fn_decl @I.G [concrete = constants.%I.G] {} {}
  321. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.G.decl [concrete = constants.%assoc0]
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: !members:
  324. // CHECK:STDOUT: .Self = %Self
  325. // CHECK:STDOUT: .G = %assoc0
  326. // CHECK:STDOUT: witness = (%I.G.decl)
  327. // CHECK:STDOUT: }
  328. // CHECK:STDOUT:
  329. // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc4_7.2 as %I.ref.loc4 {
  330. // 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] {} {}
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: !members:
  333. // CHECK:STDOUT: .G = %empty_struct_type.as.I.impl.G.decl
  334. // CHECK:STDOUT: witness = file.%I.impl_witness
  335. // CHECK:STDOUT: }
  336. // CHECK:STDOUT:
  337. // CHECK:STDOUT: generic fn @I.G(@I.%Self: %I.type) {
  338. // CHECK:STDOUT: fn();
  339. // CHECK:STDOUT: }
  340. // CHECK:STDOUT:
  341. // CHECK:STDOUT: fn @empty_struct_type.as.I.impl.G() {
  342. // CHECK:STDOUT: !entry:
  343. // CHECK:STDOUT: return
  344. // CHECK:STDOUT: }
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: specific @I.G(constants.%Self) {}
  347. // CHECK:STDOUT:
  348. // CHECK:STDOUT: specific @I.G(constants.%I.facet) {}
  349. // CHECK:STDOUT:
  350. // CHECK:STDOUT: --- combine.carbon
  351. // CHECK:STDOUT:
  352. // CHECK:STDOUT: constants {
  353. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  354. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  355. // CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete]
  356. // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete]
  357. // CHECK:STDOUT: %BitAndWith.type.8a6: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete]
  358. // CHECK:STDOUT: %BitAndWith.Op.type.9a3: type = fn_type @BitAndWith.Op, @BitAndWith(type) [concrete]
  359. // CHECK:STDOUT: %BitAndWith.impl_witness: <witness> = impl_witness imports.%BitAndWith.impl_witness_table [concrete]
  360. // CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.8a6 = facet_value type, (%BitAndWith.impl_witness) [concrete]
  361. // CHECK:STDOUT: %.fa7: type = fn_type_with_self_type %BitAndWith.Op.type.9a3, %BitAndWith.facet [concrete]
  362. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete]
  363. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete]
  364. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: <bound method> = bound_method %I.type, %type.as.BitAndWith.impl.Op [concrete]
  365. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  366. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  367. // CHECK:STDOUT: }
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: imports {
  370. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  371. // CHECK:STDOUT: .BitAndWith = %Core.BitAndWith
  372. // CHECK:STDOUT: import Core//prelude
  373. // CHECK:STDOUT: import Core//prelude/...
  374. // CHECK:STDOUT: }
  375. // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic]
  376. // CHECK:STDOUT: %Core.import_ref.636: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc25_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op]
  377. // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.636), @type.as.BitAndWith.impl [concrete]
  378. // CHECK:STDOUT: }
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: file {
  381. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  382. // CHECK:STDOUT: .Core = imports.%Core
  383. // CHECK:STDOUT: .I = %I.decl.loc3
  384. // CHECK:STDOUT: }
  385. // CHECK:STDOUT: %Core.import = import Core
  386. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  387. // 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]
  388. // 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]
  389. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  390. // CHECK:STDOUT: %.loc4_7.1: %empty_struct_type = struct_literal ()
  391. // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  392. // CHECK:STDOUT: %I.ref.loc4_12: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  393. // CHECK:STDOUT: %I.ref.loc4_16: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  394. // CHECK:STDOUT: %impl.elem0.loc4: %.fa7 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  395. // CHECK:STDOUT: %bound_method.loc4: <bound method> = bound_method %I.ref.loc4_12, %impl.elem0.loc4 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  396. // 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]
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_struct_type.as.I.impl [concrete]
  399. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  400. // CHECK:STDOUT: %I.decl.loc6: type = interface_decl @I [concrete = constants.%I.type] {} {}
  401. // 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]
  402. // 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]
  403. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  404. // CHECK:STDOUT: %.loc7_7.1: %empty_struct_type = struct_literal ()
  405. // CHECK:STDOUT: %.loc7_7.2: type = converted %.loc7_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  406. // CHECK:STDOUT: %I.ref.loc7_12: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  407. // CHECK:STDOUT: %I.ref.loc7_16: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  408. // CHECK:STDOUT: %impl.elem0.loc7: %.fa7 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  409. // CHECK:STDOUT: %bound_method.loc7: <bound method> = bound_method %I.ref.loc7_12, %impl.elem0.loc7 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  410. // 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]
  411. // CHECK:STDOUT: }
  412. // CHECK:STDOUT: }
  413. // CHECK:STDOUT:
  414. // CHECK:STDOUT: interface @I {
  415. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  416. // CHECK:STDOUT:
  417. // CHECK:STDOUT: !members:
  418. // CHECK:STDOUT: .Self = %Self
  419. // CHECK:STDOUT: witness = ()
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc4_7.2 as file.%.loc4_14.2 {
  423. // CHECK:STDOUT: !members:
  424. // CHECK:STDOUT: witness = file.%I.impl_witness
  425. // CHECK:STDOUT: }
  426. // CHECK:STDOUT:
  427. // CHECK:STDOUT: --- associated_const.carbon
  428. // CHECK:STDOUT:
  429. // CHECK:STDOUT: constants {
  430. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  431. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  432. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  433. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  434. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  435. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  436. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  437. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  438. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  439. // CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  440. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  441. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  442. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: imports {
  446. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  447. // CHECK:STDOUT: import Core//prelude
  448. // CHECK:STDOUT: import Core//prelude/...
  449. // CHECK:STDOUT: }
  450. // CHECK:STDOUT: }
  451. // CHECK:STDOUT:
  452. // CHECK:STDOUT: file {
  453. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  454. // CHECK:STDOUT: .Core = imports.%Core
  455. // CHECK:STDOUT: .I = %I.decl
  456. // CHECK:STDOUT: }
  457. // CHECK:STDOUT: %Core.import = import Core
  458. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  459. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  460. // CHECK:STDOUT: %.loc6_7.1: %empty_struct_type = struct_literal ()
  461. // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  462. // CHECK:STDOUT: %I.ref.loc6: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  463. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  464. // CHECK:STDOUT: %.Self.ref.loc6: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  465. // CHECK:STDOUT: %T.ref.loc6: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  466. // CHECK:STDOUT: %.Self.as_type.loc6: type = facet_access_type %.Self.ref.loc6 [symbolic_self = constants.%.Self.as_type]
  467. // CHECK:STDOUT: %.loc6_20: type = converted %.Self.ref.loc6, %.Self.as_type.loc6 [symbolic_self = constants.%.Self.as_type]
  468. // CHECK:STDOUT: %impl.elem0.loc6: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  469. // CHECK:STDOUT: %.loc6_26.1: %empty_tuple.type = tuple_literal ()
  470. // CHECK:STDOUT: %.loc6_26.2: type = converted %.loc6_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  471. // CHECK:STDOUT: %.loc6_14: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  472. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  473. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6, %.loc6_26.2
  474. // CHECK:STDOUT: }
  475. // CHECK:STDOUT: }
  476. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @empty_struct_type.as.I.impl [concrete]
  477. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  478. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  479. // CHECK:STDOUT: impl_decl @empty_struct_type.as.I.impl [concrete] {} {
  480. // CHECK:STDOUT: %.loc8_7.1: %empty_struct_type = struct_literal ()
  481. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  482. // CHECK:STDOUT: %I.ref.loc8: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  483. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  484. // CHECK:STDOUT: %.Self.ref.loc8: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  485. // CHECK:STDOUT: %T.ref.loc8: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  486. // CHECK:STDOUT: %.Self.as_type.loc8: type = facet_access_type %.Self.ref.loc8 [symbolic_self = constants.%.Self.as_type]
  487. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref.loc8, %.Self.as_type.loc8 [symbolic_self = constants.%.Self.as_type]
  488. // CHECK:STDOUT: %impl.elem0.loc8: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  489. // CHECK:STDOUT: %.loc8_26.1: %empty_tuple.type = tuple_literal ()
  490. // CHECK:STDOUT: %.loc8_26.2: type = converted %.loc8_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  491. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  492. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  493. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %.loc8_26.2
  494. // CHECK:STDOUT: }
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT: }
  497. // CHECK:STDOUT:
  498. // CHECK:STDOUT: interface @I {
  499. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  500. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  501. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: !members:
  505. // CHECK:STDOUT: .Self = %Self
  506. // CHECK:STDOUT: .T = @T.%assoc0
  507. // CHECK:STDOUT: witness = (%T)
  508. // CHECK:STDOUT: }
  509. // CHECK:STDOUT:
  510. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  511. // CHECK:STDOUT: assoc_const T:! type;
  512. // CHECK:STDOUT: }
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: impl @empty_struct_type.as.I.impl: %.loc6_7.2 as %.loc6_14 {
  515. // CHECK:STDOUT: !members:
  516. // CHECK:STDOUT: witness = file.%I.impl_witness
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: specific @T(constants.%Self) {}
  520. // CHECK:STDOUT:
  521. // CHECK:STDOUT: specific @T(constants.%I.facet) {}
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: --- associated_const_compound_member_access.carbon
  524. // CHECK:STDOUT:
  525. // CHECK:STDOUT: constants {
  526. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  527. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  528. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  529. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  530. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  531. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  532. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  533. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  534. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  535. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  536. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  537. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  538. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  539. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  540. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  541. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  542. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  543. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  544. // CHECK:STDOUT: %I.facet.f22: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  545. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  546. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  547. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  548. // CHECK:STDOUT: %I.facet.744: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  549. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  550. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  551. // CHECK:STDOUT: }
  552. // CHECK:STDOUT:
  553. // CHECK:STDOUT: imports {
  554. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  555. // CHECK:STDOUT: .Destroy = %Core.Destroy
  556. // CHECK:STDOUT: import Core//prelude
  557. // CHECK:STDOUT: import Core//prelude/...
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  560. // CHECK:STDOUT: }
  561. // CHECK:STDOUT:
  562. // CHECK:STDOUT: file {
  563. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  564. // CHECK:STDOUT: .Core = imports.%Core
  565. // CHECK:STDOUT: .I = %I.decl
  566. // CHECK:STDOUT: .C = %C.decl
  567. // CHECK:STDOUT: .x = %x
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT: %Core.import = import Core
  570. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  571. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  572. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  573. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  574. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  575. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  576. // CHECK:STDOUT: %.Self.ref.loc7: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  577. // CHECK:STDOUT: %T.ref.loc7: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  578. // CHECK:STDOUT: %.Self.as_type.loc7: type = facet_access_type %.Self.ref.loc7 [symbolic_self = constants.%.Self.as_type]
  579. // CHECK:STDOUT: %.loc7_19: type = converted %.Self.ref.loc7, %.Self.as_type.loc7 [symbolic_self = constants.%.Self.as_type]
  580. // CHECK:STDOUT: %impl.elem0.loc7: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  581. // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal ()
  582. // CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  583. // CHECK:STDOUT: %.loc7_13: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  584. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  585. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc7, %.loc7_25.2
  586. // CHECK:STDOUT: }
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete]
  589. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  590. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  591. // CHECK:STDOUT: name_binding_decl {
  592. // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = binding_pattern x [concrete]
  593. // CHECK:STDOUT: }
  594. // CHECK:STDOUT: %.loc9_9.1: type = splice_block %impl.elem0 [concrete = constants.%empty_tuple.type] {
  595. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  596. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  597. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  598. // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet.744]
  599. // CHECK:STDOUT: %.loc9_9.2: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet.744]
  600. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%empty_tuple.type]
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  603. // CHECK:STDOUT: %.loc9_19: %empty_tuple.type = converted @__global_init.%.loc9, %empty_tuple [concrete = constants.%empty_tuple]
  604. // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %.loc9_19
  605. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  606. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  607. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  608. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  609. // CHECK:STDOUT: %.Self.ref.loc11: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  610. // CHECK:STDOUT: %T.ref.loc11: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  611. // CHECK:STDOUT: %.Self.as_type.loc11: type = facet_access_type %.Self.ref.loc11 [symbolic_self = constants.%.Self.as_type]
  612. // CHECK:STDOUT: %.loc11_19: type = converted %.Self.ref.loc11, %.Self.as_type.loc11 [symbolic_self = constants.%.Self.as_type]
  613. // CHECK:STDOUT: %impl.elem0.loc11: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  614. // CHECK:STDOUT: %.loc11_25.1: %empty_tuple.type = tuple_literal ()
  615. // CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  616. // CHECK:STDOUT: %.loc11_13: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  617. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  618. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11, %.loc11_25.2
  619. // CHECK:STDOUT: }
  620. // CHECK:STDOUT: }
  621. // CHECK:STDOUT: }
  622. // CHECK:STDOUT:
  623. // CHECK:STDOUT: interface @I {
  624. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  625. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  626. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  627. // CHECK:STDOUT: }
  628. // CHECK:STDOUT:
  629. // CHECK:STDOUT: !members:
  630. // CHECK:STDOUT: .Self = %Self
  631. // CHECK:STDOUT: .T = @T.%assoc0
  632. // CHECK:STDOUT: witness = (%T)
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  636. // CHECK:STDOUT: assoc_const T:! type;
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT:
  639. // CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type {
  640. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  641. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  642. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  643. // CHECK:STDOUT: %.loc6: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  644. // CHECK:STDOUT: } {
  645. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  646. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  647. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  648. // CHECK:STDOUT: }
  649. // CHECK:STDOUT:
  650. // CHECK:STDOUT: !members:
  651. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  652. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  653. // CHECK:STDOUT: }
  654. // CHECK:STDOUT:
  655. // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc7 as %.loc7_13 {
  656. // CHECK:STDOUT: !members:
  657. // CHECK:STDOUT: witness = file.%I.impl_witness
  658. // CHECK:STDOUT: }
  659. // CHECK:STDOUT:
  660. // CHECK:STDOUT: class @C {
  661. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  662. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  663. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  664. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness]
  665. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  666. // CHECK:STDOUT: complete_type_witness = %complete_type
  667. // CHECK:STDOUT:
  668. // CHECK:STDOUT: !members:
  669. // CHECK:STDOUT: .Self = constants.%C
  670. // CHECK:STDOUT: }
  671. // CHECK:STDOUT:
  672. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  673. // CHECK:STDOUT:
  674. // CHECK:STDOUT: fn @__global_init() {
  675. // CHECK:STDOUT: !entry:
  676. // CHECK:STDOUT: %.loc9: %empty_tuple.type = tuple_literal ()
  677. // CHECK:STDOUT: return
  678. // CHECK:STDOUT: }
  679. // CHECK:STDOUT:
  680. // CHECK:STDOUT: specific @T(constants.%Self.7ee) {}
  681. // CHECK:STDOUT:
  682. // CHECK:STDOUT: specific @T(constants.%I.facet.f22) {}
  683. // CHECK:STDOUT:
  684. // CHECK:STDOUT: specific @T(constants.%I.facet.744) {}
  685. // CHECK:STDOUT:
  686. // CHECK:STDOUT: --- associated_const_of_facet.carbon
  687. // CHECK:STDOUT:
  688. // CHECK:STDOUT: constants {
  689. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  690. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  691. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  692. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  693. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  694. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  695. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  696. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  697. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  698. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  699. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  700. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  701. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  702. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  703. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  704. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  705. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  706. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  707. // CHECK:STDOUT: %I.facet.f22: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  708. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  709. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  710. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  711. // CHECK:STDOUT: %I.facet.744: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  712. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  713. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  714. // CHECK:STDOUT: }
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: imports {
  717. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  718. // CHECK:STDOUT: .Destroy = %Core.Destroy
  719. // CHECK:STDOUT: import Core//prelude
  720. // CHECK:STDOUT: import Core//prelude/...
  721. // CHECK:STDOUT: }
  722. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  723. // CHECK:STDOUT: }
  724. // CHECK:STDOUT:
  725. // CHECK:STDOUT: file {
  726. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  727. // CHECK:STDOUT: .Core = imports.%Core
  728. // CHECK:STDOUT: .I = %I.decl
  729. // CHECK:STDOUT: .C = %C.decl
  730. // CHECK:STDOUT: .x = %x
  731. // CHECK:STDOUT: }
  732. // CHECK:STDOUT: %Core.import = import Core
  733. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  734. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  735. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  736. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  737. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  738. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  739. // CHECK:STDOUT: %.Self.ref.loc7: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  740. // CHECK:STDOUT: %T.ref.loc7: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  741. // CHECK:STDOUT: %.Self.as_type.loc7: type = facet_access_type %.Self.ref.loc7 [symbolic_self = constants.%.Self.as_type]
  742. // CHECK:STDOUT: %.loc7_19: type = converted %.Self.ref.loc7, %.Self.as_type.loc7 [symbolic_self = constants.%.Self.as_type]
  743. // CHECK:STDOUT: %impl.elem0.loc7: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  744. // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal ()
  745. // CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  746. // CHECK:STDOUT: %.loc7_13: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  747. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  748. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc7, %.loc7_25.2
  749. // CHECK:STDOUT: }
  750. // CHECK:STDOUT: }
  751. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C.as.I.impl [concrete]
  752. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  753. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  754. // CHECK:STDOUT: name_binding_decl {
  755. // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = binding_pattern x [concrete]
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT: %.loc9_16.1: type = splice_block %impl.elem0 [concrete = constants.%empty_tuple.type] {
  758. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  759. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  760. // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet.744]
  761. // CHECK:STDOUT: %.loc9_11: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet.744]
  762. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  763. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc9_11 [concrete = constants.%C]
  764. // CHECK:STDOUT: %.loc9_16.2: type = converted %.loc9_11, %as_type [concrete = constants.%C]
  765. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%empty_tuple.type]
  766. // CHECK:STDOUT: }
  767. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  768. // CHECK:STDOUT: %.loc9_22: %empty_tuple.type = converted @__global_init.%.loc9, %empty_tuple [concrete = constants.%empty_tuple]
  769. // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %.loc9_22
  770. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  771. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  772. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  773. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  774. // CHECK:STDOUT: %.Self.ref.loc11: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  775. // CHECK:STDOUT: %T.ref.loc11: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  776. // CHECK:STDOUT: %.Self.as_type.loc11: type = facet_access_type %.Self.ref.loc11 [symbolic_self = constants.%.Self.as_type]
  777. // CHECK:STDOUT: %.loc11_19: type = converted %.Self.ref.loc11, %.Self.as_type.loc11 [symbolic_self = constants.%.Self.as_type]
  778. // CHECK:STDOUT: %impl.elem0.loc11: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  779. // CHECK:STDOUT: %.loc11_25.1: %empty_tuple.type = tuple_literal ()
  780. // CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  781. // CHECK:STDOUT: %.loc11_13: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  782. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  783. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11, %.loc11_25.2
  784. // CHECK:STDOUT: }
  785. // CHECK:STDOUT: }
  786. // CHECK:STDOUT: }
  787. // CHECK:STDOUT:
  788. // CHECK:STDOUT: interface @I {
  789. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  790. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  791. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  792. // CHECK:STDOUT: }
  793. // CHECK:STDOUT:
  794. // CHECK:STDOUT: !members:
  795. // CHECK:STDOUT: .Self = %Self
  796. // CHECK:STDOUT: .T = @T.%assoc0
  797. // CHECK:STDOUT: witness = (%T)
  798. // CHECK:STDOUT: }
  799. // CHECK:STDOUT:
  800. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  801. // CHECK:STDOUT: assoc_const T:! type;
  802. // CHECK:STDOUT: }
  803. // CHECK:STDOUT:
  804. // CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type {
  805. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  806. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  807. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  808. // CHECK:STDOUT: %.loc6: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  809. // CHECK:STDOUT: } {
  810. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  811. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  812. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  813. // CHECK:STDOUT: }
  814. // CHECK:STDOUT:
  815. // CHECK:STDOUT: !members:
  816. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  817. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  818. // CHECK:STDOUT: }
  819. // CHECK:STDOUT:
  820. // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc7 as %.loc7_13 {
  821. // CHECK:STDOUT: !members:
  822. // CHECK:STDOUT: witness = file.%I.impl_witness
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT:
  825. // CHECK:STDOUT: class @C {
  826. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  827. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  828. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  829. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness]
  830. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  831. // CHECK:STDOUT: complete_type_witness = %complete_type
  832. // CHECK:STDOUT:
  833. // CHECK:STDOUT: !members:
  834. // CHECK:STDOUT: .Self = constants.%C
  835. // CHECK:STDOUT: }
  836. // CHECK:STDOUT:
  837. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  838. // CHECK:STDOUT:
  839. // CHECK:STDOUT: fn @__global_init() {
  840. // CHECK:STDOUT: !entry:
  841. // CHECK:STDOUT: %.loc9: %empty_tuple.type = tuple_literal ()
  842. // CHECK:STDOUT: return
  843. // CHECK:STDOUT: }
  844. // CHECK:STDOUT:
  845. // CHECK:STDOUT: specific @T(constants.%Self.7ee) {}
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: specific @T(constants.%I.facet.f22) {}
  848. // CHECK:STDOUT:
  849. // CHECK:STDOUT: specific @T(constants.%I.facet.744) {}
  850. // CHECK:STDOUT:
  851. // CHECK:STDOUT: --- fail_unset_associated_const.carbon
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: constants {
  854. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  855. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  856. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  857. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  858. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  859. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  860. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  861. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  862. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  863. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  864. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  865. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  866. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  867. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  868. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  869. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  870. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  871. // CHECK:STDOUT: }
  872. // CHECK:STDOUT:
  873. // CHECK:STDOUT: imports {
  874. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  875. // CHECK:STDOUT: .Destroy = %Core.Destroy
  876. // CHECK:STDOUT: import Core//prelude
  877. // CHECK:STDOUT: import Core//prelude/...
  878. // CHECK:STDOUT: }
  879. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  880. // CHECK:STDOUT: }
  881. // CHECK:STDOUT:
  882. // CHECK:STDOUT: file {
  883. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  884. // CHECK:STDOUT: .Core = imports.%Core
  885. // CHECK:STDOUT: .I = %I.decl
  886. // CHECK:STDOUT: .C = %C.decl
  887. // CHECK:STDOUT: .x = %x
  888. // CHECK:STDOUT: }
  889. // CHECK:STDOUT: %Core.import = import Core
  890. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  891. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  892. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  893. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  894. // CHECK:STDOUT: %I.ref.loc7: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  895. // CHECK:STDOUT: }
  896. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (<error>), @C.as.I.impl [concrete]
  897. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  898. // CHECK:STDOUT: name_binding_decl {
  899. // CHECK:STDOUT: %x.patt: <error> = binding_pattern x [concrete]
  900. // CHECK:STDOUT: }
  901. // CHECK:STDOUT: %.loc13_16.1: type = splice_block %impl.elem0 [concrete = <error>] {
  902. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  903. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [concrete = constants.%I.type]
  904. // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  905. // CHECK:STDOUT: %.loc13_11: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
  906. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  907. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc13_11 [concrete = constants.%C]
  908. // CHECK:STDOUT: %.loc13_16.2: type = converted %.loc13_11, %as_type [concrete = constants.%C]
  909. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.impl_witness, element0 [concrete = <error>]
  910. // CHECK:STDOUT: }
  911. // CHECK:STDOUT: %x: <error> = bind_name x, <error> [concrete = <error>]
  912. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  913. // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [concrete = constants.%C]
  914. // CHECK:STDOUT: %I.ref.loc22: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  915. // CHECK:STDOUT: }
  916. // CHECK:STDOUT: }
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: interface @I {
  919. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  920. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  921. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  922. // CHECK:STDOUT: }
  923. // CHECK:STDOUT:
  924. // CHECK:STDOUT: !members:
  925. // CHECK:STDOUT: .Self = %Self
  926. // CHECK:STDOUT: .T = @T.%assoc0
  927. // CHECK:STDOUT: witness = (%T)
  928. // CHECK:STDOUT: }
  929. // CHECK:STDOUT:
  930. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  931. // CHECK:STDOUT: assoc_const T:! type;
  932. // CHECK:STDOUT: }
  933. // CHECK:STDOUT:
  934. // CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type {
  935. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  936. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  937. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  938. // CHECK:STDOUT: %.loc6: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  939. // CHECK:STDOUT: } {
  940. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  941. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  942. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  943. // CHECK:STDOUT: }
  944. // CHECK:STDOUT:
  945. // CHECK:STDOUT: !members:
  946. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  947. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  948. // CHECK:STDOUT: }
  949. // CHECK:STDOUT:
  950. // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc7 as %I.ref.loc7 {
  951. // CHECK:STDOUT: !members:
  952. // CHECK:STDOUT: witness = file.%I.impl_witness
  953. // CHECK:STDOUT: }
  954. // CHECK:STDOUT:
  955. // CHECK:STDOUT: class @C {
  956. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  957. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  958. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  959. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness]
  960. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  961. // CHECK:STDOUT: complete_type_witness = %complete_type
  962. // CHECK:STDOUT:
  963. // CHECK:STDOUT: !members:
  964. // CHECK:STDOUT: .Self = constants.%C
  965. // CHECK:STDOUT: }
  966. // CHECK:STDOUT:
  967. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  968. // CHECK:STDOUT:
  969. // CHECK:STDOUT: fn @__global_init() {
  970. // CHECK:STDOUT: !entry:
  971. // CHECK:STDOUT: %.loc13: %empty_tuple.type = tuple_literal ()
  972. // CHECK:STDOUT: return
  973. // CHECK:STDOUT: }
  974. // CHECK:STDOUT:
  975. // CHECK:STDOUT: specific @T(constants.%Self.7ee) {}
  976. // CHECK:STDOUT:
  977. // CHECK:STDOUT: specific @T(constants.%I.facet) {}
  978. // CHECK:STDOUT:
  979. // CHECK:STDOUT: --- fail_associated_const_before_interface_definition.carbon
  980. // CHECK:STDOUT:
  981. // CHECK:STDOUT: constants {
  982. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  983. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  984. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  985. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  986. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  987. // CHECK:STDOUT: %Destroy.impl_witness.cd5: <witness> = impl_witness @D.%Destroy.impl_witness_table [concrete]
  988. // CHECK:STDOUT: %ptr.19c: type = ptr_type %D [concrete]
  989. // CHECK:STDOUT: %pattern_type.a94: type = pattern_type %ptr.19c [concrete]
  990. // CHECK:STDOUT: %D.as.Destroy.impl.Op.type: type = fn_type @D.as.Destroy.impl.Op [concrete]
  991. // CHECK:STDOUT: %D.as.Destroy.impl.Op: %D.as.Destroy.impl.Op.type = struct_value () [concrete]
  992. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  993. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  994. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  995. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  996. // CHECK:STDOUT: %Destroy.impl_witness.071: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  997. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  998. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  999. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  1000. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  1001. // CHECK:STDOUT: }
  1002. // CHECK:STDOUT:
  1003. // CHECK:STDOUT: imports {
  1004. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1005. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1006. // CHECK:STDOUT: import Core//prelude
  1007. // CHECK:STDOUT: import Core//prelude/...
  1008. // CHECK:STDOUT: }
  1009. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1010. // CHECK:STDOUT: }
  1011. // CHECK:STDOUT:
  1012. // CHECK:STDOUT: file {
  1013. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1014. // CHECK:STDOUT: .Core = imports.%Core
  1015. // CHECK:STDOUT: .I = %I.decl.loc3
  1016. // CHECK:STDOUT: .C = %C.decl.loc4
  1017. // CHECK:STDOUT: .D = %D.decl
  1018. // CHECK:STDOUT: }
  1019. // CHECK:STDOUT: %Core.import = import Core
  1020. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1021. // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [concrete = constants.%C] {} {}
  1022. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1023. // CHECK:STDOUT: impl_decl @D.as.<error>.impl [concrete] {} {
  1024. // CHECK:STDOUT: %D.ref.loc13: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1025. // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1026. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1027. // CHECK:STDOUT: %.Self.ref.loc13: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  1028. // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C]
  1029. // CHECK:STDOUT: %.loc13: type = where_expr %.Self.2 [concrete = <error>] {
  1030. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1031. // CHECK:STDOUT: requirement_rewrite <error>, <error>
  1032. // CHECK:STDOUT: }
  1033. // CHECK:STDOUT: }
  1034. // CHECK:STDOUT: %I.decl.loc15: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1035. // CHECK:STDOUT: %C.decl.loc16: type = class_decl @C [concrete = constants.%C] {} {}
  1036. // CHECK:STDOUT: impl_decl @D.as.<error>.impl [concrete] {} {
  1037. // CHECK:STDOUT: %D.ref.loc21: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1038. // CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1039. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1040. // CHECK:STDOUT: %.Self.ref.loc21: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  1041. // CHECK:STDOUT: %T.ref: <error> = name_ref T, <error> [concrete = <error>]
  1042. // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl.loc4 [concrete = constants.%C]
  1043. // CHECK:STDOUT: %.loc21: type = where_expr %.Self.1 [concrete = <error>] {
  1044. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1045. // CHECK:STDOUT: requirement_rewrite %T.ref, <error>
  1046. // CHECK:STDOUT: }
  1047. // CHECK:STDOUT: }
  1048. // CHECK:STDOUT: }
  1049. // CHECK:STDOUT:
  1050. // CHECK:STDOUT: interface @I {
  1051. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  1052. // CHECK:STDOUT:
  1053. // CHECK:STDOUT: !members:
  1054. // CHECK:STDOUT: .Self = %Self
  1055. // CHECK:STDOUT: .T = <poisoned>
  1056. // CHECK:STDOUT: witness = ()
  1057. // CHECK:STDOUT: }
  1058. // CHECK:STDOUT:
  1059. // CHECK:STDOUT: impl @D.as.Destroy.impl: @D.%Self.ref as constants.%Destroy.type {
  1060. // CHECK:STDOUT: %D.as.Destroy.impl.Op.decl: %D.as.Destroy.impl.Op.type = fn_decl @D.as.Destroy.impl.Op [concrete = constants.%D.as.Destroy.impl.Op] {
  1061. // CHECK:STDOUT: %self.patt: %pattern_type.a94 = binding_pattern self [concrete]
  1062. // CHECK:STDOUT: %self.param_patt: %pattern_type.a94 = value_param_pattern %self.patt, call_param0 [concrete]
  1063. // CHECK:STDOUT: %.loc5: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1064. // CHECK:STDOUT: } {
  1065. // CHECK:STDOUT: %self.param: %ptr.19c = value_param call_param0
  1066. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
  1067. // CHECK:STDOUT: %self: %ptr.19c = bind_name self, %self.param
  1068. // CHECK:STDOUT: }
  1069. // CHECK:STDOUT:
  1070. // CHECK:STDOUT: !members:
  1071. // CHECK:STDOUT: .Op = %D.as.Destroy.impl.Op.decl
  1072. // CHECK:STDOUT: witness = @D.%Destroy.impl_witness
  1073. // CHECK:STDOUT: }
  1074. // CHECK:STDOUT:
  1075. // CHECK:STDOUT: impl @D.as.<error>.impl: %D.ref.loc13 as %.loc13 {
  1076. // CHECK:STDOUT: !members:
  1077. // CHECK:STDOUT: witness = <error>
  1078. // CHECK:STDOUT: }
  1079. // CHECK:STDOUT:
  1080. // CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type {
  1081. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  1082. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  1083. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  1084. // CHECK:STDOUT: %.loc16: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1085. // CHECK:STDOUT: } {
  1086. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  1087. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1088. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  1089. // CHECK:STDOUT: }
  1090. // CHECK:STDOUT:
  1091. // CHECK:STDOUT: !members:
  1092. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  1093. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  1094. // CHECK:STDOUT: }
  1095. // CHECK:STDOUT:
  1096. // CHECK:STDOUT: class @C {
  1097. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1098. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  1099. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  1100. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.071]
  1101. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1102. // CHECK:STDOUT: complete_type_witness = %complete_type
  1103. // CHECK:STDOUT:
  1104. // CHECK:STDOUT: !members:
  1105. // CHECK:STDOUT: .Self = constants.%C
  1106. // CHECK:STDOUT: }
  1107. // CHECK:STDOUT:
  1108. // CHECK:STDOUT: class @D {
  1109. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
  1110. // CHECK:STDOUT: impl_decl @D.as.Destroy.impl [concrete] {} {}
  1111. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@D.as.Destroy.impl.%D.as.Destroy.impl.Op.decl), @D.as.Destroy.impl [concrete]
  1112. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.cd5]
  1113. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1114. // CHECK:STDOUT: complete_type_witness = %complete_type
  1115. // CHECK:STDOUT:
  1116. // CHECK:STDOUT: !members:
  1117. // CHECK:STDOUT: .Self = constants.%D
  1118. // CHECK:STDOUT: }
  1119. // CHECK:STDOUT:
  1120. // CHECK:STDOUT: fn @D.as.Destroy.impl.Op(%self.param: %ptr.19c) = "no_op";
  1121. // CHECK:STDOUT:
  1122. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  1123. // CHECK:STDOUT:
  1124. // CHECK:STDOUT: --- associated_const_of_parameterized.carbon
  1125. // CHECK:STDOUT:
  1126. // CHECK:STDOUT: constants {
  1127. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1128. // CHECK:STDOUT: %.Self.659: %type = bind_symbolic_name .Self [symbolic_self]
  1129. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  1130. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1131. // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [concrete]
  1132. // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [concrete]
  1133. // CHECK:STDOUT: %I.type.b13: type = facet_type <@I, @I(%U)> [symbolic]
  1134. // CHECK:STDOUT: %Self.dae: %I.type.b13 = bind_symbolic_name Self, 1 [symbolic]
  1135. // CHECK:STDOUT: %I.assoc_type.1e5: type = assoc_entity_type @I, @I(%U) [symbolic]
  1136. // CHECK:STDOUT: %assoc0.7f3: %I.assoc_type.1e5 = assoc_entity element0, @I.%T [symbolic]
  1137. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1138. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  1139. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1140. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1141. // CHECK:STDOUT: %Destroy.impl_witness.cd5: <witness> = impl_witness @D.%Destroy.impl_witness_table [concrete]
  1142. // CHECK:STDOUT: %ptr.19c: type = ptr_type %D [concrete]
  1143. // CHECK:STDOUT: %pattern_type.a94: type = pattern_type %ptr.19c [concrete]
  1144. // CHECK:STDOUT: %D.as.Destroy.impl.Op.type: type = fn_type @D.as.Destroy.impl.Op [concrete]
  1145. // CHECK:STDOUT: %D.as.Destroy.impl.Op: %D.as.Destroy.impl.Op.type = struct_value () [concrete]
  1146. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1147. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1148. // CHECK:STDOUT: %I.type.fc3: type = facet_type <@I, @I(%C)> [concrete]
  1149. // CHECK:STDOUT: %.Self.d7f: %I.type.fc3 = bind_symbolic_name .Self [symbolic_self]
  1150. // CHECK:STDOUT: %Self.0d0: %I.type.fc3 = bind_symbolic_name Self, 1 [symbolic]
  1151. // CHECK:STDOUT: %I.assoc_type.b3c: type = assoc_entity_type @I, @I(%C) [concrete]
  1152. // CHECK:STDOUT: %assoc0.3e4: %I.assoc_type.b3c = assoc_entity element0, @I.%T [concrete]
  1153. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.d7f [symbolic_self]
  1154. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.d7f, @I, @I(%C) [symbolic_self]
  1155. // CHECK:STDOUT: %I.facet: %I.type.fc3 = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  1156. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1157. // CHECK:STDOUT: %I_where.type: type = facet_type <@I, @I(%C) where %impl.elem0 = %C> [concrete]
  1158. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  1159. // CHECK:STDOUT: %Destroy.impl_witness.071: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  1160. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  1161. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  1162. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  1163. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  1164. // CHECK:STDOUT: }
  1165. // CHECK:STDOUT:
  1166. // CHECK:STDOUT: imports {
  1167. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1168. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1169. // CHECK:STDOUT: import Core//prelude
  1170. // CHECK:STDOUT: import Core//prelude/...
  1171. // CHECK:STDOUT: }
  1172. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1173. // CHECK:STDOUT: }
  1174. // CHECK:STDOUT:
  1175. // CHECK:STDOUT: file {
  1176. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1177. // CHECK:STDOUT: .Core = imports.%Core
  1178. // CHECK:STDOUT: .I = %I.decl
  1179. // CHECK:STDOUT: .C = %C.decl.loc6
  1180. // CHECK:STDOUT: .D = %D.decl
  1181. // CHECK:STDOUT: }
  1182. // CHECK:STDOUT: %Core.import = import Core
  1183. // CHECK:STDOUT: %I.decl: %I.type.dac = interface_decl @I [concrete = constants.%I.generic] {
  1184. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  1185. // CHECK:STDOUT: } {
  1186. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.659]
  1187. // CHECK:STDOUT: %U.loc3_13.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc3_13.1 (constants.%U)]
  1188. // CHECK:STDOUT: }
  1189. // CHECK:STDOUT: %C.decl.loc6: type = class_decl @C [concrete = constants.%C] {} {}
  1190. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1191. // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {} {
  1192. // CHECK:STDOUT: %D.ref.loc8: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1193. // CHECK:STDOUT: %I.ref.loc8: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  1194. // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1195. // CHECK:STDOUT: %I.type.loc8: type = facet_type <@I, @I(constants.%C)> [concrete = constants.%I.type.fc3]
  1196. // CHECK:STDOUT: %.Self.2: %I.type.fc3 = bind_symbolic_name .Self [symbolic_self = constants.%.Self.d7f]
  1197. // CHECK:STDOUT: %.Self.ref.loc8: %I.type.fc3 = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.d7f]
  1198. // CHECK:STDOUT: %.loc8_22.1: %I.assoc_type.b3c = specific_constant @T.%assoc0, @I(constants.%C) [concrete = constants.%assoc0.3e4]
  1199. // CHECK:STDOUT: %T.ref.loc8: %I.assoc_type.b3c = name_ref T, %.loc8_22.1 [concrete = constants.%assoc0.3e4]
  1200. // CHECK:STDOUT: %.Self.as_type.loc8: type = facet_access_type %.Self.ref.loc8 [symbolic_self = constants.%.Self.as_type]
  1201. // CHECK:STDOUT: %.loc8_22.2: type = converted %.Self.ref.loc8, %.Self.as_type.loc8 [symbolic_self = constants.%.Self.as_type]
  1202. // CHECK:STDOUT: %impl.elem0.loc8: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1203. // CHECK:STDOUT: %C.ref.loc8_27: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1204. // CHECK:STDOUT: %.loc8_16: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  1205. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type.fc3
  1206. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc8, %C.ref.loc8_27
  1207. // CHECK:STDOUT: }
  1208. // CHECK:STDOUT: }
  1209. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @D.as.I.impl [concrete]
  1210. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1211. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C]
  1212. // CHECK:STDOUT: %C.decl.loc10: type = class_decl @C [concrete = constants.%C] {} {}
  1213. // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {} {
  1214. // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1215. // CHECK:STDOUT: %I.ref.loc11: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  1216. // CHECK:STDOUT: %C.ref.loc11_13: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1217. // CHECK:STDOUT: %I.type.loc11: type = facet_type <@I, @I(constants.%C)> [concrete = constants.%I.type.fc3]
  1218. // CHECK:STDOUT: %.Self.1: %I.type.fc3 = bind_symbolic_name .Self [symbolic_self = constants.%.Self.d7f]
  1219. // CHECK:STDOUT: %.Self.ref.loc11: %I.type.fc3 = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self.d7f]
  1220. // CHECK:STDOUT: %.loc11_22.1: %I.assoc_type.b3c = specific_constant @T.%assoc0, @I(constants.%C) [concrete = constants.%assoc0.3e4]
  1221. // CHECK:STDOUT: %T.ref.loc11: %I.assoc_type.b3c = name_ref T, %.loc11_22.1 [concrete = constants.%assoc0.3e4]
  1222. // CHECK:STDOUT: %.Self.as_type.loc11: type = facet_access_type %.Self.ref.loc11 [symbolic_self = constants.%.Self.as_type]
  1223. // CHECK:STDOUT: %.loc11_22.2: type = converted %.Self.ref.loc11, %.Self.as_type.loc11 [symbolic_self = constants.%.Self.as_type]
  1224. // CHECK:STDOUT: %impl.elem0.loc11: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1225. // CHECK:STDOUT: %C.ref.loc11_27: type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C]
  1226. // CHECK:STDOUT: %.loc11_16: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  1227. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type.fc3
  1228. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11, %C.ref.loc11_27
  1229. // CHECK:STDOUT: }
  1230. // CHECK:STDOUT: }
  1231. // CHECK:STDOUT: }
  1232. // CHECK:STDOUT:
  1233. // CHECK:STDOUT: generic interface @I(%U.loc3_13.2: type) {
  1234. // CHECK:STDOUT: %U.loc3_13.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc3_13.1 (constants.%U)]
  1235. // CHECK:STDOUT:
  1236. // CHECK:STDOUT: !definition:
  1237. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U.loc3_13.1)> [symbolic = %I.type (constants.%I.type.b13)]
  1238. // CHECK:STDOUT: %Self.2: @I.%I.type (%I.type.b13) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.dae)]
  1239. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%U.loc3_13.1) [symbolic = %I.assoc_type (constants.%I.assoc_type.1e5)]
  1240. // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.1e5) = assoc_entity element0, %T [symbolic = %assoc0 (constants.%assoc0.7f3)]
  1241. // CHECK:STDOUT:
  1242. // CHECK:STDOUT: interface {
  1243. // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.b13) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.dae)]
  1244. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  1245. // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.1e5) = assoc_entity element0, @I.%T [symbolic = @I.%assoc0 (constants.%assoc0.7f3)]
  1246. // CHECK:STDOUT: }
  1247. // CHECK:STDOUT:
  1248. // CHECK:STDOUT: !members:
  1249. // CHECK:STDOUT: .Self = %Self.1
  1250. // CHECK:STDOUT: .T = @T.%assoc0
  1251. // CHECK:STDOUT: witness = (%T)
  1252. // CHECK:STDOUT: }
  1253. // CHECK:STDOUT: }
  1254. // CHECK:STDOUT:
  1255. // CHECK:STDOUT: generic assoc_const @T(@I.%U.loc3_13.2: type, @I.%Self.1: @I.%I.type (%I.type.b13)) {
  1256. // CHECK:STDOUT: assoc_const T:! type;
  1257. // CHECK:STDOUT: }
  1258. // CHECK:STDOUT:
  1259. // CHECK:STDOUT: impl @D.as.Destroy.impl: @D.%Self.ref as constants.%Destroy.type {
  1260. // CHECK:STDOUT: %D.as.Destroy.impl.Op.decl: %D.as.Destroy.impl.Op.type = fn_decl @D.as.Destroy.impl.Op [concrete = constants.%D.as.Destroy.impl.Op] {
  1261. // CHECK:STDOUT: %self.patt: %pattern_type.a94 = binding_pattern self [concrete]
  1262. // CHECK:STDOUT: %self.param_patt: %pattern_type.a94 = value_param_pattern %self.patt, call_param0 [concrete]
  1263. // CHECK:STDOUT: %.loc7: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1264. // CHECK:STDOUT: } {
  1265. // CHECK:STDOUT: %self.param: %ptr.19c = value_param call_param0
  1266. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
  1267. // CHECK:STDOUT: %self: %ptr.19c = bind_name self, %self.param
  1268. // CHECK:STDOUT: }
  1269. // CHECK:STDOUT:
  1270. // CHECK:STDOUT: !members:
  1271. // CHECK:STDOUT: .Op = %D.as.Destroy.impl.Op.decl
  1272. // CHECK:STDOUT: witness = @D.%Destroy.impl_witness
  1273. // CHECK:STDOUT: }
  1274. // CHECK:STDOUT:
  1275. // CHECK:STDOUT: impl @D.as.I.impl: %D.ref.loc8 as %.loc8_16 {
  1276. // CHECK:STDOUT: !members:
  1277. // CHECK:STDOUT: witness = file.%I.impl_witness
  1278. // CHECK:STDOUT: }
  1279. // CHECK:STDOUT:
  1280. // CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type {
  1281. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  1282. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  1283. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  1284. // CHECK:STDOUT: %.loc10: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1285. // CHECK:STDOUT: } {
  1286. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  1287. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1288. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  1289. // CHECK:STDOUT: }
  1290. // CHECK:STDOUT:
  1291. // CHECK:STDOUT: !members:
  1292. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  1293. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  1294. // CHECK:STDOUT: }
  1295. // CHECK:STDOUT:
  1296. // CHECK:STDOUT: class @C {
  1297. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1298. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  1299. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  1300. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.071]
  1301. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1302. // CHECK:STDOUT: complete_type_witness = %complete_type
  1303. // CHECK:STDOUT:
  1304. // CHECK:STDOUT: !members:
  1305. // CHECK:STDOUT: .Self = constants.%C
  1306. // CHECK:STDOUT: }
  1307. // CHECK:STDOUT:
  1308. // CHECK:STDOUT: class @D {
  1309. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
  1310. // CHECK:STDOUT: impl_decl @D.as.Destroy.impl [concrete] {} {}
  1311. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@D.as.Destroy.impl.%D.as.Destroy.impl.Op.decl), @D.as.Destroy.impl [concrete]
  1312. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.cd5]
  1313. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1314. // CHECK:STDOUT: complete_type_witness = %complete_type
  1315. // CHECK:STDOUT:
  1316. // CHECK:STDOUT: !members:
  1317. // CHECK:STDOUT: .Self = constants.%D
  1318. // CHECK:STDOUT: }
  1319. // CHECK:STDOUT:
  1320. // CHECK:STDOUT: fn @D.as.Destroy.impl.Op(%self.param: %ptr.19c) = "no_op";
  1321. // CHECK:STDOUT:
  1322. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  1323. // CHECK:STDOUT:
  1324. // CHECK:STDOUT: specific @I(constants.%U) {
  1325. // CHECK:STDOUT: %U.loc3_13.1 => constants.%U
  1326. // CHECK:STDOUT: }
  1327. // CHECK:STDOUT:
  1328. // CHECK:STDOUT: specific @T(constants.%U, constants.%Self.dae) {}
  1329. // CHECK:STDOUT:
  1330. // CHECK:STDOUT: specific @I(constants.%C) {
  1331. // CHECK:STDOUT: %U.loc3_13.1 => constants.%C
  1332. // CHECK:STDOUT:
  1333. // CHECK:STDOUT: !definition:
  1334. // CHECK:STDOUT: %I.type => constants.%I.type.fc3
  1335. // CHECK:STDOUT: %Self.2 => constants.%Self.0d0
  1336. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.b3c
  1337. // CHECK:STDOUT: %assoc0 => constants.%assoc0.3e4
  1338. // CHECK:STDOUT: }
  1339. // CHECK:STDOUT:
  1340. // CHECK:STDOUT: specific @T(constants.%C, constants.%I.facet) {}
  1341. // CHECK:STDOUT:
  1342. // CHECK:STDOUT: --- find_incomplete_impl.carbon
  1343. // CHECK:STDOUT:
  1344. // CHECK:STDOUT: constants {
  1345. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1346. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  1347. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1348. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1349. // CHECK:STDOUT: %Destroy.impl_witness.cd5: <witness> = impl_witness @D.%Destroy.impl_witness_table [concrete]
  1350. // CHECK:STDOUT: %ptr.19c: type = ptr_type %D [concrete]
  1351. // CHECK:STDOUT: %pattern_type.a94: type = pattern_type %ptr.19c [concrete]
  1352. // CHECK:STDOUT: %D.as.Destroy.impl.Op.type: type = fn_type @D.as.Destroy.impl.Op [concrete]
  1353. // CHECK:STDOUT: %D.as.Destroy.impl.Op: %D.as.Destroy.impl.Op.type = struct_value () [concrete]
  1354. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1355. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1356. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  1357. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1358. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  1359. // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic]
  1360. // CHECK:STDOUT: %pattern_type.09a: type = pattern_type %I.type [concrete]
  1361. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  1362. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  1363. // CHECK:STDOUT: %C.8f0: type = class_type @C, @C(%T) [symbolic]
  1364. // CHECK:STDOUT: %I.facet: %I.type = facet_value %D, (%I.impl_witness) [concrete]
  1365. // CHECK:STDOUT: %C.cc1: type = class_type @C, @C(%I.facet) [concrete]
  1366. // CHECK:STDOUT: %pattern_type.480: type = pattern_type %C.cc1 [concrete]
  1367. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1368. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1369. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1370. // CHECK:STDOUT: %Destroy.impl_witness.250: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic]
  1371. // CHECK:STDOUT: %ptr.2e8: type = ptr_type %C.8f0 [symbolic]
  1372. // CHECK:STDOUT: %pattern_type.09c: type = pattern_type %ptr.2e8 [symbolic]
  1373. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%T) [symbolic]
  1374. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [symbolic]
  1375. // CHECK:STDOUT: }
  1376. // CHECK:STDOUT:
  1377. // CHECK:STDOUT: imports {
  1378. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1379. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1380. // CHECK:STDOUT: import Core//prelude
  1381. // CHECK:STDOUT: import Core//prelude/...
  1382. // CHECK:STDOUT: }
  1383. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1384. // CHECK:STDOUT: }
  1385. // CHECK:STDOUT:
  1386. // CHECK:STDOUT: file {
  1387. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1388. // CHECK:STDOUT: .Core = imports.%Core
  1389. // CHECK:STDOUT: .I = %I.decl.loc3
  1390. // CHECK:STDOUT: .D = %D.decl
  1391. // CHECK:STDOUT: .C = %C.decl.loc6
  1392. // CHECK:STDOUT: .F = %F.decl.loc8
  1393. // CHECK:STDOUT: }
  1394. // CHECK:STDOUT: %Core.import = import Core
  1395. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1396. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1397. // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {} {
  1398. // CHECK:STDOUT: %D.ref.loc5: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1399. // CHECK:STDOUT: %I.ref.loc5: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1400. // CHECK:STDOUT: }
  1401. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @D.as.I.impl [concrete]
  1402. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1403. // CHECK:STDOUT: %C.decl.loc6: %C.type = class_decl @C [concrete = constants.%C.generic] {
  1404. // CHECK:STDOUT: %T.patt: %pattern_type.09a = symbolic_binding_pattern T, 0 [concrete]
  1405. // CHECK:STDOUT: } {
  1406. // CHECK:STDOUT: %.loc6: type = splice_block %I.ref.loc6 [concrete = constants.%I.type] {
  1407. // CHECK:STDOUT: %.Self.2: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1408. // CHECK:STDOUT: %I.ref.loc6: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1409. // CHECK:STDOUT: }
  1410. // CHECK:STDOUT: %T.loc6_9.2: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.1 (constants.%T)]
  1411. // CHECK:STDOUT: }
  1412. // CHECK:STDOUT: %F.decl.loc8: %F.type = fn_decl @F [concrete = constants.%F] {
  1413. // CHECK:STDOUT: %x.patt: %pattern_type.480 = binding_pattern x [concrete]
  1414. // CHECK:STDOUT: %x.param_patt: %pattern_type.480 = value_param_pattern %x.patt, call_param0 [concrete]
  1415. // CHECK:STDOUT: } {
  1416. // CHECK:STDOUT: %x.param.loc8: %C.cc1 = value_param call_param0
  1417. // CHECK:STDOUT: %.loc8_12.1: type = splice_block %C.loc8 [concrete = constants.%C.cc1] {
  1418. // CHECK:STDOUT: %C.ref.loc8: %C.type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C.generic]
  1419. // CHECK:STDOUT: %D.ref.loc8: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1420. // CHECK:STDOUT: %I.facet.loc8: %I.type = facet_value constants.%D, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  1421. // CHECK:STDOUT: %.loc8_12.2: %I.type = converted %D.ref.loc8, %I.facet.loc8 [concrete = constants.%I.facet]
  1422. // CHECK:STDOUT: %C.loc8: type = class_type @C, @C(constants.%I.facet) [concrete = constants.%C.cc1]
  1423. // CHECK:STDOUT: }
  1424. // CHECK:STDOUT: %x.loc8: %C.cc1 = bind_name x, %x.param.loc8
  1425. // CHECK:STDOUT: }
  1426. // CHECK:STDOUT: %I.decl.loc10: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1427. // CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {} {
  1428. // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1429. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1430. // CHECK:STDOUT: }
  1431. // CHECK:STDOUT: %C.decl.loc12: %C.type = class_decl @C [concrete = constants.%C.generic] {
  1432. // CHECK:STDOUT: %T.patt: %pattern_type.09a = symbolic_binding_pattern T, 0 [concrete]
  1433. // CHECK:STDOUT: } {
  1434. // CHECK:STDOUT: %.loc12: type = splice_block %I.ref.loc12 [concrete = constants.%I.type] {
  1435. // CHECK:STDOUT: %.Self.1: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1436. // CHECK:STDOUT: %I.ref.loc12: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1437. // CHECK:STDOUT: }
  1438. // CHECK:STDOUT: %T.loc12: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.1 (constants.%T)]
  1439. // CHECK:STDOUT: }
  1440. // CHECK:STDOUT: %F.decl.loc14: %F.type = fn_decl @F [concrete = constants.%F] {
  1441. // CHECK:STDOUT: %x.patt: %pattern_type.480 = binding_pattern x [concrete]
  1442. // CHECK:STDOUT: %x.param_patt: %pattern_type.480 = value_param_pattern %x.patt, call_param0 [concrete]
  1443. // CHECK:STDOUT: } {
  1444. // CHECK:STDOUT: %x.param.loc14: %C.cc1 = value_param call_param0
  1445. // CHECK:STDOUT: %.loc14_12.1: type = splice_block %C.loc14 [concrete = constants.%C.cc1] {
  1446. // CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C.generic]
  1447. // CHECK:STDOUT: %D.ref.loc14: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1448. // CHECK:STDOUT: %I.facet.loc14: %I.type = facet_value constants.%D, (constants.%I.impl_witness) [concrete = constants.%I.facet]
  1449. // CHECK:STDOUT: %.loc14_12.2: %I.type = converted %D.ref.loc14, %I.facet.loc14 [concrete = constants.%I.facet]
  1450. // CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%I.facet) [concrete = constants.%C.cc1]
  1451. // CHECK:STDOUT: }
  1452. // CHECK:STDOUT: %x.loc14: %C.cc1 = bind_name x, %x.param.loc14
  1453. // CHECK:STDOUT: }
  1454. // CHECK:STDOUT: }
  1455. // CHECK:STDOUT:
  1456. // CHECK:STDOUT: interface @I {
  1457. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  1458. // CHECK:STDOUT:
  1459. // CHECK:STDOUT: !members:
  1460. // CHECK:STDOUT: .Self = %Self
  1461. // CHECK:STDOUT: witness = ()
  1462. // CHECK:STDOUT: }
  1463. // CHECK:STDOUT:
  1464. // CHECK:STDOUT: impl @D.as.Destroy.impl: @D.%Self.ref as constants.%Destroy.type {
  1465. // CHECK:STDOUT: %D.as.Destroy.impl.Op.decl: %D.as.Destroy.impl.Op.type = fn_decl @D.as.Destroy.impl.Op [concrete = constants.%D.as.Destroy.impl.Op] {
  1466. // CHECK:STDOUT: %self.patt: %pattern_type.a94 = binding_pattern self [concrete]
  1467. // CHECK:STDOUT: %self.param_patt: %pattern_type.a94 = value_param_pattern %self.patt, call_param0 [concrete]
  1468. // CHECK:STDOUT: %.loc4: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1469. // CHECK:STDOUT: } {
  1470. // CHECK:STDOUT: %self.param: %ptr.19c = value_param call_param0
  1471. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
  1472. // CHECK:STDOUT: %self: %ptr.19c = bind_name self, %self.param
  1473. // CHECK:STDOUT: }
  1474. // CHECK:STDOUT:
  1475. // CHECK:STDOUT: !members:
  1476. // CHECK:STDOUT: .Op = %D.as.Destroy.impl.Op.decl
  1477. // CHECK:STDOUT: witness = @D.%Destroy.impl_witness
  1478. // CHECK:STDOUT: }
  1479. // CHECK:STDOUT:
  1480. // CHECK:STDOUT: impl @D.as.I.impl: %D.ref.loc5 as %I.ref.loc5 {
  1481. // CHECK:STDOUT: !members:
  1482. // CHECK:STDOUT: witness = file.%I.impl_witness
  1483. // CHECK:STDOUT: }
  1484. // CHECK:STDOUT:
  1485. // CHECK:STDOUT: generic impl @C.as.Destroy.impl(@C.%T.loc12: %I.type) {
  1486. // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1487. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.8f0)]
  1488. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.250)]
  1489. // CHECK:STDOUT:
  1490. // CHECK:STDOUT: !definition:
  1491. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%T) [symbolic = %C.as.Destroy.impl.Op.type (constants.%C.as.Destroy.impl.Op.type)]
  1492. // CHECK:STDOUT: %C.as.Destroy.impl.Op: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = struct_value () [symbolic = %C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)]
  1493. // CHECK:STDOUT:
  1494. // CHECK:STDOUT: impl: @C.%Self.ref as constants.%Destroy.type {
  1495. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = fn_decl @C.as.Destroy.impl.Op [symbolic = @C.as.Destroy.impl.%C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)] {
  1496. // CHECK:STDOUT: %self.patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.09c) = binding_pattern self [concrete]
  1497. // CHECK:STDOUT: %self.param_patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.09c) = value_param_pattern %self.patt, call_param0 [concrete]
  1498. // CHECK:STDOUT: %.loc12_16.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1499. // CHECK:STDOUT: } {
  1500. // CHECK:STDOUT: %self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.2e8) = value_param call_param0
  1501. // CHECK:STDOUT: %.loc12_16.2: type = splice_block %Self.ref [symbolic = %C (constants.%C.8f0)] {
  1502. // CHECK:STDOUT: %.loc12_16.3: type = specific_constant constants.%C.8f0, @C(constants.%T) [symbolic = %C (constants.%C.8f0)]
  1503. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc12_16.3 [symbolic = %C (constants.%C.8f0)]
  1504. // CHECK:STDOUT: }
  1505. // CHECK:STDOUT: %self: @C.as.Destroy.impl.Op.%ptr (%ptr.2e8) = bind_name self, %self.param
  1506. // CHECK:STDOUT: }
  1507. // CHECK:STDOUT:
  1508. // CHECK:STDOUT: !members:
  1509. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  1510. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  1511. // CHECK:STDOUT: }
  1512. // CHECK:STDOUT: }
  1513. // CHECK:STDOUT:
  1514. // CHECK:STDOUT: class @D {
  1515. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
  1516. // CHECK:STDOUT: impl_decl @D.as.Destroy.impl [concrete] {} {}
  1517. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@D.as.Destroy.impl.%D.as.Destroy.impl.Op.decl), @D.as.Destroy.impl [concrete]
  1518. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.cd5]
  1519. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1520. // CHECK:STDOUT: complete_type_witness = %complete_type
  1521. // CHECK:STDOUT:
  1522. // CHECK:STDOUT: !members:
  1523. // CHECK:STDOUT: .Self = constants.%D
  1524. // CHECK:STDOUT: }
  1525. // CHECK:STDOUT:
  1526. // CHECK:STDOUT: generic class @C(%T.loc6_9.2: %I.type) {
  1527. // CHECK:STDOUT: %T.loc6_9.1: %I.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.1 (constants.%T)]
  1528. // CHECK:STDOUT:
  1529. // CHECK:STDOUT: !definition:
  1530. // CHECK:STDOUT:
  1531. // CHECK:STDOUT: class {
  1532. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C.8f0 [symbolic = @C.as.Destroy.impl.%C (constants.%C.8f0)]
  1533. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  1534. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  1535. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table, @C.as.Destroy.impl(constants.%T) [symbolic = @C.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness.250)]
  1536. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1537. // CHECK:STDOUT: complete_type_witness = %complete_type
  1538. // CHECK:STDOUT:
  1539. // CHECK:STDOUT: !members:
  1540. // CHECK:STDOUT: .Self = constants.%C.8f0
  1541. // CHECK:STDOUT: }
  1542. // CHECK:STDOUT: }
  1543. // CHECK:STDOUT:
  1544. // CHECK:STDOUT: fn @D.as.Destroy.impl.Op(%self.param: %ptr.19c) = "no_op";
  1545. // CHECK:STDOUT:
  1546. // CHECK:STDOUT: fn @F(%x.param.loc14: %C.cc1) {
  1547. // CHECK:STDOUT: !entry:
  1548. // CHECK:STDOUT: return
  1549. // CHECK:STDOUT: }
  1550. // CHECK:STDOUT:
  1551. // CHECK:STDOUT: generic fn @C.as.Destroy.impl.Op(@C.%T.loc12: %I.type) {
  1552. // CHECK:STDOUT: %T: %I.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1553. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.8f0)]
  1554. // CHECK:STDOUT: %ptr: type = ptr_type %C [symbolic = %ptr (constants.%ptr.2e8)]
  1555. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.09c)]
  1556. // CHECK:STDOUT:
  1557. // CHECK:STDOUT: !definition:
  1558. // CHECK:STDOUT:
  1559. // CHECK:STDOUT: fn(%self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.2e8)) = "no_op";
  1560. // CHECK:STDOUT: }
  1561. // CHECK:STDOUT:
  1562. // CHECK:STDOUT: specific @C(constants.%T) {
  1563. // CHECK:STDOUT: %T.loc6_9.1 => constants.%T
  1564. // CHECK:STDOUT: }
  1565. // CHECK:STDOUT:
  1566. // CHECK:STDOUT: specific @C(constants.%I.facet) {
  1567. // CHECK:STDOUT: %T.loc6_9.1 => constants.%I.facet
  1568. // CHECK:STDOUT:
  1569. // CHECK:STDOUT: !definition:
  1570. // CHECK:STDOUT: }
  1571. // CHECK:STDOUT:
  1572. // CHECK:STDOUT: specific @C.as.Destroy.impl(constants.%T) {
  1573. // CHECK:STDOUT: %T => constants.%T
  1574. // CHECK:STDOUT: %C => constants.%C.8f0
  1575. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.250
  1576. // CHECK:STDOUT: }
  1577. // CHECK:STDOUT:
  1578. // CHECK:STDOUT: specific @C.as.Destroy.impl.Op(constants.%T) {
  1579. // CHECK:STDOUT: %T => constants.%T
  1580. // CHECK:STDOUT: %C => constants.%C.8f0
  1581. // CHECK:STDOUT: %ptr => constants.%ptr.2e8
  1582. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.09c
  1583. // CHECK:STDOUT: }
  1584. // CHECK:STDOUT:
  1585. // CHECK:STDOUT: --- fail_todo_two_interfaces.carbon
  1586. // CHECK:STDOUT:
  1587. // CHECK:STDOUT: constants {
  1588. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1589. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  1590. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1591. // CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete]
  1592. // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete]
  1593. // CHECK:STDOUT: %BitAndWith.type.8a6: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete]
  1594. // CHECK:STDOUT: %BitAndWith.Op.type.9a3: type = fn_type @BitAndWith.Op, @BitAndWith(type) [concrete]
  1595. // CHECK:STDOUT: %BitAndWith.impl_witness: <witness> = impl_witness imports.%BitAndWith.impl_witness_table [concrete]
  1596. // CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.8a6 = facet_value type, (%BitAndWith.impl_witness) [concrete]
  1597. // CHECK:STDOUT: %.fa7: type = fn_type_with_self_type %BitAndWith.Op.type.9a3, %BitAndWith.facet [concrete]
  1598. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete]
  1599. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete]
  1600. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: <bound method> = bound_method %I.type, %type.as.BitAndWith.impl.Op [concrete]
  1601. // CHECK:STDOUT: %facet_type: type = facet_type <@I & @J> [concrete]
  1602. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1603. // CHECK:STDOUT: %Self.bf6: %J.type = bind_symbolic_name Self, 0 [symbolic]
  1604. // CHECK:STDOUT: }
  1605. // CHECK:STDOUT:
  1606. // CHECK:STDOUT: imports {
  1607. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1608. // CHECK:STDOUT: .BitAndWith = %Core.BitAndWith
  1609. // CHECK:STDOUT: import Core//prelude
  1610. // CHECK:STDOUT: import Core//prelude/...
  1611. // CHECK:STDOUT: }
  1612. // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic]
  1613. // CHECK:STDOUT: %Core.import_ref.636: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc25_42, loaded [concrete = constants.%type.as.BitAndWith.impl.Op]
  1614. // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.636), @type.as.BitAndWith.impl [concrete]
  1615. // CHECK:STDOUT: }
  1616. // CHECK:STDOUT:
  1617. // CHECK:STDOUT: file {
  1618. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1619. // CHECK:STDOUT: .Core = imports.%Core
  1620. // CHECK:STDOUT: .I = %I.decl.loc3
  1621. // CHECK:STDOUT: .J = %J.decl.loc4
  1622. // CHECK:STDOUT: }
  1623. // CHECK:STDOUT: %Core.import = import Core
  1624. // CHECK:STDOUT: %I.decl.loc3: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1625. // CHECK:STDOUT: %J.decl.loc4: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1626. // 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]
  1627. // 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]
  1628. // CHECK:STDOUT: impl_decl @empty_struct_type.as.<error>.impl [concrete] {} {
  1629. // CHECK:STDOUT: %.loc10_7.1: %empty_struct_type = struct_literal ()
  1630. // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1631. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl.loc3 [concrete = constants.%I.type]
  1632. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl.loc4 [concrete = constants.%J.type]
  1633. // CHECK:STDOUT: %impl.elem0: %.fa7 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1634. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %I.ref, %impl.elem0 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1635. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call: init type = call %bound_method(%I.ref, %J.ref) [concrete = constants.%facet_type]
  1636. // CHECK:STDOUT: }
  1637. // CHECK:STDOUT: %I.decl.loc12: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1638. // CHECK:STDOUT: %J.decl.loc13: type = interface_decl @J [concrete = constants.%J.type] {} {}
  1639. // CHECK:STDOUT: }
  1640. // CHECK:STDOUT:
  1641. // CHECK:STDOUT: interface @I {
  1642. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  1643. // CHECK:STDOUT:
  1644. // CHECK:STDOUT: !members:
  1645. // CHECK:STDOUT: .Self = %Self
  1646. // CHECK:STDOUT: witness = ()
  1647. // CHECK:STDOUT: }
  1648. // CHECK:STDOUT:
  1649. // CHECK:STDOUT: interface @J {
  1650. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.bf6]
  1651. // CHECK:STDOUT:
  1652. // CHECK:STDOUT: !members:
  1653. // CHECK:STDOUT: .Self = %Self
  1654. // CHECK:STDOUT: witness = ()
  1655. // CHECK:STDOUT: }
  1656. // CHECK:STDOUT:
  1657. // CHECK:STDOUT: impl @empty_struct_type.as.<error>.impl: %.loc10_7.2 as file.%.loc10_14.2;
  1658. // CHECK:STDOUT:
  1659. // CHECK:STDOUT: --- fail_never_assigned_associated_const.carbon
  1660. // CHECK:STDOUT:
  1661. // CHECK:STDOUT: constants {
  1662. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1663. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1664. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1665. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  1666. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%U [concrete]
  1667. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1668. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1669. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1670. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  1671. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  1672. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  1673. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  1674. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1675. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  1676. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1677. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1678. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  1679. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  1680. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  1681. // CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  1682. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1683. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  1684. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  1685. // CHECK:STDOUT: }
  1686. // CHECK:STDOUT:
  1687. // CHECK:STDOUT: imports {
  1688. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1689. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1690. // CHECK:STDOUT: import Core//prelude
  1691. // CHECK:STDOUT: import Core//prelude/...
  1692. // CHECK:STDOUT: }
  1693. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1694. // CHECK:STDOUT: }
  1695. // CHECK:STDOUT:
  1696. // CHECK:STDOUT: file {
  1697. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1698. // CHECK:STDOUT: .Core = imports.%Core
  1699. // CHECK:STDOUT: .I = %I.decl
  1700. // CHECK:STDOUT: .C = %C.decl
  1701. // CHECK:STDOUT: }
  1702. // CHECK:STDOUT: %Core.import = import Core
  1703. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1704. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1705. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  1706. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1707. // CHECK:STDOUT: %I.ref.loc9: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1708. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1709. // CHECK:STDOUT: %.Self.ref.loc9: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  1710. // CHECK:STDOUT: %T.ref.loc9: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  1711. // CHECK:STDOUT: %.Self.as_type.loc9: type = facet_access_type %.Self.ref.loc9 [symbolic_self = constants.%.Self.as_type]
  1712. // CHECK:STDOUT: %.loc9_19: type = converted %.Self.ref.loc9, %.Self.as_type.loc9 [symbolic_self = constants.%.Self.as_type]
  1713. // CHECK:STDOUT: %impl.elem0.loc9: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1714. // CHECK:STDOUT: %.loc9_25.1: %empty_tuple.type = tuple_literal ()
  1715. // CHECK:STDOUT: %.loc9_25.2: type = converted %.loc9_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1716. // CHECK:STDOUT: %.loc9_13: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  1717. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1718. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9, %.loc9_25.2
  1719. // CHECK:STDOUT: }
  1720. // CHECK:STDOUT: }
  1721. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, <error>), @C.as.I.impl [concrete]
  1722. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1723. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1724. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  1725. // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1726. // CHECK:STDOUT: %I.ref.loc18: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1727. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1728. // CHECK:STDOUT: %.Self.ref.loc18: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  1729. // CHECK:STDOUT: %T.ref.loc18: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  1730. // CHECK:STDOUT: %.Self.as_type.loc18: type = facet_access_type %.Self.ref.loc18 [symbolic_self = constants.%.Self.as_type]
  1731. // CHECK:STDOUT: %.loc18_19: type = converted %.Self.ref.loc18, %.Self.as_type.loc18 [symbolic_self = constants.%.Self.as_type]
  1732. // CHECK:STDOUT: %impl.elem0.loc18: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1733. // CHECK:STDOUT: %.loc18_25.1: %empty_tuple.type = tuple_literal ()
  1734. // CHECK:STDOUT: %.loc18_25.2: type = converted %.loc18_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1735. // CHECK:STDOUT: %.loc18_13: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  1736. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1737. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc18, %.loc18_25.2
  1738. // CHECK:STDOUT: }
  1739. // CHECK:STDOUT: }
  1740. // CHECK:STDOUT: }
  1741. // CHECK:STDOUT:
  1742. // CHECK:STDOUT: interface @I {
  1743. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  1744. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  1745. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  1746. // CHECK:STDOUT: }
  1747. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1748. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%U [concrete = constants.%assoc1]
  1749. // CHECK:STDOUT: }
  1750. // CHECK:STDOUT:
  1751. // CHECK:STDOUT: !members:
  1752. // CHECK:STDOUT: .Self = %Self
  1753. // CHECK:STDOUT: .T = @T.%assoc0
  1754. // CHECK:STDOUT: .U = @U.%assoc1
  1755. // CHECK:STDOUT: witness = (%T, %U)
  1756. // CHECK:STDOUT: }
  1757. // CHECK:STDOUT:
  1758. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  1759. // CHECK:STDOUT: assoc_const T:! type;
  1760. // CHECK:STDOUT: }
  1761. // CHECK:STDOUT:
  1762. // CHECK:STDOUT: generic assoc_const @U(@I.%Self: %I.type) {
  1763. // CHECK:STDOUT: assoc_const U:! type;
  1764. // CHECK:STDOUT: }
  1765. // CHECK:STDOUT:
  1766. // CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type {
  1767. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  1768. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  1769. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  1770. // CHECK:STDOUT: %.loc7: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1771. // CHECK:STDOUT: } {
  1772. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  1773. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1774. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  1775. // CHECK:STDOUT: }
  1776. // CHECK:STDOUT:
  1777. // CHECK:STDOUT: !members:
  1778. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  1779. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  1780. // CHECK:STDOUT: }
  1781. // CHECK:STDOUT:
  1782. // CHECK:STDOUT: impl @C.as.I.impl: %C.ref.loc9 as %.loc9_13 {
  1783. // CHECK:STDOUT: !members:
  1784. // CHECK:STDOUT: witness = file.%I.impl_witness
  1785. // CHECK:STDOUT: }
  1786. // CHECK:STDOUT:
  1787. // CHECK:STDOUT: class @C {
  1788. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1789. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  1790. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  1791. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness]
  1792. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1793. // CHECK:STDOUT: complete_type_witness = %complete_type
  1794. // CHECK:STDOUT:
  1795. // CHECK:STDOUT: !members:
  1796. // CHECK:STDOUT: .Self = constants.%C
  1797. // CHECK:STDOUT: }
  1798. // CHECK:STDOUT:
  1799. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  1800. // CHECK:STDOUT:
  1801. // CHECK:STDOUT: specific @T(constants.%Self.7ee) {}
  1802. // CHECK:STDOUT:
  1803. // CHECK:STDOUT: specific @U(constants.%Self.7ee) {}
  1804. // CHECK:STDOUT:
  1805. // CHECK:STDOUT: specific @T(constants.%I.facet) {}
  1806. // CHECK:STDOUT:
  1807. // CHECK:STDOUT: --- example_from_proposal_5168.carbon
  1808. // CHECK:STDOUT:
  1809. // CHECK:STDOUT: constants {
  1810. // CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
  1811. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1812. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  1813. // CHECK:STDOUT: %U: %X.type = bind_symbolic_name U, 0 [symbolic]
  1814. // CHECK:STDOUT: %pattern_type.07d: type = pattern_type %X.type [concrete]
  1815. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1816. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1817. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1818. // CHECK:STDOUT: %U.as_type: type = facet_access_type %U [symbolic]
  1819. // CHECK:STDOUT: %pattern_type.523: type = pattern_type %U.as_type [symbolic]
  1820. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1821. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1822. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1823. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness file.%X.impl_witness_table [concrete]
  1824. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  1825. // CHECK:STDOUT: %Self.0ee: %X.type = bind_symbolic_name Self, 0 [symbolic]
  1826. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1827. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1828. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  1829. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  1830. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  1831. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  1832. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  1833. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1834. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1835. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  1836. // CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
  1837. // CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
  1838. // CHECK:STDOUT: %X.facet: %X.type = facet_value %C, (%X.impl_witness) [concrete]
  1839. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%X.facet) [concrete]
  1840. // CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G, @G(%X.facet) [concrete]
  1841. // CHECK:STDOUT: %Self.045: %Y.type = bind_symbolic_name Self, 0 [symbolic]
  1842. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %U.as_type [symbolic]
  1843. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness file.%Y.impl_witness_table [concrete]
  1844. // CHECK:STDOUT: }
  1845. // CHECK:STDOUT:
  1846. // CHECK:STDOUT: imports {
  1847. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1848. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1849. // CHECK:STDOUT: import Core//prelude
  1850. // CHECK:STDOUT: import Core//prelude/...
  1851. // CHECK:STDOUT: }
  1852. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1853. // CHECK:STDOUT: }
  1854. // CHECK:STDOUT:
  1855. // CHECK:STDOUT: file {
  1856. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1857. // CHECK:STDOUT: .Core = imports.%Core
  1858. // CHECK:STDOUT: .X = %X.decl.loc3
  1859. // CHECK:STDOUT: .F = %F.decl.loc6
  1860. // CHECK:STDOUT: .G = %G.decl.loc7
  1861. // CHECK:STDOUT: .C = %C.decl.loc9
  1862. // CHECK:STDOUT: .Y = %Y.decl.loc14
  1863. // CHECK:STDOUT: .H = %H.decl
  1864. // CHECK:STDOUT: }
  1865. // CHECK:STDOUT: %Core.import = import Core
  1866. // CHECK:STDOUT: %X.decl.loc3: type = interface_decl @X [concrete = constants.%X.type] {} {}
  1867. // CHECK:STDOUT: %F.decl.loc6: %F.type = fn_decl @F [concrete = constants.%F] {
  1868. // CHECK:STDOUT: %U.patt: %pattern_type.07d = symbolic_binding_pattern U, 0 [concrete]
  1869. // CHECK:STDOUT: } {
  1870. // CHECK:STDOUT: %.loc6: type = splice_block %X.ref.loc6 [concrete = constants.%X.type] {
  1871. // CHECK:STDOUT: %.Self.2: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1872. // CHECK:STDOUT: %X.ref.loc6: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1873. // CHECK:STDOUT: }
  1874. // CHECK:STDOUT: %U.loc6_6.2: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc6_6.1 (constants.%U)]
  1875. // CHECK:STDOUT: }
  1876. // CHECK:STDOUT: %G.decl.loc7: %G.type = fn_decl @G [concrete = constants.%G] {
  1877. // CHECK:STDOUT: %U.patt: %pattern_type.07d = symbolic_binding_pattern U, 0 [concrete]
  1878. // CHECK:STDOUT: %u.patt: @G.%pattern_type (%pattern_type.523) = binding_pattern u [concrete]
  1879. // CHECK:STDOUT: %u.param_patt: @G.%pattern_type (%pattern_type.523) = value_param_pattern %u.patt, call_param0 [concrete]
  1880. // CHECK:STDOUT: } {
  1881. // CHECK:STDOUT: %.loc7_10: type = splice_block %X.ref.loc7 [concrete = constants.%X.type] {
  1882. // CHECK:STDOUT: %.Self.2: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1883. // CHECK:STDOUT: %X.ref.loc7: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1884. // CHECK:STDOUT: }
  1885. // CHECK:STDOUT: %U.loc7_6.2: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc7_6.1 (constants.%U)]
  1886. // CHECK:STDOUT: %u.param.loc7: @G.%U.as_type.loc7_16.1 (%U.as_type) = value_param call_param0
  1887. // CHECK:STDOUT: %.loc7_16.1: type = splice_block %.loc7_16.2 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)] {
  1888. // CHECK:STDOUT: %U.ref.loc7: %X.type = name_ref U, %U.loc7_6.2 [symbolic = %U.loc7_6.1 (constants.%U)]
  1889. // 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)]
  1890. // 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)]
  1891. // CHECK:STDOUT: }
  1892. // CHECK:STDOUT: %u.loc7: @G.%U.as_type.loc7_16.1 (%U.as_type) = bind_name u, %u.param.loc7
  1893. // CHECK:STDOUT: }
  1894. // CHECK:STDOUT: %C.decl.loc9: type = class_decl @C [concrete = constants.%C] {} {}
  1895. // CHECK:STDOUT: impl_decl @C.as.X.impl [concrete] {} {
  1896. // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1897. // CHECK:STDOUT: %X.ref.loc12: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1898. // CHECK:STDOUT: }
  1899. // CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (), @C.as.X.impl [concrete]
  1900. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness]
  1901. // CHECK:STDOUT: %Y.decl.loc14: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
  1902. // CHECK:STDOUT: %X.decl.loc16: type = interface_decl @X [concrete = constants.%X.type] {} {}
  1903. // CHECK:STDOUT: %C.decl.loc23: type = class_decl @C [concrete = constants.%C] {} {}
  1904. // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {
  1905. // CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete]
  1906. // CHECK:STDOUT: %c.param_patt: %pattern_type.c48 = value_param_pattern %c.patt, call_param0 [concrete]
  1907. // CHECK:STDOUT: } {
  1908. // CHECK:STDOUT: %c.param: %C = value_param call_param0
  1909. // CHECK:STDOUT: %C.ref.loc25: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1910. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  1911. // CHECK:STDOUT: }
  1912. // CHECK:STDOUT: %Y.decl.loc33: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
  1913. // CHECK:STDOUT: %F.decl.loc34: %F.type = fn_decl @F [concrete = constants.%F] {
  1914. // CHECK:STDOUT: %U.patt: %pattern_type.07d = symbolic_binding_pattern U, 0 [concrete]
  1915. // CHECK:STDOUT: } {
  1916. // CHECK:STDOUT: %.loc34: type = splice_block %X.ref.loc34 [concrete = constants.%X.type] {
  1917. // CHECK:STDOUT: %.Self.1: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1918. // CHECK:STDOUT: %X.ref.loc34: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1919. // CHECK:STDOUT: }
  1920. // CHECK:STDOUT: %U.loc34: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc6_6.1 (constants.%U)]
  1921. // CHECK:STDOUT: }
  1922. // CHECK:STDOUT: %G.decl.loc35: %G.type = fn_decl @G [concrete = constants.%G] {
  1923. // CHECK:STDOUT: %U.patt: %pattern_type.07d = symbolic_binding_pattern U, 0 [concrete]
  1924. // CHECK:STDOUT: %u.patt: @G.%pattern_type (%pattern_type.523) = binding_pattern u [concrete]
  1925. // CHECK:STDOUT: %u.param_patt: @G.%pattern_type (%pattern_type.523) = value_param_pattern %u.patt, call_param0 [concrete]
  1926. // CHECK:STDOUT: } {
  1927. // CHECK:STDOUT: %.loc35_10: type = splice_block %X.ref.loc35 [concrete = constants.%X.type] {
  1928. // CHECK:STDOUT: %.Self.1: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1929. // CHECK:STDOUT: %X.ref.loc35: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1930. // CHECK:STDOUT: }
  1931. // CHECK:STDOUT: %U.loc35: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc7_6.1 (constants.%U)]
  1932. // CHECK:STDOUT: %u.param.loc35: @G.%U.as_type.loc7_16.1 (%U.as_type) = value_param call_param0
  1933. // CHECK:STDOUT: %.loc35_16.1: type = splice_block %.loc35_16.2 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)] {
  1934. // CHECK:STDOUT: %U.ref.loc35: %X.type = name_ref U, %U.loc35 [symbolic = %U.loc7_6.1 (constants.%U)]
  1935. // CHECK:STDOUT: %U.as_type.loc35: type = facet_access_type %U.ref.loc35 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)]
  1936. // CHECK:STDOUT: %.loc35_16.2: type = converted %U.ref.loc35, %U.as_type.loc35 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)]
  1937. // CHECK:STDOUT: }
  1938. // CHECK:STDOUT: %u.loc35: @G.%U.as_type.loc7_16.1 (%U.as_type) = bind_name u, %u.param.loc35
  1939. // CHECK:STDOUT: }
  1940. // CHECK:STDOUT: impl_decl @C.as.Y.impl [concrete] {} {
  1941. // CHECK:STDOUT: %C.ref.loc36: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1942. // CHECK:STDOUT: %Y.ref.loc36: type = name_ref Y, file.%Y.decl.loc14 [concrete = constants.%Y.type]
  1943. // CHECK:STDOUT: }
  1944. // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @C.as.Y.impl [concrete]
  1945. // CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness]
  1946. // CHECK:STDOUT: impl_decl @C.as.X.impl [concrete] {} {
  1947. // CHECK:STDOUT: %C.ref.loc37: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1948. // CHECK:STDOUT: %X.ref.loc37: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
  1949. // CHECK:STDOUT: }
  1950. // CHECK:STDOUT: impl_decl @C.as.Y.impl [concrete] {} {
  1951. // CHECK:STDOUT: %C.ref.loc38: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  1952. // CHECK:STDOUT: %Y.ref.loc38: type = name_ref Y, file.%Y.decl.loc14 [concrete = constants.%Y.type]
  1953. // CHECK:STDOUT: }
  1954. // CHECK:STDOUT: }
  1955. // CHECK:STDOUT:
  1956. // CHECK:STDOUT: interface @X {
  1957. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.0ee]
  1958. // CHECK:STDOUT:
  1959. // CHECK:STDOUT: !members:
  1960. // CHECK:STDOUT: .Self = %Self
  1961. // CHECK:STDOUT: witness = ()
  1962. // CHECK:STDOUT: }
  1963. // CHECK:STDOUT:
  1964. // CHECK:STDOUT: interface @Y {
  1965. // CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.045]
  1966. // CHECK:STDOUT:
  1967. // CHECK:STDOUT: !members:
  1968. // CHECK:STDOUT: .Self = %Self
  1969. // CHECK:STDOUT: witness = ()
  1970. // CHECK:STDOUT: }
  1971. // CHECK:STDOUT:
  1972. // CHECK:STDOUT: impl @C.as.X.impl: %C.ref.loc12 as %X.ref.loc12 {
  1973. // CHECK:STDOUT: !members:
  1974. // CHECK:STDOUT: witness = file.%X.impl_witness
  1975. // CHECK:STDOUT: }
  1976. // CHECK:STDOUT:
  1977. // CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type {
  1978. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  1979. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  1980. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  1981. // CHECK:STDOUT: %.loc23: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1982. // CHECK:STDOUT: } {
  1983. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  1984. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1985. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  1986. // CHECK:STDOUT: }
  1987. // CHECK:STDOUT:
  1988. // CHECK:STDOUT: !members:
  1989. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  1990. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  1991. // CHECK:STDOUT: }
  1992. // CHECK:STDOUT:
  1993. // CHECK:STDOUT: impl @C.as.Y.impl: %C.ref.loc36 as %Y.ref.loc36 {
  1994. // CHECK:STDOUT: !members:
  1995. // CHECK:STDOUT: witness = file.%Y.impl_witness
  1996. // CHECK:STDOUT: }
  1997. // CHECK:STDOUT:
  1998. // CHECK:STDOUT: class @C {
  1999. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  2000. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  2001. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  2002. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness]
  2003. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2004. // CHECK:STDOUT: complete_type_witness = %complete_type
  2005. // CHECK:STDOUT:
  2006. // CHECK:STDOUT: !members:
  2007. // CHECK:STDOUT: .Self = constants.%C
  2008. // CHECK:STDOUT: }
  2009. // CHECK:STDOUT:
  2010. // CHECK:STDOUT: generic fn @F(%U.loc6_6.2: %X.type) {
  2011. // CHECK:STDOUT: %U.loc6_6.1: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc6_6.1 (constants.%U)]
  2012. // CHECK:STDOUT:
  2013. // CHECK:STDOUT: !definition:
  2014. // CHECK:STDOUT:
  2015. // CHECK:STDOUT: fn() {
  2016. // CHECK:STDOUT: !entry:
  2017. // CHECK:STDOUT: return
  2018. // CHECK:STDOUT: }
  2019. // CHECK:STDOUT: }
  2020. // CHECK:STDOUT:
  2021. // CHECK:STDOUT: generic fn @G(%U.loc7_6.2: %X.type) {
  2022. // CHECK:STDOUT: %U.loc7_6.1: %X.type = bind_symbolic_name U, 0 [symbolic = %U.loc7_6.1 (constants.%U)]
  2023. // CHECK:STDOUT: %U.as_type.loc7_16.1: type = facet_access_type %U.loc7_6.1 [symbolic = %U.as_type.loc7_16.1 (constants.%U.as_type)]
  2024. // CHECK:STDOUT: %pattern_type: type = pattern_type %U.as_type.loc7_16.1 [symbolic = %pattern_type (constants.%pattern_type.523)]
  2025. // CHECK:STDOUT:
  2026. // CHECK:STDOUT: !definition:
  2027. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %U.as_type.loc7_16.1 [symbolic = %require_complete (constants.%require_complete)]
  2028. // CHECK:STDOUT:
  2029. // CHECK:STDOUT: fn(%u.param.loc35: @G.%U.as_type.loc7_16.1 (%U.as_type)) {
  2030. // CHECK:STDOUT: !entry:
  2031. // CHECK:STDOUT: return
  2032. // CHECK:STDOUT: }
  2033. // CHECK:STDOUT: }
  2034. // CHECK:STDOUT:
  2035. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  2036. // CHECK:STDOUT:
  2037. // CHECK:STDOUT: fn @H(%c.param: %C) {
  2038. // CHECK:STDOUT: !entry:
  2039. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl.loc6 [concrete = constants.%F]
  2040. // CHECK:STDOUT: %C.ref.loc27: type = name_ref C, file.%C.decl.loc9 [concrete = constants.%C]
  2041. // CHECK:STDOUT: %X.facet.loc27: %X.type = facet_value constants.%C, (constants.%X.impl_witness) [concrete = constants.%X.facet]
  2042. // CHECK:STDOUT: %.loc27: %X.type = converted %C.ref.loc27, %X.facet.loc27 [concrete = constants.%X.facet]
  2043. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%X.facet) [concrete = constants.%F.specific_fn]
  2044. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
  2045. // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl.loc7 [concrete = constants.%G]
  2046. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  2047. // CHECK:STDOUT: %X.facet.loc28_6.1: %X.type = facet_value constants.%C, (constants.%X.impl_witness) [concrete = constants.%X.facet]
  2048. // CHECK:STDOUT: %.loc28_6.1: %X.type = converted constants.%C, %X.facet.loc28_6.1 [concrete = constants.%X.facet]
  2049. // CHECK:STDOUT: %X.facet.loc28_6.2: %X.type = facet_value constants.%C, (constants.%X.impl_witness) [concrete = constants.%X.facet]
  2050. // CHECK:STDOUT: %.loc28_6.2: %X.type = converted constants.%C, %X.facet.loc28_6.2 [concrete = constants.%X.facet]
  2051. // CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G.ref, @G(constants.%X.facet) [concrete = constants.%G.specific_fn]
  2052. // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn(%c.ref)
  2053. // CHECK:STDOUT: return
  2054. // CHECK:STDOUT: }
  2055. // CHECK:STDOUT:
  2056. // CHECK:STDOUT: specific @F(constants.%U) {
  2057. // CHECK:STDOUT: %U.loc6_6.1 => constants.%U
  2058. // CHECK:STDOUT: }
  2059. // CHECK:STDOUT:
  2060. // CHECK:STDOUT: specific @G(constants.%U) {
  2061. // CHECK:STDOUT: %U.loc7_6.1 => constants.%U
  2062. // CHECK:STDOUT: %U.as_type.loc7_16.1 => constants.%U.as_type
  2063. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.523
  2064. // CHECK:STDOUT: }
  2065. // CHECK:STDOUT:
  2066. // CHECK:STDOUT: specific @F(constants.%X.facet) {
  2067. // CHECK:STDOUT: %U.loc6_6.1 => constants.%X.facet
  2068. // CHECK:STDOUT:
  2069. // CHECK:STDOUT: !definition:
  2070. // CHECK:STDOUT: }
  2071. // CHECK:STDOUT:
  2072. // CHECK:STDOUT: specific @G(constants.%X.facet) {
  2073. // CHECK:STDOUT: %U.loc7_6.1 => constants.%X.facet
  2074. // CHECK:STDOUT: %U.as_type.loc7_16.1 => constants.%C
  2075. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c48
  2076. // CHECK:STDOUT:
  2077. // CHECK:STDOUT: !definition:
  2078. // CHECK:STDOUT: %require_complete => constants.%complete_type
  2079. // CHECK:STDOUT: }
  2080. // CHECK:STDOUT:
  2081. // CHECK:STDOUT: --- fail_todo_impl_in_interface_definition.carbon
  2082. // CHECK:STDOUT:
  2083. // CHECK:STDOUT: constants {
  2084. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  2085. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  2086. // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
  2087. // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
  2088. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  2089. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%I.F.decl [concrete]
  2090. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self.7ee) [symbolic]
  2091. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  2092. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  2093. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%Self.7ee) [symbolic]
  2094. // CHECK:STDOUT: %ptr.12a: type = ptr_type %C [symbolic]
  2095. // CHECK:STDOUT: %pattern_type.d53: type = pattern_type %ptr.12a [symbolic]
  2096. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%Self.7ee) [symbolic]
  2097. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2098. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2099. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2100. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self.7ee) [symbolic]
  2101. // CHECK:STDOUT: }
  2102. // CHECK:STDOUT:
  2103. // CHECK:STDOUT: imports {
  2104. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2105. // CHECK:STDOUT: .Destroy = %Core.Destroy
  2106. // CHECK:STDOUT: import Core//prelude
  2107. // CHECK:STDOUT: import Core//prelude/...
  2108. // CHECK:STDOUT: }
  2109. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  2110. // CHECK:STDOUT: }
  2111. // CHECK:STDOUT:
  2112. // CHECK:STDOUT: file {
  2113. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2114. // CHECK:STDOUT: .Core = imports.%Core
  2115. // CHECK:STDOUT: .I = %I.decl
  2116. // CHECK:STDOUT: }
  2117. // CHECK:STDOUT: %Core.import = import Core
  2118. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  2119. // CHECK:STDOUT: }
  2120. // CHECK:STDOUT:
  2121. // CHECK:STDOUT: interface @I {
  2122. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  2123. // CHECK:STDOUT: %I.F.decl: %I.F.type = fn_decl @I.F [concrete = constants.%I.F] {} {}
  2124. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.F.decl [concrete = constants.%assoc0]
  2125. // CHECK:STDOUT:
  2126. // CHECK:STDOUT: !members:
  2127. // CHECK:STDOUT: .Self = %Self
  2128. // CHECK:STDOUT: .F = %assoc0
  2129. // CHECK:STDOUT: .I = <poisoned>
  2130. // CHECK:STDOUT: witness = (%I.F.decl)
  2131. // CHECK:STDOUT: }
  2132. // CHECK:STDOUT:
  2133. // CHECK:STDOUT: generic impl @C.as.Destroy.impl(@I.%Self: %I.type) {
  2134. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  2135. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2136. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%Self) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness)]
  2137. // CHECK:STDOUT:
  2138. // CHECK:STDOUT: !definition:
  2139. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%Self) [symbolic = %C.as.Destroy.impl.Op.type (constants.%C.as.Destroy.impl.Op.type)]
  2140. // CHECK:STDOUT: %C.as.Destroy.impl.Op: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = struct_value () [symbolic = %C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)]
  2141. // CHECK:STDOUT:
  2142. // CHECK:STDOUT: impl: @C.%Self.ref as constants.%Destroy.type {
  2143. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = fn_decl @C.as.Destroy.impl.Op [symbolic = @C.as.Destroy.impl.%C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)] {
  2144. // CHECK:STDOUT: %self.patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.d53) = binding_pattern self [concrete]
  2145. // CHECK:STDOUT: %self.param_patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.d53) = value_param_pattern %self.patt, call_param0 [concrete]
  2146. // CHECK:STDOUT: %.loc10_13.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  2147. // CHECK:STDOUT: } {
  2148. // CHECK:STDOUT: %self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.12a) = value_param call_param0
  2149. // CHECK:STDOUT: %.loc10_13.2: type = splice_block %Self.ref [symbolic = %C (constants.%C)] {
  2150. // CHECK:STDOUT: %.loc10_13.3: type = specific_constant constants.%C, @C(constants.%Self.7ee) [symbolic = %C (constants.%C)]
  2151. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_13.3 [symbolic = %C (constants.%C)]
  2152. // CHECK:STDOUT: }
  2153. // CHECK:STDOUT: %self: @C.as.Destroy.impl.Op.%ptr (%ptr.12a) = bind_name self, %self.param
  2154. // CHECK:STDOUT: }
  2155. // CHECK:STDOUT:
  2156. // CHECK:STDOUT: !members:
  2157. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  2158. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  2159. // CHECK:STDOUT: }
  2160. // CHECK:STDOUT: }
  2161. // CHECK:STDOUT:
  2162. // CHECK:STDOUT: generic impl @C.as.I.impl(@I.%Self: %I.type) {
  2163. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  2164. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2165. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness (constants.%I.impl_witness)]
  2166. // CHECK:STDOUT:
  2167. // CHECK:STDOUT: !definition:
  2168. // CHECK:STDOUT:
  2169. // CHECK:STDOUT: impl: %C.ref.loc11 as %I.ref.loc11 {
  2170. // CHECK:STDOUT: !members:
  2171. // CHECK:STDOUT: .F = <poisoned>
  2172. // CHECK:STDOUT: witness = @I.F.%I.impl_witness
  2173. // CHECK:STDOUT: }
  2174. // CHECK:STDOUT: }
  2175. // CHECK:STDOUT:
  2176. // CHECK:STDOUT: generic class @C(@I.%Self: %I.type) {
  2177. // CHECK:STDOUT: !definition:
  2178. // CHECK:STDOUT:
  2179. // CHECK:STDOUT: class {
  2180. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [symbolic = @C.as.Destroy.impl.%C (constants.%C)]
  2181. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  2182. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  2183. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table, @C.as.Destroy.impl(constants.%Self.7ee) [symbolic = @C.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness)]
  2184. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2185. // CHECK:STDOUT: complete_type_witness = %complete_type
  2186. // CHECK:STDOUT:
  2187. // CHECK:STDOUT: !members:
  2188. // CHECK:STDOUT: .Self = constants.%C
  2189. // CHECK:STDOUT: }
  2190. // CHECK:STDOUT: }
  2191. // CHECK:STDOUT:
  2192. // CHECK:STDOUT: generic fn @I.F(@I.%Self: %I.type) {
  2193. // CHECK:STDOUT: !definition:
  2194. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  2195. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2196. // CHECK:STDOUT:
  2197. // CHECK:STDOUT: fn() {
  2198. // CHECK:STDOUT: !entry:
  2199. // CHECK:STDOUT: %C.decl: type = class_decl @C [symbolic = @I.F.%C (constants.%C)] {} {}
  2200. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  2201. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, @I.F.%C.decl [symbolic = %C (constants.%C)]
  2202. // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  2203. // CHECK:STDOUT: }
  2204. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (<error>), @C.as.I.impl [concrete]
  2205. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Self.7ee) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)]
  2206. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  2207. // CHECK:STDOUT: %C.ref.loc20: type = name_ref C, @I.F.%C.decl [symbolic = %C (constants.%C)]
  2208. // CHECK:STDOUT: %I.ref.loc20: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  2209. // CHECK:STDOUT: }
  2210. // CHECK:STDOUT: return
  2211. // CHECK:STDOUT: }
  2212. // CHECK:STDOUT: }
  2213. // CHECK:STDOUT:
  2214. // CHECK:STDOUT: generic fn @C.as.Destroy.impl.Op(@I.%Self: %I.type) {
  2215. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  2216. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2217. // CHECK:STDOUT: %ptr: type = ptr_type %C [symbolic = %ptr (constants.%ptr.12a)]
  2218. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.d53)]
  2219. // CHECK:STDOUT:
  2220. // CHECK:STDOUT: !definition:
  2221. // CHECK:STDOUT:
  2222. // CHECK:STDOUT: fn(%self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.12a)) = "no_op";
  2223. // CHECK:STDOUT: }
  2224. // CHECK:STDOUT:
  2225. // CHECK:STDOUT: specific @I.F(constants.%Self.7ee) {}
  2226. // CHECK:STDOUT:
  2227. // CHECK:STDOUT: specific @C(constants.%Self.7ee) {}
  2228. // CHECK:STDOUT:
  2229. // CHECK:STDOUT: specific @C.as.Destroy.impl(constants.%Self.7ee) {
  2230. // CHECK:STDOUT: %Self => constants.%Self.7ee
  2231. // CHECK:STDOUT: %C => constants.%C
  2232. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness
  2233. // CHECK:STDOUT: }
  2234. // CHECK:STDOUT:
  2235. // CHECK:STDOUT: specific @C.as.Destroy.impl.Op(constants.%Self.7ee) {
  2236. // CHECK:STDOUT: %Self => constants.%Self.7ee
  2237. // CHECK:STDOUT: %C => constants.%C
  2238. // CHECK:STDOUT: %ptr => constants.%ptr.12a
  2239. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.d53
  2240. // CHECK:STDOUT: }
  2241. // CHECK:STDOUT:
  2242. // CHECK:STDOUT: specific @C.as.I.impl(constants.%Self.7ee) {
  2243. // CHECK:STDOUT: %Self => constants.%Self.7ee
  2244. // CHECK:STDOUT: %C => constants.%C
  2245. // CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness
  2246. // CHECK:STDOUT: }
  2247. // CHECK:STDOUT:
  2248. // CHECK:STDOUT: --- fail_todo_impl_in_interface_definition_with_associated.carbon
  2249. // CHECK:STDOUT:
  2250. // CHECK:STDOUT: constants {
  2251. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  2252. // CHECK:STDOUT: %Self.7ee: %I.type = bind_symbolic_name Self, 0 [symbolic]
  2253. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  2254. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%U [concrete]
  2255. // CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
  2256. // CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
  2257. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%I.F.decl [concrete]
  2258. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self.7ee) [symbolic]
  2259. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  2260. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  2261. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%Self.7ee) [symbolic]
  2262. // CHECK:STDOUT: %ptr.12a: type = ptr_type %C [symbolic]
  2263. // CHECK:STDOUT: %pattern_type.d53: type = pattern_type %ptr.12a [symbolic]
  2264. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%Self.7ee) [symbolic]
  2265. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [symbolic]
  2266. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  2267. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  2268. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  2269. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  2270. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  2271. // CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  2272. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  2273. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %C> [symbolic]
  2274. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %I_where.type [symbolic]
  2275. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self.7ee) [symbolic]
  2276. // CHECK:STDOUT: }
  2277. // CHECK:STDOUT:
  2278. // CHECK:STDOUT: imports {
  2279. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  2280. // CHECK:STDOUT: .Destroy = %Core.Destroy
  2281. // CHECK:STDOUT: import Core//prelude
  2282. // CHECK:STDOUT: import Core//prelude/...
  2283. // CHECK:STDOUT: }
  2284. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  2285. // CHECK:STDOUT: }
  2286. // CHECK:STDOUT:
  2287. // CHECK:STDOUT: file {
  2288. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  2289. // CHECK:STDOUT: .Core = imports.%Core
  2290. // CHECK:STDOUT: .I = %I.decl
  2291. // CHECK:STDOUT: }
  2292. // CHECK:STDOUT: %Core.import = import Core
  2293. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  2294. // CHECK:STDOUT: }
  2295. // CHECK:STDOUT:
  2296. // CHECK:STDOUT: interface @I {
  2297. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7ee]
  2298. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  2299. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%U [concrete = constants.%assoc0]
  2300. // CHECK:STDOUT: }
  2301. // CHECK:STDOUT: %I.F.decl: %I.F.type = fn_decl @I.F [concrete = constants.%I.F] {} {}
  2302. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %I.F.decl [concrete = constants.%assoc1]
  2303. // CHECK:STDOUT:
  2304. // CHECK:STDOUT: !members:
  2305. // CHECK:STDOUT: .Self = %Self
  2306. // CHECK:STDOUT: .U = @U.%assoc0
  2307. // CHECK:STDOUT: .F = %assoc1
  2308. // CHECK:STDOUT: .I = <poisoned>
  2309. // CHECK:STDOUT: witness = (%U, %I.F.decl)
  2310. // CHECK:STDOUT: }
  2311. // CHECK:STDOUT:
  2312. // CHECK:STDOUT: generic assoc_const @U(@I.%Self: %I.type) {
  2313. // CHECK:STDOUT: assoc_const U:! type;
  2314. // CHECK:STDOUT: }
  2315. // CHECK:STDOUT:
  2316. // CHECK:STDOUT: generic impl @C.as.Destroy.impl(@I.%Self: %I.type) {
  2317. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  2318. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2319. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%Self) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness)]
  2320. // CHECK:STDOUT:
  2321. // CHECK:STDOUT: !definition:
  2322. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%Self) [symbolic = %C.as.Destroy.impl.Op.type (constants.%C.as.Destroy.impl.Op.type)]
  2323. // CHECK:STDOUT: %C.as.Destroy.impl.Op: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = struct_value () [symbolic = %C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)]
  2324. // CHECK:STDOUT:
  2325. // CHECK:STDOUT: impl: @C.%Self.ref as constants.%Destroy.type {
  2326. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = fn_decl @C.as.Destroy.impl.Op [symbolic = @C.as.Destroy.impl.%C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)] {
  2327. // CHECK:STDOUT: %self.patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.d53) = binding_pattern self [concrete]
  2328. // CHECK:STDOUT: %self.param_patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.d53) = value_param_pattern %self.patt, call_param0 [concrete]
  2329. // CHECK:STDOUT: %.loc11_13.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  2330. // CHECK:STDOUT: } {
  2331. // CHECK:STDOUT: %self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.12a) = value_param call_param0
  2332. // CHECK:STDOUT: %.loc11_13.2: type = splice_block %Self.ref [symbolic = %C (constants.%C)] {
  2333. // CHECK:STDOUT: %.loc11_13.3: type = specific_constant constants.%C, @C(constants.%Self.7ee) [symbolic = %C (constants.%C)]
  2334. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc11_13.3 [symbolic = %C (constants.%C)]
  2335. // CHECK:STDOUT: }
  2336. // CHECK:STDOUT: %self: @C.as.Destroy.impl.Op.%ptr (%ptr.12a) = bind_name self, %self.param
  2337. // CHECK:STDOUT: }
  2338. // CHECK:STDOUT:
  2339. // CHECK:STDOUT: !members:
  2340. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  2341. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  2342. // CHECK:STDOUT: }
  2343. // CHECK:STDOUT: }
  2344. // CHECK:STDOUT:
  2345. // CHECK:STDOUT: generic impl @C.as.I.impl(@I.%Self: %I.type) {
  2346. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  2347. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2348. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where constants.%impl.elem0 = %C> [symbolic = %I_where.type (constants.%I_where.type)]
  2349. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %I_where.type [symbolic = %require_complete (constants.%require_complete)]
  2350. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @I.F.%I.impl_witness_table, @C.as.I.impl(%Self) [symbolic = %I.impl_witness (constants.%I.impl_witness)]
  2351. // CHECK:STDOUT:
  2352. // CHECK:STDOUT: !definition:
  2353. // CHECK:STDOUT:
  2354. // CHECK:STDOUT: impl: %C.ref.loc12_10 as %.loc12_17 {
  2355. // CHECK:STDOUT: !members:
  2356. // CHECK:STDOUT: .F = <poisoned>
  2357. // CHECK:STDOUT: witness = @I.F.%I.impl_witness
  2358. // CHECK:STDOUT: }
  2359. // CHECK:STDOUT: }
  2360. // CHECK:STDOUT:
  2361. // CHECK:STDOUT: generic class @C(@I.%Self: %I.type) {
  2362. // CHECK:STDOUT: !definition:
  2363. // CHECK:STDOUT:
  2364. // CHECK:STDOUT: class {
  2365. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [symbolic = @C.as.Destroy.impl.%C (constants.%C)]
  2366. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  2367. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  2368. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table, @C.as.Destroy.impl(constants.%Self.7ee) [symbolic = @C.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness)]
  2369. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  2370. // CHECK:STDOUT: complete_type_witness = %complete_type
  2371. // CHECK:STDOUT:
  2372. // CHECK:STDOUT: !members:
  2373. // CHECK:STDOUT: .Self = constants.%C
  2374. // CHECK:STDOUT: }
  2375. // CHECK:STDOUT: }
  2376. // CHECK:STDOUT:
  2377. // CHECK:STDOUT: generic fn @I.F(@I.%Self: %I.type) {
  2378. // CHECK:STDOUT: !definition:
  2379. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  2380. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2381. // CHECK:STDOUT:
  2382. // CHECK:STDOUT: fn() {
  2383. // CHECK:STDOUT: !entry:
  2384. // CHECK:STDOUT: %C.decl: type = class_decl @C [symbolic = @I.F.%C (constants.%C)] {} {}
  2385. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  2386. // CHECK:STDOUT: %C.ref.loc12_10: type = name_ref C, @I.F.%C.decl [symbolic = %C (constants.%C)]
  2387. // CHECK:STDOUT: %I.ref.loc12: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  2388. // CHECK:STDOUT: %.Self.2: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  2389. // CHECK:STDOUT: %.Self.ref.loc12: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  2390. // CHECK:STDOUT: %U.ref.loc12: %I.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  2391. // CHECK:STDOUT: %.Self.as_type.loc12: type = facet_access_type %.Self.ref.loc12 [symbolic_self = constants.%.Self.as_type]
  2392. // CHECK:STDOUT: %.loc12_23: type = converted %.Self.ref.loc12, %.Self.as_type.loc12 [symbolic_self = constants.%.Self.as_type]
  2393. // CHECK:STDOUT: %impl.elem0.loc12: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  2394. // CHECK:STDOUT: %C.ref.loc12_28: type = name_ref C, @I.F.%C.decl [symbolic = %C (constants.%C)]
  2395. // CHECK:STDOUT: %.loc12_17: type = where_expr %.Self.2 [symbolic = %I_where.type (constants.%I_where.type)] {
  2396. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  2397. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc12, %C.ref.loc12_28
  2398. // CHECK:STDOUT: }
  2399. // CHECK:STDOUT: }
  2400. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, <error>), @C.as.I.impl [concrete]
  2401. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Self.7ee) [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness)]
  2402. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [symbolic = @C.as.I.impl.%C (constants.%C)]
  2403. // CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
  2404. // CHECK:STDOUT: %C.ref.loc21_10: type = name_ref C, @I.F.%C.decl [symbolic = %C (constants.%C)]
  2405. // CHECK:STDOUT: %I.ref.loc21: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  2406. // CHECK:STDOUT: %.Self.1: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  2407. // CHECK:STDOUT: %.Self.ref.loc21: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  2408. // CHECK:STDOUT: %U.ref.loc21: %I.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  2409. // CHECK:STDOUT: %.Self.as_type.loc21: type = facet_access_type %.Self.ref.loc21 [symbolic_self = constants.%.Self.as_type]
  2410. // CHECK:STDOUT: %.loc21_23: type = converted %.Self.ref.loc21, %.Self.as_type.loc21 [symbolic_self = constants.%.Self.as_type]
  2411. // CHECK:STDOUT: %impl.elem0.loc21: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  2412. // CHECK:STDOUT: %C.ref.loc21_28: type = name_ref C, @I.F.%C.decl [symbolic = %C (constants.%C)]
  2413. // CHECK:STDOUT: %.loc21_17: type = where_expr %.Self.1 [symbolic = %I_where.type (constants.%I_where.type)] {
  2414. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  2415. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc21, %C.ref.loc21_28
  2416. // CHECK:STDOUT: }
  2417. // CHECK:STDOUT: }
  2418. // CHECK:STDOUT: return
  2419. // CHECK:STDOUT: }
  2420. // CHECK:STDOUT: }
  2421. // CHECK:STDOUT:
  2422. // CHECK:STDOUT: generic fn @C.as.Destroy.impl.Op(@I.%Self: %I.type) {
  2423. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7ee)]
  2424. // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)]
  2425. // CHECK:STDOUT: %ptr: type = ptr_type %C [symbolic = %ptr (constants.%ptr.12a)]
  2426. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.d53)]
  2427. // CHECK:STDOUT:
  2428. // CHECK:STDOUT: !definition:
  2429. // CHECK:STDOUT:
  2430. // CHECK:STDOUT: fn(%self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.12a)) = "no_op";
  2431. // CHECK:STDOUT: }
  2432. // CHECK:STDOUT:
  2433. // CHECK:STDOUT: specific @U(constants.%Self.7ee) {}
  2434. // CHECK:STDOUT:
  2435. // CHECK:STDOUT: specific @I.F(constants.%Self.7ee) {}
  2436. // CHECK:STDOUT:
  2437. // CHECK:STDOUT: specific @C(constants.%Self.7ee) {}
  2438. // CHECK:STDOUT:
  2439. // CHECK:STDOUT: specific @C.as.Destroy.impl(constants.%Self.7ee) {
  2440. // CHECK:STDOUT: %Self => constants.%Self.7ee
  2441. // CHECK:STDOUT: %C => constants.%C
  2442. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness
  2443. // CHECK:STDOUT: }
  2444. // CHECK:STDOUT:
  2445. // CHECK:STDOUT: specific @C.as.Destroy.impl.Op(constants.%Self.7ee) {
  2446. // CHECK:STDOUT: %Self => constants.%Self.7ee
  2447. // CHECK:STDOUT: %C => constants.%C
  2448. // CHECK:STDOUT: %ptr => constants.%ptr.12a
  2449. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.d53
  2450. // CHECK:STDOUT: }
  2451. // CHECK:STDOUT:
  2452. // CHECK:STDOUT: specific @U(constants.%I.facet) {}
  2453. // CHECK:STDOUT:
  2454. // CHECK:STDOUT: specific @C.as.I.impl(constants.%Self.7ee) {
  2455. // CHECK:STDOUT: %Self => constants.%Self.7ee
  2456. // CHECK:STDOUT: %C => constants.%C
  2457. // CHECK:STDOUT: %I_where.type => constants.%I_where.type
  2458. // CHECK:STDOUT: %require_complete => constants.%require_complete
  2459. // CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness
  2460. // CHECK:STDOUT: }
  2461. // CHECK:STDOUT: