forward_decls.carbon 113 KB

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