import_interface_assoc_const.carbon 102 KB

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