equal_rewrite.carbon 100 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/where_expr/equal_rewrite.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/where_expr/equal_rewrite.carbon
  10. // --- equal_constraint.carbon
  11. library "[[@TEST_NAME]]";
  12. interface N {
  13. let P:! type;
  14. }
  15. fn Equal(T:! N where .P = {});
  16. // --- nested_rewrites.carbon
  17. library "[[@TEST_NAME]]";
  18. interface A {
  19. let B:! type;
  20. let C:! type;
  21. }
  22. fn NestedRewrite(D:! (A where .B = bool) where .C = ());
  23. // --- repeated_rewrite.carbon
  24. library "[[@TEST_NAME]]";
  25. interface E {
  26. let F:! type;
  27. }
  28. fn OneRewrite(G:! E where .F = i32) {}
  29. fn RepeatedRewrite(H:! E where .F = i32 and .F = i32) {
  30. OneRewrite(H);
  31. }
  32. fn OneRewriteAgain(I:! E where .F = i32) {
  33. RepeatedRewrite(I);
  34. }
  35. // --- rewrites_reordered.carbon
  36. library "[[@TEST_NAME]]";
  37. interface J {
  38. let K:! type;
  39. let L:! type;
  40. }
  41. fn Alphabetical(M:! J where .K = () and .L = bool) {}
  42. fn Reversed(N:! J where .L = bool and .K = ()) {
  43. Alphabetical(N);
  44. }
  45. // --- todo_fail_rewrites_mismatch_right.carbon
  46. library "[[@TEST_NAME]]";
  47. interface O {
  48. let P:! type;
  49. }
  50. fn WithInteger(Q:! O where .P = i32) {}
  51. fn WithBool(R:! O where .P = bool) {
  52. // TODO: This should fail.
  53. WithInteger(R);
  54. }
  55. // --- todo_fail_rewrites_mismatch_left.carbon
  56. library "[[@TEST_NAME]]";
  57. interface S {
  58. let T:! type;
  59. let U:! type;
  60. }
  61. fn WithT(V:! S where .T = ()) {}
  62. fn WithU(W:! S where .U = ()) {
  63. // TODO: This should fail.
  64. WithT(W);
  65. }
  66. // --- fail_import_rewrites.carbon
  67. library "[[@TEST_NAME]]";
  68. import library "equal_constraint";
  69. import library "nested_rewrites";
  70. fn Calls() {
  71. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+8]]:3: error: cannot convert type `bool` into type implementing `N where .(N.P) = {}` [ConversionFailureTypeToFacet]
  72. // CHECK:STDERR: Equal(bool);
  73. // CHECK:STDERR: ^~~~~~~~~~~
  74. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE-7]]:1: in import [InImport]
  75. // CHECK:STDERR: equal_constraint.carbon:8:10: note: initializing generic parameter `T` declared here [InitializingGenericParam]
  76. // CHECK:STDERR: fn Equal(T:! N where .P = {});
  77. // CHECK:STDERR: ^
  78. // CHECK:STDERR:
  79. Equal(bool);
  80. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+8]]:3: error: cannot convert type `i32` into type implementing `A where .(A.C) = () and .(A.B) = bool` [ConversionFailureTypeToFacet]
  81. // CHECK:STDERR: NestedRewrite(i32);
  82. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
  83. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE-17]]:1: in import [InImport]
  84. // CHECK:STDERR: nested_rewrites.carbon:9:18: note: initializing generic parameter `D` declared here [InitializingGenericParam]
  85. // CHECK:STDERR: fn NestedRewrite(D:! (A where .B = bool) where .C = ());
  86. // CHECK:STDERR: ^
  87. // CHECK:STDERR:
  88. NestedRewrite(i32);
  89. }
  90. // --- fail_check_rewrite_constraints.carbon
  91. library "[[@TEST_NAME]]";
  92. interface I {
  93. let Member:! type;
  94. }
  95. // `2` can't be converted to the type of `I.Member`
  96. // CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+7]]:46: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
  97. // CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2);
  98. // CHECK:STDERR: ^
  99. // CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+4]]:46: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
  100. // CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2);
  101. // CHECK:STDERR: ^
  102. // CHECK:STDERR:
  103. fn RewriteTypeMismatch(X:! I where .Member = 2);
  104. // --- fail_todo_let.carbon
  105. library "[[@TEST_NAME]]";
  106. interface A {}
  107. class D {}
  108. impl D as A {}
  109. // TODO: This should be a compile-time binding, once that is supported.
  110. // CHECK:STDERR: fail_todo_let.carbon:[[@LINE+4]]:35: error: cannot convert type `D` into type implementing `type where...` [ConversionFailureTypeToFacet]
  111. // CHECK:STDERR: let B: type where .Self impls A = D;
  112. // CHECK:STDERR: ^
  113. // CHECK:STDERR:
  114. let B: type where .Self impls A = D;
  115. // --- fail_type_does_not_implement_where.carbon
  116. library "[[@TEST_NAME]]";
  117. interface E {
  118. let F:! type;
  119. let G:! type;
  120. }
  121. // Testing how these types get stringified in error messages.
  122. // TODO: This should be a compile-time binding, once that is supported.
  123. // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:42: error: cannot convert type `f64` into type implementing `E where .(E.G) = () and .(E.F) = bool` [ConversionFailureTypeToFacet]
  124. // CHECK:STDERR: let H: (E where .F = bool and .G = ()) = f64;
  125. // CHECK:STDERR: ^~~
  126. // CHECK:STDERR:
  127. let H: (E where .F = bool and .G = ()) = f64;
  128. // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:45: error: cannot convert type `bool` into type implementing `E where .(E.G) = i32 and .(E.F) = {}` [ConversionFailureTypeToFacet]
  129. // CHECK:STDERR: let J: ((E where .F = {}) where .G = i32) = bool;
  130. // CHECK:STDERR: ^~~~
  131. // CHECK:STDERR:
  132. let J: ((E where .F = {}) where .G = i32) = bool;
  133. // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:33: error: cannot convert type `bool` into type implementing `E where .(E.F) = .(E.G)` [ConversionFailureTypeToFacet]
  134. // CHECK:STDERR: let K: (E where .F = .Self.G) = bool;
  135. // CHECK:STDERR: ^~~~
  136. // CHECK:STDERR:
  137. let K: (E where .F = .Self.G) = bool;
  138. // CHECK:STDOUT: --- equal_constraint.carbon
  139. // CHECK:STDOUT:
  140. // CHECK:STDOUT: constants {
  141. // CHECK:STDOUT: %N.type: type = facet_type <@N> [concrete]
  142. // CHECK:STDOUT: %Self: %N.type = bind_symbolic_name Self, 0 [symbolic]
  143. // CHECK:STDOUT: %N.assoc_type: type = assoc_entity_type %N.type [concrete]
  144. // CHECK:STDOUT: %assoc0: %N.assoc_type = assoc_entity element0, @N.%P [concrete]
  145. // CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic_self]
  146. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  147. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  148. // CHECK:STDOUT: %N.facet: %N.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  149. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  150. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  151. // CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0 = %empty_struct_type> [concrete]
  152. // CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic]
  153. // CHECK:STDOUT: %T.patt: %N_where.type = symbolic_binding_pattern T, 0 [symbolic]
  154. // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete]
  155. // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete]
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: imports {
  159. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  160. // CHECK:STDOUT: import Core//prelude
  161. // CHECK:STDOUT: import Core//prelude/...
  162. // CHECK:STDOUT: }
  163. // CHECK:STDOUT: }
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: file {
  166. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  167. // CHECK:STDOUT: .Core = imports.%Core
  168. // CHECK:STDOUT: .N = %N.decl
  169. // CHECK:STDOUT: .Equal = %Equal.decl
  170. // CHECK:STDOUT: }
  171. // CHECK:STDOUT: %Core.import = import Core
  172. // CHECK:STDOUT: %N.decl: type = interface_decl @N [concrete = constants.%N.type] {} {}
  173. // CHECK:STDOUT: %Equal.decl: %Equal.type = fn_decl @Equal [concrete = constants.%Equal] {
  174. // CHECK:STDOUT: %T.patt.loc8_10.1: %N_where.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_10.2 (constants.%T.patt)]
  175. // CHECK:STDOUT: } {
  176. // CHECK:STDOUT: %.loc8_16.1: type = splice_block %.loc8_16.2 [concrete = constants.%N_where.type] {
  177. // CHECK:STDOUT: %N.ref: type = name_ref N, file.%N.decl [concrete = constants.%N.type]
  178. // CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  179. // CHECK:STDOUT: %.Self.ref: %N.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  180. // CHECK:STDOUT: %P.ref: %N.assoc_type = name_ref P, @P.%assoc0 [concrete = constants.%assoc0]
  181. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  182. // CHECK:STDOUT: %.loc8_22: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  183. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  184. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  185. // CHECK:STDOUT: %.loc8_28.1: %empty_struct_type = struct_literal ()
  186. // CHECK:STDOUT: %.loc8_28.2: type = converted %.loc8_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  187. // CHECK:STDOUT: %.loc8_16.2: type = where_expr %.Self [concrete = constants.%N_where.type] {
  188. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_28.2
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT: %T.loc8_10.1: %N_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_10.2 (constants.%T)]
  192. // CHECK:STDOUT: }
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT:
  195. // CHECK:STDOUT: interface @N {
  196. // CHECK:STDOUT: %Self: %N.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  197. // CHECK:STDOUT: %P: type = assoc_const_decl @P [concrete] {
  198. // CHECK:STDOUT: %assoc0: %N.assoc_type = assoc_entity element0, @N.%P [concrete = constants.%assoc0]
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: !members:
  202. // CHECK:STDOUT: .Self = %Self
  203. // CHECK:STDOUT: .P = @P.%assoc0
  204. // CHECK:STDOUT: witness = (%P)
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT:
  207. // CHECK:STDOUT: generic assoc_const @P(@N.%Self: %N.type) {
  208. // CHECK:STDOUT: assoc_const P:! type;
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: generic fn @Equal(%T.loc8_10.1: %N_where.type) {
  212. // CHECK:STDOUT: %T.loc8_10.2: %N_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_10.2 (constants.%T)]
  213. // CHECK:STDOUT: %T.patt.loc8_10.2: %N_where.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_10.2 (constants.%T.patt)]
  214. // CHECK:STDOUT:
  215. // CHECK:STDOUT: fn(%T.patt.loc8_10.1: %N_where.type);
  216. // CHECK:STDOUT: }
  217. // CHECK:STDOUT:
  218. // CHECK:STDOUT: specific @P(constants.%Self) {}
  219. // CHECK:STDOUT:
  220. // CHECK:STDOUT: specific @P(constants.%N.facet) {}
  221. // CHECK:STDOUT:
  222. // CHECK:STDOUT: specific @Equal(constants.%T) {
  223. // CHECK:STDOUT: %T.loc8_10.2 => constants.%T
  224. // CHECK:STDOUT: %T.patt.loc8_10.2 => constants.%T.patt
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: --- nested_rewrites.carbon
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: constants {
  230. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  231. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic]
  232. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type %A.type [concrete]
  233. // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, @A.%B [concrete]
  234. // CHECK:STDOUT: %assoc1: %A.assoc_type = assoc_entity element1, @A.%C [concrete]
  235. // CHECK:STDOUT: %.Self.3ca: %A.type = bind_symbolic_name .Self [symbolic_self]
  236. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  237. // CHECK:STDOUT: %.Self.as_type.adb: type = facet_access_type %.Self.3ca [symbolic_self]
  238. // CHECK:STDOUT: %.Self.as_wit.iface0.844: <witness> = facet_access_witness %.Self.3ca, element0 [symbolic_self]
  239. // CHECK:STDOUT: %A.facet.aea: %A.type = facet_value %.Self.as_type.adb, (%.Self.as_wit.iface0.844) [symbolic_self]
  240. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0.844, element0 [symbolic_self]
  241. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  242. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  243. // CHECK:STDOUT: %A_where.type.bcb: type = facet_type <@A where %impl.elem0 = bool> [concrete]
  244. // CHECK:STDOUT: %.Self.80b: %A_where.type.bcb = bind_symbolic_name .Self [symbolic_self]
  245. // CHECK:STDOUT: %.Self.as_type.ec1: type = facet_access_type %.Self.80b [symbolic_self]
  246. // CHECK:STDOUT: %.Self.as_wit.iface0.d15: <witness> = facet_access_witness %.Self.80b, element0 [symbolic_self]
  247. // CHECK:STDOUT: %A.facet.271: %A.type = facet_value %.Self.as_type.ec1, (%.Self.as_wit.iface0.d15) [symbolic_self]
  248. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.iface0.d15, element1 [symbolic_self]
  249. // CHECK:STDOUT: %A_where.type.248: type = facet_type <@A where %impl.elem1 = %empty_tuple.type and %impl.elem0 = bool> [concrete]
  250. // CHECK:STDOUT: %D: %A_where.type.248 = bind_symbolic_name D, 0 [symbolic]
  251. // CHECK:STDOUT: %D.patt: %A_where.type.248 = symbolic_binding_pattern D, 0 [symbolic]
  252. // CHECK:STDOUT: %NestedRewrite.type: type = fn_type @NestedRewrite [concrete]
  253. // CHECK:STDOUT: %NestedRewrite: %NestedRewrite.type = struct_value () [concrete]
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: imports {
  257. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  258. // CHECK:STDOUT: .Bool = %Core.Bool
  259. // CHECK:STDOUT: import Core//prelude
  260. // CHECK:STDOUT: import Core//prelude/...
  261. // CHECK:STDOUT: }
  262. // CHECK:STDOUT: }
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: file {
  265. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  266. // CHECK:STDOUT: .Core = imports.%Core
  267. // CHECK:STDOUT: .A = %A.decl
  268. // CHECK:STDOUT: .NestedRewrite = %NestedRewrite.decl
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: %Core.import = import Core
  271. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  272. // CHECK:STDOUT: %NestedRewrite.decl: %NestedRewrite.type = fn_decl @NestedRewrite [concrete = constants.%NestedRewrite] {
  273. // CHECK:STDOUT: %D.patt.loc9_18.1: %A_where.type.248 = symbolic_binding_pattern D, 0 [symbolic = %D.patt.loc9_18.2 (constants.%D.patt)]
  274. // CHECK:STDOUT: } {
  275. // CHECK:STDOUT: %.loc9_42.1: type = splice_block %.loc9_42.2 [concrete = constants.%A_where.type.248] {
  276. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  277. // CHECK:STDOUT: %.Self.1: %A.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.3ca]
  278. // CHECK:STDOUT: %.Self.ref.loc9_31: %A.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self.3ca]
  279. // CHECK:STDOUT: %B.ref: %A.assoc_type = name_ref B, @B.%assoc0 [concrete = constants.%assoc0]
  280. // CHECK:STDOUT: %.Self.as_type.loc9_31: type = facet_access_type %.Self.ref.loc9_31 [symbolic_self = constants.%.Self.as_type.adb]
  281. // CHECK:STDOUT: %.loc9_31: type = converted %.Self.ref.loc9_31, %.Self.as_type.loc9_31 [symbolic_self = constants.%.Self.as_type.adb]
  282. // CHECK:STDOUT: %.Self.as_wit.iface0.loc9_31: <witness> = facet_access_witness %.Self.ref.loc9_31, element0 [symbolic_self = constants.%.Self.as_wit.iface0.844]
  283. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0.loc9_31, element0 [symbolic_self = constants.%impl.elem0]
  284. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  285. // CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %bool.make_type [concrete = bool]
  286. // CHECK:STDOUT: %.loc9_36.2: type = converted %bool.make_type, %.loc9_36.1 [concrete = bool]
  287. // CHECK:STDOUT: %.loc9_25: type = where_expr %.Self.1 [concrete = constants.%A_where.type.bcb] {
  288. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_36.2
  289. // CHECK:STDOUT: }
  290. // CHECK:STDOUT: %.Self.2: %A_where.type.bcb = bind_symbolic_name .Self [symbolic_self = constants.%.Self.80b]
  291. // CHECK:STDOUT: %.Self.ref.loc9_48: %A_where.type.bcb = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.80b]
  292. // CHECK:STDOUT: %C.ref: %A.assoc_type = name_ref C, @C.%assoc1 [concrete = constants.%assoc1]
  293. // CHECK:STDOUT: %.Self.as_type.loc9_48: type = facet_access_type %.Self.ref.loc9_48 [symbolic_self = constants.%.Self.as_type.ec1]
  294. // CHECK:STDOUT: %.loc9_48: type = converted %.Self.ref.loc9_48, %.Self.as_type.loc9_48 [symbolic_self = constants.%.Self.as_type.ec1]
  295. // CHECK:STDOUT: %.Self.as_wit.iface0.loc9_48: <witness> = facet_access_witness %.Self.ref.loc9_48, element0 [symbolic_self = constants.%.Self.as_wit.iface0.d15]
  296. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.iface0.loc9_48, element1 [symbolic_self = constants.%impl.elem1]
  297. // CHECK:STDOUT: %.loc9_54.1: %empty_tuple.type = tuple_literal ()
  298. // CHECK:STDOUT: %.loc9_54.2: type = converted %.loc9_54.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  299. // CHECK:STDOUT: %.loc9_42.2: type = where_expr %.Self.2 [concrete = constants.%A_where.type.248] {
  300. // CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc9_54.2
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: %D.loc9_18.1: %A_where.type.248 = bind_symbolic_name D, 0 [symbolic = %D.loc9_18.2 (constants.%D)]
  304. // CHECK:STDOUT: }
  305. // CHECK:STDOUT: }
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: interface @A {
  308. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  309. // CHECK:STDOUT: %B: type = assoc_const_decl @B [concrete] {
  310. // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, @A.%B [concrete = constants.%assoc0]
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT: %C: type = assoc_const_decl @C [concrete] {
  313. // CHECK:STDOUT: %assoc1: %A.assoc_type = assoc_entity element1, @A.%C [concrete = constants.%assoc1]
  314. // CHECK:STDOUT: }
  315. // CHECK:STDOUT:
  316. // CHECK:STDOUT: !members:
  317. // CHECK:STDOUT: .Self = %Self
  318. // CHECK:STDOUT: .B = @B.%assoc0
  319. // CHECK:STDOUT: .C = @C.%assoc1
  320. // CHECK:STDOUT: witness = (%B, %C)
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: generic assoc_const @B(@A.%Self: %A.type) {
  324. // CHECK:STDOUT: assoc_const B:! type;
  325. // CHECK:STDOUT: }
  326. // CHECK:STDOUT:
  327. // CHECK:STDOUT: generic assoc_const @C(@A.%Self: %A.type) {
  328. // CHECK:STDOUT: assoc_const C:! type;
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT:
  331. // CHECK:STDOUT: generic fn @NestedRewrite(%D.loc9_18.1: %A_where.type.248) {
  332. // CHECK:STDOUT: %D.loc9_18.2: %A_where.type.248 = bind_symbolic_name D, 0 [symbolic = %D.loc9_18.2 (constants.%D)]
  333. // CHECK:STDOUT: %D.patt.loc9_18.2: %A_where.type.248 = symbolic_binding_pattern D, 0 [symbolic = %D.patt.loc9_18.2 (constants.%D.patt)]
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: fn(%D.patt.loc9_18.1: %A_where.type.248);
  336. // CHECK:STDOUT: }
  337. // CHECK:STDOUT:
  338. // CHECK:STDOUT: specific @B(constants.%Self) {}
  339. // CHECK:STDOUT:
  340. // CHECK:STDOUT: specific @C(constants.%Self) {}
  341. // CHECK:STDOUT:
  342. // CHECK:STDOUT: specific @B(constants.%A.facet.aea) {}
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: specific @C(constants.%A.facet.271) {}
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: specific @NestedRewrite(constants.%D) {
  347. // CHECK:STDOUT: %D.loc9_18.2 => constants.%D
  348. // CHECK:STDOUT: %D.patt.loc9_18.2 => constants.%D.patt
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: --- repeated_rewrite.carbon
  352. // CHECK:STDOUT:
  353. // CHECK:STDOUT: constants {
  354. // CHECK:STDOUT: %E.type: type = facet_type <@E> [concrete]
  355. // CHECK:STDOUT: %Self: %E.type = bind_symbolic_name Self, 0 [symbolic]
  356. // CHECK:STDOUT: %E.assoc_type: type = assoc_entity_type %E.type [concrete]
  357. // CHECK:STDOUT: %assoc0: %E.assoc_type = assoc_entity element0, @E.%F [concrete]
  358. // CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic_self]
  359. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  360. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  361. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  362. // CHECK:STDOUT: %E.facet: %E.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  363. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  364. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  365. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  366. // CHECK:STDOUT: %E_where.type: type = facet_type <@E where %impl.elem0 = %i32> [concrete]
  367. // CHECK:STDOUT: %G: %E_where.type = bind_symbolic_name G, 0 [symbolic]
  368. // CHECK:STDOUT: %G.patt: %E_where.type = symbolic_binding_pattern G, 0 [symbolic]
  369. // CHECK:STDOUT: %OneRewrite.type: type = fn_type @OneRewrite [concrete]
  370. // CHECK:STDOUT: %OneRewrite: %OneRewrite.type = struct_value () [concrete]
  371. // CHECK:STDOUT: %H: %E_where.type = bind_symbolic_name H, 0 [symbolic]
  372. // CHECK:STDOUT: %H.patt: %E_where.type = symbolic_binding_pattern H, 0 [symbolic]
  373. // CHECK:STDOUT: %RepeatedRewrite.type: type = fn_type @RepeatedRewrite [concrete]
  374. // CHECK:STDOUT: %RepeatedRewrite: %RepeatedRewrite.type = struct_value () [concrete]
  375. // CHECK:STDOUT: %OneRewrite.specific_fn.90a0d5.1: <specific function> = specific_function %OneRewrite, @OneRewrite(%H) [symbolic]
  376. // CHECK:STDOUT: %I: %E_where.type = bind_symbolic_name I, 0 [symbolic]
  377. // CHECK:STDOUT: %I.patt: %E_where.type = symbolic_binding_pattern I, 0 [symbolic]
  378. // CHECK:STDOUT: %OneRewriteAgain.type: type = fn_type @OneRewriteAgain [concrete]
  379. // CHECK:STDOUT: %OneRewriteAgain: %OneRewriteAgain.type = struct_value () [concrete]
  380. // CHECK:STDOUT: %RepeatedRewrite.specific_fn: <specific function> = specific_function %RepeatedRewrite, @RepeatedRewrite(%I) [symbolic]
  381. // CHECK:STDOUT: %OneRewrite.specific_fn.90a0d5.2: <specific function> = specific_function %OneRewrite, @OneRewrite(%I) [symbolic]
  382. // CHECK:STDOUT: }
  383. // CHECK:STDOUT:
  384. // CHECK:STDOUT: imports {
  385. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  386. // CHECK:STDOUT: .Int = %Core.Int
  387. // CHECK:STDOUT: import Core//prelude
  388. // CHECK:STDOUT: import Core//prelude/...
  389. // CHECK:STDOUT: }
  390. // CHECK:STDOUT: }
  391. // CHECK:STDOUT:
  392. // CHECK:STDOUT: file {
  393. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  394. // CHECK:STDOUT: .Core = imports.%Core
  395. // CHECK:STDOUT: .E = %E.decl
  396. // CHECK:STDOUT: .OneRewrite = %OneRewrite.decl
  397. // CHECK:STDOUT: .RepeatedRewrite = %RepeatedRewrite.decl
  398. // CHECK:STDOUT: .OneRewriteAgain = %OneRewriteAgain.decl
  399. // CHECK:STDOUT: }
  400. // CHECK:STDOUT: %Core.import = import Core
  401. // CHECK:STDOUT: %E.decl: type = interface_decl @E [concrete = constants.%E.type] {} {}
  402. // CHECK:STDOUT: %OneRewrite.decl: %OneRewrite.type = fn_decl @OneRewrite [concrete = constants.%OneRewrite] {
  403. // CHECK:STDOUT: %G.patt.loc8_15.1: %E_where.type = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc8_15.2 (constants.%G.patt)]
  404. // CHECK:STDOUT: } {
  405. // CHECK:STDOUT: %.loc8_21.1: type = splice_block %.loc8_21.2 [concrete = constants.%E_where.type] {
  406. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E.type]
  407. // CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  408. // CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  409. // CHECK:STDOUT: %F.ref: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
  410. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  411. // CHECK:STDOUT: %.loc8_27: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  412. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  413. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  414. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  415. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  416. // CHECK:STDOUT: %.loc8_21.2: type = where_expr %.Self [concrete = constants.%E_where.type] {
  417. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  418. // CHECK:STDOUT: }
  419. // CHECK:STDOUT: }
  420. // CHECK:STDOUT: %G.loc8_15.1: %E_where.type = bind_symbolic_name G, 0 [symbolic = %G.loc8_15.2 (constants.%G)]
  421. // CHECK:STDOUT: }
  422. // CHECK:STDOUT: %RepeatedRewrite.decl: %RepeatedRewrite.type = fn_decl @RepeatedRewrite [concrete = constants.%RepeatedRewrite] {
  423. // CHECK:STDOUT: %H.patt.loc10_20.1: %E_where.type = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc10_20.2 (constants.%H.patt)]
  424. // CHECK:STDOUT: } {
  425. // CHECK:STDOUT: %.loc10_26.1: type = splice_block %.loc10_26.2 [concrete = constants.%E_where.type] {
  426. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E.type]
  427. // CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  428. // CHECK:STDOUT: %.Self.ref.loc10_32: %E.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  429. // CHECK:STDOUT: %F.ref.loc10_32: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
  430. // CHECK:STDOUT: %.Self.as_type.loc10_32: type = facet_access_type %.Self.ref.loc10_32 [symbolic_self = constants.%.Self.as_type]
  431. // CHECK:STDOUT: %.loc10_32: type = converted %.Self.ref.loc10_32, %.Self.as_type.loc10_32 [symbolic_self = constants.%.Self.as_type]
  432. // CHECK:STDOUT: %.Self.as_wit.iface0.loc10_32: <witness> = facet_access_witness %.Self.ref.loc10_32, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  433. // CHECK:STDOUT: %impl.elem0.loc10_32: type = impl_witness_access %.Self.as_wit.iface0.loc10_32, element0 [symbolic_self = constants.%impl.elem0]
  434. // CHECK:STDOUT: %int_32.loc10_37: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  435. // CHECK:STDOUT: %i32.loc10_37: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  436. // CHECK:STDOUT: %.Self.ref.loc10_45: %E.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  437. // CHECK:STDOUT: %F.ref.loc10_45: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
  438. // CHECK:STDOUT: %.Self.as_type.loc10_45: type = facet_access_type %.Self.ref.loc10_45 [symbolic_self = constants.%.Self.as_type]
  439. // CHECK:STDOUT: %.loc10_45: type = converted %.Self.ref.loc10_45, %.Self.as_type.loc10_45 [symbolic_self = constants.%.Self.as_type]
  440. // CHECK:STDOUT: %.Self.as_wit.iface0.loc10_45: <witness> = facet_access_witness %.Self.ref.loc10_45, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  441. // CHECK:STDOUT: %impl.elem0.loc10_45: type = impl_witness_access %.Self.as_wit.iface0.loc10_45, element0 [symbolic_self = constants.%impl.elem0]
  442. // CHECK:STDOUT: %int_32.loc10_50: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  443. // CHECK:STDOUT: %i32.loc10_50: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  444. // CHECK:STDOUT: %.loc10_26.2: type = where_expr %.Self [concrete = constants.%E_where.type] {
  445. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_32, %i32.loc10_37
  446. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_45, %i32.loc10_50
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT: }
  449. // CHECK:STDOUT: %H.loc10_20.1: %E_where.type = bind_symbolic_name H, 0 [symbolic = %H.loc10_20.2 (constants.%H)]
  450. // CHECK:STDOUT: }
  451. // CHECK:STDOUT: %OneRewriteAgain.decl: %OneRewriteAgain.type = fn_decl @OneRewriteAgain [concrete = constants.%OneRewriteAgain] {
  452. // CHECK:STDOUT: %I.patt.loc14_20.1: %E_where.type = symbolic_binding_pattern I, 0 [symbolic = %I.patt.loc14_20.2 (constants.%I.patt)]
  453. // CHECK:STDOUT: } {
  454. // CHECK:STDOUT: %.loc14_26.1: type = splice_block %.loc14_26.2 [concrete = constants.%E_where.type] {
  455. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E.type]
  456. // CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  457. // CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  458. // CHECK:STDOUT: %F.ref: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
  459. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  460. // CHECK:STDOUT: %.loc14_32: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  461. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  462. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  463. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  464. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  465. // CHECK:STDOUT: %.loc14_26.2: type = where_expr %.Self [concrete = constants.%E_where.type] {
  466. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT: }
  469. // CHECK:STDOUT: %I.loc14_20.1: %E_where.type = bind_symbolic_name I, 0 [symbolic = %I.loc14_20.2 (constants.%I)]
  470. // CHECK:STDOUT: }
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT:
  473. // CHECK:STDOUT: interface @E {
  474. // CHECK:STDOUT: %Self: %E.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  475. // CHECK:STDOUT: %F: type = assoc_const_decl @F [concrete] {
  476. // CHECK:STDOUT: %assoc0: %E.assoc_type = assoc_entity element0, @E.%F [concrete = constants.%assoc0]
  477. // CHECK:STDOUT: }
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: !members:
  480. // CHECK:STDOUT: .Self = %Self
  481. // CHECK:STDOUT: .F = @F.%assoc0
  482. // CHECK:STDOUT: witness = (%F)
  483. // CHECK:STDOUT: }
  484. // CHECK:STDOUT:
  485. // CHECK:STDOUT: generic assoc_const @F(@E.%Self: %E.type) {
  486. // CHECK:STDOUT: assoc_const F:! type;
  487. // CHECK:STDOUT: }
  488. // CHECK:STDOUT:
  489. // CHECK:STDOUT: generic fn @OneRewrite(%G.loc8_15.1: %E_where.type) {
  490. // CHECK:STDOUT: %G.loc8_15.2: %E_where.type = bind_symbolic_name G, 0 [symbolic = %G.loc8_15.2 (constants.%G)]
  491. // CHECK:STDOUT: %G.patt.loc8_15.2: %E_where.type = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc8_15.2 (constants.%G.patt)]
  492. // CHECK:STDOUT:
  493. // CHECK:STDOUT: !definition:
  494. // CHECK:STDOUT:
  495. // CHECK:STDOUT: fn(%G.patt.loc8_15.1: %E_where.type) {
  496. // CHECK:STDOUT: !entry:
  497. // CHECK:STDOUT: return
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT: }
  500. // CHECK:STDOUT:
  501. // CHECK:STDOUT: generic fn @RepeatedRewrite(%H.loc10_20.1: %E_where.type) {
  502. // CHECK:STDOUT: %H.loc10_20.2: %E_where.type = bind_symbolic_name H, 0 [symbolic = %H.loc10_20.2 (constants.%H)]
  503. // CHECK:STDOUT: %H.patt.loc10_20.2: %E_where.type = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc10_20.2 (constants.%H.patt)]
  504. // CHECK:STDOUT:
  505. // CHECK:STDOUT: !definition:
  506. // CHECK:STDOUT: %OneRewrite.specific_fn.loc11_3.2: <specific function> = specific_function constants.%OneRewrite, @OneRewrite(%H.loc10_20.2) [symbolic = %OneRewrite.specific_fn.loc11_3.2 (constants.%OneRewrite.specific_fn.90a0d5.1)]
  507. // CHECK:STDOUT:
  508. // CHECK:STDOUT: fn(%H.patt.loc10_20.1: %E_where.type) {
  509. // CHECK:STDOUT: !entry:
  510. // CHECK:STDOUT: %OneRewrite.ref: %OneRewrite.type = name_ref OneRewrite, file.%OneRewrite.decl [concrete = constants.%OneRewrite]
  511. // CHECK:STDOUT: %H.ref: %E_where.type = name_ref H, %H.loc10_20.1 [symbolic = %H.loc10_20.2 (constants.%H)]
  512. // CHECK:STDOUT: %OneRewrite.specific_fn.loc11_3.1: <specific function> = specific_function %OneRewrite.ref, @OneRewrite(constants.%H) [symbolic = %OneRewrite.specific_fn.loc11_3.2 (constants.%OneRewrite.specific_fn.90a0d5.1)]
  513. // CHECK:STDOUT: %OneRewrite.call: init %empty_tuple.type = call %OneRewrite.specific_fn.loc11_3.1()
  514. // CHECK:STDOUT: return
  515. // CHECK:STDOUT: }
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT:
  518. // CHECK:STDOUT: generic fn @OneRewriteAgain(%I.loc14_20.1: %E_where.type) {
  519. // CHECK:STDOUT: %I.loc14_20.2: %E_where.type = bind_symbolic_name I, 0 [symbolic = %I.loc14_20.2 (constants.%I)]
  520. // CHECK:STDOUT: %I.patt.loc14_20.2: %E_where.type = symbolic_binding_pattern I, 0 [symbolic = %I.patt.loc14_20.2 (constants.%I.patt)]
  521. // CHECK:STDOUT:
  522. // CHECK:STDOUT: !definition:
  523. // CHECK:STDOUT: %RepeatedRewrite.specific_fn.loc15_3.2: <specific function> = specific_function constants.%RepeatedRewrite, @RepeatedRewrite(%I.loc14_20.2) [symbolic = %RepeatedRewrite.specific_fn.loc15_3.2 (constants.%RepeatedRewrite.specific_fn)]
  524. // CHECK:STDOUT:
  525. // CHECK:STDOUT: fn(%I.patt.loc14_20.1: %E_where.type) {
  526. // CHECK:STDOUT: !entry:
  527. // CHECK:STDOUT: %RepeatedRewrite.ref: %RepeatedRewrite.type = name_ref RepeatedRewrite, file.%RepeatedRewrite.decl [concrete = constants.%RepeatedRewrite]
  528. // CHECK:STDOUT: %I.ref: %E_where.type = name_ref I, %I.loc14_20.1 [symbolic = %I.loc14_20.2 (constants.%I)]
  529. // CHECK:STDOUT: %RepeatedRewrite.specific_fn.loc15_3.1: <specific function> = specific_function %RepeatedRewrite.ref, @RepeatedRewrite(constants.%I) [symbolic = %RepeatedRewrite.specific_fn.loc15_3.2 (constants.%RepeatedRewrite.specific_fn)]
  530. // CHECK:STDOUT: %RepeatedRewrite.call: init %empty_tuple.type = call %RepeatedRewrite.specific_fn.loc15_3.1()
  531. // CHECK:STDOUT: return
  532. // CHECK:STDOUT: }
  533. // CHECK:STDOUT: }
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: specific @F(constants.%Self) {}
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: specific @F(constants.%E.facet) {}
  538. // CHECK:STDOUT:
  539. // CHECK:STDOUT: specific @OneRewrite(constants.%G) {
  540. // CHECK:STDOUT: %G.loc8_15.2 => constants.%G
  541. // CHECK:STDOUT: %G.patt.loc8_15.2 => constants.%G.patt
  542. // CHECK:STDOUT: }
  543. // CHECK:STDOUT:
  544. // CHECK:STDOUT: specific @RepeatedRewrite(constants.%H) {
  545. // CHECK:STDOUT: %H.loc10_20.2 => constants.%H
  546. // CHECK:STDOUT: %H.patt.loc10_20.2 => constants.%H.patt
  547. // CHECK:STDOUT: }
  548. // CHECK:STDOUT:
  549. // CHECK:STDOUT: specific @OneRewrite(constants.%H) {
  550. // CHECK:STDOUT: %G.loc8_15.2 => constants.%H
  551. // CHECK:STDOUT: %G.patt.loc8_15.2 => constants.%G.patt
  552. // CHECK:STDOUT:
  553. // CHECK:STDOUT: !definition:
  554. // CHECK:STDOUT: }
  555. // CHECK:STDOUT:
  556. // CHECK:STDOUT: specific @OneRewrite(@RepeatedRewrite.%H.loc10_20.2) {}
  557. // CHECK:STDOUT:
  558. // CHECK:STDOUT: specific @OneRewriteAgain(constants.%I) {
  559. // CHECK:STDOUT: %I.loc14_20.2 => constants.%I
  560. // CHECK:STDOUT: %I.patt.loc14_20.2 => constants.%I.patt
  561. // CHECK:STDOUT: }
  562. // CHECK:STDOUT:
  563. // CHECK:STDOUT: specific @RepeatedRewrite(constants.%I) {
  564. // CHECK:STDOUT: %H.loc10_20.2 => constants.%I
  565. // CHECK:STDOUT: %H.patt.loc10_20.2 => constants.%H.patt
  566. // CHECK:STDOUT:
  567. // CHECK:STDOUT: !definition:
  568. // CHECK:STDOUT: %OneRewrite.specific_fn.loc11_3.2 => constants.%OneRewrite.specific_fn.90a0d5.2
  569. // CHECK:STDOUT: }
  570. // CHECK:STDOUT:
  571. // CHECK:STDOUT: specific @RepeatedRewrite(@OneRewriteAgain.%I.loc14_20.2) {}
  572. // CHECK:STDOUT:
  573. // CHECK:STDOUT: specific @OneRewrite(constants.%I) {
  574. // CHECK:STDOUT: %G.loc8_15.2 => constants.%I
  575. // CHECK:STDOUT: %G.patt.loc8_15.2 => constants.%G.patt
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: !definition:
  578. // CHECK:STDOUT: }
  579. // CHECK:STDOUT:
  580. // CHECK:STDOUT: --- rewrites_reordered.carbon
  581. // CHECK:STDOUT:
  582. // CHECK:STDOUT: constants {
  583. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  584. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic]
  585. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type %J.type [concrete]
  586. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%K [concrete]
  587. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%L [concrete]
  588. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self]
  589. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  590. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  591. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  592. // CHECK:STDOUT: %J.facet: %J.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  593. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  594. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.iface0, element1 [symbolic_self]
  595. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  596. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  597. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem1 = bool and %impl.elem0 = %empty_tuple.type> [concrete]
  598. // CHECK:STDOUT: %M: %J_where.type = bind_symbolic_name M, 0 [symbolic]
  599. // CHECK:STDOUT: %M.patt: %J_where.type = symbolic_binding_pattern M, 0 [symbolic]
  600. // CHECK:STDOUT: %Alphabetical.type: type = fn_type @Alphabetical [concrete]
  601. // CHECK:STDOUT: %Alphabetical: %Alphabetical.type = struct_value () [concrete]
  602. // CHECK:STDOUT: %N: %J_where.type = bind_symbolic_name N, 0 [symbolic]
  603. // CHECK:STDOUT: %N.patt: %J_where.type = symbolic_binding_pattern N, 0 [symbolic]
  604. // CHECK:STDOUT: %Reversed.type: type = fn_type @Reversed [concrete]
  605. // CHECK:STDOUT: %Reversed: %Reversed.type = struct_value () [concrete]
  606. // CHECK:STDOUT: %Alphabetical.specific_fn: <specific function> = specific_function %Alphabetical, @Alphabetical(%N) [symbolic]
  607. // CHECK:STDOUT: }
  608. // CHECK:STDOUT:
  609. // CHECK:STDOUT: imports {
  610. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  611. // CHECK:STDOUT: .Bool = %Core.Bool
  612. // CHECK:STDOUT: import Core//prelude
  613. // CHECK:STDOUT: import Core//prelude/...
  614. // CHECK:STDOUT: }
  615. // CHECK:STDOUT: }
  616. // CHECK:STDOUT:
  617. // CHECK:STDOUT: file {
  618. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  619. // CHECK:STDOUT: .Core = imports.%Core
  620. // CHECK:STDOUT: .J = %J.decl
  621. // CHECK:STDOUT: .Alphabetical = %Alphabetical.decl
  622. // CHECK:STDOUT: .Reversed = %Reversed.decl
  623. // CHECK:STDOUT: }
  624. // CHECK:STDOUT: %Core.import = import Core
  625. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  626. // CHECK:STDOUT: %Alphabetical.decl: %Alphabetical.type = fn_decl @Alphabetical [concrete = constants.%Alphabetical] {
  627. // CHECK:STDOUT: %M.patt.loc9_17.1: %J_where.type = symbolic_binding_pattern M, 0 [symbolic = %M.patt.loc9_17.2 (constants.%M.patt)]
  628. // CHECK:STDOUT: } {
  629. // CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [concrete = constants.%J_where.type] {
  630. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  631. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  632. // CHECK:STDOUT: %.Self.ref.loc9_29: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  633. // CHECK:STDOUT: %K.ref: %J.assoc_type = name_ref K, @K.%assoc0 [concrete = constants.%assoc0]
  634. // CHECK:STDOUT: %.Self.as_type.loc9_29: type = facet_access_type %.Self.ref.loc9_29 [symbolic_self = constants.%.Self.as_type]
  635. // CHECK:STDOUT: %.loc9_29: type = converted %.Self.ref.loc9_29, %.Self.as_type.loc9_29 [symbolic_self = constants.%.Self.as_type]
  636. // CHECK:STDOUT: %.Self.as_wit.iface0.loc9_29: <witness> = facet_access_witness %.Self.ref.loc9_29, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  637. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0.loc9_29, element0 [symbolic_self = constants.%impl.elem0]
  638. // CHECK:STDOUT: %.loc9_35.1: %empty_tuple.type = tuple_literal ()
  639. // CHECK:STDOUT: %.loc9_35.2: type = converted %.loc9_35.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  640. // CHECK:STDOUT: %.Self.ref.loc9_41: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  641. // CHECK:STDOUT: %L.ref: %J.assoc_type = name_ref L, @L.%assoc1 [concrete = constants.%assoc1]
  642. // CHECK:STDOUT: %.Self.as_type.loc9_41: type = facet_access_type %.Self.ref.loc9_41 [symbolic_self = constants.%.Self.as_type]
  643. // CHECK:STDOUT: %.loc9_41: type = converted %.Self.ref.loc9_41, %.Self.as_type.loc9_41 [symbolic_self = constants.%.Self.as_type]
  644. // CHECK:STDOUT: %.Self.as_wit.iface0.loc9_41: <witness> = facet_access_witness %.Self.ref.loc9_41, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  645. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.iface0.loc9_41, element1 [symbolic_self = constants.%impl.elem1]
  646. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  647. // CHECK:STDOUT: %.loc9_46.1: type = value_of_initializer %bool.make_type [concrete = bool]
  648. // CHECK:STDOUT: %.loc9_46.2: type = converted %bool.make_type, %.loc9_46.1 [concrete = bool]
  649. // CHECK:STDOUT: %.loc9_23.2: type = where_expr %.Self [concrete = constants.%J_where.type] {
  650. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_35.2
  651. // CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc9_46.2
  652. // CHECK:STDOUT: }
  653. // CHECK:STDOUT: }
  654. // CHECK:STDOUT: %M.loc9_17.1: %J_where.type = bind_symbolic_name M, 0 [symbolic = %M.loc9_17.2 (constants.%M)]
  655. // CHECK:STDOUT: }
  656. // CHECK:STDOUT: %Reversed.decl: %Reversed.type = fn_decl @Reversed [concrete = constants.%Reversed] {
  657. // CHECK:STDOUT: %N.patt.loc11_13.1: %J_where.type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)]
  658. // CHECK:STDOUT: } {
  659. // CHECK:STDOUT: %.loc11_19.1: type = splice_block %.loc11_19.2 [concrete = constants.%J_where.type] {
  660. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  661. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  662. // CHECK:STDOUT: %.Self.ref.loc11_25: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  663. // CHECK:STDOUT: %L.ref: %J.assoc_type = name_ref L, @L.%assoc1 [concrete = constants.%assoc1]
  664. // CHECK:STDOUT: %.Self.as_type.loc11_25: type = facet_access_type %.Self.ref.loc11_25 [symbolic_self = constants.%.Self.as_type]
  665. // CHECK:STDOUT: %.loc11_25: type = converted %.Self.ref.loc11_25, %.Self.as_type.loc11_25 [symbolic_self = constants.%.Self.as_type]
  666. // CHECK:STDOUT: %.Self.as_wit.iface0.loc11_25: <witness> = facet_access_witness %.Self.ref.loc11_25, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  667. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.iface0.loc11_25, element1 [symbolic_self = constants.%impl.elem1]
  668. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  669. // CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %bool.make_type [concrete = bool]
  670. // CHECK:STDOUT: %.loc11_30.2: type = converted %bool.make_type, %.loc11_30.1 [concrete = bool]
  671. // CHECK:STDOUT: %.Self.ref.loc11_39: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  672. // CHECK:STDOUT: %K.ref: %J.assoc_type = name_ref K, @K.%assoc0 [concrete = constants.%assoc0]
  673. // CHECK:STDOUT: %.Self.as_type.loc11_39: type = facet_access_type %.Self.ref.loc11_39 [symbolic_self = constants.%.Self.as_type]
  674. // CHECK:STDOUT: %.loc11_39: type = converted %.Self.ref.loc11_39, %.Self.as_type.loc11_39 [symbolic_self = constants.%.Self.as_type]
  675. // CHECK:STDOUT: %.Self.as_wit.iface0.loc11_39: <witness> = facet_access_witness %.Self.ref.loc11_39, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  676. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0.loc11_39, element0 [symbolic_self = constants.%impl.elem0]
  677. // CHECK:STDOUT: %.loc11_45.1: %empty_tuple.type = tuple_literal ()
  678. // CHECK:STDOUT: %.loc11_45.2: type = converted %.loc11_45.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  679. // CHECK:STDOUT: %.loc11_19.2: type = where_expr %.Self [concrete = constants.%J_where.type] {
  680. // CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc11_30.2
  681. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc11_45.2
  682. // CHECK:STDOUT: }
  683. // CHECK:STDOUT: }
  684. // CHECK:STDOUT: %N.loc11_13.1: %J_where.type = bind_symbolic_name N, 0 [symbolic = %N.loc11_13.2 (constants.%N)]
  685. // CHECK:STDOUT: }
  686. // CHECK:STDOUT: }
  687. // CHECK:STDOUT:
  688. // CHECK:STDOUT: interface @J {
  689. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  690. // CHECK:STDOUT: %K: type = assoc_const_decl @K [concrete] {
  691. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%K [concrete = constants.%assoc0]
  692. // CHECK:STDOUT: }
  693. // CHECK:STDOUT: %L: type = assoc_const_decl @L [concrete] {
  694. // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%L [concrete = constants.%assoc1]
  695. // CHECK:STDOUT: }
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: !members:
  698. // CHECK:STDOUT: .Self = %Self
  699. // CHECK:STDOUT: .K = @K.%assoc0
  700. // CHECK:STDOUT: .L = @L.%assoc1
  701. // CHECK:STDOUT: witness = (%K, %L)
  702. // CHECK:STDOUT: }
  703. // CHECK:STDOUT:
  704. // CHECK:STDOUT: generic assoc_const @K(@J.%Self: %J.type) {
  705. // CHECK:STDOUT: assoc_const K:! type;
  706. // CHECK:STDOUT: }
  707. // CHECK:STDOUT:
  708. // CHECK:STDOUT: generic assoc_const @L(@J.%Self: %J.type) {
  709. // CHECK:STDOUT: assoc_const L:! type;
  710. // CHECK:STDOUT: }
  711. // CHECK:STDOUT:
  712. // CHECK:STDOUT: generic fn @Alphabetical(%M.loc9_17.1: %J_where.type) {
  713. // CHECK:STDOUT: %M.loc9_17.2: %J_where.type = bind_symbolic_name M, 0 [symbolic = %M.loc9_17.2 (constants.%M)]
  714. // CHECK:STDOUT: %M.patt.loc9_17.2: %J_where.type = symbolic_binding_pattern M, 0 [symbolic = %M.patt.loc9_17.2 (constants.%M.patt)]
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: !definition:
  717. // CHECK:STDOUT:
  718. // CHECK:STDOUT: fn(%M.patt.loc9_17.1: %J_where.type) {
  719. // CHECK:STDOUT: !entry:
  720. // CHECK:STDOUT: return
  721. // CHECK:STDOUT: }
  722. // CHECK:STDOUT: }
  723. // CHECK:STDOUT:
  724. // CHECK:STDOUT: generic fn @Reversed(%N.loc11_13.1: %J_where.type) {
  725. // CHECK:STDOUT: %N.loc11_13.2: %J_where.type = bind_symbolic_name N, 0 [symbolic = %N.loc11_13.2 (constants.%N)]
  726. // CHECK:STDOUT: %N.patt.loc11_13.2: %J_where.type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)]
  727. // CHECK:STDOUT:
  728. // CHECK:STDOUT: !definition:
  729. // CHECK:STDOUT: %Alphabetical.specific_fn.loc12_3.2: <specific function> = specific_function constants.%Alphabetical, @Alphabetical(%N.loc11_13.2) [symbolic = %Alphabetical.specific_fn.loc12_3.2 (constants.%Alphabetical.specific_fn)]
  730. // CHECK:STDOUT:
  731. // CHECK:STDOUT: fn(%N.patt.loc11_13.1: %J_where.type) {
  732. // CHECK:STDOUT: !entry:
  733. // CHECK:STDOUT: %Alphabetical.ref: %Alphabetical.type = name_ref Alphabetical, file.%Alphabetical.decl [concrete = constants.%Alphabetical]
  734. // CHECK:STDOUT: %N.ref: %J_where.type = name_ref N, %N.loc11_13.1 [symbolic = %N.loc11_13.2 (constants.%N)]
  735. // CHECK:STDOUT: %Alphabetical.specific_fn.loc12_3.1: <specific function> = specific_function %Alphabetical.ref, @Alphabetical(constants.%N) [symbolic = %Alphabetical.specific_fn.loc12_3.2 (constants.%Alphabetical.specific_fn)]
  736. // CHECK:STDOUT: %Alphabetical.call: init %empty_tuple.type = call %Alphabetical.specific_fn.loc12_3.1()
  737. // CHECK:STDOUT: return
  738. // CHECK:STDOUT: }
  739. // CHECK:STDOUT: }
  740. // CHECK:STDOUT:
  741. // CHECK:STDOUT: specific @K(constants.%Self) {}
  742. // CHECK:STDOUT:
  743. // CHECK:STDOUT: specific @L(constants.%Self) {}
  744. // CHECK:STDOUT:
  745. // CHECK:STDOUT: specific @K(constants.%J.facet) {}
  746. // CHECK:STDOUT:
  747. // CHECK:STDOUT: specific @L(constants.%J.facet) {}
  748. // CHECK:STDOUT:
  749. // CHECK:STDOUT: specific @Alphabetical(constants.%M) {
  750. // CHECK:STDOUT: %M.loc9_17.2 => constants.%M
  751. // CHECK:STDOUT: %M.patt.loc9_17.2 => constants.%M.patt
  752. // CHECK:STDOUT: }
  753. // CHECK:STDOUT:
  754. // CHECK:STDOUT: specific @Reversed(constants.%N) {
  755. // CHECK:STDOUT: %N.loc11_13.2 => constants.%N
  756. // CHECK:STDOUT: %N.patt.loc11_13.2 => constants.%N.patt
  757. // CHECK:STDOUT: }
  758. // CHECK:STDOUT:
  759. // CHECK:STDOUT: specific @Alphabetical(constants.%N) {
  760. // CHECK:STDOUT: %M.loc9_17.2 => constants.%N
  761. // CHECK:STDOUT: %M.patt.loc9_17.2 => constants.%M.patt
  762. // CHECK:STDOUT:
  763. // CHECK:STDOUT: !definition:
  764. // CHECK:STDOUT: }
  765. // CHECK:STDOUT:
  766. // CHECK:STDOUT: specific @Alphabetical(@Reversed.%N.loc11_13.2) {}
  767. // CHECK:STDOUT:
  768. // CHECK:STDOUT: --- todo_fail_rewrites_mismatch_right.carbon
  769. // CHECK:STDOUT:
  770. // CHECK:STDOUT: constants {
  771. // CHECK:STDOUT: %O.type: type = facet_type <@O> [concrete]
  772. // CHECK:STDOUT: %Self: %O.type = bind_symbolic_name Self, 0 [symbolic]
  773. // CHECK:STDOUT: %O.assoc_type: type = assoc_entity_type %O.type [concrete]
  774. // CHECK:STDOUT: %assoc0: %O.assoc_type = assoc_entity element0, @O.%P [concrete]
  775. // CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic_self]
  776. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  777. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  778. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  779. // CHECK:STDOUT: %O.facet.22f: %O.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  780. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  781. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  782. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  783. // CHECK:STDOUT: %O_where.type.fe1: type = facet_type <@O where %impl.elem0 = %i32> [concrete]
  784. // CHECK:STDOUT: %Q: %O_where.type.fe1 = bind_symbolic_name Q, 0 [symbolic]
  785. // CHECK:STDOUT: %Q.patt: %O_where.type.fe1 = symbolic_binding_pattern Q, 0 [symbolic]
  786. // CHECK:STDOUT: %WithInteger.type: type = fn_type @WithInteger [concrete]
  787. // CHECK:STDOUT: %WithInteger: %WithInteger.type = struct_value () [concrete]
  788. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  789. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  790. // CHECK:STDOUT: %O_where.type.741: type = facet_type <@O where %impl.elem0 = bool> [concrete]
  791. // CHECK:STDOUT: %R: %O_where.type.741 = bind_symbolic_name R, 0 [symbolic]
  792. // CHECK:STDOUT: %R.patt: %O_where.type.741 = symbolic_binding_pattern R, 0 [symbolic]
  793. // CHECK:STDOUT: %WithBool.type: type = fn_type @WithBool [concrete]
  794. // CHECK:STDOUT: %WithBool: %WithBool.type = struct_value () [concrete]
  795. // CHECK:STDOUT: %R.as_wit.iface0: <witness> = facet_access_witness %R, element0 [symbolic]
  796. // CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic]
  797. // CHECK:STDOUT: %O.facet.3ed: %O_where.type.fe1 = facet_value %R.as_type, (%R.as_wit.iface0) [symbolic]
  798. // CHECK:STDOUT: %WithInteger.specific_fn: <specific function> = specific_function %WithInteger, @WithInteger(%O.facet.3ed) [symbolic]
  799. // CHECK:STDOUT: }
  800. // CHECK:STDOUT:
  801. // CHECK:STDOUT: imports {
  802. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  803. // CHECK:STDOUT: .Int = %Core.Int
  804. // CHECK:STDOUT: .Bool = %Core.Bool
  805. // CHECK:STDOUT: import Core//prelude
  806. // CHECK:STDOUT: import Core//prelude/...
  807. // CHECK:STDOUT: }
  808. // CHECK:STDOUT: }
  809. // CHECK:STDOUT:
  810. // CHECK:STDOUT: file {
  811. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  812. // CHECK:STDOUT: .Core = imports.%Core
  813. // CHECK:STDOUT: .O = %O.decl
  814. // CHECK:STDOUT: .WithInteger = %WithInteger.decl
  815. // CHECK:STDOUT: .WithBool = %WithBool.decl
  816. // CHECK:STDOUT: }
  817. // CHECK:STDOUT: %Core.import = import Core
  818. // CHECK:STDOUT: %O.decl: type = interface_decl @O [concrete = constants.%O.type] {} {}
  819. // CHECK:STDOUT: %WithInteger.decl: %WithInteger.type = fn_decl @WithInteger [concrete = constants.%WithInteger] {
  820. // CHECK:STDOUT: %Q.patt.loc8_16.1: %O_where.type.fe1 = symbolic_binding_pattern Q, 0 [symbolic = %Q.patt.loc8_16.2 (constants.%Q.patt)]
  821. // CHECK:STDOUT: } {
  822. // CHECK:STDOUT: %.loc8_22.1: type = splice_block %.loc8_22.2 [concrete = constants.%O_where.type.fe1] {
  823. // CHECK:STDOUT: %O.ref: type = name_ref O, file.%O.decl [concrete = constants.%O.type]
  824. // CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  825. // CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  826. // CHECK:STDOUT: %P.ref: %O.assoc_type = name_ref P, @P.%assoc0 [concrete = constants.%assoc0]
  827. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  828. // CHECK:STDOUT: %.loc8_28: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  829. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  830. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  831. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  832. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  833. // CHECK:STDOUT: %.loc8_22.2: type = where_expr %.Self [concrete = constants.%O_where.type.fe1] {
  834. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  835. // CHECK:STDOUT: }
  836. // CHECK:STDOUT: }
  837. // CHECK:STDOUT: %Q.loc8_16.1: %O_where.type.fe1 = bind_symbolic_name Q, 0 [symbolic = %Q.loc8_16.2 (constants.%Q)]
  838. // CHECK:STDOUT: }
  839. // CHECK:STDOUT: %WithBool.decl: %WithBool.type = fn_decl @WithBool [concrete = constants.%WithBool] {
  840. // CHECK:STDOUT: %R.patt.loc10_13.1: %O_where.type.741 = symbolic_binding_pattern R, 0 [symbolic = %R.patt.loc10_13.2 (constants.%R.patt)]
  841. // CHECK:STDOUT: } {
  842. // CHECK:STDOUT: %.loc10_19.1: type = splice_block %.loc10_19.2 [concrete = constants.%O_where.type.741] {
  843. // CHECK:STDOUT: %O.ref: type = name_ref O, file.%O.decl [concrete = constants.%O.type]
  844. // CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  845. // CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  846. // CHECK:STDOUT: %P.ref: %O.assoc_type = name_ref P, @P.%assoc0 [concrete = constants.%assoc0]
  847. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  848. // CHECK:STDOUT: %.loc10_25: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  849. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  850. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  851. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  852. // CHECK:STDOUT: %.loc10_30.1: type = value_of_initializer %bool.make_type [concrete = bool]
  853. // CHECK:STDOUT: %.loc10_30.2: type = converted %bool.make_type, %.loc10_30.1 [concrete = bool]
  854. // CHECK:STDOUT: %.loc10_19.2: type = where_expr %.Self [concrete = constants.%O_where.type.741] {
  855. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_30.2
  856. // CHECK:STDOUT: }
  857. // CHECK:STDOUT: }
  858. // CHECK:STDOUT: %R.loc10_13.1: %O_where.type.741 = bind_symbolic_name R, 0 [symbolic = %R.loc10_13.2 (constants.%R)]
  859. // CHECK:STDOUT: }
  860. // CHECK:STDOUT: }
  861. // CHECK:STDOUT:
  862. // CHECK:STDOUT: interface @O {
  863. // CHECK:STDOUT: %Self: %O.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  864. // CHECK:STDOUT: %P: type = assoc_const_decl @P [concrete] {
  865. // CHECK:STDOUT: %assoc0: %O.assoc_type = assoc_entity element0, @O.%P [concrete = constants.%assoc0]
  866. // CHECK:STDOUT: }
  867. // CHECK:STDOUT:
  868. // CHECK:STDOUT: !members:
  869. // CHECK:STDOUT: .Self = %Self
  870. // CHECK:STDOUT: .P = @P.%assoc0
  871. // CHECK:STDOUT: witness = (%P)
  872. // CHECK:STDOUT: }
  873. // CHECK:STDOUT:
  874. // CHECK:STDOUT: generic assoc_const @P(@O.%Self: %O.type) {
  875. // CHECK:STDOUT: assoc_const P:! type;
  876. // CHECK:STDOUT: }
  877. // CHECK:STDOUT:
  878. // CHECK:STDOUT: generic fn @WithInteger(%Q.loc8_16.1: %O_where.type.fe1) {
  879. // CHECK:STDOUT: %Q.loc8_16.2: %O_where.type.fe1 = bind_symbolic_name Q, 0 [symbolic = %Q.loc8_16.2 (constants.%Q)]
  880. // CHECK:STDOUT: %Q.patt.loc8_16.2: %O_where.type.fe1 = symbolic_binding_pattern Q, 0 [symbolic = %Q.patt.loc8_16.2 (constants.%Q.patt)]
  881. // CHECK:STDOUT:
  882. // CHECK:STDOUT: !definition:
  883. // CHECK:STDOUT:
  884. // CHECK:STDOUT: fn(%Q.patt.loc8_16.1: %O_where.type.fe1) {
  885. // CHECK:STDOUT: !entry:
  886. // CHECK:STDOUT: return
  887. // CHECK:STDOUT: }
  888. // CHECK:STDOUT: }
  889. // CHECK:STDOUT:
  890. // CHECK:STDOUT: generic fn @WithBool(%R.loc10_13.1: %O_where.type.741) {
  891. // CHECK:STDOUT: %R.loc10_13.2: %O_where.type.741 = bind_symbolic_name R, 0 [symbolic = %R.loc10_13.2 (constants.%R)]
  892. // CHECK:STDOUT: %R.patt.loc10_13.2: %O_where.type.741 = symbolic_binding_pattern R, 0 [symbolic = %R.patt.loc10_13.2 (constants.%R.patt)]
  893. // CHECK:STDOUT:
  894. // CHECK:STDOUT: !definition:
  895. // CHECK:STDOUT: %R.as_wit.iface0.loc12_16.2: <witness> = facet_access_witness %R.loc10_13.2, element0 [symbolic = %R.as_wit.iface0.loc12_16.2 (constants.%R.as_wit.iface0)]
  896. // CHECK:STDOUT: %R.as_type.loc12_16.2: type = facet_access_type %R.loc10_13.2 [symbolic = %R.as_type.loc12_16.2 (constants.%R.as_type)]
  897. // CHECK:STDOUT: %O.facet.loc12_16.2: %O_where.type.fe1 = facet_value %R.as_type.loc12_16.2, (%R.as_wit.iface0.loc12_16.2) [symbolic = %O.facet.loc12_16.2 (constants.%O.facet.3ed)]
  898. // CHECK:STDOUT: %WithInteger.specific_fn.loc12_3.2: <specific function> = specific_function constants.%WithInteger, @WithInteger(%O.facet.loc12_16.2) [symbolic = %WithInteger.specific_fn.loc12_3.2 (constants.%WithInteger.specific_fn)]
  899. // CHECK:STDOUT:
  900. // CHECK:STDOUT: fn(%R.patt.loc10_13.1: %O_where.type.741) {
  901. // CHECK:STDOUT: !entry:
  902. // CHECK:STDOUT: %WithInteger.ref: %WithInteger.type = name_ref WithInteger, file.%WithInteger.decl [concrete = constants.%WithInteger]
  903. // CHECK:STDOUT: %R.ref: %O_where.type.741 = name_ref R, %R.loc10_13.1 [symbolic = %R.loc10_13.2 (constants.%R)]
  904. // CHECK:STDOUT: %R.as_wit.iface0.loc12_16.1: <witness> = facet_access_witness constants.%R, element0 [symbolic = %R.as_wit.iface0.loc12_16.2 (constants.%R.as_wit.iface0)]
  905. // CHECK:STDOUT: %R.as_type.loc12_16.1: type = facet_access_type constants.%R [symbolic = %R.as_type.loc12_16.2 (constants.%R.as_type)]
  906. // CHECK:STDOUT: %O.facet.loc12_16.1: %O_where.type.fe1 = facet_value %R.as_type.loc12_16.1, (%R.as_wit.iface0.loc12_16.1) [symbolic = %O.facet.loc12_16.2 (constants.%O.facet.3ed)]
  907. // CHECK:STDOUT: %.loc12: %O_where.type.fe1 = converted %R.ref, %O.facet.loc12_16.1 [symbolic = %O.facet.loc12_16.2 (constants.%O.facet.3ed)]
  908. // CHECK:STDOUT: %WithInteger.specific_fn.loc12_3.1: <specific function> = specific_function %WithInteger.ref, @WithInteger(constants.%O.facet.3ed) [symbolic = %WithInteger.specific_fn.loc12_3.2 (constants.%WithInteger.specific_fn)]
  909. // CHECK:STDOUT: %WithInteger.call: init %empty_tuple.type = call %WithInteger.specific_fn.loc12_3.1()
  910. // CHECK:STDOUT: return
  911. // CHECK:STDOUT: }
  912. // CHECK:STDOUT: }
  913. // CHECK:STDOUT:
  914. // CHECK:STDOUT: specific @P(constants.%Self) {}
  915. // CHECK:STDOUT:
  916. // CHECK:STDOUT: specific @P(constants.%O.facet.22f) {}
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: specific @WithInteger(constants.%Q) {
  919. // CHECK:STDOUT: %Q.loc8_16.2 => constants.%Q
  920. // CHECK:STDOUT: %Q.patt.loc8_16.2 => constants.%Q.patt
  921. // CHECK:STDOUT: }
  922. // CHECK:STDOUT:
  923. // CHECK:STDOUT: specific @WithBool(constants.%R) {
  924. // CHECK:STDOUT: %R.loc10_13.2 => constants.%R
  925. // CHECK:STDOUT: %R.patt.loc10_13.2 => constants.%R.patt
  926. // CHECK:STDOUT: }
  927. // CHECK:STDOUT:
  928. // CHECK:STDOUT: specific @WithInteger(constants.%O.facet.3ed) {
  929. // CHECK:STDOUT: %Q.loc8_16.2 => constants.%O.facet.3ed
  930. // CHECK:STDOUT: %Q.patt.loc8_16.2 => constants.%Q.patt
  931. // CHECK:STDOUT:
  932. // CHECK:STDOUT: !definition:
  933. // CHECK:STDOUT: }
  934. // CHECK:STDOUT:
  935. // CHECK:STDOUT: specific @WithInteger(@WithBool.%O.facet.loc12_16.2) {}
  936. // CHECK:STDOUT:
  937. // CHECK:STDOUT: --- todo_fail_rewrites_mismatch_left.carbon
  938. // CHECK:STDOUT:
  939. // CHECK:STDOUT: constants {
  940. // CHECK:STDOUT: %S.type: type = facet_type <@S> [concrete]
  941. // CHECK:STDOUT: %Self: %S.type = bind_symbolic_name Self, 0 [symbolic]
  942. // CHECK:STDOUT: %S.assoc_type: type = assoc_entity_type %S.type [concrete]
  943. // CHECK:STDOUT: %assoc0: %S.assoc_type = assoc_entity element0, @S.%T [concrete]
  944. // CHECK:STDOUT: %assoc1: %S.assoc_type = assoc_entity element1, @S.%U [concrete]
  945. // CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic_self]
  946. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  947. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  948. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  949. // CHECK:STDOUT: %S.facet.140: %S.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  950. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  951. // CHECK:STDOUT: %S_where.type.15b: type = facet_type <@S where %impl.elem0 = %empty_tuple.type> [concrete]
  952. // CHECK:STDOUT: %V: %S_where.type.15b = bind_symbolic_name V, 0 [symbolic]
  953. // CHECK:STDOUT: %V.patt: %S_where.type.15b = symbolic_binding_pattern V, 0 [symbolic]
  954. // CHECK:STDOUT: %WithT.type: type = fn_type @WithT [concrete]
  955. // CHECK:STDOUT: %WithT: %WithT.type = struct_value () [concrete]
  956. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.iface0, element1 [symbolic_self]
  957. // CHECK:STDOUT: %S_where.type.0be: type = facet_type <@S where %impl.elem1 = %empty_tuple.type> [concrete]
  958. // CHECK:STDOUT: %W: %S_where.type.0be = bind_symbolic_name W, 0 [symbolic]
  959. // CHECK:STDOUT: %W.patt: %S_where.type.0be = symbolic_binding_pattern W, 0 [symbolic]
  960. // CHECK:STDOUT: %WithU.type: type = fn_type @WithU [concrete]
  961. // CHECK:STDOUT: %WithU: %WithU.type = struct_value () [concrete]
  962. // CHECK:STDOUT: %W.as_wit.iface0: <witness> = facet_access_witness %W, element0 [symbolic]
  963. // CHECK:STDOUT: %W.as_type: type = facet_access_type %W [symbolic]
  964. // CHECK:STDOUT: %S.facet.6fe: %S_where.type.15b = facet_value %W.as_type, (%W.as_wit.iface0) [symbolic]
  965. // CHECK:STDOUT: %WithT.specific_fn: <specific function> = specific_function %WithT, @WithT(%S.facet.6fe) [symbolic]
  966. // CHECK:STDOUT: }
  967. // CHECK:STDOUT:
  968. // CHECK:STDOUT: imports {
  969. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  970. // CHECK:STDOUT: import Core//prelude
  971. // CHECK:STDOUT: import Core//prelude/...
  972. // CHECK:STDOUT: }
  973. // CHECK:STDOUT: }
  974. // CHECK:STDOUT:
  975. // CHECK:STDOUT: file {
  976. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  977. // CHECK:STDOUT: .Core = imports.%Core
  978. // CHECK:STDOUT: .S = %S.decl
  979. // CHECK:STDOUT: .WithT = %WithT.decl
  980. // CHECK:STDOUT: .WithU = %WithU.decl
  981. // CHECK:STDOUT: }
  982. // CHECK:STDOUT: %Core.import = import Core
  983. // CHECK:STDOUT: %S.decl: type = interface_decl @S [concrete = constants.%S.type] {} {}
  984. // CHECK:STDOUT: %WithT.decl: %WithT.type = fn_decl @WithT [concrete = constants.%WithT] {
  985. // CHECK:STDOUT: %V.patt.loc9_10.1: %S_where.type.15b = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc9_10.2 (constants.%V.patt)]
  986. // CHECK:STDOUT: } {
  987. // CHECK:STDOUT: %.loc9_16.1: type = splice_block %.loc9_16.2 [concrete = constants.%S_where.type.15b] {
  988. // CHECK:STDOUT: %S.ref: type = name_ref S, file.%S.decl [concrete = constants.%S.type]
  989. // CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  990. // CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  991. // CHECK:STDOUT: %T.ref: %S.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
  992. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  993. // CHECK:STDOUT: %.loc9_22: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  994. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  995. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  996. // CHECK:STDOUT: %.loc9_28.1: %empty_tuple.type = tuple_literal ()
  997. // CHECK:STDOUT: %.loc9_28.2: type = converted %.loc9_28.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  998. // CHECK:STDOUT: %.loc9_16.2: type = where_expr %.Self [concrete = constants.%S_where.type.15b] {
  999. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_28.2
  1000. // CHECK:STDOUT: }
  1001. // CHECK:STDOUT: }
  1002. // CHECK:STDOUT: %V.loc9_10.1: %S_where.type.15b = bind_symbolic_name V, 0 [symbolic = %V.loc9_10.2 (constants.%V)]
  1003. // CHECK:STDOUT: }
  1004. // CHECK:STDOUT: %WithU.decl: %WithU.type = fn_decl @WithU [concrete = constants.%WithU] {
  1005. // CHECK:STDOUT: %W.patt.loc11_10.1: %S_where.type.0be = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_10.2 (constants.%W.patt)]
  1006. // CHECK:STDOUT: } {
  1007. // CHECK:STDOUT: %.loc11_16.1: type = splice_block %.loc11_16.2 [concrete = constants.%S_where.type.0be] {
  1008. // CHECK:STDOUT: %S.ref: type = name_ref S, file.%S.decl [concrete = constants.%S.type]
  1009. // CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1010. // CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1011. // CHECK:STDOUT: %U.ref: %S.assoc_type = name_ref U, @U.%assoc1 [concrete = constants.%assoc1]
  1012. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  1013. // CHECK:STDOUT: %.loc11_22: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  1014. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  1015. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.iface0, element1 [symbolic_self = constants.%impl.elem1]
  1016. // CHECK:STDOUT: %.loc11_28.1: %empty_tuple.type = tuple_literal ()
  1017. // CHECK:STDOUT: %.loc11_28.2: type = converted %.loc11_28.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1018. // CHECK:STDOUT: %.loc11_16.2: type = where_expr %.Self [concrete = constants.%S_where.type.0be] {
  1019. // CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc11_28.2
  1020. // CHECK:STDOUT: }
  1021. // CHECK:STDOUT: }
  1022. // CHECK:STDOUT: %W.loc11_10.1: %S_where.type.0be = bind_symbolic_name W, 0 [symbolic = %W.loc11_10.2 (constants.%W)]
  1023. // CHECK:STDOUT: }
  1024. // CHECK:STDOUT: }
  1025. // CHECK:STDOUT:
  1026. // CHECK:STDOUT: interface @S {
  1027. // CHECK:STDOUT: %Self: %S.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1028. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  1029. // CHECK:STDOUT: %assoc0: %S.assoc_type = assoc_entity element0, @S.%T [concrete = constants.%assoc0]
  1030. // CHECK:STDOUT: }
  1031. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  1032. // CHECK:STDOUT: %assoc1: %S.assoc_type = assoc_entity element1, @S.%U [concrete = constants.%assoc1]
  1033. // CHECK:STDOUT: }
  1034. // CHECK:STDOUT:
  1035. // CHECK:STDOUT: !members:
  1036. // CHECK:STDOUT: .Self = %Self
  1037. // CHECK:STDOUT: .T = @T.%assoc0
  1038. // CHECK:STDOUT: .U = @U.%assoc1
  1039. // CHECK:STDOUT: witness = (%T, %U)
  1040. // CHECK:STDOUT: }
  1041. // CHECK:STDOUT:
  1042. // CHECK:STDOUT: generic assoc_const @T(@S.%Self: %S.type) {
  1043. // CHECK:STDOUT: assoc_const T:! type;
  1044. // CHECK:STDOUT: }
  1045. // CHECK:STDOUT:
  1046. // CHECK:STDOUT: generic assoc_const @U(@S.%Self: %S.type) {
  1047. // CHECK:STDOUT: assoc_const U:! type;
  1048. // CHECK:STDOUT: }
  1049. // CHECK:STDOUT:
  1050. // CHECK:STDOUT: generic fn @WithT(%V.loc9_10.1: %S_where.type.15b) {
  1051. // CHECK:STDOUT: %V.loc9_10.2: %S_where.type.15b = bind_symbolic_name V, 0 [symbolic = %V.loc9_10.2 (constants.%V)]
  1052. // CHECK:STDOUT: %V.patt.loc9_10.2: %S_where.type.15b = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc9_10.2 (constants.%V.patt)]
  1053. // CHECK:STDOUT:
  1054. // CHECK:STDOUT: !definition:
  1055. // CHECK:STDOUT:
  1056. // CHECK:STDOUT: fn(%V.patt.loc9_10.1: %S_where.type.15b) {
  1057. // CHECK:STDOUT: !entry:
  1058. // CHECK:STDOUT: return
  1059. // CHECK:STDOUT: }
  1060. // CHECK:STDOUT: }
  1061. // CHECK:STDOUT:
  1062. // CHECK:STDOUT: generic fn @WithU(%W.loc11_10.1: %S_where.type.0be) {
  1063. // CHECK:STDOUT: %W.loc11_10.2: %S_where.type.0be = bind_symbolic_name W, 0 [symbolic = %W.loc11_10.2 (constants.%W)]
  1064. // CHECK:STDOUT: %W.patt.loc11_10.2: %S_where.type.0be = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_10.2 (constants.%W.patt)]
  1065. // CHECK:STDOUT:
  1066. // CHECK:STDOUT: !definition:
  1067. // CHECK:STDOUT: %W.as_wit.iface0.loc13_10.2: <witness> = facet_access_witness %W.loc11_10.2, element0 [symbolic = %W.as_wit.iface0.loc13_10.2 (constants.%W.as_wit.iface0)]
  1068. // CHECK:STDOUT: %W.as_type.loc13_10.2: type = facet_access_type %W.loc11_10.2 [symbolic = %W.as_type.loc13_10.2 (constants.%W.as_type)]
  1069. // CHECK:STDOUT: %S.facet.loc13_10.2: %S_where.type.15b = facet_value %W.as_type.loc13_10.2, (%W.as_wit.iface0.loc13_10.2) [symbolic = %S.facet.loc13_10.2 (constants.%S.facet.6fe)]
  1070. // CHECK:STDOUT: %WithT.specific_fn.loc13_3.2: <specific function> = specific_function constants.%WithT, @WithT(%S.facet.loc13_10.2) [symbolic = %WithT.specific_fn.loc13_3.2 (constants.%WithT.specific_fn)]
  1071. // CHECK:STDOUT:
  1072. // CHECK:STDOUT: fn(%W.patt.loc11_10.1: %S_where.type.0be) {
  1073. // CHECK:STDOUT: !entry:
  1074. // CHECK:STDOUT: %WithT.ref: %WithT.type = name_ref WithT, file.%WithT.decl [concrete = constants.%WithT]
  1075. // CHECK:STDOUT: %W.ref: %S_where.type.0be = name_ref W, %W.loc11_10.1 [symbolic = %W.loc11_10.2 (constants.%W)]
  1076. // CHECK:STDOUT: %W.as_wit.iface0.loc13_10.1: <witness> = facet_access_witness constants.%W, element0 [symbolic = %W.as_wit.iface0.loc13_10.2 (constants.%W.as_wit.iface0)]
  1077. // CHECK:STDOUT: %W.as_type.loc13_10.1: type = facet_access_type constants.%W [symbolic = %W.as_type.loc13_10.2 (constants.%W.as_type)]
  1078. // CHECK:STDOUT: %S.facet.loc13_10.1: %S_where.type.15b = facet_value %W.as_type.loc13_10.1, (%W.as_wit.iface0.loc13_10.1) [symbolic = %S.facet.loc13_10.2 (constants.%S.facet.6fe)]
  1079. // CHECK:STDOUT: %.loc13: %S_where.type.15b = converted %W.ref, %S.facet.loc13_10.1 [symbolic = %S.facet.loc13_10.2 (constants.%S.facet.6fe)]
  1080. // CHECK:STDOUT: %WithT.specific_fn.loc13_3.1: <specific function> = specific_function %WithT.ref, @WithT(constants.%S.facet.6fe) [symbolic = %WithT.specific_fn.loc13_3.2 (constants.%WithT.specific_fn)]
  1081. // CHECK:STDOUT: %WithT.call: init %empty_tuple.type = call %WithT.specific_fn.loc13_3.1()
  1082. // CHECK:STDOUT: return
  1083. // CHECK:STDOUT: }
  1084. // CHECK:STDOUT: }
  1085. // CHECK:STDOUT:
  1086. // CHECK:STDOUT: specific @T(constants.%Self) {}
  1087. // CHECK:STDOUT:
  1088. // CHECK:STDOUT: specific @U(constants.%Self) {}
  1089. // CHECK:STDOUT:
  1090. // CHECK:STDOUT: specific @T(constants.%S.facet.140) {}
  1091. // CHECK:STDOUT:
  1092. // CHECK:STDOUT: specific @WithT(constants.%V) {
  1093. // CHECK:STDOUT: %V.loc9_10.2 => constants.%V
  1094. // CHECK:STDOUT: %V.patt.loc9_10.2 => constants.%V.patt
  1095. // CHECK:STDOUT: }
  1096. // CHECK:STDOUT:
  1097. // CHECK:STDOUT: specific @U(constants.%S.facet.140) {}
  1098. // CHECK:STDOUT:
  1099. // CHECK:STDOUT: specific @WithU(constants.%W) {
  1100. // CHECK:STDOUT: %W.loc11_10.2 => constants.%W
  1101. // CHECK:STDOUT: %W.patt.loc11_10.2 => constants.%W.patt
  1102. // CHECK:STDOUT: }
  1103. // CHECK:STDOUT:
  1104. // CHECK:STDOUT: specific @WithT(constants.%S.facet.6fe) {
  1105. // CHECK:STDOUT: %V.loc9_10.2 => constants.%S.facet.6fe
  1106. // CHECK:STDOUT: %V.patt.loc9_10.2 => constants.%V.patt
  1107. // CHECK:STDOUT:
  1108. // CHECK:STDOUT: !definition:
  1109. // CHECK:STDOUT: }
  1110. // CHECK:STDOUT:
  1111. // CHECK:STDOUT: specific @WithT(@WithU.%S.facet.loc13_10.2) {}
  1112. // CHECK:STDOUT:
  1113. // CHECK:STDOUT: --- fail_import_rewrites.carbon
  1114. // CHECK:STDOUT:
  1115. // CHECK:STDOUT: constants {
  1116. // CHECK:STDOUT: %Calls.type: type = fn_type @Calls [concrete]
  1117. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1118. // CHECK:STDOUT: %Calls: %Calls.type = struct_value () [concrete]
  1119. // CHECK:STDOUT: %Equal.type.d73: type = fn_type @Equal.1 [concrete]
  1120. // CHECK:STDOUT: %Equal.517: %Equal.type.d73 = struct_value () [concrete]
  1121. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1122. // CHECK:STDOUT: %N.type: type = facet_type <@N> [concrete]
  1123. // CHECK:STDOUT: %.Self.9aa: %N.type = bind_symbolic_name .Self [symbolic_self]
  1124. // CHECK:STDOUT: %.Self.as_wit.iface0.e75: <witness> = facet_access_witness %.Self.9aa, element0 [symbolic_self]
  1125. // CHECK:STDOUT: %impl.elem0.a31: type = impl_witness_access %.Self.as_wit.iface0.e75, element0 [symbolic_self]
  1126. // CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0.a31 = %empty_struct_type> [concrete]
  1127. // CHECK:STDOUT: %T.patt: %N_where.type = symbolic_binding_pattern T, 0 [symbolic]
  1128. // CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic]
  1129. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  1130. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  1131. // CHECK:STDOUT: %NestedRewrite.type: type = fn_type @NestedRewrite [concrete]
  1132. // CHECK:STDOUT: %NestedRewrite: %NestedRewrite.type = struct_value () [concrete]
  1133. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  1134. // CHECK:STDOUT: %.Self.3ca: %A.type = bind_symbolic_name .Self [symbolic_self]
  1135. // CHECK:STDOUT: %.Self.as_wit.iface0.844: <witness> = facet_access_witness %.Self.3ca, element0 [symbolic_self]
  1136. // CHECK:STDOUT: %impl.elem0.696: type = impl_witness_access %.Self.as_wit.iface0.844, element0 [symbolic_self]
  1137. // CHECK:STDOUT: %A_where.type.bcb: type = facet_type <@A where %impl.elem0.696 = bool> [concrete]
  1138. // CHECK:STDOUT: %.Self.80b: %A_where.type.bcb = bind_symbolic_name .Self [symbolic_self]
  1139. // CHECK:STDOUT: %.Self.as_wit.iface0.d15: <witness> = facet_access_witness %.Self.80b, element0 [symbolic_self]
  1140. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.iface0.d15, element1 [symbolic_self]
  1141. // CHECK:STDOUT: %A_where.type.248: type = facet_type <@A where %impl.elem1 = %empty_tuple.type and %impl.elem0.696 = bool> [concrete]
  1142. // CHECK:STDOUT: %D.patt: %A_where.type.248 = symbolic_binding_pattern D, 0 [symbolic]
  1143. // CHECK:STDOUT: %D: %A_where.type.248 = bind_symbolic_name D, 0 [symbolic]
  1144. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1145. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1146. // CHECK:STDOUT: }
  1147. // CHECK:STDOUT:
  1148. // CHECK:STDOUT: imports {
  1149. // CHECK:STDOUT: %Main.N = import_ref Main//equal_constraint, N, unloaded
  1150. // CHECK:STDOUT: %Main.Equal: %Equal.type.d73 = import_ref Main//equal_constraint, Equal, loaded [concrete = constants.%Equal.517]
  1151. // CHECK:STDOUT: %Main.A = import_ref Main//nested_rewrites, A, unloaded
  1152. // CHECK:STDOUT: %Main.NestedRewrite: %NestedRewrite.type = import_ref Main//nested_rewrites, NestedRewrite, loaded [concrete = constants.%NestedRewrite]
  1153. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1154. // CHECK:STDOUT: .Bool = %Core.Bool
  1155. // CHECK:STDOUT: .Int = %Core.Int
  1156. // CHECK:STDOUT: import Core//prelude
  1157. // CHECK:STDOUT: import Core//prelude/...
  1158. // CHECK:STDOUT: }
  1159. // CHECK:STDOUT: %Main.import_ref.169 = import_ref Main//equal_constraint, inst18 [no loc], unloaded
  1160. // CHECK:STDOUT: %Main.import_ref.020 = import_ref Main//equal_constraint, loc5_8, unloaded
  1161. // CHECK:STDOUT: %Main.P = import_ref Main//equal_constraint, P, unloaded
  1162. // CHECK:STDOUT: %Main.import_ref.3bc: %N_where.type = import_ref Main//equal_constraint, loc8_10, loaded [symbolic = @Equal.1.%T (constants.%T)]
  1163. // CHECK:STDOUT: %Main.import_ref.b61 = import_ref Main//nested_rewrites, inst18 [no loc], unloaded
  1164. // CHECK:STDOUT: %Main.import_ref.91a = import_ref Main//nested_rewrites, loc5_8, unloaded
  1165. // CHECK:STDOUT: %Main.import_ref.55d = import_ref Main//nested_rewrites, loc6_8, unloaded
  1166. // CHECK:STDOUT: %Main.B = import_ref Main//nested_rewrites, B, unloaded
  1167. // CHECK:STDOUT: %Main.C = import_ref Main//nested_rewrites, C, unloaded
  1168. // CHECK:STDOUT: %Main.import_ref.705: %A_where.type.248 = import_ref Main//nested_rewrites, loc9_18, loaded [symbolic = @NestedRewrite.%D (constants.%D)]
  1169. // CHECK:STDOUT: }
  1170. // CHECK:STDOUT:
  1171. // CHECK:STDOUT: file {
  1172. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1173. // CHECK:STDOUT: .N = imports.%Main.N
  1174. // CHECK:STDOUT: .Equal = imports.%Main.Equal
  1175. // CHECK:STDOUT: .A = imports.%Main.A
  1176. // CHECK:STDOUT: .NestedRewrite = imports.%Main.NestedRewrite
  1177. // CHECK:STDOUT: .Core = imports.%Core
  1178. // CHECK:STDOUT: .Calls = %Calls.decl
  1179. // CHECK:STDOUT: }
  1180. // CHECK:STDOUT: %Core.import = import Core
  1181. // CHECK:STDOUT: %default.import = import <none>
  1182. // CHECK:STDOUT: %Calls.decl: %Calls.type = fn_decl @Calls [concrete = constants.%Calls] {} {}
  1183. // CHECK:STDOUT: }
  1184. // CHECK:STDOUT:
  1185. // CHECK:STDOUT: interface @N [from "equal_constraint.carbon"] {
  1186. // CHECK:STDOUT: !members:
  1187. // CHECK:STDOUT: .Self = imports.%Main.import_ref.169
  1188. // CHECK:STDOUT: .P = imports.%Main.import_ref.020
  1189. // CHECK:STDOUT: witness = (imports.%Main.P)
  1190. // CHECK:STDOUT: }
  1191. // CHECK:STDOUT:
  1192. // CHECK:STDOUT: interface @A [from "nested_rewrites.carbon"] {
  1193. // CHECK:STDOUT: !members:
  1194. // CHECK:STDOUT: .Self = imports.%Main.import_ref.b61
  1195. // CHECK:STDOUT: .B = imports.%Main.import_ref.91a
  1196. // CHECK:STDOUT: .C = imports.%Main.import_ref.55d
  1197. // CHECK:STDOUT: witness = (imports.%Main.B, imports.%Main.C)
  1198. // CHECK:STDOUT: }
  1199. // CHECK:STDOUT:
  1200. // CHECK:STDOUT: fn @Calls() {
  1201. // CHECK:STDOUT: !entry:
  1202. // CHECK:STDOUT: %Equal.ref: %Equal.type.d73 = name_ref Equal, imports.%Main.Equal [concrete = constants.%Equal.517]
  1203. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  1204. // CHECK:STDOUT: %NestedRewrite.ref: %NestedRewrite.type = name_ref NestedRewrite, imports.%Main.NestedRewrite [concrete = constants.%NestedRewrite]
  1205. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1206. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1207. // CHECK:STDOUT: return
  1208. // CHECK:STDOUT: }
  1209. // CHECK:STDOUT:
  1210. // CHECK:STDOUT: generic fn @Equal.1(imports.%Main.import_ref.3bc: %N_where.type) [from "equal_constraint.carbon"] {
  1211. // CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1212. // CHECK:STDOUT: %T.patt.2: %N_where.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.2 (constants.%T.patt)]
  1213. // CHECK:STDOUT:
  1214. // CHECK:STDOUT: fn(%T.patt.1: %N_where.type);
  1215. // CHECK:STDOUT: }
  1216. // CHECK:STDOUT:
  1217. // CHECK:STDOUT: generic fn @NestedRewrite(imports.%Main.import_ref.705: %A_where.type.248) [from "nested_rewrites.carbon"] {
  1218. // CHECK:STDOUT: %D: %A_where.type.248 = bind_symbolic_name D, 0 [symbolic = %D (constants.%D)]
  1219. // CHECK:STDOUT: %D.patt.2: %A_where.type.248 = symbolic_binding_pattern D, 0 [symbolic = %D.patt.2 (constants.%D.patt)]
  1220. // CHECK:STDOUT:
  1221. // CHECK:STDOUT: fn(%D.patt.1: %A_where.type.248);
  1222. // CHECK:STDOUT: }
  1223. // CHECK:STDOUT:
  1224. // CHECK:STDOUT: specific @Equal.1(constants.%T) {
  1225. // CHECK:STDOUT: %T => constants.%T
  1226. // CHECK:STDOUT: %T.patt.2 => constants.%T.patt
  1227. // CHECK:STDOUT: }
  1228. // CHECK:STDOUT:
  1229. // CHECK:STDOUT: specific @NestedRewrite(constants.%D) {
  1230. // CHECK:STDOUT: %D => constants.%D
  1231. // CHECK:STDOUT: %D.patt.2 => constants.%D.patt
  1232. // CHECK:STDOUT: }
  1233. // CHECK:STDOUT:
  1234. // CHECK:STDOUT: --- fail_check_rewrite_constraints.carbon
  1235. // CHECK:STDOUT:
  1236. // CHECK:STDOUT: constants {
  1237. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1238. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1239. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [concrete]
  1240. // CHECK:STDOUT: %assoc0.05b: %I.assoc_type = assoc_entity element0, @I.%Member [concrete]
  1241. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  1242. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  1243. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self, element0 [symbolic_self]
  1244. // CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%.Self.as_wit.iface0) [symbolic_self]
  1245. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self]
  1246. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  1247. // CHECK:STDOUT: %RewriteTypeMismatch.type: type = fn_type @RewriteTypeMismatch [concrete]
  1248. // CHECK:STDOUT: %RewriteTypeMismatch: %RewriteTypeMismatch.type = struct_value () [concrete]
  1249. // CHECK:STDOUT: }
  1250. // CHECK:STDOUT:
  1251. // CHECK:STDOUT: imports {
  1252. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1253. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1254. // CHECK:STDOUT: import Core//prelude
  1255. // CHECK:STDOUT: import Core//prelude/...
  1256. // CHECK:STDOUT: }
  1257. // CHECK:STDOUT: }
  1258. // CHECK:STDOUT:
  1259. // CHECK:STDOUT: file {
  1260. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1261. // CHECK:STDOUT: .Core = imports.%Core
  1262. // CHECK:STDOUT: .I = %I.decl
  1263. // CHECK:STDOUT: .RewriteTypeMismatch = %RewriteTypeMismatch.decl
  1264. // CHECK:STDOUT: }
  1265. // CHECK:STDOUT: %Core.import = import Core
  1266. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1267. // CHECK:STDOUT: %RewriteTypeMismatch.decl: %RewriteTypeMismatch.type = fn_decl @RewriteTypeMismatch [concrete = constants.%RewriteTypeMismatch] {
  1268. // CHECK:STDOUT: %X.patt: <error> = symbolic_binding_pattern X, 0 [concrete = <error>]
  1269. // CHECK:STDOUT: } {
  1270. // CHECK:STDOUT: %.loc16_30.1: type = splice_block %.loc16_30.2 [concrete = <error>] {
  1271. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1272. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1273. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1274. // CHECK:STDOUT: %Member.ref: %I.assoc_type = name_ref Member, @Member.%assoc0 [concrete = constants.%assoc0.05b]
  1275. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  1276. // CHECK:STDOUT: %.loc16_36: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  1277. // CHECK:STDOUT: %.Self.as_wit.iface0: <witness> = facet_access_witness %.Self.ref, element0 [symbolic_self = constants.%.Self.as_wit.iface0]
  1278. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0, element0 [symbolic_self = constants.%impl.elem0]
  1279. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  1280. // CHECK:STDOUT: %.loc16_46: type = converted %int_2, <error> [concrete = <error>]
  1281. // CHECK:STDOUT: %.loc16_30.2: type = where_expr %.Self [concrete = <error>] {
  1282. // CHECK:STDOUT: requirement_rewrite %impl.elem0, <error>
  1283. // CHECK:STDOUT: }
  1284. // CHECK:STDOUT: }
  1285. // CHECK:STDOUT: %X: <error> = bind_symbolic_name X, 0 [concrete = <error>]
  1286. // CHECK:STDOUT: }
  1287. // CHECK:STDOUT: }
  1288. // CHECK:STDOUT:
  1289. // CHECK:STDOUT: interface @I {
  1290. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  1291. // CHECK:STDOUT: %Member: type = assoc_const_decl @Member [concrete] {
  1292. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Member [concrete = constants.%assoc0.05b]
  1293. // CHECK:STDOUT: }
  1294. // CHECK:STDOUT:
  1295. // CHECK:STDOUT: !members:
  1296. // CHECK:STDOUT: .Self = %Self
  1297. // CHECK:STDOUT: .Member = @Member.%assoc0
  1298. // CHECK:STDOUT: witness = (%Member)
  1299. // CHECK:STDOUT: }
  1300. // CHECK:STDOUT:
  1301. // CHECK:STDOUT: generic assoc_const @Member(@I.%Self: %I.type) {
  1302. // CHECK:STDOUT: assoc_const Member:! type;
  1303. // CHECK:STDOUT: }
  1304. // CHECK:STDOUT:
  1305. // CHECK:STDOUT: generic fn @RewriteTypeMismatch(%X: <error>) {
  1306. // CHECK:STDOUT: fn(%X.patt: <error>);
  1307. // CHECK:STDOUT: }
  1308. // CHECK:STDOUT:
  1309. // CHECK:STDOUT: specific @Member(constants.%Self.826) {}
  1310. // CHECK:STDOUT:
  1311. // CHECK:STDOUT: specific @Member(constants.%I.facet) {}
  1312. // CHECK:STDOUT:
  1313. // CHECK:STDOUT: specific @RewriteTypeMismatch(<error>) {}
  1314. // CHECK:STDOUT:
  1315. // CHECK:STDOUT: --- fail_todo_let.carbon
  1316. // CHECK:STDOUT:
  1317. // CHECK:STDOUT: constants {
  1318. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  1319. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic]
  1320. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  1321. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1322. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1323. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [concrete]
  1324. // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self]
  1325. // CHECK:STDOUT: %type_where: type = facet_type <type where TODO> [concrete]
  1326. // CHECK:STDOUT: }
  1327. // CHECK:STDOUT:
  1328. // CHECK:STDOUT: imports {
  1329. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1330. // CHECK:STDOUT: import Core//prelude
  1331. // CHECK:STDOUT: import Core//prelude/...
  1332. // CHECK:STDOUT: }
  1333. // CHECK:STDOUT: }
  1334. // CHECK:STDOUT:
  1335. // CHECK:STDOUT: file {
  1336. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1337. // CHECK:STDOUT: .Core = imports.%Core
  1338. // CHECK:STDOUT: .A = %A.decl
  1339. // CHECK:STDOUT: .D = %D.decl
  1340. // CHECK:STDOUT: .B = %B
  1341. // CHECK:STDOUT: }
  1342. // CHECK:STDOUT: %Core.import = import Core
  1343. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  1344. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1345. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1346. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1347. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1348. // CHECK:STDOUT: }
  1349. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [concrete = constants.%impl_witness]
  1350. // CHECK:STDOUT: name_binding_decl {
  1351. // CHECK:STDOUT: %B.patt: %type_where = binding_pattern B
  1352. // CHECK:STDOUT: }
  1353. // CHECK:STDOUT: %.loc12_13.1: type = splice_block %.loc12_13.2 [concrete = constants.%type_where] {
  1354. // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1355. // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  1356. // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [concrete = constants.%A.type]
  1357. // CHECK:STDOUT: %.loc12_13.2: type = where_expr %.Self [concrete = constants.%type_where] {
  1358. // CHECK:STDOUT: requirement_impls %.Self.ref, %A.ref
  1359. // CHECK:STDOUT: }
  1360. // CHECK:STDOUT: }
  1361. // CHECK:STDOUT: %B: %type_where = bind_name B, <error>
  1362. // CHECK:STDOUT: }
  1363. // CHECK:STDOUT:
  1364. // CHECK:STDOUT: interface @A {
  1365. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1366. // CHECK:STDOUT:
  1367. // CHECK:STDOUT: !members:
  1368. // CHECK:STDOUT: .Self = %Self
  1369. // CHECK:STDOUT: witness = ()
  1370. // CHECK:STDOUT: }
  1371. // CHECK:STDOUT:
  1372. // CHECK:STDOUT: impl @impl: %D.ref as %A.ref {
  1373. // CHECK:STDOUT: !members:
  1374. // CHECK:STDOUT: witness = file.%impl_witness
  1375. // CHECK:STDOUT: }
  1376. // CHECK:STDOUT:
  1377. // CHECK:STDOUT: class @D {
  1378. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1379. // CHECK:STDOUT: complete_type_witness = %complete_type
  1380. // CHECK:STDOUT:
  1381. // CHECK:STDOUT: !members:
  1382. // CHECK:STDOUT: .Self = constants.%D
  1383. // CHECK:STDOUT: }
  1384. // CHECK:STDOUT:
  1385. // CHECK:STDOUT: fn @__global_init() {
  1386. // CHECK:STDOUT: !entry:
  1387. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1388. // CHECK:STDOUT: return
  1389. // CHECK:STDOUT: }
  1390. // CHECK:STDOUT:
  1391. // CHECK:STDOUT: --- fail_type_does_not_implement_where.carbon
  1392. // CHECK:STDOUT:
  1393. // CHECK:STDOUT: constants {
  1394. // CHECK:STDOUT: %E.type: type = facet_type <@E> [concrete]
  1395. // CHECK:STDOUT: %Self: %E.type = bind_symbolic_name Self, 0 [symbolic]
  1396. // CHECK:STDOUT: %E.assoc_type: type = assoc_entity_type %E.type [concrete]
  1397. // CHECK:STDOUT: %assoc0: %E.assoc_type = assoc_entity element0, @E.%F [concrete]
  1398. // CHECK:STDOUT: %assoc1: %E.assoc_type = assoc_entity element1, @E.%G [concrete]
  1399. // CHECK:STDOUT: %.Self.da5: %E.type = bind_symbolic_name .Self [symbolic_self]
  1400. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1401. // CHECK:STDOUT: %.Self.as_type.34e: type = facet_access_type %.Self.da5 [symbolic_self]
  1402. // CHECK:STDOUT: %.Self.as_wit.iface0.7f0: <witness> = facet_access_witness %.Self.da5, element0 [symbolic_self]
  1403. // CHECK:STDOUT: %E.facet.99c: %E.type = facet_value %.Self.as_type.34e, (%.Self.as_wit.iface0.7f0) [symbolic_self]
  1404. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.iface0.7f0, element0 [symbolic_self]
  1405. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  1406. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  1407. // CHECK:STDOUT: %impl.elem1.7a9: type = impl_witness_access %.Self.as_wit.iface0.7f0, element1 [symbolic_self]
  1408. // CHECK:STDOUT: %E_where.type.281: type = facet_type <@E where %impl.elem1.7a9 = %empty_tuple.type and %impl.elem0 = bool> [concrete]
  1409. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
  1410. // CHECK:STDOUT: %Float.type: type = fn_type @Float [concrete]
  1411. // CHECK:STDOUT: %Float: %Float.type = struct_value () [concrete]
  1412. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1413. // CHECK:STDOUT: %E_where.type.c42: type = facet_type <@E where %impl.elem0 = %empty_struct_type> [concrete]
  1414. // CHECK:STDOUT: %.Self.450: %E_where.type.c42 = bind_symbolic_name .Self [symbolic_self]
  1415. // CHECK:STDOUT: %.Self.as_type.450: type = facet_access_type %.Self.450 [symbolic_self]
  1416. // CHECK:STDOUT: %.Self.as_wit.iface0.b26: <witness> = facet_access_witness %.Self.450, element0 [symbolic_self]
  1417. // CHECK:STDOUT: %E.facet.8b4: %E.type = facet_value %.Self.as_type.450, (%.Self.as_wit.iface0.b26) [symbolic_self]
  1418. // CHECK:STDOUT: %impl.elem1.bae: type = impl_witness_access %.Self.as_wit.iface0.b26, element1 [symbolic_self]
  1419. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1420. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1421. // CHECK:STDOUT: %E_where.type.d43: type = facet_type <@E where %impl.elem1.bae = %i32 and %impl.elem0 = %empty_struct_type> [concrete]
  1422. // CHECK:STDOUT: %E_where.type.ca8: type = facet_type <@E where %impl.elem0 = %impl.elem1.7a9> [concrete]
  1423. // CHECK:STDOUT: }
  1424. // CHECK:STDOUT:
  1425. // CHECK:STDOUT: imports {
  1426. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1427. // CHECK:STDOUT: .Bool = %Core.Bool
  1428. // CHECK:STDOUT: .Float = %Core.Float
  1429. // CHECK:STDOUT: .Int = %Core.Int
  1430. // CHECK:STDOUT: import Core//prelude
  1431. // CHECK:STDOUT: import Core//prelude/...
  1432. // CHECK:STDOUT: }
  1433. // CHECK:STDOUT: }
  1434. // CHECK:STDOUT:
  1435. // CHECK:STDOUT: file {
  1436. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1437. // CHECK:STDOUT: .Core = imports.%Core
  1438. // CHECK:STDOUT: .E = %E.decl
  1439. // CHECK:STDOUT: .H = %H
  1440. // CHECK:STDOUT: .J = %J
  1441. // CHECK:STDOUT: .K = %K
  1442. // CHECK:STDOUT: }
  1443. // CHECK:STDOUT: %Core.import = import Core
  1444. // CHECK:STDOUT: %E.decl: type = interface_decl @E [concrete = constants.%E.type] {} {}
  1445. // CHECK:STDOUT: name_binding_decl {
  1446. // CHECK:STDOUT: %H.patt: %E_where.type.281 = binding_pattern H
  1447. // CHECK:STDOUT: }
  1448. // CHECK:STDOUT: %.loc15_11.1: type = splice_block %.loc15_11.2 [concrete = constants.%E_where.type.281] {
  1449. // CHECK:STDOUT: %E.ref.loc15: type = name_ref E, %E.decl [concrete = constants.%E.type]
  1450. // CHECK:STDOUT: %.Self.1: %E.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.da5]
  1451. // CHECK:STDOUT: %.Self.ref.loc15_17: %E.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self.da5]
  1452. // CHECK:STDOUT: %F.ref.loc15: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
  1453. // CHECK:STDOUT: %.Self.as_type.loc15_17: type = facet_access_type %.Self.ref.loc15_17 [symbolic_self = constants.%.Self.as_type.34e]
  1454. // CHECK:STDOUT: %.loc15_17: type = converted %.Self.ref.loc15_17, %.Self.as_type.loc15_17 [symbolic_self = constants.%.Self.as_type.34e]
  1455. // CHECK:STDOUT: %.Self.as_wit.iface0.loc15_17: <witness> = facet_access_witness %.Self.ref.loc15_17, element0 [symbolic_self = constants.%.Self.as_wit.iface0.7f0]
  1456. // CHECK:STDOUT: %impl.elem0.loc15: type = impl_witness_access %.Self.as_wit.iface0.loc15_17, element0 [symbolic_self = constants.%impl.elem0]
  1457. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
  1458. // CHECK:STDOUT: %.loc15_22.1: type = value_of_initializer %bool.make_type [concrete = bool]
  1459. // CHECK:STDOUT: %.loc15_22.2: type = converted %bool.make_type, %.loc15_22.1 [concrete = bool]
  1460. // CHECK:STDOUT: %.Self.ref.loc15_31: %E.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self.da5]
  1461. // CHECK:STDOUT: %G.ref.loc15: %E.assoc_type = name_ref G, @G.%assoc1 [concrete = constants.%assoc1]
  1462. // CHECK:STDOUT: %.Self.as_type.loc15_31: type = facet_access_type %.Self.ref.loc15_31 [symbolic_self = constants.%.Self.as_type.34e]
  1463. // CHECK:STDOUT: %.loc15_31: type = converted %.Self.ref.loc15_31, %.Self.as_type.loc15_31 [symbolic_self = constants.%.Self.as_type.34e]
  1464. // CHECK:STDOUT: %.Self.as_wit.iface0.loc15_31: <witness> = facet_access_witness %.Self.ref.loc15_31, element0 [symbolic_self = constants.%.Self.as_wit.iface0.7f0]
  1465. // CHECK:STDOUT: %impl.elem1.loc15: type = impl_witness_access %.Self.as_wit.iface0.loc15_31, element1 [symbolic_self = constants.%impl.elem1.7a9]
  1466. // CHECK:STDOUT: %.loc15_37.1: %empty_tuple.type = tuple_literal ()
  1467. // CHECK:STDOUT: %.loc15_37.2: type = converted %.loc15_37.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1468. // CHECK:STDOUT: %.loc15_11.2: type = where_expr %.Self.1 [concrete = constants.%E_where.type.281] {
  1469. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc15, %.loc15_22.2
  1470. // CHECK:STDOUT: requirement_rewrite %impl.elem1.loc15, %.loc15_37.2
  1471. // CHECK:STDOUT: }
  1472. // CHECK:STDOUT: }
  1473. // CHECK:STDOUT: %H: %E_where.type.281 = bind_name H, <error>
  1474. // CHECK:STDOUT: name_binding_decl {
  1475. // CHECK:STDOUT: %J.patt: %E_where.type.d43 = binding_pattern J
  1476. // CHECK:STDOUT: }
  1477. // CHECK:STDOUT: %.loc21_27.1: type = splice_block %.loc21_27.2 [concrete = constants.%E_where.type.d43] {
  1478. // CHECK:STDOUT: %E.ref.loc21: type = name_ref E, %E.decl [concrete = constants.%E.type]
  1479. // CHECK:STDOUT: %.Self.2: %E.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.da5]
  1480. // CHECK:STDOUT: %.Self.ref.loc21_18: %E.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.da5]
  1481. // CHECK:STDOUT: %F.ref.loc21: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
  1482. // CHECK:STDOUT: %.Self.as_type.loc21_18: type = facet_access_type %.Self.ref.loc21_18 [symbolic_self = constants.%.Self.as_type.34e]
  1483. // CHECK:STDOUT: %.loc21_18: type = converted %.Self.ref.loc21_18, %.Self.as_type.loc21_18 [symbolic_self = constants.%.Self.as_type.34e]
  1484. // CHECK:STDOUT: %.Self.as_wit.iface0.loc21_18: <witness> = facet_access_witness %.Self.ref.loc21_18, element0 [symbolic_self = constants.%.Self.as_wit.iface0.7f0]
  1485. // CHECK:STDOUT: %impl.elem0.loc21: type = impl_witness_access %.Self.as_wit.iface0.loc21_18, element0 [symbolic_self = constants.%impl.elem0]
  1486. // CHECK:STDOUT: %.loc21_24.1: %empty_struct_type = struct_literal ()
  1487. // CHECK:STDOUT: %.loc21_24.2: type = converted %.loc21_24.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  1488. // CHECK:STDOUT: %.loc21_12: type = where_expr %.Self.2 [concrete = constants.%E_where.type.c42] {
  1489. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc21, %.loc21_24.2
  1490. // CHECK:STDOUT: }
  1491. // CHECK:STDOUT: %.Self.3: %E_where.type.c42 = bind_symbolic_name .Self [symbolic_self = constants.%.Self.450]
  1492. // CHECK:STDOUT: %.Self.ref.loc21_33: %E_where.type.c42 = name_ref .Self, %.Self.3 [symbolic_self = constants.%.Self.450]
  1493. // CHECK:STDOUT: %G.ref.loc21: %E.assoc_type = name_ref G, @G.%assoc1 [concrete = constants.%assoc1]
  1494. // CHECK:STDOUT: %.Self.as_type.loc21_33: type = facet_access_type %.Self.ref.loc21_33 [symbolic_self = constants.%.Self.as_type.450]
  1495. // CHECK:STDOUT: %.loc21_33: type = converted %.Self.ref.loc21_33, %.Self.as_type.loc21_33 [symbolic_self = constants.%.Self.as_type.450]
  1496. // CHECK:STDOUT: %.Self.as_wit.iface0.loc21_33: <witness> = facet_access_witness %.Self.ref.loc21_33, element0 [symbolic_self = constants.%.Self.as_wit.iface0.b26]
  1497. // CHECK:STDOUT: %impl.elem1.loc21: type = impl_witness_access %.Self.as_wit.iface0.loc21_33, element1 [symbolic_self = constants.%impl.elem1.bae]
  1498. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1499. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1500. // CHECK:STDOUT: %.loc21_27.2: type = where_expr %.Self.3 [concrete = constants.%E_where.type.d43] {
  1501. // CHECK:STDOUT: requirement_rewrite %impl.elem1.loc21, %i32
  1502. // CHECK:STDOUT: }
  1503. // CHECK:STDOUT: }
  1504. // CHECK:STDOUT: %J: %E_where.type.d43 = bind_name J, <error>
  1505. // CHECK:STDOUT: name_binding_decl {
  1506. // CHECK:STDOUT: %K.patt: %E_where.type.ca8 = binding_pattern K
  1507. // CHECK:STDOUT: }
  1508. // CHECK:STDOUT: %.loc27_11.1: type = splice_block %.loc27_11.2 [concrete = constants.%E_where.type.ca8] {
  1509. // CHECK:STDOUT: %E.ref.loc27: type = name_ref E, %E.decl [concrete = constants.%E.type]
  1510. // CHECK:STDOUT: %.Self.4: %E.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.da5]
  1511. // CHECK:STDOUT: %.Self.ref.loc27_17: %E.type = name_ref .Self, %.Self.4 [symbolic_self = constants.%.Self.da5]
  1512. // CHECK:STDOUT: %F.ref.loc27: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
  1513. // CHECK:STDOUT: %.Self.as_type.loc27_17: type = facet_access_type %.Self.ref.loc27_17 [symbolic_self = constants.%.Self.as_type.34e]
  1514. // CHECK:STDOUT: %.loc27_17: type = converted %.Self.ref.loc27_17, %.Self.as_type.loc27_17 [symbolic_self = constants.%.Self.as_type.34e]
  1515. // CHECK:STDOUT: %.Self.as_wit.iface0.loc27_17: <witness> = facet_access_witness %.Self.ref.loc27_17, element0 [symbolic_self = constants.%.Self.as_wit.iface0.7f0]
  1516. // CHECK:STDOUT: %impl.elem0.loc27: type = impl_witness_access %.Self.as_wit.iface0.loc27_17, element0 [symbolic_self = constants.%impl.elem0]
  1517. // CHECK:STDOUT: %.Self.ref.loc27_22: %E.type = name_ref .Self, %.Self.4 [symbolic_self = constants.%.Self.da5]
  1518. // CHECK:STDOUT: %G.ref.loc27: %E.assoc_type = name_ref G, @G.%assoc1 [concrete = constants.%assoc1]
  1519. // CHECK:STDOUT: %.Self.as_type.loc27_27: type = facet_access_type %.Self.ref.loc27_22 [symbolic_self = constants.%.Self.as_type.34e]
  1520. // CHECK:STDOUT: %.loc27_27: type = converted %.Self.ref.loc27_22, %.Self.as_type.loc27_27 [symbolic_self = constants.%.Self.as_type.34e]
  1521. // CHECK:STDOUT: %.Self.as_wit.iface0.loc27_27: <witness> = facet_access_witness %.Self.ref.loc27_22, element0 [symbolic_self = constants.%.Self.as_wit.iface0.7f0]
  1522. // CHECK:STDOUT: %impl.elem1.loc27: type = impl_witness_access %.Self.as_wit.iface0.loc27_27, element1 [symbolic_self = constants.%impl.elem1.7a9]
  1523. // CHECK:STDOUT: %.loc27_11.2: type = where_expr %.Self.4 [concrete = constants.%E_where.type.ca8] {
  1524. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc27, %impl.elem1.loc27
  1525. // CHECK:STDOUT: }
  1526. // CHECK:STDOUT: }
  1527. // CHECK:STDOUT: %K: %E_where.type.ca8 = bind_name K, <error>
  1528. // CHECK:STDOUT: }
  1529. // CHECK:STDOUT:
  1530. // CHECK:STDOUT: interface @E {
  1531. // CHECK:STDOUT: %Self: %E.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1532. // CHECK:STDOUT: %F: type = assoc_const_decl @F [concrete] {
  1533. // CHECK:STDOUT: %assoc0: %E.assoc_type = assoc_entity element0, @E.%F [concrete = constants.%assoc0]
  1534. // CHECK:STDOUT: }
  1535. // CHECK:STDOUT: %G: type = assoc_const_decl @G [concrete] {
  1536. // CHECK:STDOUT: %assoc1: %E.assoc_type = assoc_entity element1, @E.%G [concrete = constants.%assoc1]
  1537. // CHECK:STDOUT: }
  1538. // CHECK:STDOUT:
  1539. // CHECK:STDOUT: !members:
  1540. // CHECK:STDOUT: .Self = %Self
  1541. // CHECK:STDOUT: .F = @F.%assoc0
  1542. // CHECK:STDOUT: .G = @G.%assoc1
  1543. // CHECK:STDOUT: witness = (%F, %G)
  1544. // CHECK:STDOUT: }
  1545. // CHECK:STDOUT:
  1546. // CHECK:STDOUT: generic assoc_const @F(@E.%Self: %E.type) {
  1547. // CHECK:STDOUT: assoc_const F:! type;
  1548. // CHECK:STDOUT: }
  1549. // CHECK:STDOUT:
  1550. // CHECK:STDOUT: generic assoc_const @G(@E.%Self: %E.type) {
  1551. // CHECK:STDOUT: assoc_const G:! type;
  1552. // CHECK:STDOUT: }
  1553. // CHECK:STDOUT:
  1554. // CHECK:STDOUT: fn @__global_init() {
  1555. // CHECK:STDOUT: !entry:
  1556. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  1557. // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [concrete = f64]
  1558. // CHECK:STDOUT: %bool.make_type.loc21: init type = call constants.%Bool() [concrete = bool]
  1559. // CHECK:STDOUT: %bool.make_type.loc27: init type = call constants.%Bool() [concrete = bool]
  1560. // CHECK:STDOUT: return
  1561. // CHECK:STDOUT: }
  1562. // CHECK:STDOUT:
  1563. // CHECK:STDOUT: specific @F(constants.%Self) {}
  1564. // CHECK:STDOUT:
  1565. // CHECK:STDOUT: specific @G(constants.%Self) {}
  1566. // CHECK:STDOUT:
  1567. // CHECK:STDOUT: specific @F(constants.%E.facet.99c) {}
  1568. // CHECK:STDOUT:
  1569. // CHECK:STDOUT: specific @G(constants.%E.facet.99c) {}
  1570. // CHECK:STDOUT:
  1571. // CHECK:STDOUT: specific @G(constants.%E.facet.8b4) {}
  1572. // CHECK:STDOUT: