import_interface_assoc_const.carbon 101 KB

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