import_interface_assoc_const.carbon 102 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712
  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/none.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/import_interface_assoc_const.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_interface_assoc_const.carbon
  14. // --- interface.carbon
  15. library "[[@TEST_NAME]]";
  16. interface I { let T:! type; }
  17. interface I3 {
  18. let T1:! type;
  19. let T2:! type;
  20. let T3:! type;
  21. }
  22. interface NonType {
  23. let Y:! {.a: {}};
  24. }
  25. // --- basic.carbon
  26. library "[[@TEST_NAME]]";
  27. import library "interface";
  28. class C1 { }
  29. impl C1 as I where .T = {} { }
  30. // --- redecl.carbon
  31. library "[[@TEST_NAME]]";
  32. import library "interface";
  33. class C2 { }
  34. impl C2 as I where .T = {};
  35. impl C2 as I where .T = {} { }
  36. // --- fail_redecl_adds_rewrites.carbon
  37. library "[[@TEST_NAME]]";
  38. import library "interface";
  39. class C3 { }
  40. // CHECK:STDERR: fail_redecl_adds_rewrites.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition]
  41. // CHECK:STDERR: impl C3 as I;
  42. // CHECK:STDERR: ^~~~~~~~~~~~~
  43. // CHECK:STDERR:
  44. impl C3 as I;
  45. impl C3 as I where .T = {} { }
  46. // --- fail_mismatch.carbon
  47. library "[[@TEST_NAME]]";
  48. import library "interface";
  49. class C4 { }
  50. // CHECK:STDERR: fail_mismatch.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition]
  51. // CHECK:STDERR: impl C4 as I where .T = {};
  52. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  53. // CHECK:STDERR:
  54. impl C4 as I where .T = {};
  55. impl C4 as I where .T = () { }
  56. // --- fail_mismatch_bad_value.carbon
  57. library "[[@TEST_NAME]]";
  58. import library "interface";
  59. class C5 { }
  60. // This is testing that it won't complain about mismatching values if they
  61. // have errors.
  62. // CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+8]]:27: error: name `BAD1` not found [NameNotFound]
  63. // CHECK:STDERR: impl C5 as I3 where .T1 = BAD1 and .T2 = {.a: {}} and .T3 = BAD2;
  64. // CHECK:STDERR: ^~~~
  65. // CHECK:STDERR:
  66. // CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+4]]:61: error: name `BAD2` not found [NameNotFound]
  67. // CHECK:STDERR: impl C5 as I3 where .T1 = BAD1 and .T2 = {.a: {}} and .T3 = BAD2;
  68. // CHECK:STDERR: ^~~~
  69. // CHECK:STDERR:
  70. impl C5 as I3 where .T1 = BAD1 and .T2 = {.a: {}} and .T3 = BAD2;
  71. // CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+8]]:46: error: name `BAD3` not found [NameNotFound]
  72. // CHECK:STDERR: impl C5 as I3 where .T1 = {.b: {}} and .T2 = BAD3 and .T3 = BAD4 { }
  73. // CHECK:STDERR: ^~~~
  74. // CHECK:STDERR:
  75. // CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+4]]:61: error: name `BAD4` not found [NameNotFound]
  76. // CHECK:STDERR: impl C5 as I3 where .T1 = {.b: {}} and .T2 = BAD3 and .T3 = BAD4 { }
  77. // CHECK:STDERR: ^~~~
  78. // CHECK:STDERR:
  79. impl C5 as I3 where .T1 = {.b: {}} and .T2 = BAD3 and .T3 = BAD4 { }
  80. // --- fail_missing_on_definition.carbon
  81. library "[[@TEST_NAME]]";
  82. import library "interface";
  83. class C6 { }
  84. impl C6 as I where .T = {};
  85. // CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE+12]]:1: error: associated constant T not given a value in impl of interface I [ImplAssociatedConstantNeedsValue]
  86. // CHECK:STDERR: impl C6 as I { }
  87. // CHECK:STDERR: ^~~~~~~~~~~~~~
  88. // CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE-7]]:1: in import [InImport]
  89. // CHECK:STDERR: interface.carbon:3:19: note: associated constant declared here [AssociatedConstantHere]
  90. // CHECK:STDERR: interface I { let T:! type; }
  91. // CHECK:STDERR: ^~~~~~~~
  92. // CHECK:STDERR:
  93. // CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE-9]]:1: error: impl declared but not defined [ImplMissingDefinition]
  94. // CHECK:STDERR: impl C6 as I where .T = {};
  95. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  96. // CHECK:STDERR:
  97. impl C6 as I { }
  98. // --- fail_two_different.carbon
  99. library "[[@TEST_NAME]]";
  100. import library "interface";
  101. class C7 { }
  102. // CHECK:STDERR: fail_two_different.carbon:[[@LINE+4]]:12: error: associated constant `.(I.T)` given two different values `{}` and `()` [AssociatedConstantWithDifferentValues]
  103. // CHECK:STDERR: impl C7 as I where .T = {} and .T = () { }
  104. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  105. // CHECK:STDERR:
  106. impl C7 as I where .T = {} and .T = () { }
  107. // --- fail_two_different_first_bad.carbon
  108. library "[[@TEST_NAME]]";
  109. import library "interface";
  110. class C8 { }
  111. // CHECK:STDERR: fail_two_different_first_bad.carbon:[[@LINE+4]]:25: error: name `BAD5` not found [NameNotFound]
  112. // CHECK:STDERR: impl C8 as I where .T = BAD5 and .T = () { }
  113. // CHECK:STDERR: ^~~~
  114. // CHECK:STDERR:
  115. impl C8 as I where .T = BAD5 and .T = () { }
  116. // --- fail_two_different_second_bad.carbon
  117. library "[[@TEST_NAME]]";
  118. import library "interface";
  119. class C9 { }
  120. // CHECK:STDERR: fail_two_different_second_bad.carbon:[[@LINE+4]]:37: error: name `BAD6` not found [NameNotFound]
  121. // CHECK:STDERR: impl C9 as I where .T = {} and .T = BAD6 { }
  122. // CHECK:STDERR: ^~~~
  123. // CHECK:STDERR:
  124. impl C9 as I where .T = {} and .T = BAD6 { }
  125. // --- fail_two_different_both_bad.carbon
  126. library "[[@TEST_NAME]]";
  127. import library "interface";
  128. class CA { }
  129. // CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+8]]:25: error: name `BAD7` not found [NameNotFound]
  130. // CHECK:STDERR: impl CA as I where .T = BAD7 and .T = BAD8 { }
  131. // CHECK:STDERR: ^~~~
  132. // CHECK:STDERR:
  133. // CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+4]]:39: error: name `BAD8` not found [NameNotFound]
  134. // CHECK:STDERR: impl CA as I where .T = BAD7 and .T = BAD8 { }
  135. // CHECK:STDERR: ^~~~
  136. // CHECK:STDERR:
  137. impl CA as I where .T = BAD7 and .T = BAD8 { }
  138. // --- repeated.carbon
  139. library "[[@TEST_NAME]]";
  140. import library "interface";
  141. class CB { }
  142. impl CB as I where .T = {} and .T = {} { }
  143. // --- non-type.carbon
  144. library "[[@TEST_NAME]]";
  145. import library "interface";
  146. class CC { }
  147. impl CC as NonType where .Y = {.a = {}} { }
  148. // --- interface_with_function.carbon
  149. library "[[@TEST_NAME]]";
  150. interface IF { fn F(); }
  151. // --- fail_where_rewrite_function.carbon
  152. library "[[@TEST_NAME]]";
  153. import library "interface_with_function";
  154. class CD { }
  155. // CHECK:STDERR: fail_where_rewrite_function.carbon:[[@LINE+4]]:12: error: rewrite specified for associated function F [RewriteForAssociatedFunction]
  156. // CHECK:STDERR: impl CD as IF where .F = 0 {
  157. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  158. // CHECK:STDERR:
  159. impl CD as IF where .F = 0 {
  160. fn F() {}
  161. }
  162. // CHECK:STDOUT: --- interface.carbon
  163. // CHECK:STDOUT:
  164. // CHECK:STDOUT: constants {
  165. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  166. // CHECK:STDOUT: %Self.ab9: %I.type = symbolic_binding Self, 0 [symbolic]
  167. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  168. // CHECK:STDOUT: %assoc0.e06: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  169. // CHECK:STDOUT: %I3.type: type = facet_type <@I3> [concrete]
  170. // CHECK:STDOUT: %Self.70b: %I3.type = symbolic_binding Self, 0 [symbolic]
  171. // CHECK:STDOUT: %I3.assoc_type: type = assoc_entity_type @I3 [concrete]
  172. // CHECK:STDOUT: %assoc0.236: %I3.assoc_type = assoc_entity element0, @I3.%T1 [concrete]
  173. // CHECK:STDOUT: %assoc1: %I3.assoc_type = assoc_entity element1, @I3.%T2 [concrete]
  174. // CHECK:STDOUT: %assoc2: %I3.assoc_type = assoc_entity element2, @I3.%T3 [concrete]
  175. // CHECK:STDOUT: %NonType.type: type = facet_type <@NonType> [concrete]
  176. // CHECK:STDOUT: %Self.13f: %NonType.type = symbolic_binding Self, 0 [symbolic]
  177. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  178. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_struct_type} [concrete]
  179. // CHECK:STDOUT: %NonType.assoc_type: type = assoc_entity_type @NonType [concrete]
  180. // CHECK:STDOUT: %assoc0.b16: %NonType.assoc_type = assoc_entity element0, @NonType.%Y [concrete]
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: file {
  184. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  185. // CHECK:STDOUT: .I = %I.decl
  186. // CHECK:STDOUT: .I3 = %I3.decl
  187. // CHECK:STDOUT: .NonType = %NonType.decl
  188. // CHECK:STDOUT: }
  189. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  190. // CHECK:STDOUT: %I3.decl: type = interface_decl @I3 [concrete = constants.%I3.type] {} {}
  191. // CHECK:STDOUT: %NonType.decl: type = interface_decl @NonType [concrete = constants.%NonType.type] {} {}
  192. // CHECK:STDOUT: }
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: interface @I {
  195. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.ab9]
  196. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  197. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0.e06]
  198. // CHECK:STDOUT: }
  199. // CHECK:STDOUT:
  200. // CHECK:STDOUT: !members:
  201. // CHECK:STDOUT: .Self = %Self
  202. // CHECK:STDOUT: .T = @T.%assoc0
  203. // CHECK:STDOUT: witness = (%T)
  204. // CHECK:STDOUT:
  205. // CHECK:STDOUT: !requires:
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: interface @I3 {
  209. // CHECK:STDOUT: %Self: %I3.type = symbolic_binding Self, 0 [symbolic = constants.%Self.70b]
  210. // CHECK:STDOUT: %T1: type = assoc_const_decl @T1 [concrete] {
  211. // CHECK:STDOUT: %assoc0: %I3.assoc_type = assoc_entity element0, @I3.%T1 [concrete = constants.%assoc0.236]
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT: %T2: type = assoc_const_decl @T2 [concrete] {
  214. // CHECK:STDOUT: %assoc1: %I3.assoc_type = assoc_entity element1, @I3.%T2 [concrete = constants.%assoc1]
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT: %T3: type = assoc_const_decl @T3 [concrete] {
  217. // CHECK:STDOUT: %assoc2: %I3.assoc_type = assoc_entity element2, @I3.%T3 [concrete = constants.%assoc2]
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT:
  220. // CHECK:STDOUT: !members:
  221. // CHECK:STDOUT: .Self = %Self
  222. // CHECK:STDOUT: .T1 = @T1.%assoc0
  223. // CHECK:STDOUT: .T2 = @T2.%assoc1
  224. // CHECK:STDOUT: .T3 = @T3.%assoc2
  225. // CHECK:STDOUT: witness = (%T1, %T2, %T3)
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: !requires:
  228. // CHECK:STDOUT: }
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: interface @NonType {
  231. // CHECK:STDOUT: %Self: %NonType.type = symbolic_binding Self, 0 [symbolic = constants.%Self.13f]
  232. // CHECK:STDOUT: %Y: %struct_type.a = assoc_const_decl @Y [concrete] {
  233. // CHECK:STDOUT: %assoc0: %NonType.assoc_type = assoc_entity element0, @NonType.%Y [concrete = constants.%assoc0.b16]
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: !members:
  237. // CHECK:STDOUT: .Self = %Self
  238. // CHECK:STDOUT: .Y = @Y.%assoc0
  239. // CHECK:STDOUT: witness = (%Y)
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: !requires:
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  245. // CHECK:STDOUT: assoc_const T:! type;
  246. // CHECK:STDOUT: }
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: generic assoc_const @T1(@I3.%Self: %I3.type) {
  249. // CHECK:STDOUT: assoc_const T1:! type;
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: generic assoc_const @T2(@I3.%Self: %I3.type) {
  253. // CHECK:STDOUT: assoc_const T2:! type;
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: generic assoc_const @T3(@I3.%Self: %I3.type) {
  257. // CHECK:STDOUT: assoc_const T3:! type;
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: generic assoc_const @Y(@NonType.%Self: %NonType.type) {
  261. // CHECK:STDOUT: assoc_const Y:! %struct_type.a;
  262. // CHECK:STDOUT: }
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: specific @T(constants.%Self.ab9) {}
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: specific @T1(constants.%Self.70b) {}
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: specific @T2(constants.%Self.70b) {}
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: specific @T3(constants.%Self.70b) {}
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: specific @Y(constants.%Self.13f) {}
  273. // CHECK:STDOUT:
  274. // CHECK:STDOUT: --- basic.carbon
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: constants {
  277. // CHECK:STDOUT: %C1: type = class_type @C1 [concrete]
  278. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  279. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  280. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  281. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  282. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  283. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  284. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  285. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  286. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  287. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  288. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  289. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete]
  290. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C1.as.I.impl.%I.impl_witness_table [concrete]
  291. // CHECK:STDOUT: }
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: imports {
  294. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  295. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  296. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  297. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  298. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  299. // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [concrete = %T]
  300. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  301. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  302. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: file {
  306. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  307. // CHECK:STDOUT: .I = imports.%Main.I
  308. // CHECK:STDOUT: .I3 = imports.%Main.I3
  309. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  310. // CHECK:STDOUT: .C1 = %C1.decl
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT: %default.import = import <none>
  313. // CHECK:STDOUT: %C1.decl: type = class_decl @C1 [concrete = constants.%C1] {} {}
  314. // CHECK:STDOUT: impl_decl @C1.as.I.impl [concrete] {} {
  315. // CHECK:STDOUT: %C1.ref: type = name_ref C1, file.%C1.decl [concrete = constants.%C1]
  316. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  317. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  318. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  319. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  320. // CHECK:STDOUT: %.loc5_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  321. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  322. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  323. // CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  324. // CHECK:STDOUT: %.loc5_26.2: type = converted %.loc5_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  325. // CHECK:STDOUT: %.loc5_14: type = where_expr %.Self [concrete = constants.%I_where.type] {
  326. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  327. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc5_26.2
  328. // CHECK:STDOUT: }
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT: }
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  333. // CHECK:STDOUT: !members:
  334. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  335. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  336. // CHECK:STDOUT: witness = (imports.%Main.T)
  337. // CHECK:STDOUT:
  338. // CHECK:STDOUT: !requires:
  339. // CHECK:STDOUT: }
  340. // CHECK:STDOUT:
  341. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  342. // CHECK:STDOUT: assoc_const T:! type;
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT:
  345. // CHECK:STDOUT: impl @C1.as.I.impl: %C1.ref as %.loc5_14 {
  346. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C1.as.I.impl [concrete]
  347. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  348. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  349. // CHECK:STDOUT:
  350. // CHECK:STDOUT: !members:
  351. // CHECK:STDOUT: witness = %I.impl_witness
  352. // CHECK:STDOUT: }
  353. // CHECK:STDOUT:
  354. // CHECK:STDOUT: class @C1 {
  355. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  356. // CHECK:STDOUT: complete_type_witness = %complete_type
  357. // CHECK:STDOUT:
  358. // CHECK:STDOUT: !members:
  359. // CHECK:STDOUT: .Self = constants.%C1
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: specific @T(constants.%Self) {}
  363. // CHECK:STDOUT:
  364. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: --- redecl.carbon
  367. // CHECK:STDOUT:
  368. // CHECK:STDOUT: constants {
  369. // CHECK:STDOUT: %C2: type = class_type @C2 [concrete]
  370. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  371. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  372. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  373. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  374. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  375. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  376. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  377. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  378. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  379. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  380. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  381. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete]
  382. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C2.as.I.impl.%I.impl_witness_table [concrete]
  383. // CHECK:STDOUT: }
  384. // CHECK:STDOUT:
  385. // CHECK:STDOUT: imports {
  386. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  387. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  388. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  389. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  390. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  391. // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [concrete = %T]
  392. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  393. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  394. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT:
  397. // CHECK:STDOUT: file {
  398. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  399. // CHECK:STDOUT: .I = imports.%Main.I
  400. // CHECK:STDOUT: .I3 = imports.%Main.I3
  401. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  402. // CHECK:STDOUT: .C2 = %C2.decl
  403. // CHECK:STDOUT: }
  404. // CHECK:STDOUT: %default.import = import <none>
  405. // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [concrete = constants.%C2] {} {}
  406. // CHECK:STDOUT: impl_decl @C2.as.I.impl [concrete] {} {
  407. // CHECK:STDOUT: %C2.ref.loc5: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  408. // CHECK:STDOUT: %I.ref.loc5: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  409. // CHECK:STDOUT: %.Self.2: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  410. // CHECK:STDOUT: %.Self.ref.loc5: %I.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  411. // CHECK:STDOUT: %.Self.as_type.loc5: type = facet_access_type %.Self.ref.loc5 [symbolic_self = constants.%.Self.binding.as_type]
  412. // CHECK:STDOUT: %.loc5_20: type = converted %.Self.ref.loc5, %.Self.as_type.loc5 [symbolic_self = constants.%.Self.binding.as_type]
  413. // CHECK:STDOUT: %T.ref.loc5: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  414. // CHECK:STDOUT: %impl.elem0.loc5: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  415. // CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  416. // CHECK:STDOUT: %.loc5_26.2: type = converted %.loc5_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  417. // CHECK:STDOUT: %.loc5_14: type = where_expr %.Self.2 [concrete = constants.%I_where.type] {
  418. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  419. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc5, %.loc5_26.2
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT: }
  422. // CHECK:STDOUT: impl_decl @C2.as.I.impl [concrete] {} {
  423. // CHECK:STDOUT: %C2.ref.loc6: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
  424. // CHECK:STDOUT: %I.ref.loc6: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  425. // CHECK:STDOUT: %.Self.1: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  426. // CHECK:STDOUT: %.Self.ref.loc6: %I.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self]
  427. // CHECK:STDOUT: %.Self.as_type.loc6: type = facet_access_type %.Self.ref.loc6 [symbolic_self = constants.%.Self.binding.as_type]
  428. // CHECK:STDOUT: %.loc6_20: type = converted %.Self.ref.loc6, %.Self.as_type.loc6 [symbolic_self = constants.%.Self.binding.as_type]
  429. // CHECK:STDOUT: %T.ref.loc6: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  430. // CHECK:STDOUT: %impl.elem0.loc6: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  431. // CHECK:STDOUT: %.loc6_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  432. // CHECK:STDOUT: %.loc6_26.2: type = converted %.loc6_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  433. // CHECK:STDOUT: %.loc6_14: type = where_expr %.Self.1 [concrete = constants.%I_where.type] {
  434. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  435. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6, %.loc6_26.2
  436. // CHECK:STDOUT: }
  437. // CHECK:STDOUT: }
  438. // CHECK:STDOUT: }
  439. // CHECK:STDOUT:
  440. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  441. // CHECK:STDOUT: !members:
  442. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  443. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  444. // CHECK:STDOUT: witness = (imports.%Main.T)
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: !requires:
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT:
  449. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  450. // CHECK:STDOUT: assoc_const T:! type;
  451. // CHECK:STDOUT: }
  452. // CHECK:STDOUT:
  453. // CHECK:STDOUT: impl @C2.as.I.impl: %C2.ref.loc5 as %.loc5_14 {
  454. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C2.as.I.impl [concrete]
  455. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  456. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  457. // CHECK:STDOUT:
  458. // CHECK:STDOUT: !members:
  459. // CHECK:STDOUT: witness = %I.impl_witness
  460. // CHECK:STDOUT: }
  461. // CHECK:STDOUT:
  462. // CHECK:STDOUT: class @C2 {
  463. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  464. // CHECK:STDOUT: complete_type_witness = %complete_type
  465. // CHECK:STDOUT:
  466. // CHECK:STDOUT: !members:
  467. // CHECK:STDOUT: .Self = constants.%C2
  468. // CHECK:STDOUT: }
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: specific @T(constants.%Self) {}
  471. // CHECK:STDOUT:
  472. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: --- fail_redecl_adds_rewrites.carbon
  475. // CHECK:STDOUT:
  476. // CHECK:STDOUT: constants {
  477. // CHECK:STDOUT: %C3: type = class_type @C3 [concrete]
  478. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  479. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  480. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  481. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  482. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  483. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  484. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  485. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  486. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  487. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  488. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  489. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete]
  490. // CHECK:STDOUT: %I.impl_witness.721: <witness> = impl_witness @C3.as.I.impl.b9a.%I.impl_witness_table [concrete]
  491. // CHECK:STDOUT: }
  492. // CHECK:STDOUT:
  493. // CHECK:STDOUT: imports {
  494. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  495. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  496. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  497. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  498. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  499. // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [concrete = %T]
  500. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  501. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  502. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  503. // CHECK:STDOUT: }
  504. // CHECK:STDOUT:
  505. // CHECK:STDOUT: file {
  506. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  507. // CHECK:STDOUT: .I = imports.%Main.I
  508. // CHECK:STDOUT: .I3 = imports.%Main.I3
  509. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  510. // CHECK:STDOUT: .C3 = %C3.decl
  511. // CHECK:STDOUT: }
  512. // CHECK:STDOUT: %default.import = import <none>
  513. // CHECK:STDOUT: %C3.decl: type = class_decl @C3 [concrete = constants.%C3] {} {}
  514. // CHECK:STDOUT: impl_decl @C3.as.I.impl.4fb [concrete] {} {
  515. // CHECK:STDOUT: %C3.ref: type = name_ref C3, file.%C3.decl [concrete = constants.%C3]
  516. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT: impl_decl @C3.as.I.impl.b9a [concrete] {} {
  519. // CHECK:STDOUT: %C3.ref: type = name_ref C3, file.%C3.decl [concrete = constants.%C3]
  520. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  521. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  522. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  523. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  524. // CHECK:STDOUT: %.loc10_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  525. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  526. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  527. // CHECK:STDOUT: %.loc10_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  528. // CHECK:STDOUT: %.loc10_26.2: type = converted %.loc10_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  529. // CHECK:STDOUT: %.loc10_14: type = where_expr %.Self [concrete = constants.%I_where.type] {
  530. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  531. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_26.2
  532. // CHECK:STDOUT: }
  533. // CHECK:STDOUT: }
  534. // CHECK:STDOUT: }
  535. // CHECK:STDOUT:
  536. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  537. // CHECK:STDOUT: !members:
  538. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  539. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  540. // CHECK:STDOUT: witness = (imports.%Main.T)
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: !requires:
  543. // CHECK:STDOUT: }
  544. // CHECK:STDOUT:
  545. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  546. // CHECK:STDOUT: assoc_const T:! type;
  547. // CHECK:STDOUT: }
  548. // CHECK:STDOUT:
  549. // CHECK:STDOUT: impl @C3.as.I.impl.4fb: %C3.ref as %I.ref;
  550. // CHECK:STDOUT:
  551. // CHECK:STDOUT: impl @C3.as.I.impl.b9a: %C3.ref as %.loc10_14 {
  552. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C3.as.I.impl.b9a [concrete]
  553. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.721]
  554. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  555. // CHECK:STDOUT:
  556. // CHECK:STDOUT: !members:
  557. // CHECK:STDOUT: witness = %I.impl_witness
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT:
  560. // CHECK:STDOUT: class @C3 {
  561. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  562. // CHECK:STDOUT: complete_type_witness = %complete_type
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: !members:
  565. // CHECK:STDOUT: .Self = constants.%C3
  566. // CHECK:STDOUT: }
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: specific @T(constants.%Self) {}
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  571. // CHECK:STDOUT:
  572. // CHECK:STDOUT: --- fail_mismatch.carbon
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: constants {
  575. // CHECK:STDOUT: %C4: type = class_type @C4 [concrete]
  576. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  577. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  578. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  579. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  580. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  581. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  582. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  583. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  584. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  585. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  586. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  587. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  588. // CHECK:STDOUT: %I_where.type.1c0: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete]
  589. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  590. // CHECK:STDOUT: %I_where.type.0f9: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
  591. // CHECK:STDOUT: %I.impl_witness.68c: <witness> = impl_witness @C4.as.I.impl.95c.%I.impl_witness_table [concrete]
  592. // CHECK:STDOUT: }
  593. // CHECK:STDOUT:
  594. // CHECK:STDOUT: imports {
  595. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  596. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  597. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  598. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  599. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  600. // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [concrete = %T]
  601. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  602. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  603. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  604. // CHECK:STDOUT: }
  605. // CHECK:STDOUT:
  606. // CHECK:STDOUT: file {
  607. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  608. // CHECK:STDOUT: .I = imports.%Main.I
  609. // CHECK:STDOUT: .I3 = imports.%Main.I3
  610. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  611. // CHECK:STDOUT: .C4 = %C4.decl
  612. // CHECK:STDOUT: }
  613. // CHECK:STDOUT: %default.import = import <none>
  614. // CHECK:STDOUT: %C4.decl: type = class_decl @C4 [concrete = constants.%C4] {} {}
  615. // CHECK:STDOUT: impl_decl @C4.as.I.impl.2eb [concrete] {} {
  616. // CHECK:STDOUT: %C4.ref: type = name_ref C4, file.%C4.decl [concrete = constants.%C4]
  617. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  618. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  619. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  620. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  621. // CHECK:STDOUT: %.loc9_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  622. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  623. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  624. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  625. // CHECK:STDOUT: %.loc9_26.2: type = converted %.loc9_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  626. // CHECK:STDOUT: %.loc9_14: type = where_expr %.Self [concrete = constants.%I_where.type.1c0] {
  627. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  628. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_26.2
  629. // CHECK:STDOUT: }
  630. // CHECK:STDOUT: }
  631. // CHECK:STDOUT: impl_decl @C4.as.I.impl.95c [concrete] {} {
  632. // CHECK:STDOUT: %C4.ref: type = name_ref C4, file.%C4.decl [concrete = constants.%C4]
  633. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  634. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  635. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  636. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  637. // CHECK:STDOUT: %.loc10_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  638. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  639. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  640. // CHECK:STDOUT: %.loc10_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  641. // CHECK:STDOUT: %.loc10_26.2: type = converted %.loc10_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  642. // CHECK:STDOUT: %.loc10_14: type = where_expr %.Self [concrete = constants.%I_where.type.0f9] {
  643. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  644. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_26.2
  645. // CHECK:STDOUT: }
  646. // CHECK:STDOUT: }
  647. // CHECK:STDOUT: }
  648. // CHECK:STDOUT:
  649. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  650. // CHECK:STDOUT: !members:
  651. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  652. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  653. // CHECK:STDOUT: witness = (imports.%Main.T)
  654. // CHECK:STDOUT:
  655. // CHECK:STDOUT: !requires:
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT:
  658. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  659. // CHECK:STDOUT: assoc_const T:! type;
  660. // CHECK:STDOUT: }
  661. // CHECK:STDOUT:
  662. // CHECK:STDOUT: impl @C4.as.I.impl.2eb: %C4.ref as %.loc9_14;
  663. // CHECK:STDOUT:
  664. // CHECK:STDOUT: impl @C4.as.I.impl.95c: %C4.ref as %.loc10_14 {
  665. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @C4.as.I.impl.95c [concrete]
  666. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.68c]
  667. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  668. // CHECK:STDOUT:
  669. // CHECK:STDOUT: !members:
  670. // CHECK:STDOUT: witness = %I.impl_witness
  671. // CHECK:STDOUT: }
  672. // CHECK:STDOUT:
  673. // CHECK:STDOUT: class @C4 {
  674. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  675. // CHECK:STDOUT: complete_type_witness = %complete_type
  676. // CHECK:STDOUT:
  677. // CHECK:STDOUT: !members:
  678. // CHECK:STDOUT: .Self = constants.%C4
  679. // CHECK:STDOUT: }
  680. // CHECK:STDOUT:
  681. // CHECK:STDOUT: specific @T(constants.%Self) {}
  682. // CHECK:STDOUT:
  683. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  684. // CHECK:STDOUT:
  685. // CHECK:STDOUT: --- fail_mismatch_bad_value.carbon
  686. // CHECK:STDOUT:
  687. // CHECK:STDOUT: constants {
  688. // CHECK:STDOUT: %C5: type = class_type @C5 [concrete]
  689. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  690. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  691. // CHECK:STDOUT: %I3.type: type = facet_type <@I3> [concrete]
  692. // CHECK:STDOUT: %Self: %I3.type = symbolic_binding Self, 0 [symbolic]
  693. // CHECK:STDOUT: %.Self: %I3.type = symbolic_binding .Self [symbolic_self]
  694. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  695. // CHECK:STDOUT: %I3.assoc_type: type = assoc_entity_type @I3 [concrete]
  696. // CHECK:STDOUT: %assoc0: %I3.assoc_type = assoc_entity element0, imports.%Main.import_ref.922 [concrete]
  697. // CHECK:STDOUT: %I3.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I3 [symbolic_self]
  698. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I3.lookup_impl_witness, element0 [symbolic_self]
  699. // CHECK:STDOUT: %assoc1: %I3.assoc_type = assoc_entity element1, imports.%Main.import_ref.8d8 [concrete]
  700. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %I3.lookup_impl_witness, element1 [symbolic_self]
  701. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  702. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_struct_type} [concrete]
  703. // CHECK:STDOUT: %assoc2: %I3.assoc_type = assoc_entity element2, imports.%Main.import_ref.b42 [concrete]
  704. // CHECK:STDOUT: %impl.elem2: type = impl_witness_access %I3.lookup_impl_witness, element2 [symbolic_self]
  705. // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %empty_struct_type} [concrete]
  706. // CHECK:STDOUT: }
  707. // CHECK:STDOUT:
  708. // CHECK:STDOUT: imports {
  709. // CHECK:STDOUT: %Main.I = import_ref Main//interface, I, unloaded
  710. // CHECK:STDOUT: %Main.I3: type = import_ref Main//interface, I3, loaded [concrete = constants.%I3.type]
  711. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  712. // CHECK:STDOUT: %Main.import_ref.6d9 = import_ref Main//interface, loc5_14, unloaded
  713. // CHECK:STDOUT: %Main.import_ref.264: %I3.assoc_type = import_ref Main//interface, loc6_9, loaded [concrete = constants.%assoc0]
  714. // CHECK:STDOUT: %Main.import_ref.242: %I3.assoc_type = import_ref Main//interface, loc7_9, loaded [concrete = constants.%assoc1]
  715. // CHECK:STDOUT: %Main.import_ref.9b6: %I3.assoc_type = import_ref Main//interface, loc8_9, loaded [concrete = constants.%assoc2]
  716. // CHECK:STDOUT: %Main.T1 = import_ref Main//interface, T1, unloaded
  717. // CHECK:STDOUT: %Main.T2 = import_ref Main//interface, T2, unloaded
  718. // CHECK:STDOUT: %Main.T3 = import_ref Main//interface, T3, unloaded
  719. // CHECK:STDOUT: %Main.import_ref.922: type = import_ref Main//interface, loc6_9, loaded [concrete = %T1]
  720. // CHECK:STDOUT: %T1: type = assoc_const_decl @T1 [concrete] {}
  721. // CHECK:STDOUT: %Main.import_ref.e58186.1: %I3.type = import_ref Main//interface, loc5_14, loaded [symbolic = constants.%Self]
  722. // CHECK:STDOUT: %Main.import_ref.8d8: type = import_ref Main//interface, loc7_9, loaded [concrete = %T2]
  723. // CHECK:STDOUT: %T2: type = assoc_const_decl @T2 [concrete] {}
  724. // CHECK:STDOUT: %Main.import_ref.e58186.2: %I3.type = import_ref Main//interface, loc5_14, loaded [symbolic = constants.%Self]
  725. // CHECK:STDOUT: %Main.import_ref.b42: type = import_ref Main//interface, loc8_9, loaded [concrete = %T3]
  726. // CHECK:STDOUT: %T3: type = assoc_const_decl @T3 [concrete] {}
  727. // CHECK:STDOUT: %Main.import_ref.e58186.3: %I3.type = import_ref Main//interface, loc5_14, loaded [symbolic = constants.%Self]
  728. // CHECK:STDOUT: }
  729. // CHECK:STDOUT:
  730. // CHECK:STDOUT: file {
  731. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  732. // CHECK:STDOUT: .I = imports.%Main.I
  733. // CHECK:STDOUT: .I3 = imports.%Main.I3
  734. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  735. // CHECK:STDOUT: .C5 = %C5.decl
  736. // CHECK:STDOUT: .BAD1 = <poisoned>
  737. // CHECK:STDOUT: .BAD2 = <poisoned>
  738. // CHECK:STDOUT: .BAD3 = <poisoned>
  739. // CHECK:STDOUT: .BAD4 = <poisoned>
  740. // CHECK:STDOUT: }
  741. // CHECK:STDOUT: %default.import = import <none>
  742. // CHECK:STDOUT: %C5.decl: type = class_decl @C5 [concrete = constants.%C5] {} {}
  743. // CHECK:STDOUT: impl_decl @C5.as.<error>.impl.bcbfb8.1 [concrete] {} {
  744. // CHECK:STDOUT: %C5.ref: type = name_ref C5, file.%C5.decl [concrete = constants.%C5]
  745. // CHECK:STDOUT: %I3.ref: type = name_ref I3, imports.%Main.I3 [concrete = constants.%I3.type]
  746. // CHECK:STDOUT: %.Self: %I3.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  747. // CHECK:STDOUT: %.Self.ref.loc17_21: %I3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  748. // CHECK:STDOUT: %.Self.as_type.loc17_21: type = facet_access_type %.Self.ref.loc17_21 [symbolic_self = constants.%.Self.binding.as_type]
  749. // CHECK:STDOUT: %.loc17_21: type = converted %.Self.ref.loc17_21, %.Self.as_type.loc17_21 [symbolic_self = constants.%.Self.binding.as_type]
  750. // CHECK:STDOUT: %T1.ref: %I3.assoc_type = name_ref T1, imports.%Main.import_ref.264 [concrete = constants.%assoc0]
  751. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I3.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  752. // CHECK:STDOUT: %BAD1.ref: <error> = name_ref BAD1, <error> [concrete = <error>]
  753. // CHECK:STDOUT: %.Self.ref.loc17_36: %I3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  754. // CHECK:STDOUT: %.Self.as_type.loc17_36: type = facet_access_type %.Self.ref.loc17_36 [symbolic_self = constants.%.Self.binding.as_type]
  755. // CHECK:STDOUT: %.loc17_36: type = converted %.Self.ref.loc17_36, %.Self.as_type.loc17_36 [symbolic_self = constants.%.Self.binding.as_type]
  756. // CHECK:STDOUT: %T2.ref: %I3.assoc_type = name_ref T2, imports.%Main.import_ref.242 [concrete = constants.%assoc1]
  757. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access constants.%I3.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1]
  758. // CHECK:STDOUT: %.loc17_48.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  759. // CHECK:STDOUT: %.loc17_48.2: type = converted %.loc17_48.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  760. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_struct_type} [concrete = constants.%struct_type.a]
  761. // CHECK:STDOUT: %.Self.ref.loc17_55: %I3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  762. // CHECK:STDOUT: %.Self.as_type.loc17_55: type = facet_access_type %.Self.ref.loc17_55 [symbolic_self = constants.%.Self.binding.as_type]
  763. // CHECK:STDOUT: %.loc17_55: type = converted %.Self.ref.loc17_55, %.Self.as_type.loc17_55 [symbolic_self = constants.%.Self.binding.as_type]
  764. // CHECK:STDOUT: %T3.ref: %I3.assoc_type = name_ref T3, imports.%Main.import_ref.9b6 [concrete = constants.%assoc2]
  765. // CHECK:STDOUT: %impl.elem2: type = impl_witness_access constants.%I3.lookup_impl_witness, element2 [symbolic_self = constants.%impl.elem2]
  766. // CHECK:STDOUT: %BAD2.ref: <error> = name_ref BAD2, <error> [concrete = <error>]
  767. // CHECK:STDOUT: %.loc17_15: type = where_expr %.Self [concrete = <error>] {
  768. // CHECK:STDOUT: requirement_base_facet_type constants.%I3.type
  769. // CHECK:STDOUT: requirement_rewrite %impl.elem0, <error>
  770. // CHECK:STDOUT: requirement_rewrite %impl.elem1, %struct_type.a
  771. // CHECK:STDOUT: requirement_rewrite %impl.elem2, <error>
  772. // CHECK:STDOUT: }
  773. // CHECK:STDOUT: }
  774. // CHECK:STDOUT: impl_decl @C5.as.<error>.impl.bcbfb8.2 [concrete] {} {
  775. // CHECK:STDOUT: %C5.ref: type = name_ref C5, file.%C5.decl [concrete = constants.%C5]
  776. // CHECK:STDOUT: %I3.ref: type = name_ref I3, imports.%Main.I3 [concrete = constants.%I3.type]
  777. // CHECK:STDOUT: %.Self: %I3.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  778. // CHECK:STDOUT: %.Self.ref.loc27_21: %I3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  779. // CHECK:STDOUT: %.Self.as_type.loc27_21: type = facet_access_type %.Self.ref.loc27_21 [symbolic_self = constants.%.Self.binding.as_type]
  780. // CHECK:STDOUT: %.loc27_21: type = converted %.Self.ref.loc27_21, %.Self.as_type.loc27_21 [symbolic_self = constants.%.Self.binding.as_type]
  781. // CHECK:STDOUT: %T1.ref: %I3.assoc_type = name_ref T1, imports.%Main.import_ref.264 [concrete = constants.%assoc0]
  782. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I3.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  783. // CHECK:STDOUT: %.loc27_33.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  784. // CHECK:STDOUT: %.loc27_33.2: type = converted %.loc27_33.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  785. // CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %empty_struct_type} [concrete = constants.%struct_type.b]
  786. // CHECK:STDOUT: %.Self.ref.loc27_40: %I3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  787. // CHECK:STDOUT: %.Self.as_type.loc27_40: type = facet_access_type %.Self.ref.loc27_40 [symbolic_self = constants.%.Self.binding.as_type]
  788. // CHECK:STDOUT: %.loc27_40: type = converted %.Self.ref.loc27_40, %.Self.as_type.loc27_40 [symbolic_self = constants.%.Self.binding.as_type]
  789. // CHECK:STDOUT: %T2.ref: %I3.assoc_type = name_ref T2, imports.%Main.import_ref.242 [concrete = constants.%assoc1]
  790. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access constants.%I3.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1]
  791. // CHECK:STDOUT: %BAD3.ref: <error> = name_ref BAD3, <error> [concrete = <error>]
  792. // CHECK:STDOUT: %.Self.ref.loc27_55: %I3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  793. // CHECK:STDOUT: %.Self.as_type.loc27_55: type = facet_access_type %.Self.ref.loc27_55 [symbolic_self = constants.%.Self.binding.as_type]
  794. // CHECK:STDOUT: %.loc27_55: type = converted %.Self.ref.loc27_55, %.Self.as_type.loc27_55 [symbolic_self = constants.%.Self.binding.as_type]
  795. // CHECK:STDOUT: %T3.ref: %I3.assoc_type = name_ref T3, imports.%Main.import_ref.9b6 [concrete = constants.%assoc2]
  796. // CHECK:STDOUT: %impl.elem2: type = impl_witness_access constants.%I3.lookup_impl_witness, element2 [symbolic_self = constants.%impl.elem2]
  797. // CHECK:STDOUT: %BAD4.ref: <error> = name_ref BAD4, <error> [concrete = <error>]
  798. // CHECK:STDOUT: %.loc27_15: type = where_expr %.Self [concrete = <error>] {
  799. // CHECK:STDOUT: requirement_base_facet_type constants.%I3.type
  800. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %struct_type.b
  801. // CHECK:STDOUT: requirement_rewrite %impl.elem1, <error>
  802. // CHECK:STDOUT: requirement_rewrite %impl.elem2, <error>
  803. // CHECK:STDOUT: }
  804. // CHECK:STDOUT: }
  805. // CHECK:STDOUT: }
  806. // CHECK:STDOUT:
  807. // CHECK:STDOUT: interface @I3 [from "interface.carbon"] {
  808. // CHECK:STDOUT: !members:
  809. // CHECK:STDOUT: .Self = imports.%Main.import_ref.6d9
  810. // CHECK:STDOUT: .T1 = imports.%Main.import_ref.264
  811. // CHECK:STDOUT: .T2 = imports.%Main.import_ref.242
  812. // CHECK:STDOUT: .T3 = imports.%Main.import_ref.9b6
  813. // CHECK:STDOUT: witness = (imports.%Main.T1, imports.%Main.T2, imports.%Main.T3)
  814. // CHECK:STDOUT:
  815. // CHECK:STDOUT: !requires:
  816. // CHECK:STDOUT: }
  817. // CHECK:STDOUT:
  818. // CHECK:STDOUT: generic assoc_const @T1(imports.%Main.import_ref.e58186.1: %I3.type) [from "interface.carbon"] {
  819. // CHECK:STDOUT: assoc_const T1:! type;
  820. // CHECK:STDOUT: }
  821. // CHECK:STDOUT:
  822. // CHECK:STDOUT: generic assoc_const @T2(imports.%Main.import_ref.e58186.2: %I3.type) [from "interface.carbon"] {
  823. // CHECK:STDOUT: assoc_const T2:! type;
  824. // CHECK:STDOUT: }
  825. // CHECK:STDOUT:
  826. // CHECK:STDOUT: generic assoc_const @T3(imports.%Main.import_ref.e58186.3: %I3.type) [from "interface.carbon"] {
  827. // CHECK:STDOUT: assoc_const T3:! type;
  828. // CHECK:STDOUT: }
  829. // CHECK:STDOUT:
  830. // CHECK:STDOUT: impl @C5.as.<error>.impl.bcbfb8.1: %C5.ref as %.loc17_15;
  831. // CHECK:STDOUT:
  832. // CHECK:STDOUT: impl @C5.as.<error>.impl.bcbfb8.2: %C5.ref as %.loc27_15 {
  833. // CHECK:STDOUT: !members:
  834. // CHECK:STDOUT: witness = <error>
  835. // CHECK:STDOUT: }
  836. // CHECK:STDOUT:
  837. // CHECK:STDOUT: class @C5 {
  838. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  839. // CHECK:STDOUT: complete_type_witness = %complete_type
  840. // CHECK:STDOUT:
  841. // CHECK:STDOUT: !members:
  842. // CHECK:STDOUT: .Self = constants.%C5
  843. // CHECK:STDOUT: }
  844. // CHECK:STDOUT:
  845. // CHECK:STDOUT: specific @T1(constants.%Self) {}
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: specific @T1(constants.%.Self) {}
  848. // CHECK:STDOUT:
  849. // CHECK:STDOUT: specific @T2(constants.%Self) {}
  850. // CHECK:STDOUT:
  851. // CHECK:STDOUT: specific @T2(constants.%.Self) {}
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: specific @T3(constants.%Self) {}
  854. // CHECK:STDOUT:
  855. // CHECK:STDOUT: specific @T3(constants.%.Self) {}
  856. // CHECK:STDOUT:
  857. // CHECK:STDOUT: --- fail_missing_on_definition.carbon
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: constants {
  860. // CHECK:STDOUT: %C6: type = class_type @C6 [concrete]
  861. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  862. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  863. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  864. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  865. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  866. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  867. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  868. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  869. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  870. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  871. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  872. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete]
  873. // CHECK:STDOUT: %I.impl_witness.9dc: <witness> = impl_witness @C6.as.I.impl.27c.%I.impl_witness_table [concrete]
  874. // CHECK:STDOUT: }
  875. // CHECK:STDOUT:
  876. // CHECK:STDOUT: imports {
  877. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  878. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  879. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  880. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  881. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  882. // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [concrete = %T]
  883. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  884. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  885. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  886. // CHECK:STDOUT: }
  887. // CHECK:STDOUT:
  888. // CHECK:STDOUT: file {
  889. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  890. // CHECK:STDOUT: .I = imports.%Main.I
  891. // CHECK:STDOUT: .I3 = imports.%Main.I3
  892. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  893. // CHECK:STDOUT: .C6 = %C6.decl
  894. // CHECK:STDOUT: }
  895. // CHECK:STDOUT: %default.import = import <none>
  896. // CHECK:STDOUT: %C6.decl: type = class_decl @C6 [concrete = constants.%C6] {} {}
  897. // CHECK:STDOUT: impl_decl @C6.as.I.impl.756 [concrete] {} {
  898. // CHECK:STDOUT: %C6.ref: type = name_ref C6, file.%C6.decl [concrete = constants.%C6]
  899. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  900. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  901. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  902. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  903. // CHECK:STDOUT: %.loc5_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  904. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  905. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  906. // CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  907. // CHECK:STDOUT: %.loc5_26.2: type = converted %.loc5_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  908. // CHECK:STDOUT: %.loc5_14: type = where_expr %.Self [concrete = constants.%I_where.type] {
  909. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  910. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc5_26.2
  911. // CHECK:STDOUT: }
  912. // CHECK:STDOUT: }
  913. // CHECK:STDOUT: impl_decl @C6.as.I.impl.27c [concrete] {} {
  914. // CHECK:STDOUT: %C6.ref: type = name_ref C6, file.%C6.decl [concrete = constants.%C6]
  915. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  916. // CHECK:STDOUT: }
  917. // CHECK:STDOUT: }
  918. // CHECK:STDOUT:
  919. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  920. // CHECK:STDOUT: !members:
  921. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  922. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  923. // CHECK:STDOUT: witness = (imports.%Main.T)
  924. // CHECK:STDOUT:
  925. // CHECK:STDOUT: !requires:
  926. // CHECK:STDOUT: }
  927. // CHECK:STDOUT:
  928. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  929. // CHECK:STDOUT: assoc_const T:! type;
  930. // CHECK:STDOUT: }
  931. // CHECK:STDOUT:
  932. // CHECK:STDOUT: impl @C6.as.I.impl.756: %C6.ref as %.loc5_14;
  933. // CHECK:STDOUT:
  934. // CHECK:STDOUT: impl @C6.as.I.impl.27c: %C6.ref as %I.ref {
  935. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (<error>), @C6.as.I.impl.27c [concrete]
  936. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.9dc]
  937. // CHECK:STDOUT:
  938. // CHECK:STDOUT: !members:
  939. // CHECK:STDOUT: witness = %I.impl_witness
  940. // CHECK:STDOUT: }
  941. // CHECK:STDOUT:
  942. // CHECK:STDOUT: class @C6 {
  943. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  944. // CHECK:STDOUT: complete_type_witness = %complete_type
  945. // CHECK:STDOUT:
  946. // CHECK:STDOUT: !members:
  947. // CHECK:STDOUT: .Self = constants.%C6
  948. // CHECK:STDOUT: }
  949. // CHECK:STDOUT:
  950. // CHECK:STDOUT: specific @T(constants.%Self) {}
  951. // CHECK:STDOUT:
  952. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  953. // CHECK:STDOUT:
  954. // CHECK:STDOUT: --- fail_two_different.carbon
  955. // CHECK:STDOUT:
  956. // CHECK:STDOUT: constants {
  957. // CHECK:STDOUT: %C7: type = class_type @C7 [concrete]
  958. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  959. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  960. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  961. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  962. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  963. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  964. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  965. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  966. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  967. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  968. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  969. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  970. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  971. // CHECK:STDOUT: }
  972. // CHECK:STDOUT:
  973. // CHECK:STDOUT: imports {
  974. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  975. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  976. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  977. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  978. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  979. // CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded
  980. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  981. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  982. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  983. // CHECK:STDOUT: }
  984. // CHECK:STDOUT:
  985. // CHECK:STDOUT: file {
  986. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  987. // CHECK:STDOUT: .I = imports.%Main.I
  988. // CHECK:STDOUT: .I3 = imports.%Main.I3
  989. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  990. // CHECK:STDOUT: .C7 = %C7.decl
  991. // CHECK:STDOUT: }
  992. // CHECK:STDOUT: %default.import = import <none>
  993. // CHECK:STDOUT: %C7.decl: type = class_decl @C7 [concrete = constants.%C7] {} {}
  994. // CHECK:STDOUT: impl_decl @C7.as.<error>.impl [concrete] {} {
  995. // CHECK:STDOUT: %C7.ref: type = name_ref C7, file.%C7.decl [concrete = constants.%C7]
  996. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  997. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  998. // CHECK:STDOUT: %.Self.ref.loc10_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  999. // CHECK:STDOUT: %.Self.as_type.loc10_20: type = facet_access_type %.Self.ref.loc10_20 [symbolic_self = constants.%.Self.binding.as_type]
  1000. // CHECK:STDOUT: %.loc10_20: type = converted %.Self.ref.loc10_20, %.Self.as_type.loc10_20 [symbolic_self = constants.%.Self.binding.as_type]
  1001. // CHECK:STDOUT: %T.ref.loc10_20: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1002. // CHECK:STDOUT: %impl.elem0.loc10_20: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1003. // CHECK:STDOUT: %.loc10_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1004. // CHECK:STDOUT: %.loc10_26.2: type = converted %.loc10_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1005. // CHECK:STDOUT: %.Self.ref.loc10_32: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1006. // CHECK:STDOUT: %.Self.as_type.loc10_32: type = facet_access_type %.Self.ref.loc10_32 [symbolic_self = constants.%.Self.binding.as_type]
  1007. // CHECK:STDOUT: %.loc10_32: type = converted %.Self.ref.loc10_32, %.Self.as_type.loc10_32 [symbolic_self = constants.%.Self.binding.as_type]
  1008. // CHECK:STDOUT: %T.ref.loc10_32: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1009. // CHECK:STDOUT: %impl.elem0.loc10_32: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1010. // CHECK:STDOUT: %impl.elem0.subst: type = impl_witness_access_substituted %impl.elem0.loc10_32, %.loc10_26.2 [concrete = constants.%empty_struct_type]
  1011. // CHECK:STDOUT: %.loc10_38.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  1012. // CHECK:STDOUT: %.loc10_38.2: type = converted %.loc10_38.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1013. // CHECK:STDOUT: %.loc10_14: type = where_expr %.Self [concrete = <error>] {
  1014. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1015. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_20, %.loc10_26.2
  1016. // CHECK:STDOUT: requirement_rewrite %impl.elem0.subst, %.loc10_38.2
  1017. // CHECK:STDOUT: }
  1018. // CHECK:STDOUT: }
  1019. // CHECK:STDOUT: }
  1020. // CHECK:STDOUT:
  1021. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  1022. // CHECK:STDOUT: !members:
  1023. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  1024. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  1025. // CHECK:STDOUT: witness = (imports.%Main.T)
  1026. // CHECK:STDOUT:
  1027. // CHECK:STDOUT: !requires:
  1028. // CHECK:STDOUT: }
  1029. // CHECK:STDOUT:
  1030. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  1031. // CHECK:STDOUT: assoc_const T:! type;
  1032. // CHECK:STDOUT: }
  1033. // CHECK:STDOUT:
  1034. // CHECK:STDOUT: impl @C7.as.<error>.impl: %C7.ref as %.loc10_14 {
  1035. // CHECK:STDOUT: !members:
  1036. // CHECK:STDOUT: witness = <error>
  1037. // CHECK:STDOUT: }
  1038. // CHECK:STDOUT:
  1039. // CHECK:STDOUT: class @C7 {
  1040. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1041. // CHECK:STDOUT: complete_type_witness = %complete_type
  1042. // CHECK:STDOUT:
  1043. // CHECK:STDOUT: !members:
  1044. // CHECK:STDOUT: .Self = constants.%C7
  1045. // CHECK:STDOUT: }
  1046. // CHECK:STDOUT:
  1047. // CHECK:STDOUT: specific @T(constants.%Self) {}
  1048. // CHECK:STDOUT:
  1049. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  1050. // CHECK:STDOUT:
  1051. // CHECK:STDOUT: --- fail_two_different_first_bad.carbon
  1052. // CHECK:STDOUT:
  1053. // CHECK:STDOUT: constants {
  1054. // CHECK:STDOUT: %C8: type = class_type @C8 [concrete]
  1055. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1056. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1057. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1058. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  1059. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  1060. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1061. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  1062. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1063. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  1064. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  1065. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1066. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  1067. // CHECK:STDOUT: }
  1068. // CHECK:STDOUT:
  1069. // CHECK:STDOUT: imports {
  1070. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  1071. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  1072. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  1073. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  1074. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  1075. // CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded
  1076. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  1077. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  1078. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  1079. // CHECK:STDOUT: }
  1080. // CHECK:STDOUT:
  1081. // CHECK:STDOUT: file {
  1082. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1083. // CHECK:STDOUT: .I = imports.%Main.I
  1084. // CHECK:STDOUT: .I3 = imports.%Main.I3
  1085. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  1086. // CHECK:STDOUT: .C8 = %C8.decl
  1087. // CHECK:STDOUT: .BAD5 = <poisoned>
  1088. // CHECK:STDOUT: }
  1089. // CHECK:STDOUT: %default.import = import <none>
  1090. // CHECK:STDOUT: %C8.decl: type = class_decl @C8 [concrete = constants.%C8] {} {}
  1091. // CHECK:STDOUT: impl_decl @C8.as.<error>.impl [concrete] {} {
  1092. // CHECK:STDOUT: %C8.ref: type = name_ref C8, file.%C8.decl [concrete = constants.%C8]
  1093. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  1094. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1095. // CHECK:STDOUT: %.Self.ref.loc10_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1096. // CHECK:STDOUT: %.Self.as_type.loc10_20: type = facet_access_type %.Self.ref.loc10_20 [symbolic_self = constants.%.Self.binding.as_type]
  1097. // CHECK:STDOUT: %.loc10_20: type = converted %.Self.ref.loc10_20, %.Self.as_type.loc10_20 [symbolic_self = constants.%.Self.binding.as_type]
  1098. // CHECK:STDOUT: %T.ref.loc10_20: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1099. // CHECK:STDOUT: %impl.elem0.loc10_20: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1100. // CHECK:STDOUT: %BAD5.ref: <error> = name_ref BAD5, <error> [concrete = <error>]
  1101. // CHECK:STDOUT: %.Self.ref.loc10_34: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1102. // CHECK:STDOUT: %.Self.as_type.loc10_34: type = facet_access_type %.Self.ref.loc10_34 [symbolic_self = constants.%.Self.binding.as_type]
  1103. // CHECK:STDOUT: %.loc10_34: type = converted %.Self.ref.loc10_34, %.Self.as_type.loc10_34 [symbolic_self = constants.%.Self.binding.as_type]
  1104. // CHECK:STDOUT: %T.ref.loc10_34: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1105. // CHECK:STDOUT: %impl.elem0.loc10_34: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1106. // CHECK:STDOUT: %impl.elem0.subst: type = impl_witness_access_substituted %impl.elem0.loc10_34, <error> [concrete = <error>]
  1107. // CHECK:STDOUT: %.loc10_40.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  1108. // CHECK:STDOUT: %.loc10_40.2: type = converted %.loc10_40.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1109. // CHECK:STDOUT: %.loc10_14: type = where_expr %.Self [concrete = <error>] {
  1110. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1111. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_20, <error>
  1112. // CHECK:STDOUT: requirement_rewrite %impl.elem0.subst, %.loc10_40.2
  1113. // CHECK:STDOUT: }
  1114. // CHECK:STDOUT: }
  1115. // CHECK:STDOUT: }
  1116. // CHECK:STDOUT:
  1117. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  1118. // CHECK:STDOUT: !members:
  1119. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  1120. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  1121. // CHECK:STDOUT: witness = (imports.%Main.T)
  1122. // CHECK:STDOUT:
  1123. // CHECK:STDOUT: !requires:
  1124. // CHECK:STDOUT: }
  1125. // CHECK:STDOUT:
  1126. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  1127. // CHECK:STDOUT: assoc_const T:! type;
  1128. // CHECK:STDOUT: }
  1129. // CHECK:STDOUT:
  1130. // CHECK:STDOUT: impl @C8.as.<error>.impl: %C8.ref as %.loc10_14 {
  1131. // CHECK:STDOUT: !members:
  1132. // CHECK:STDOUT: witness = <error>
  1133. // CHECK:STDOUT: }
  1134. // CHECK:STDOUT:
  1135. // CHECK:STDOUT: class @C8 {
  1136. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1137. // CHECK:STDOUT: complete_type_witness = %complete_type
  1138. // CHECK:STDOUT:
  1139. // CHECK:STDOUT: !members:
  1140. // CHECK:STDOUT: .Self = constants.%C8
  1141. // CHECK:STDOUT: }
  1142. // CHECK:STDOUT:
  1143. // CHECK:STDOUT: specific @T(constants.%Self) {}
  1144. // CHECK:STDOUT:
  1145. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  1146. // CHECK:STDOUT:
  1147. // CHECK:STDOUT: --- fail_two_different_second_bad.carbon
  1148. // CHECK:STDOUT:
  1149. // CHECK:STDOUT: constants {
  1150. // CHECK:STDOUT: %C9: type = class_type @C9 [concrete]
  1151. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1152. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1153. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1154. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  1155. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  1156. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  1157. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1158. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  1159. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  1160. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1161. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  1162. // CHECK:STDOUT: }
  1163. // CHECK:STDOUT:
  1164. // CHECK:STDOUT: imports {
  1165. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  1166. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  1167. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  1168. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  1169. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  1170. // CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded
  1171. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  1172. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  1173. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  1174. // CHECK:STDOUT: }
  1175. // CHECK:STDOUT:
  1176. // CHECK:STDOUT: file {
  1177. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1178. // CHECK:STDOUT: .I = imports.%Main.I
  1179. // CHECK:STDOUT: .I3 = imports.%Main.I3
  1180. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  1181. // CHECK:STDOUT: .C9 = %C9.decl
  1182. // CHECK:STDOUT: .BAD6 = <poisoned>
  1183. // CHECK:STDOUT: }
  1184. // CHECK:STDOUT: %default.import = import <none>
  1185. // CHECK:STDOUT: %C9.decl: type = class_decl @C9 [concrete = constants.%C9] {} {}
  1186. // CHECK:STDOUT: impl_decl @C9.as.<error>.impl [concrete] {} {
  1187. // CHECK:STDOUT: %C9.ref: type = name_ref C9, file.%C9.decl [concrete = constants.%C9]
  1188. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  1189. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1190. // CHECK:STDOUT: %.Self.ref.loc10_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1191. // CHECK:STDOUT: %.Self.as_type.loc10_20: type = facet_access_type %.Self.ref.loc10_20 [symbolic_self = constants.%.Self.binding.as_type]
  1192. // CHECK:STDOUT: %.loc10_20: type = converted %.Self.ref.loc10_20, %.Self.as_type.loc10_20 [symbolic_self = constants.%.Self.binding.as_type]
  1193. // CHECK:STDOUT: %T.ref.loc10_20: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1194. // CHECK:STDOUT: %impl.elem0.loc10_20: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1195. // CHECK:STDOUT: %.loc10_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1196. // CHECK:STDOUT: %.loc10_26.2: type = converted %.loc10_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1197. // CHECK:STDOUT: %.Self.ref.loc10_32: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1198. // CHECK:STDOUT: %.Self.as_type.loc10_32: type = facet_access_type %.Self.ref.loc10_32 [symbolic_self = constants.%.Self.binding.as_type]
  1199. // CHECK:STDOUT: %.loc10_32: type = converted %.Self.ref.loc10_32, %.Self.as_type.loc10_32 [symbolic_self = constants.%.Self.binding.as_type]
  1200. // CHECK:STDOUT: %T.ref.loc10_32: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1201. // CHECK:STDOUT: %impl.elem0.loc10_32: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1202. // CHECK:STDOUT: %impl.elem0.subst: type = impl_witness_access_substituted %impl.elem0.loc10_32, %.loc10_26.2 [concrete = constants.%empty_struct_type]
  1203. // CHECK:STDOUT: %BAD6.ref: <error> = name_ref BAD6, <error> [concrete = <error>]
  1204. // CHECK:STDOUT: %.loc10_14: type = where_expr %.Self [concrete = <error>] {
  1205. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1206. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_20, %.loc10_26.2
  1207. // CHECK:STDOUT: requirement_rewrite %impl.elem0.subst, <error>
  1208. // CHECK:STDOUT: }
  1209. // CHECK:STDOUT: }
  1210. // CHECK:STDOUT: }
  1211. // CHECK:STDOUT:
  1212. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  1213. // CHECK:STDOUT: !members:
  1214. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  1215. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  1216. // CHECK:STDOUT: witness = (imports.%Main.T)
  1217. // CHECK:STDOUT:
  1218. // CHECK:STDOUT: !requires:
  1219. // CHECK:STDOUT: }
  1220. // CHECK:STDOUT:
  1221. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  1222. // CHECK:STDOUT: assoc_const T:! type;
  1223. // CHECK:STDOUT: }
  1224. // CHECK:STDOUT:
  1225. // CHECK:STDOUT: impl @C9.as.<error>.impl: %C9.ref as %.loc10_14 {
  1226. // CHECK:STDOUT: !members:
  1227. // CHECK:STDOUT: witness = <error>
  1228. // CHECK:STDOUT: }
  1229. // CHECK:STDOUT:
  1230. // CHECK:STDOUT: class @C9 {
  1231. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1232. // CHECK:STDOUT: complete_type_witness = %complete_type
  1233. // CHECK:STDOUT:
  1234. // CHECK:STDOUT: !members:
  1235. // CHECK:STDOUT: .Self = constants.%C9
  1236. // CHECK:STDOUT: }
  1237. // CHECK:STDOUT:
  1238. // CHECK:STDOUT: specific @T(constants.%Self) {}
  1239. // CHECK:STDOUT:
  1240. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  1241. // CHECK:STDOUT:
  1242. // CHECK:STDOUT: --- fail_two_different_both_bad.carbon
  1243. // CHECK:STDOUT:
  1244. // CHECK:STDOUT: constants {
  1245. // CHECK:STDOUT: %CA: type = class_type @CA [concrete]
  1246. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1247. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1248. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1249. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  1250. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  1251. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  1252. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1253. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  1254. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  1255. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1256. // CHECK:STDOUT: }
  1257. // CHECK:STDOUT:
  1258. // CHECK:STDOUT: imports {
  1259. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  1260. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  1261. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  1262. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  1263. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  1264. // CHECK:STDOUT: %Main.T = import_ref Main//interface, T, unloaded
  1265. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  1266. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  1267. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  1268. // CHECK:STDOUT: }
  1269. // CHECK:STDOUT:
  1270. // CHECK:STDOUT: file {
  1271. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1272. // CHECK:STDOUT: .I = imports.%Main.I
  1273. // CHECK:STDOUT: .I3 = imports.%Main.I3
  1274. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  1275. // CHECK:STDOUT: .CA = %CA.decl
  1276. // CHECK:STDOUT: .BAD7 = <poisoned>
  1277. // CHECK:STDOUT: .BAD8 = <poisoned>
  1278. // CHECK:STDOUT: }
  1279. // CHECK:STDOUT: %default.import = import <none>
  1280. // CHECK:STDOUT: %CA.decl: type = class_decl @CA [concrete = constants.%CA] {} {}
  1281. // CHECK:STDOUT: impl_decl @CA.as.<error>.impl [concrete] {} {
  1282. // CHECK:STDOUT: %CA.ref: type = name_ref CA, file.%CA.decl [concrete = constants.%CA]
  1283. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  1284. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1285. // CHECK:STDOUT: %.Self.ref.loc14_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1286. // CHECK:STDOUT: %.Self.as_type.loc14_20: type = facet_access_type %.Self.ref.loc14_20 [symbolic_self = constants.%.Self.binding.as_type]
  1287. // CHECK:STDOUT: %.loc14_20: type = converted %.Self.ref.loc14_20, %.Self.as_type.loc14_20 [symbolic_self = constants.%.Self.binding.as_type]
  1288. // CHECK:STDOUT: %T.ref.loc14_20: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1289. // CHECK:STDOUT: %impl.elem0.loc14_20: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1290. // CHECK:STDOUT: %BAD7.ref: <error> = name_ref BAD7, <error> [concrete = <error>]
  1291. // CHECK:STDOUT: %.Self.ref.loc14_34: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1292. // CHECK:STDOUT: %.Self.as_type.loc14_34: type = facet_access_type %.Self.ref.loc14_34 [symbolic_self = constants.%.Self.binding.as_type]
  1293. // CHECK:STDOUT: %.loc14_34: type = converted %.Self.ref.loc14_34, %.Self.as_type.loc14_34 [symbolic_self = constants.%.Self.binding.as_type]
  1294. // CHECK:STDOUT: %T.ref.loc14_34: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1295. // CHECK:STDOUT: %impl.elem0.loc14_34: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1296. // CHECK:STDOUT: %impl.elem0.subst: type = impl_witness_access_substituted %impl.elem0.loc14_34, <error> [concrete = <error>]
  1297. // CHECK:STDOUT: %BAD8.ref: <error> = name_ref BAD8, <error> [concrete = <error>]
  1298. // CHECK:STDOUT: %.loc14_14: type = where_expr %.Self [concrete = <error>] {
  1299. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1300. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc14_20, <error>
  1301. // CHECK:STDOUT: requirement_rewrite %impl.elem0.subst, <error>
  1302. // CHECK:STDOUT: }
  1303. // CHECK:STDOUT: }
  1304. // CHECK:STDOUT: }
  1305. // CHECK:STDOUT:
  1306. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  1307. // CHECK:STDOUT: !members:
  1308. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  1309. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  1310. // CHECK:STDOUT: witness = (imports.%Main.T)
  1311. // CHECK:STDOUT:
  1312. // CHECK:STDOUT: !requires:
  1313. // CHECK:STDOUT: }
  1314. // CHECK:STDOUT:
  1315. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  1316. // CHECK:STDOUT: assoc_const T:! type;
  1317. // CHECK:STDOUT: }
  1318. // CHECK:STDOUT:
  1319. // CHECK:STDOUT: impl @CA.as.<error>.impl: %CA.ref as %.loc14_14 {
  1320. // CHECK:STDOUT: !members:
  1321. // CHECK:STDOUT: witness = <error>
  1322. // CHECK:STDOUT: }
  1323. // CHECK:STDOUT:
  1324. // CHECK:STDOUT: class @CA {
  1325. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1326. // CHECK:STDOUT: complete_type_witness = %complete_type
  1327. // CHECK:STDOUT:
  1328. // CHECK:STDOUT: !members:
  1329. // CHECK:STDOUT: .Self = constants.%CA
  1330. // CHECK:STDOUT: }
  1331. // CHECK:STDOUT:
  1332. // CHECK:STDOUT: specific @T(constants.%Self) {}
  1333. // CHECK:STDOUT:
  1334. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  1335. // CHECK:STDOUT:
  1336. // CHECK:STDOUT: --- repeated.carbon
  1337. // CHECK:STDOUT:
  1338. // CHECK:STDOUT: constants {
  1339. // CHECK:STDOUT: %CB: type = class_type @CB [concrete]
  1340. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1341. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1342. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1343. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  1344. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
  1345. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  1346. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1347. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.be8 [concrete]
  1348. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  1349. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  1350. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  1351. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete]
  1352. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @CB.as.I.impl.%I.impl_witness_table [concrete]
  1353. // CHECK:STDOUT: }
  1354. // CHECK:STDOUT:
  1355. // CHECK:STDOUT: imports {
  1356. // CHECK:STDOUT: %Main.I: type = import_ref Main//interface, I, loaded [concrete = constants.%I.type]
  1357. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  1358. // CHECK:STDOUT: %Main.NonType = import_ref Main//interface, NonType, unloaded
  1359. // CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//interface, loc3_13, unloaded
  1360. // CHECK:STDOUT: %Main.import_ref.873: %I.assoc_type = import_ref Main//interface, loc3_20, loaded [concrete = constants.%assoc0]
  1361. // CHECK:STDOUT: %Main.T: type = import_ref Main//interface, T, loaded [concrete = %T]
  1362. // CHECK:STDOUT: %Main.import_ref.be8: type = import_ref Main//interface, loc3_20, loaded [concrete = %T]
  1363. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {}
  1364. // CHECK:STDOUT: %Main.import_ref.236: %I.type = import_ref Main//interface, loc3_13, loaded [symbolic = constants.%Self]
  1365. // CHECK:STDOUT: }
  1366. // CHECK:STDOUT:
  1367. // CHECK:STDOUT: file {
  1368. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1369. // CHECK:STDOUT: .I = imports.%Main.I
  1370. // CHECK:STDOUT: .I3 = imports.%Main.I3
  1371. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  1372. // CHECK:STDOUT: .CB = %CB.decl
  1373. // CHECK:STDOUT: }
  1374. // CHECK:STDOUT: %default.import = import <none>
  1375. // CHECK:STDOUT: %CB.decl: type = class_decl @CB [concrete = constants.%CB] {} {}
  1376. // CHECK:STDOUT: impl_decl @CB.as.I.impl [concrete] {} {
  1377. // CHECK:STDOUT: %CB.ref: type = name_ref CB, file.%CB.decl [concrete = constants.%CB]
  1378. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  1379. // CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1380. // CHECK:STDOUT: %.Self.ref.loc6_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1381. // CHECK:STDOUT: %.Self.as_type.loc6_20: type = facet_access_type %.Self.ref.loc6_20 [symbolic_self = constants.%.Self.binding.as_type]
  1382. // CHECK:STDOUT: %.loc6_20: type = converted %.Self.ref.loc6_20, %.Self.as_type.loc6_20 [symbolic_self = constants.%.Self.binding.as_type]
  1383. // CHECK:STDOUT: %T.ref.loc6_20: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1384. // CHECK:STDOUT: %impl.elem0.loc6_20: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1385. // CHECK:STDOUT: %.loc6_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1386. // CHECK:STDOUT: %.loc6_26.2: type = converted %.loc6_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1387. // CHECK:STDOUT: %.Self.ref.loc6_32: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1388. // CHECK:STDOUT: %.Self.as_type.loc6_32: type = facet_access_type %.Self.ref.loc6_32 [symbolic_self = constants.%.Self.binding.as_type]
  1389. // CHECK:STDOUT: %.loc6_32: type = converted %.Self.ref.loc6_32, %.Self.as_type.loc6_32 [symbolic_self = constants.%.Self.binding.as_type]
  1390. // CHECK:STDOUT: %T.ref.loc6_32: %I.assoc_type = name_ref T, imports.%Main.import_ref.873 [concrete = constants.%assoc0]
  1391. // CHECK:STDOUT: %impl.elem0.loc6_32: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1392. // CHECK:STDOUT: %impl.elem0.subst: type = impl_witness_access_substituted %impl.elem0.loc6_32, %.loc6_26.2 [concrete = constants.%empty_struct_type]
  1393. // CHECK:STDOUT: %.loc6_38.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1394. // CHECK:STDOUT: %.loc6_38.2: type = converted %.loc6_38.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1395. // CHECK:STDOUT: %.loc6_14: type = where_expr %.Self [concrete = constants.%I_where.type] {
  1396. // CHECK:STDOUT: requirement_base_facet_type constants.%I.type
  1397. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6_20, %.loc6_26.2
  1398. // CHECK:STDOUT: requirement_rewrite %impl.elem0.subst, %.loc6_38.2
  1399. // CHECK:STDOUT: }
  1400. // CHECK:STDOUT: }
  1401. // CHECK:STDOUT: }
  1402. // CHECK:STDOUT:
  1403. // CHECK:STDOUT: interface @I [from "interface.carbon"] {
  1404. // CHECK:STDOUT: !members:
  1405. // CHECK:STDOUT: .Self = imports.%Main.import_ref.c82
  1406. // CHECK:STDOUT: .T = imports.%Main.import_ref.873
  1407. // CHECK:STDOUT: witness = (imports.%Main.T)
  1408. // CHECK:STDOUT:
  1409. // CHECK:STDOUT: !requires:
  1410. // CHECK:STDOUT: }
  1411. // CHECK:STDOUT:
  1412. // CHECK:STDOUT: generic assoc_const @T(imports.%Main.import_ref.236: %I.type) [from "interface.carbon"] {
  1413. // CHECK:STDOUT: assoc_const T:! type;
  1414. // CHECK:STDOUT: }
  1415. // CHECK:STDOUT:
  1416. // CHECK:STDOUT: impl @CB.as.I.impl: %CB.ref as %.loc6_14 {
  1417. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @CB.as.I.impl [concrete]
  1418. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1419. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1420. // CHECK:STDOUT:
  1421. // CHECK:STDOUT: !members:
  1422. // CHECK:STDOUT: witness = %I.impl_witness
  1423. // CHECK:STDOUT: }
  1424. // CHECK:STDOUT:
  1425. // CHECK:STDOUT: class @CB {
  1426. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1427. // CHECK:STDOUT: complete_type_witness = %complete_type
  1428. // CHECK:STDOUT:
  1429. // CHECK:STDOUT: !members:
  1430. // CHECK:STDOUT: .Self = constants.%CB
  1431. // CHECK:STDOUT: }
  1432. // CHECK:STDOUT:
  1433. // CHECK:STDOUT: specific @T(constants.%Self) {}
  1434. // CHECK:STDOUT:
  1435. // CHECK:STDOUT: specific @T(constants.%.Self) {}
  1436. // CHECK:STDOUT:
  1437. // CHECK:STDOUT: --- non-type.carbon
  1438. // CHECK:STDOUT:
  1439. // CHECK:STDOUT: constants {
  1440. // CHECK:STDOUT: %CC: type = class_type @CC [concrete]
  1441. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1442. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1443. // CHECK:STDOUT: %NonType.type: type = facet_type <@NonType> [concrete]
  1444. // CHECK:STDOUT: %Self: %NonType.type = symbolic_binding Self, 0 [symbolic]
  1445. // CHECK:STDOUT: %.Self: %NonType.type = symbolic_binding .Self [symbolic_self]
  1446. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  1447. // CHECK:STDOUT: %NonType.assoc_type: type = assoc_entity_type @NonType [concrete]
  1448. // CHECK:STDOUT: %assoc0: %NonType.assoc_type = assoc_entity element0, imports.%Main.import_ref.074 [concrete]
  1449. // CHECK:STDOUT: %NonType.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @NonType [symbolic_self]
  1450. // CHECK:STDOUT: %struct_type.a.225: type = struct_type {.a: %empty_struct_type} [concrete]
  1451. // CHECK:STDOUT: %impl.elem0: %struct_type.a.225 = impl_witness_access %NonType.lookup_impl_witness, element0 [symbolic_self]
  1452. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  1453. // CHECK:STDOUT: %struct: %struct_type.a.225 = struct_value (%empty_struct) [concrete]
  1454. // CHECK:STDOUT: %NonType_where.type: type = facet_type <@NonType where %impl.elem0 = %struct> [concrete]
  1455. // CHECK:STDOUT: %NonType.impl_witness: <witness> = impl_witness @CC.as.NonType.impl.%NonType.impl_witness_table [concrete]
  1456. // CHECK:STDOUT: }
  1457. // CHECK:STDOUT:
  1458. // CHECK:STDOUT: imports {
  1459. // CHECK:STDOUT: %Main.I = import_ref Main//interface, I, unloaded
  1460. // CHECK:STDOUT: %Main.I3 = import_ref Main//interface, I3, unloaded
  1461. // CHECK:STDOUT: %Main.NonType: type = import_ref Main//interface, NonType, loaded [concrete = constants.%NonType.type]
  1462. // CHECK:STDOUT: %Main.import_ref.e7e = import_ref Main//interface, loc11_19, unloaded
  1463. // CHECK:STDOUT: %Main.import_ref.048: %NonType.assoc_type = import_ref Main//interface, loc12_8, loaded [concrete = constants.%assoc0]
  1464. // CHECK:STDOUT: %Main.Y: %struct_type.a.225 = import_ref Main//interface, Y, loaded [concrete = %Y]
  1465. // CHECK:STDOUT: %Main.import_ref.074: %struct_type.a.225 = import_ref Main//interface, loc12_8, loaded [concrete = %Y]
  1466. // CHECK:STDOUT: %Y: %struct_type.a.225 = assoc_const_decl @Y [concrete] {}
  1467. // CHECK:STDOUT: %Main.import_ref.a24: %NonType.type = import_ref Main//interface, loc11_19, loaded [symbolic = constants.%Self]
  1468. // CHECK:STDOUT: }
  1469. // CHECK:STDOUT:
  1470. // CHECK:STDOUT: file {
  1471. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1472. // CHECK:STDOUT: .I = imports.%Main.I
  1473. // CHECK:STDOUT: .I3 = imports.%Main.I3
  1474. // CHECK:STDOUT: .NonType = imports.%Main.NonType
  1475. // CHECK:STDOUT: .CC = %CC.decl
  1476. // CHECK:STDOUT: }
  1477. // CHECK:STDOUT: %default.import = import <none>
  1478. // CHECK:STDOUT: %CC.decl: type = class_decl @CC [concrete = constants.%CC] {} {}
  1479. // CHECK:STDOUT: impl_decl @CC.as.NonType.impl [concrete] {} {
  1480. // CHECK:STDOUT: %CC.ref: type = name_ref CC, file.%CC.decl [concrete = constants.%CC]
  1481. // CHECK:STDOUT: %NonType.ref: type = name_ref NonType, imports.%Main.NonType [concrete = constants.%NonType.type]
  1482. // CHECK:STDOUT: %.Self: %NonType.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1483. // CHECK:STDOUT: %.Self.ref: %NonType.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1484. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  1485. // CHECK:STDOUT: %.loc6_26: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  1486. // CHECK:STDOUT: %Y.ref: %NonType.assoc_type = name_ref Y, imports.%Main.import_ref.048 [concrete = constants.%assoc0]
  1487. // CHECK:STDOUT: %impl.elem0: %struct_type.a.225 = impl_witness_access constants.%NonType.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1488. // CHECK:STDOUT: %.loc6_38: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1489. // CHECK:STDOUT: %.loc6_39.1: %struct_type.a.225 = struct_literal (%.loc6_38) [concrete = constants.%struct]
  1490. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  1491. // CHECK:STDOUT: %.loc6_39.2: %empty_struct_type = converted %.loc6_38, %empty_struct [concrete = constants.%empty_struct]
  1492. // CHECK:STDOUT: %struct: %struct_type.a.225 = struct_value (%.loc6_39.2) [concrete = constants.%struct]
  1493. // CHECK:STDOUT: %.loc6_39.3: %struct_type.a.225 = converted %.loc6_39.1, %struct [concrete = constants.%struct]
  1494. // CHECK:STDOUT: %.loc6_20: type = where_expr %.Self [concrete = constants.%NonType_where.type] {
  1495. // CHECK:STDOUT: requirement_base_facet_type constants.%NonType.type
  1496. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc6_39.3
  1497. // CHECK:STDOUT: }
  1498. // CHECK:STDOUT: }
  1499. // CHECK:STDOUT: }
  1500. // CHECK:STDOUT:
  1501. // CHECK:STDOUT: interface @NonType [from "interface.carbon"] {
  1502. // CHECK:STDOUT: !members:
  1503. // CHECK:STDOUT: .Self = imports.%Main.import_ref.e7e
  1504. // CHECK:STDOUT: .Y = imports.%Main.import_ref.048
  1505. // CHECK:STDOUT: witness = (imports.%Main.Y)
  1506. // CHECK:STDOUT:
  1507. // CHECK:STDOUT: !requires:
  1508. // CHECK:STDOUT: }
  1509. // CHECK:STDOUT:
  1510. // CHECK:STDOUT: generic assoc_const @Y(imports.%Main.import_ref.a24: %NonType.type) [from "interface.carbon"] {
  1511. // CHECK:STDOUT: assoc_const Y:! %struct_type.a.225;
  1512. // CHECK:STDOUT: }
  1513. // CHECK:STDOUT:
  1514. // CHECK:STDOUT: impl @CC.as.NonType.impl: %CC.ref as %.loc6_20 {
  1515. // CHECK:STDOUT: %NonType.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @CC.as.NonType.impl [concrete]
  1516. // CHECK:STDOUT: %NonType.impl_witness: <witness> = impl_witness %NonType.impl_witness_table [concrete = constants.%NonType.impl_witness]
  1517. // CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.225 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct]
  1518. // CHECK:STDOUT:
  1519. // CHECK:STDOUT: !members:
  1520. // CHECK:STDOUT: witness = %NonType.impl_witness
  1521. // CHECK:STDOUT: }
  1522. // CHECK:STDOUT:
  1523. // CHECK:STDOUT: class @CC {
  1524. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1525. // CHECK:STDOUT: complete_type_witness = %complete_type
  1526. // CHECK:STDOUT:
  1527. // CHECK:STDOUT: !members:
  1528. // CHECK:STDOUT: .Self = constants.%CC
  1529. // CHECK:STDOUT: }
  1530. // CHECK:STDOUT:
  1531. // CHECK:STDOUT: specific @Y(constants.%Self) {}
  1532. // CHECK:STDOUT:
  1533. // CHECK:STDOUT: specific @Y(constants.%.Self) {}
  1534. // CHECK:STDOUT:
  1535. // CHECK:STDOUT: --- interface_with_function.carbon
  1536. // CHECK:STDOUT:
  1537. // CHECK:STDOUT: constants {
  1538. // CHECK:STDOUT: %IF.type: type = facet_type <@IF> [concrete]
  1539. // CHECK:STDOUT: %Self: %IF.type = symbolic_binding Self, 0 [symbolic]
  1540. // CHECK:STDOUT: %IF.F.type: type = fn_type @IF.F [concrete]
  1541. // CHECK:STDOUT: %IF.F: %IF.F.type = struct_value () [concrete]
  1542. // CHECK:STDOUT: %IF.assoc_type: type = assoc_entity_type @IF [concrete]
  1543. // CHECK:STDOUT: %assoc0: %IF.assoc_type = assoc_entity element0, @IF.%IF.F.decl [concrete]
  1544. // CHECK:STDOUT: }
  1545. // CHECK:STDOUT:
  1546. // CHECK:STDOUT: file {
  1547. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1548. // CHECK:STDOUT: .IF = %IF.decl
  1549. // CHECK:STDOUT: }
  1550. // CHECK:STDOUT: %IF.decl: type = interface_decl @IF [concrete = constants.%IF.type] {} {}
  1551. // CHECK:STDOUT: }
  1552. // CHECK:STDOUT:
  1553. // CHECK:STDOUT: interface @IF {
  1554. // CHECK:STDOUT: %Self: %IF.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  1555. // CHECK:STDOUT: %IF.F.decl: %IF.F.type = fn_decl @IF.F [concrete = constants.%IF.F] {} {}
  1556. // CHECK:STDOUT: %assoc0: %IF.assoc_type = assoc_entity element0, %IF.F.decl [concrete = constants.%assoc0]
  1557. // CHECK:STDOUT:
  1558. // CHECK:STDOUT: !members:
  1559. // CHECK:STDOUT: .Self = %Self
  1560. // CHECK:STDOUT: .F = %assoc0
  1561. // CHECK:STDOUT: witness = (%IF.F.decl)
  1562. // CHECK:STDOUT:
  1563. // CHECK:STDOUT: !requires:
  1564. // CHECK:STDOUT: }
  1565. // CHECK:STDOUT:
  1566. // CHECK:STDOUT: generic fn @IF.F(@IF.%Self: %IF.type) {
  1567. // CHECK:STDOUT: fn();
  1568. // CHECK:STDOUT: }
  1569. // CHECK:STDOUT:
  1570. // CHECK:STDOUT: specific @IF.F(constants.%Self) {}
  1571. // CHECK:STDOUT:
  1572. // CHECK:STDOUT: --- fail_where_rewrite_function.carbon
  1573. // CHECK:STDOUT:
  1574. // CHECK:STDOUT: constants {
  1575. // CHECK:STDOUT: %CD: type = class_type @CD [concrete]
  1576. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1577. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1578. // CHECK:STDOUT: %IF.type: type = facet_type <@IF> [concrete]
  1579. // CHECK:STDOUT: %Self: %IF.type = symbolic_binding Self, 0 [symbolic]
  1580. // CHECK:STDOUT: %.Self: %IF.type = symbolic_binding .Self [symbolic_self]
  1581. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  1582. // CHECK:STDOUT: %IF.assoc_type: type = assoc_entity_type @IF [concrete]
  1583. // CHECK:STDOUT: %assoc0: %IF.assoc_type = assoc_entity element0, imports.%Main.import_ref.a87 [concrete]
  1584. // CHECK:STDOUT: %IF.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @IF [symbolic_self]
  1585. // CHECK:STDOUT: %IF.F.type: type = fn_type @IF.F [concrete]
  1586. // CHECK:STDOUT: %IF.F: %IF.F.type = struct_value () [concrete]
  1587. // CHECK:STDOUT: %.f6e: type = fn_type_with_self_type %IF.F.type, %.Self [symbolic_self]
  1588. // CHECK:STDOUT: %impl.elem0: %.f6e = impl_witness_access %IF.lookup_impl_witness, element0 [symbolic_self]
  1589. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  1590. // CHECK:STDOUT: %IF_where.type: type = facet_type <@IF where %impl.elem0 = %int_0> [concrete]
  1591. // CHECK:STDOUT: %IF.impl_witness: <witness> = impl_witness @CD.as.IF.impl.%IF.impl_witness_table [concrete]
  1592. // CHECK:STDOUT: %CD.as.IF.impl.F.type: type = fn_type @CD.as.IF.impl.F [concrete]
  1593. // CHECK:STDOUT: %CD.as.IF.impl.F: %CD.as.IF.impl.F.type = struct_value () [concrete]
  1594. // CHECK:STDOUT: %IF.facet: %IF.type = facet_value %CD, (%IF.impl_witness) [concrete]
  1595. // CHECK:STDOUT: }
  1596. // CHECK:STDOUT:
  1597. // CHECK:STDOUT: imports {
  1598. // CHECK:STDOUT: %Main.IF: type = import_ref Main//interface_with_function, IF, loaded [concrete = constants.%IF.type]
  1599. // CHECK:STDOUT: %Main.import_ref.b9e = import_ref Main//interface_with_function, loc3_14, unloaded
  1600. // CHECK:STDOUT: %Main.import_ref.9af: %IF.assoc_type = import_ref Main//interface_with_function, loc3_22, loaded [concrete = constants.%assoc0]
  1601. // CHECK:STDOUT: %Main.F: %IF.F.type = import_ref Main//interface_with_function, F, loaded [concrete = constants.%IF.F]
  1602. // CHECK:STDOUT: %Main.import_ref.a87: %IF.F.type = import_ref Main//interface_with_function, loc3_22, loaded [concrete = constants.%IF.F]
  1603. // CHECK:STDOUT: %Main.import_ref.e88: %IF.type = import_ref Main//interface_with_function, loc3_14, loaded [symbolic = constants.%Self]
  1604. // CHECK:STDOUT: }
  1605. // CHECK:STDOUT:
  1606. // CHECK:STDOUT: file {
  1607. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1608. // CHECK:STDOUT: .IF = imports.%Main.IF
  1609. // CHECK:STDOUT: .CD = %CD.decl
  1610. // CHECK:STDOUT: }
  1611. // CHECK:STDOUT: %default.import = import <none>
  1612. // CHECK:STDOUT: %CD.decl: type = class_decl @CD [concrete = constants.%CD] {} {}
  1613. // CHECK:STDOUT: impl_decl @CD.as.IF.impl [concrete] {} {
  1614. // CHECK:STDOUT: %CD.ref: type = name_ref CD, file.%CD.decl [concrete = constants.%CD]
  1615. // CHECK:STDOUT: %IF.ref: type = name_ref IF, imports.%Main.IF [concrete = constants.%IF.type]
  1616. // CHECK:STDOUT: %.Self: %IF.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1617. // CHECK:STDOUT: %.Self.ref: %IF.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1618. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  1619. // CHECK:STDOUT: %.loc10_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  1620. // CHECK:STDOUT: %F.ref: %IF.assoc_type = name_ref F, imports.%Main.import_ref.9af [concrete = constants.%assoc0]
  1621. // CHECK:STDOUT: %impl.elem0: %.f6e = impl_witness_access constants.%IF.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  1622. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  1623. // CHECK:STDOUT: %.loc10_15: type = where_expr %.Self [concrete = constants.%IF_where.type] {
  1624. // CHECK:STDOUT: requirement_base_facet_type constants.%IF.type
  1625. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %int_0
  1626. // CHECK:STDOUT: }
  1627. // CHECK:STDOUT: }
  1628. // CHECK:STDOUT: }
  1629. // CHECK:STDOUT:
  1630. // CHECK:STDOUT: interface @IF [from "interface_with_function.carbon"] {
  1631. // CHECK:STDOUT: !members:
  1632. // CHECK:STDOUT: .Self = imports.%Main.import_ref.b9e
  1633. // CHECK:STDOUT: .F = imports.%Main.import_ref.9af
  1634. // CHECK:STDOUT: witness = (imports.%Main.F)
  1635. // CHECK:STDOUT:
  1636. // CHECK:STDOUT: !requires:
  1637. // CHECK:STDOUT: }
  1638. // CHECK:STDOUT:
  1639. // CHECK:STDOUT: impl @CD.as.IF.impl: %CD.ref as %.loc10_15 {
  1640. // CHECK:STDOUT: %CD.as.IF.impl.F.decl: %CD.as.IF.impl.F.type = fn_decl @CD.as.IF.impl.F [concrete = constants.%CD.as.IF.impl.F] {} {}
  1641. // CHECK:STDOUT: %IF.impl_witness_table = impl_witness_table (%CD.as.IF.impl.F.decl), @CD.as.IF.impl [concrete]
  1642. // CHECK:STDOUT: %IF.impl_witness: <witness> = impl_witness %IF.impl_witness_table [concrete = constants.%IF.impl_witness]
  1643. // CHECK:STDOUT:
  1644. // CHECK:STDOUT: !members:
  1645. // CHECK:STDOUT: .F = %CD.as.IF.impl.F.decl
  1646. // CHECK:STDOUT: witness = %IF.impl_witness
  1647. // CHECK:STDOUT: }
  1648. // CHECK:STDOUT:
  1649. // CHECK:STDOUT: class @CD {
  1650. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1651. // CHECK:STDOUT: complete_type_witness = %complete_type
  1652. // CHECK:STDOUT:
  1653. // CHECK:STDOUT: !members:
  1654. // CHECK:STDOUT: .Self = constants.%CD
  1655. // CHECK:STDOUT: }
  1656. // CHECK:STDOUT:
  1657. // CHECK:STDOUT: generic fn @IF.F(imports.%Main.import_ref.e88: %IF.type) [from "interface_with_function.carbon"] {
  1658. // CHECK:STDOUT: fn;
  1659. // CHECK:STDOUT: }
  1660. // CHECK:STDOUT:
  1661. // CHECK:STDOUT: fn @CD.as.IF.impl.F() {
  1662. // CHECK:STDOUT: !entry:
  1663. // CHECK:STDOUT: return
  1664. // CHECK:STDOUT: }
  1665. // CHECK:STDOUT:
  1666. // CHECK:STDOUT: specific @IF.F(constants.%Self) {}
  1667. // CHECK:STDOUT:
  1668. // CHECK:STDOUT: specific @IF.F(constants.%IF.facet) {}
  1669. // CHECK:STDOUT: