equal_rewrite.carbon 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392
  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. // --- 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. // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `O where .(O.P) = bool` to `O where .(O.P) = i32` [ImplicitAsConversionFailure]
  53. // CHECK:STDERR: WithInteger(R);
  54. // CHECK:STDERR: ^~~~~~~~~~~~~~
  55. // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE+7]]:3: note: type `O where .(O.P) = bool` does not implement interface `Core.ImplicitAs(O where .(O.P) = i32)` [MissingImplInMemberAccessNote]
  56. // CHECK:STDERR: WithInteger(R);
  57. // CHECK:STDERR: ^~~~~~~~~~~~~~
  58. // CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE-9]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  59. // CHECK:STDERR: fn WithInteger(Q:! O where .P = i32) {}
  60. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  61. // CHECK:STDERR:
  62. WithInteger(R);
  63. }
  64. // --- fail_rewrites_mismatch_left.carbon
  65. library "[[@TEST_NAME]]";
  66. interface S {
  67. let T:! type;
  68. let U:! type;
  69. }
  70. fn WithT(V:! S where .T = ()) {}
  71. fn WithU(W:! S where .U = ()) {
  72. // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `S where .(S.U) = ()` to `S where .(S.T) = ()` [ImplicitAsConversionFailure]
  73. // CHECK:STDERR: WithT(W);
  74. // CHECK:STDERR: ^~~~~~~~
  75. // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE+7]]:3: note: type `S where .(S.U) = ()` does not implement interface `Core.ImplicitAs(S where .(S.T) = ())` [MissingImplInMemberAccessNote]
  76. // CHECK:STDERR: WithT(W);
  77. // CHECK:STDERR: ^~~~~~~~
  78. // CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE-9]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  79. // CHECK:STDERR: fn WithT(V:! S where .T = ()) {}
  80. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. // CHECK:STDERR:
  82. WithT(W);
  83. }
  84. // --- fail_import_rewrites.carbon
  85. library "[[@TEST_NAME]]";
  86. import library "equal_constraint";
  87. import library "nested_rewrites";
  88. fn Calls() {
  89. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+11]]:3: error: cannot implicitly convert from `type` to `N where .(N.P) = {}` [ImplicitAsConversionFailure]
  90. // CHECK:STDERR: Equal(bool);
  91. // CHECK:STDERR: ^~~~~~~~~~~
  92. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `Core.ImplicitAs(N where .(N.P) = {})` [MissingImplInMemberAccessNote]
  93. // CHECK:STDERR: Equal(bool);
  94. // CHECK:STDERR: ^~~~~~~~~~~
  95. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE-10]]:1: in import [InImport]
  96. // CHECK:STDERR: equal_constraint.carbon:8:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  97. // CHECK:STDERR: fn Equal(T:! N where .P = {});
  98. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  99. // CHECK:STDERR:
  100. Equal(bool);
  101. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+11]]:3: error: cannot implicitly convert from `type` to `A where .(A.C) = () and .(A.B) = bool` [ImplicitAsConversionFailure]
  102. // CHECK:STDERR: NestedRewrite(i32);
  103. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
  104. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `Core.ImplicitAs(A where .(A.C) = () and .(A.B) = bool)` [MissingImplInMemberAccessNote]
  105. // CHECK:STDERR: NestedRewrite(i32);
  106. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
  107. // CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE-23]]:1: in import [InImport]
  108. // CHECK:STDERR: nested_rewrites.carbon:9:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  109. // CHECK:STDERR: fn NestedRewrite(D:! (A where .B = bool) where .C = ());
  110. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  111. // CHECK:STDERR:
  112. NestedRewrite(i32);
  113. }
  114. // --- fail_check_rewrite_constraints.carbon
  115. library "[[@TEST_NAME]]";
  116. interface I {
  117. let Member:! type;
  118. }
  119. // `2` can't be converted to the type of `I.Member`
  120. // CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+7]]:46: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure]
  121. // CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2);
  122. // CHECK:STDERR: ^
  123. // CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+4]]:46: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
  124. // CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2);
  125. // CHECK:STDERR: ^
  126. // CHECK:STDERR:
  127. fn RewriteTypeMismatch(X:! I where .Member = 2);
  128. // --- fail_todo_let.carbon
  129. library "[[@TEST_NAME]]";
  130. interface A {}
  131. class D {}
  132. impl D as A {}
  133. // TODO: This should be a compile-time binding, once that is supported.
  134. // CHECK:STDERR: fail_todo_let.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `type` to `type where...` [ImplicitAsConversionFailure]
  135. // CHECK:STDERR: let B: type where .Self impls A = D;
  136. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  137. // CHECK:STDERR: fail_todo_let.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `Core.ImplicitAs(type where...)` [MissingImplInMemberAccessNote]
  138. // CHECK:STDERR: let B: type where .Self impls A = D;
  139. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  140. // CHECK:STDERR:
  141. let B: type where .Self impls A = D;
  142. // --- fail_type_does_not_implement_where.carbon
  143. library "[[@TEST_NAME]]";
  144. interface E {
  145. let F:! type;
  146. let G:! type;
  147. }
  148. // Testing how these types get stringified in error messages.
  149. // TODO: This should be a compile-time binding, once that is supported.
  150. // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `type` to `E where .(E.G) = () and .(E.F) = bool` [ImplicitAsConversionFailure]
  151. // CHECK:STDERR: let H: (E where .F = bool and .G = ()) = f64;
  152. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153. // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `Core.ImplicitAs(E where .(E.G) = () and .(E.F) = bool)` [MissingImplInMemberAccessNote]
  154. // CHECK:STDERR: let H: (E where .F = bool and .G = ()) = f64;
  155. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  156. // CHECK:STDERR:
  157. let H: (E where .F = bool and .G = ()) = f64;
  158. // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `type` to `E where .(E.G) = i32 and .(E.F) = {}` [ImplicitAsConversionFailure]
  159. // CHECK:STDERR: let J: ((E where .F = {}) where .G = i32) = bool;
  160. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  161. // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `Core.ImplicitAs(E where .(E.G) = i32 and .(E.F) = {})` [MissingImplInMemberAccessNote]
  162. // CHECK:STDERR: let J: ((E where .F = {}) where .G = i32) = bool;
  163. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  164. // CHECK:STDERR:
  165. let J: ((E where .F = {}) where .G = i32) = bool;
  166. // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `type` to `E where .(E.F) = .(E.G)` [ImplicitAsConversionFailure]
  167. // CHECK:STDERR: let K: (E where .F = .Self.G) = bool;
  168. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  169. // CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+3]]:1: note: type `type` does not implement interface `Core.ImplicitAs(E where .(E.F) = .(E.G))` [MissingImplInMemberAccessNote]
  170. // CHECK:STDERR: let K: (E where .F = .Self.G) = bool;
  171. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  172. let K: (E where .F = .Self.G) = bool;
  173. // CHECK:STDOUT: --- equal_constraint.carbon
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: constants {
  176. // CHECK:STDOUT: %N.type: type = facet_type <@N> [template]
  177. // CHECK:STDOUT: %Self: %N.type = bind_symbolic_name Self, 0 [symbolic]
  178. // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %N.type, type [template]
  179. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, @N.%P [template]
  180. // CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic]
  181. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self [symbolic]
  182. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic]
  183. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  184. // CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0 = %empty_struct_type> [template]
  185. // CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic]
  186. // CHECK:STDOUT: %T.patt: %N_where.type = symbolic_binding_pattern T, 0 [symbolic]
  187. // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [template]
  188. // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [template]
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT:
  191. // CHECK:STDOUT: imports {
  192. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  193. // CHECK:STDOUT: import Core//prelude
  194. // CHECK:STDOUT: import Core//prelude/...
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT: }
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: file {
  199. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  200. // CHECK:STDOUT: .Core = imports.%Core
  201. // CHECK:STDOUT: .N = %N.decl
  202. // CHECK:STDOUT: .Equal = %Equal.decl
  203. // CHECK:STDOUT: }
  204. // CHECK:STDOUT: %Core.import = import Core
  205. // CHECK:STDOUT: %N.decl: type = interface_decl @N [template = constants.%N.type] {} {}
  206. // CHECK:STDOUT: %Equal.decl: %Equal.type = fn_decl @Equal [template = constants.%Equal] {
  207. // CHECK:STDOUT: %T.patt.loc8_10.1: %N_where.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_10.2 (constants.%T.patt)]
  208. // CHECK:STDOUT: %T.param_patt: %N_where.type = value_param_pattern %T.patt.loc8_10.1, runtime_param<invalid> [symbolic = %T.patt.loc8_10.2 (constants.%T.patt)]
  209. // CHECK:STDOUT: } {
  210. // CHECK:STDOUT: %T.param: %N_where.type = value_param runtime_param<invalid>
  211. // CHECK:STDOUT: %.loc8_16.1: type = splice_block %.loc8_16.2 [template = constants.%N_where.type] {
  212. // CHECK:STDOUT: %N.ref: type = name_ref N, file.%N.decl [template = constants.%N.type]
  213. // CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  214. // CHECK:STDOUT: %.Self.ref: %N.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  215. // CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @N.%assoc0 [template = constants.%assoc0]
  216. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit]
  217. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0]
  218. // CHECK:STDOUT: %.loc8_28.1: %empty_struct_type = struct_literal ()
  219. // CHECK:STDOUT: %.loc8_28.2: type = converted %.loc8_28.1, constants.%empty_struct_type [template = constants.%empty_struct_type]
  220. // CHECK:STDOUT: %.loc8_16.2: type = where_expr %.Self [template = constants.%N_where.type] {
  221. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_28.2
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT: %T.loc8_10.1: %N_where.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_10.2 (constants.%T)]
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: interface @N {
  229. // CHECK:STDOUT: %Self: %N.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  230. // CHECK:STDOUT: %P: type = assoc_const_decl P [template]
  231. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %P [template = constants.%assoc0]
  232. // CHECK:STDOUT:
  233. // CHECK:STDOUT: !members:
  234. // CHECK:STDOUT: .Self = %Self
  235. // CHECK:STDOUT: .P = %assoc0
  236. // CHECK:STDOUT: witness = (%P)
  237. // CHECK:STDOUT: }
  238. // CHECK:STDOUT:
  239. // CHECK:STDOUT: generic fn @Equal(%T.loc8_10.1: %N_where.type) {
  240. // CHECK:STDOUT: %T.loc8_10.2: %N_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_10.2 (constants.%T)]
  241. // CHECK:STDOUT: %T.patt.loc8_10.2: %N_where.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_10.2 (constants.%T.patt)]
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: fn(%T.param_patt: %N_where.type);
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: specific @Equal(constants.%T) {
  247. // CHECK:STDOUT: %T.loc8_10.2 => constants.%T
  248. // CHECK:STDOUT: %T.patt.loc8_10.2 => constants.%T
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: --- nested_rewrites.carbon
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: constants {
  254. // CHECK:STDOUT: %A.type: type = facet_type <@A> [template]
  255. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic]
  256. // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %A.type, type [template]
  257. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, @A.%B [template]
  258. // CHECK:STDOUT: %assoc1: %assoc_type = assoc_entity element1, @A.%C [template]
  259. // CHECK:STDOUT: %.Self.3ca: %A.type = bind_symbolic_name .Self [symbolic]
  260. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  261. // CHECK:STDOUT: %.Self.as_wit.794: <witness> = facet_access_witness %.Self.3ca [symbolic]
  262. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.794, element0 [symbolic]
  263. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  264. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  265. // CHECK:STDOUT: %A_where.type.ef9: type = facet_type <@A where %impl.elem0 = bool> [template]
  266. // CHECK:STDOUT: %.Self.e46: %A_where.type.ef9 = bind_symbolic_name .Self [symbolic]
  267. // CHECK:STDOUT: %.Self.as_wit.a35: <witness> = facet_access_witness %.Self.e46 [symbolic]
  268. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.a35, element1 [symbolic]
  269. // CHECK:STDOUT: %A_where.type.791: type = facet_type <@A where %impl.elem1 = %empty_tuple.type and %impl.elem0 = bool> [template]
  270. // CHECK:STDOUT: %D: %A_where.type.791 = bind_symbolic_name D, 0 [symbolic]
  271. // CHECK:STDOUT: %D.patt: %A_where.type.791 = symbolic_binding_pattern D, 0 [symbolic]
  272. // CHECK:STDOUT: %NestedRewrite.type: type = fn_type @NestedRewrite [template]
  273. // CHECK:STDOUT: %NestedRewrite: %NestedRewrite.type = struct_value () [template]
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: imports {
  277. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  278. // CHECK:STDOUT: .Bool = %import_ref
  279. // CHECK:STDOUT: import Core//prelude
  280. // CHECK:STDOUT: import Core//prelude/...
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT: }
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: file {
  285. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  286. // CHECK:STDOUT: .Core = imports.%Core
  287. // CHECK:STDOUT: .A = %A.decl
  288. // CHECK:STDOUT: .NestedRewrite = %NestedRewrite.decl
  289. // CHECK:STDOUT: }
  290. // CHECK:STDOUT: %Core.import = import Core
  291. // CHECK:STDOUT: %A.decl: type = interface_decl @A [template = constants.%A.type] {} {}
  292. // CHECK:STDOUT: %NestedRewrite.decl: %NestedRewrite.type = fn_decl @NestedRewrite [template = constants.%NestedRewrite] {
  293. // CHECK:STDOUT: %D.patt.loc9_18.1: %A_where.type.791 = symbolic_binding_pattern D, 0 [symbolic = %D.patt.loc9_18.2 (constants.%D.patt)]
  294. // CHECK:STDOUT: %D.param_patt: %A_where.type.791 = value_param_pattern %D.patt.loc9_18.1, runtime_param<invalid> [symbolic = %D.patt.loc9_18.2 (constants.%D.patt)]
  295. // CHECK:STDOUT: } {
  296. // CHECK:STDOUT: %D.param: %A_where.type.791 = value_param runtime_param<invalid>
  297. // CHECK:STDOUT: %.loc9_42.1: type = splice_block %.loc9_42.2 [template = constants.%A_where.type.791] {
  298. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A.type]
  299. // CHECK:STDOUT: %.Self.1: %A.type = bind_symbolic_name .Self [symbolic = constants.%.Self.3ca]
  300. // CHECK:STDOUT: %.Self.ref.loc9_31: %A.type = name_ref .Self, %.Self.1 [symbolic = constants.%.Self.3ca]
  301. // CHECK:STDOUT: %B.ref: %assoc_type = name_ref B, @A.%assoc0 [template = constants.%assoc0]
  302. // CHECK:STDOUT: %.Self.as_wit.loc9_31: <witness> = facet_access_witness %.Self.ref.loc9_31 [symbolic = constants.%.Self.as_wit.794]
  303. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.loc9_31, element0 [symbolic = constants.%impl.elem0]
  304. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  305. // CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %bool.make_type [template = bool]
  306. // CHECK:STDOUT: %.loc9_36.2: type = converted %bool.make_type, %.loc9_36.1 [template = bool]
  307. // CHECK:STDOUT: %.loc9_25: type = where_expr %.Self.1 [template = constants.%A_where.type.ef9] {
  308. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_36.2
  309. // CHECK:STDOUT: }
  310. // CHECK:STDOUT: %.Self.2: %A_where.type.ef9 = bind_symbolic_name .Self [symbolic = constants.%.Self.e46]
  311. // CHECK:STDOUT: %.Self.ref.loc9_48: %A_where.type.ef9 = name_ref .Self, %.Self.2 [symbolic = constants.%.Self.e46]
  312. // CHECK:STDOUT: %C.ref: %assoc_type = name_ref C, @A.%assoc1 [template = constants.%assoc1]
  313. // CHECK:STDOUT: %.Self.as_wit.loc9_48: <witness> = facet_access_witness %.Self.ref.loc9_48 [symbolic = constants.%.Self.as_wit.a35]
  314. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.loc9_48, element1 [symbolic = constants.%impl.elem1]
  315. // CHECK:STDOUT: %.loc9_54.1: %empty_tuple.type = tuple_literal ()
  316. // CHECK:STDOUT: %.loc9_54.2: type = converted %.loc9_54.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  317. // CHECK:STDOUT: %.loc9_42.2: type = where_expr %.Self.2 [template = constants.%A_where.type.791] {
  318. // CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc9_54.2
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT: }
  321. // CHECK:STDOUT: %D.loc9_18.1: %A_where.type.791 = bind_symbolic_name D, 0, %D.param [symbolic = %D.loc9_18.2 (constants.%D)]
  322. // CHECK:STDOUT: }
  323. // CHECK:STDOUT: }
  324. // CHECK:STDOUT:
  325. // CHECK:STDOUT: interface @A {
  326. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  327. // CHECK:STDOUT: %B: type = assoc_const_decl B [template]
  328. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %B [template = constants.%assoc0]
  329. // CHECK:STDOUT: %C: type = assoc_const_decl C [template]
  330. // CHECK:STDOUT: %assoc1: %assoc_type = assoc_entity element1, %C [template = constants.%assoc1]
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: !members:
  333. // CHECK:STDOUT: .Self = %Self
  334. // CHECK:STDOUT: .B = %assoc0
  335. // CHECK:STDOUT: .C = %assoc1
  336. // CHECK:STDOUT: witness = (%B, %C)
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: generic fn @NestedRewrite(%D.loc9_18.1: %A_where.type.791) {
  340. // CHECK:STDOUT: %D.loc9_18.2: %A_where.type.791 = bind_symbolic_name D, 0 [symbolic = %D.loc9_18.2 (constants.%D)]
  341. // CHECK:STDOUT: %D.patt.loc9_18.2: %A_where.type.791 = symbolic_binding_pattern D, 0 [symbolic = %D.patt.loc9_18.2 (constants.%D.patt)]
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: fn(%D.param_patt: %A_where.type.791);
  344. // CHECK:STDOUT: }
  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
  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> [template]
  355. // CHECK:STDOUT: %Self: %E.type = bind_symbolic_name Self, 0 [symbolic]
  356. // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %E.type, type [template]
  357. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, @E.%F [template]
  358. // CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic]
  359. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  360. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self [symbolic]
  361. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic]
  362. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  363. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  364. // CHECK:STDOUT: %E_where.type: type = facet_type <@E where %impl.elem0 = %i32> [template]
  365. // CHECK:STDOUT: %G: %E_where.type = bind_symbolic_name G, 0 [symbolic]
  366. // CHECK:STDOUT: %G.patt: %E_where.type = symbolic_binding_pattern G, 0 [symbolic]
  367. // CHECK:STDOUT: %OneRewrite.type: type = fn_type @OneRewrite [template]
  368. // CHECK:STDOUT: %OneRewrite: %OneRewrite.type = struct_value () [template]
  369. // CHECK:STDOUT: %H: %E_where.type = bind_symbolic_name H, 0 [symbolic]
  370. // CHECK:STDOUT: %H.patt: %E_where.type = symbolic_binding_pattern H, 0 [symbolic]
  371. // CHECK:STDOUT: %RepeatedRewrite.type: type = fn_type @RepeatedRewrite [template]
  372. // CHECK:STDOUT: %RepeatedRewrite: %RepeatedRewrite.type = struct_value () [template]
  373. // CHECK:STDOUT: %OneRewrite.specific_fn.a2b: <specific function> = specific_function %OneRewrite, @OneRewrite(%H) [symbolic]
  374. // CHECK:STDOUT: %I: %E_where.type = bind_symbolic_name I, 0 [symbolic]
  375. // CHECK:STDOUT: %I.patt: %E_where.type = symbolic_binding_pattern I, 0 [symbolic]
  376. // CHECK:STDOUT: %OneRewriteAgain.type: type = fn_type @OneRewriteAgain [template]
  377. // CHECK:STDOUT: %OneRewriteAgain: %OneRewriteAgain.type = struct_value () [template]
  378. // CHECK:STDOUT: %RepeatedRewrite.specific_fn: <specific function> = specific_function %RepeatedRewrite, @RepeatedRewrite(%I) [symbolic]
  379. // CHECK:STDOUT: %OneRewrite.specific_fn.74a: <specific function> = specific_function %OneRewrite, @OneRewrite(%I) [symbolic]
  380. // CHECK:STDOUT: }
  381. // CHECK:STDOUT:
  382. // CHECK:STDOUT: imports {
  383. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  384. // CHECK:STDOUT: .Int = %import_ref.187
  385. // CHECK:STDOUT: import Core//prelude
  386. // CHECK:STDOUT: import Core//prelude/...
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT: }
  389. // CHECK:STDOUT:
  390. // CHECK:STDOUT: file {
  391. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  392. // CHECK:STDOUT: .Core = imports.%Core
  393. // CHECK:STDOUT: .E = %E.decl
  394. // CHECK:STDOUT: .OneRewrite = %OneRewrite.decl
  395. // CHECK:STDOUT: .RepeatedRewrite = %RepeatedRewrite.decl
  396. // CHECK:STDOUT: .OneRewriteAgain = %OneRewriteAgain.decl
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT: %Core.import = import Core
  399. // CHECK:STDOUT: %E.decl: type = interface_decl @E [template = constants.%E.type] {} {}
  400. // CHECK:STDOUT: %OneRewrite.decl: %OneRewrite.type = fn_decl @OneRewrite [template = constants.%OneRewrite] {
  401. // CHECK:STDOUT: %G.patt.loc8_15.1: %E_where.type = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc8_15.2 (constants.%G.patt)]
  402. // CHECK:STDOUT: %G.param_patt: %E_where.type = value_param_pattern %G.patt.loc8_15.1, runtime_param<invalid> [symbolic = %G.patt.loc8_15.2 (constants.%G.patt)]
  403. // CHECK:STDOUT: } {
  404. // CHECK:STDOUT: %G.param: %E_where.type = value_param runtime_param<invalid>
  405. // CHECK:STDOUT: %.loc8_21.1: type = splice_block %.loc8_21.2 [template = constants.%E_where.type] {
  406. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [template = constants.%E.type]
  407. // CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  408. // CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  409. // CHECK:STDOUT: %F.ref: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0]
  410. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit]
  411. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0]
  412. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  413. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  414. // CHECK:STDOUT: %.loc8_21.2: type = where_expr %.Self [template = constants.%E_where.type] {
  415. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  416. // CHECK:STDOUT: }
  417. // CHECK:STDOUT: }
  418. // CHECK:STDOUT: %G.loc8_15.1: %E_where.type = bind_symbolic_name G, 0, %G.param [symbolic = %G.loc8_15.2 (constants.%G)]
  419. // CHECK:STDOUT: }
  420. // CHECK:STDOUT: %RepeatedRewrite.decl: %RepeatedRewrite.type = fn_decl @RepeatedRewrite [template = constants.%RepeatedRewrite] {
  421. // CHECK:STDOUT: %H.patt.loc10_20.1: %E_where.type = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc10_20.2 (constants.%H.patt)]
  422. // CHECK:STDOUT: %H.param_patt: %E_where.type = value_param_pattern %H.patt.loc10_20.1, runtime_param<invalid> [symbolic = %H.patt.loc10_20.2 (constants.%H.patt)]
  423. // CHECK:STDOUT: } {
  424. // CHECK:STDOUT: %H.param: %E_where.type = value_param runtime_param<invalid>
  425. // CHECK:STDOUT: %.loc10_26.1: type = splice_block %.loc10_26.2 [template = constants.%E_where.type] {
  426. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [template = constants.%E.type]
  427. // CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  428. // CHECK:STDOUT: %.Self.ref.loc10_32: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  429. // CHECK:STDOUT: %F.ref.loc10_32: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0]
  430. // CHECK:STDOUT: %.Self.as_wit.loc10_32: <witness> = facet_access_witness %.Self.ref.loc10_32 [symbolic = constants.%.Self.as_wit]
  431. // CHECK:STDOUT: %impl.elem0.loc10_32: type = impl_witness_access %.Self.as_wit.loc10_32, element0 [symbolic = constants.%impl.elem0]
  432. // CHECK:STDOUT: %int_32.loc10_37: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  433. // CHECK:STDOUT: %i32.loc10_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  434. // CHECK:STDOUT: %.Self.ref.loc10_45: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  435. // CHECK:STDOUT: %F.ref.loc10_45: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0]
  436. // CHECK:STDOUT: %.Self.as_wit.loc10_45: <witness> = facet_access_witness %.Self.ref.loc10_45 [symbolic = constants.%.Self.as_wit]
  437. // CHECK:STDOUT: %impl.elem0.loc10_45: type = impl_witness_access %.Self.as_wit.loc10_45, element0 [symbolic = constants.%impl.elem0]
  438. // CHECK:STDOUT: %int_32.loc10_50: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  439. // CHECK:STDOUT: %i32.loc10_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  440. // CHECK:STDOUT: %.loc10_26.2: type = where_expr %.Self [template = constants.%E_where.type] {
  441. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_32, %i32.loc10_37
  442. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_45, %i32.loc10_50
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT: %H.loc10_20.1: %E_where.type = bind_symbolic_name H, 0, %H.param [symbolic = %H.loc10_20.2 (constants.%H)]
  446. // CHECK:STDOUT: }
  447. // CHECK:STDOUT: %OneRewriteAgain.decl: %OneRewriteAgain.type = fn_decl @OneRewriteAgain [template = constants.%OneRewriteAgain] {
  448. // CHECK:STDOUT: %I.patt.loc14_20.1: %E_where.type = symbolic_binding_pattern I, 0 [symbolic = %I.patt.loc14_20.2 (constants.%I.patt)]
  449. // CHECK:STDOUT: %I.param_patt: %E_where.type = value_param_pattern %I.patt.loc14_20.1, runtime_param<invalid> [symbolic = %I.patt.loc14_20.2 (constants.%I.patt)]
  450. // CHECK:STDOUT: } {
  451. // CHECK:STDOUT: %I.param: %E_where.type = value_param runtime_param<invalid>
  452. // CHECK:STDOUT: %.loc14_26.1: type = splice_block %.loc14_26.2 [template = constants.%E_where.type] {
  453. // CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [template = constants.%E.type]
  454. // CHECK:STDOUT: %.Self: %E.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  455. // CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  456. // CHECK:STDOUT: %F.ref: %assoc_type = name_ref F, @E.%assoc0 [template = constants.%assoc0]
  457. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit]
  458. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0]
  459. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  460. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  461. // CHECK:STDOUT: %.loc14_26.2: type = where_expr %.Self [template = constants.%E_where.type] {
  462. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  463. // CHECK:STDOUT: }
  464. // CHECK:STDOUT: }
  465. // CHECK:STDOUT: %I.loc14_20.1: %E_where.type = bind_symbolic_name I, 0, %I.param [symbolic = %I.loc14_20.2 (constants.%I)]
  466. // CHECK:STDOUT: }
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT:
  469. // CHECK:STDOUT: interface @E {
  470. // CHECK:STDOUT: %Self: %E.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  471. // CHECK:STDOUT: %F: type = assoc_const_decl F [template]
  472. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %F [template = constants.%assoc0]
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: !members:
  475. // CHECK:STDOUT: .Self = %Self
  476. // CHECK:STDOUT: .F = %assoc0
  477. // CHECK:STDOUT: witness = (%F)
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT:
  480. // CHECK:STDOUT: generic fn @OneRewrite(%G.loc8_15.1: %E_where.type) {
  481. // CHECK:STDOUT: %G.loc8_15.2: %E_where.type = bind_symbolic_name G, 0 [symbolic = %G.loc8_15.2 (constants.%G)]
  482. // CHECK:STDOUT: %G.patt.loc8_15.2: %E_where.type = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc8_15.2 (constants.%G.patt)]
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: !definition:
  485. // CHECK:STDOUT:
  486. // CHECK:STDOUT: fn(%G.param_patt: %E_where.type) {
  487. // CHECK:STDOUT: !entry:
  488. // CHECK:STDOUT: return
  489. // CHECK:STDOUT: }
  490. // CHECK:STDOUT: }
  491. // CHECK:STDOUT:
  492. // CHECK:STDOUT: generic fn @RepeatedRewrite(%H.loc10_20.1: %E_where.type) {
  493. // CHECK:STDOUT: %H.loc10_20.2: %E_where.type = bind_symbolic_name H, 0 [symbolic = %H.loc10_20.2 (constants.%H)]
  494. // CHECK:STDOUT: %H.patt.loc10_20.2: %E_where.type = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc10_20.2 (constants.%H.patt)]
  495. // CHECK:STDOUT:
  496. // CHECK:STDOUT: !definition:
  497. // 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.a2b)]
  498. // CHECK:STDOUT:
  499. // CHECK:STDOUT: fn(%H.param_patt: %E_where.type) {
  500. // CHECK:STDOUT: !entry:
  501. // CHECK:STDOUT: %OneRewrite.ref: %OneRewrite.type = name_ref OneRewrite, file.%OneRewrite.decl [template = constants.%OneRewrite]
  502. // CHECK:STDOUT: %H.ref: %E_where.type = name_ref H, %H.loc10_20.1 [symbolic = %H.loc10_20.2 (constants.%H)]
  503. // 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.a2b)]
  504. // CHECK:STDOUT: %OneRewrite.call: init %empty_tuple.type = call %OneRewrite.specific_fn.loc11_3.1()
  505. // CHECK:STDOUT: return
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT: }
  508. // CHECK:STDOUT:
  509. // CHECK:STDOUT: generic fn @OneRewriteAgain(%I.loc14_20.1: %E_where.type) {
  510. // CHECK:STDOUT: %I.loc14_20.2: %E_where.type = bind_symbolic_name I, 0 [symbolic = %I.loc14_20.2 (constants.%I)]
  511. // CHECK:STDOUT: %I.patt.loc14_20.2: %E_where.type = symbolic_binding_pattern I, 0 [symbolic = %I.patt.loc14_20.2 (constants.%I.patt)]
  512. // CHECK:STDOUT:
  513. // CHECK:STDOUT: !definition:
  514. // 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)]
  515. // CHECK:STDOUT:
  516. // CHECK:STDOUT: fn(%I.param_patt: %E_where.type) {
  517. // CHECK:STDOUT: !entry:
  518. // CHECK:STDOUT: %RepeatedRewrite.ref: %RepeatedRewrite.type = name_ref RepeatedRewrite, file.%RepeatedRewrite.decl [template = constants.%RepeatedRewrite]
  519. // CHECK:STDOUT: %I.ref: %E_where.type = name_ref I, %I.loc14_20.1 [symbolic = %I.loc14_20.2 (constants.%I)]
  520. // 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)]
  521. // CHECK:STDOUT: %RepeatedRewrite.call: init %empty_tuple.type = call %RepeatedRewrite.specific_fn.loc15_3.1()
  522. // CHECK:STDOUT: return
  523. // CHECK:STDOUT: }
  524. // CHECK:STDOUT: }
  525. // CHECK:STDOUT:
  526. // CHECK:STDOUT: specific @OneRewrite(constants.%G) {
  527. // CHECK:STDOUT: %G.loc8_15.2 => constants.%G
  528. // CHECK:STDOUT: %G.patt.loc8_15.2 => constants.%G
  529. // CHECK:STDOUT: }
  530. // CHECK:STDOUT:
  531. // CHECK:STDOUT: specific @RepeatedRewrite(constants.%H) {
  532. // CHECK:STDOUT: %H.loc10_20.2 => constants.%H
  533. // CHECK:STDOUT: %H.patt.loc10_20.2 => constants.%H
  534. // CHECK:STDOUT: }
  535. // CHECK:STDOUT:
  536. // CHECK:STDOUT: specific @OneRewrite(constants.%H) {
  537. // CHECK:STDOUT: %G.loc8_15.2 => constants.%H
  538. // CHECK:STDOUT: %G.patt.loc8_15.2 => constants.%H
  539. // CHECK:STDOUT:
  540. // CHECK:STDOUT: !definition:
  541. // CHECK:STDOUT: }
  542. // CHECK:STDOUT:
  543. // CHECK:STDOUT: specific @OneRewrite(@RepeatedRewrite.%H.loc10_20.2) {}
  544. // CHECK:STDOUT:
  545. // CHECK:STDOUT: specific @OneRewriteAgain(constants.%I) {
  546. // CHECK:STDOUT: %I.loc14_20.2 => constants.%I
  547. // CHECK:STDOUT: %I.patt.loc14_20.2 => constants.%I
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT:
  550. // CHECK:STDOUT: specific @RepeatedRewrite(constants.%I) {
  551. // CHECK:STDOUT: %H.loc10_20.2 => constants.%I
  552. // CHECK:STDOUT: %H.patt.loc10_20.2 => constants.%I
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: !definition:
  555. // CHECK:STDOUT: %OneRewrite.specific_fn.loc11_3.2 => constants.%OneRewrite.specific_fn.74a
  556. // CHECK:STDOUT: }
  557. // CHECK:STDOUT:
  558. // CHECK:STDOUT: specific @RepeatedRewrite(@OneRewriteAgain.%I.loc14_20.2) {}
  559. // CHECK:STDOUT:
  560. // CHECK:STDOUT: specific @OneRewrite(constants.%I) {
  561. // CHECK:STDOUT: %G.loc8_15.2 => constants.%I
  562. // CHECK:STDOUT: %G.patt.loc8_15.2 => constants.%I
  563. // CHECK:STDOUT: }
  564. // CHECK:STDOUT:
  565. // CHECK:STDOUT: --- rewrites_reordered.carbon
  566. // CHECK:STDOUT:
  567. // CHECK:STDOUT: constants {
  568. // CHECK:STDOUT: %J.type: type = facet_type <@J> [template]
  569. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic]
  570. // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %J.type, type [template]
  571. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, @J.%K [template]
  572. // CHECK:STDOUT: %assoc1: %assoc_type = assoc_entity element1, @J.%L [template]
  573. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic]
  574. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  575. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self [symbolic]
  576. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic]
  577. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit, element1 [symbolic]
  578. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  579. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  580. // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem1 = bool and %impl.elem0 = %empty_tuple.type> [template]
  581. // CHECK:STDOUT: %M: %J_where.type = bind_symbolic_name M, 0 [symbolic]
  582. // CHECK:STDOUT: %M.patt: %J_where.type = symbolic_binding_pattern M, 0 [symbolic]
  583. // CHECK:STDOUT: %Alphabetical.type: type = fn_type @Alphabetical [template]
  584. // CHECK:STDOUT: %Alphabetical: %Alphabetical.type = struct_value () [template]
  585. // CHECK:STDOUT: %N: %J_where.type = bind_symbolic_name N, 0 [symbolic]
  586. // CHECK:STDOUT: %N.patt: %J_where.type = symbolic_binding_pattern N, 0 [symbolic]
  587. // CHECK:STDOUT: %Reversed.type: type = fn_type @Reversed [template]
  588. // CHECK:STDOUT: %Reversed: %Reversed.type = struct_value () [template]
  589. // CHECK:STDOUT: %Alphabetical.specific_fn: <specific function> = specific_function %Alphabetical, @Alphabetical(%N) [symbolic]
  590. // CHECK:STDOUT: }
  591. // CHECK:STDOUT:
  592. // CHECK:STDOUT: imports {
  593. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  594. // CHECK:STDOUT: .Bool = %import_ref
  595. // CHECK:STDOUT: import Core//prelude
  596. // CHECK:STDOUT: import Core//prelude/...
  597. // CHECK:STDOUT: }
  598. // CHECK:STDOUT: }
  599. // CHECK:STDOUT:
  600. // CHECK:STDOUT: file {
  601. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  602. // CHECK:STDOUT: .Core = imports.%Core
  603. // CHECK:STDOUT: .J = %J.decl
  604. // CHECK:STDOUT: .Alphabetical = %Alphabetical.decl
  605. // CHECK:STDOUT: .Reversed = %Reversed.decl
  606. // CHECK:STDOUT: }
  607. // CHECK:STDOUT: %Core.import = import Core
  608. // CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%J.type] {} {}
  609. // CHECK:STDOUT: %Alphabetical.decl: %Alphabetical.type = fn_decl @Alphabetical [template = constants.%Alphabetical] {
  610. // CHECK:STDOUT: %M.patt.loc9_17.1: %J_where.type = symbolic_binding_pattern M, 0 [symbolic = %M.patt.loc9_17.2 (constants.%M.patt)]
  611. // CHECK:STDOUT: %M.param_patt: %J_where.type = value_param_pattern %M.patt.loc9_17.1, runtime_param<invalid> [symbolic = %M.patt.loc9_17.2 (constants.%M.patt)]
  612. // CHECK:STDOUT: } {
  613. // CHECK:STDOUT: %M.param: %J_where.type = value_param runtime_param<invalid>
  614. // CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [template = constants.%J_where.type] {
  615. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type]
  616. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  617. // CHECK:STDOUT: %.Self.ref.loc9_29: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  618. // CHECK:STDOUT: %K.ref: %assoc_type = name_ref K, @J.%assoc0 [template = constants.%assoc0]
  619. // CHECK:STDOUT: %.Self.as_wit.loc9_29: <witness> = facet_access_witness %.Self.ref.loc9_29 [symbolic = constants.%.Self.as_wit]
  620. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.loc9_29, element0 [symbolic = constants.%impl.elem0]
  621. // CHECK:STDOUT: %.loc9_35.1: %empty_tuple.type = tuple_literal ()
  622. // CHECK:STDOUT: %.loc9_35.2: type = converted %.loc9_35.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  623. // CHECK:STDOUT: %.Self.ref.loc9_41: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  624. // CHECK:STDOUT: %L.ref: %assoc_type = name_ref L, @J.%assoc1 [template = constants.%assoc1]
  625. // CHECK:STDOUT: %.Self.as_wit.loc9_41: <witness> = facet_access_witness %.Self.ref.loc9_41 [symbolic = constants.%.Self.as_wit]
  626. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.loc9_41, element1 [symbolic = constants.%impl.elem1]
  627. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  628. // CHECK:STDOUT: %.loc9_46.1: type = value_of_initializer %bool.make_type [template = bool]
  629. // CHECK:STDOUT: %.loc9_46.2: type = converted %bool.make_type, %.loc9_46.1 [template = bool]
  630. // CHECK:STDOUT: %.loc9_23.2: type = where_expr %.Self [template = constants.%J_where.type] {
  631. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_35.2
  632. // CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc9_46.2
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT: }
  635. // CHECK:STDOUT: %M.loc9_17.1: %J_where.type = bind_symbolic_name M, 0, %M.param [symbolic = %M.loc9_17.2 (constants.%M)]
  636. // CHECK:STDOUT: }
  637. // CHECK:STDOUT: %Reversed.decl: %Reversed.type = fn_decl @Reversed [template = constants.%Reversed] {
  638. // CHECK:STDOUT: %N.patt.loc11_13.1: %J_where.type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)]
  639. // CHECK:STDOUT: %N.param_patt: %J_where.type = value_param_pattern %N.patt.loc11_13.1, runtime_param<invalid> [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)]
  640. // CHECK:STDOUT: } {
  641. // CHECK:STDOUT: %N.param: %J_where.type = value_param runtime_param<invalid>
  642. // CHECK:STDOUT: %.loc11_19.1: type = splice_block %.loc11_19.2 [template = constants.%J_where.type] {
  643. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type]
  644. // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  645. // CHECK:STDOUT: %.Self.ref.loc11_25: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  646. // CHECK:STDOUT: %L.ref: %assoc_type = name_ref L, @J.%assoc1 [template = constants.%assoc1]
  647. // CHECK:STDOUT: %.Self.as_wit.loc11_25: <witness> = facet_access_witness %.Self.ref.loc11_25 [symbolic = constants.%.Self.as_wit]
  648. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.loc11_25, element1 [symbolic = constants.%impl.elem1]
  649. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  650. // CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %bool.make_type [template = bool]
  651. // CHECK:STDOUT: %.loc11_30.2: type = converted %bool.make_type, %.loc11_30.1 [template = bool]
  652. // CHECK:STDOUT: %.Self.ref.loc11_39: %J.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  653. // CHECK:STDOUT: %K.ref: %assoc_type = name_ref K, @J.%assoc0 [template = constants.%assoc0]
  654. // CHECK:STDOUT: %.Self.as_wit.loc11_39: <witness> = facet_access_witness %.Self.ref.loc11_39 [symbolic = constants.%.Self.as_wit]
  655. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.loc11_39, element0 [symbolic = constants.%impl.elem0]
  656. // CHECK:STDOUT: %.loc11_45.1: %empty_tuple.type = tuple_literal ()
  657. // CHECK:STDOUT: %.loc11_45.2: type = converted %.loc11_45.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  658. // CHECK:STDOUT: %.loc11_19.2: type = where_expr %.Self [template = constants.%J_where.type] {
  659. // CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc11_30.2
  660. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc11_45.2
  661. // CHECK:STDOUT: }
  662. // CHECK:STDOUT: }
  663. // CHECK:STDOUT: %N.loc11_13.1: %J_where.type = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc11_13.2 (constants.%N)]
  664. // CHECK:STDOUT: }
  665. // CHECK:STDOUT: }
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: interface @J {
  668. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  669. // CHECK:STDOUT: %K: type = assoc_const_decl K [template]
  670. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %K [template = constants.%assoc0]
  671. // CHECK:STDOUT: %L: type = assoc_const_decl L [template]
  672. // CHECK:STDOUT: %assoc1: %assoc_type = assoc_entity element1, %L [template = constants.%assoc1]
  673. // CHECK:STDOUT:
  674. // CHECK:STDOUT: !members:
  675. // CHECK:STDOUT: .Self = %Self
  676. // CHECK:STDOUT: .K = %assoc0
  677. // CHECK:STDOUT: .L = %assoc1
  678. // CHECK:STDOUT: witness = (%K, %L)
  679. // CHECK:STDOUT: }
  680. // CHECK:STDOUT:
  681. // CHECK:STDOUT: generic fn @Alphabetical(%M.loc9_17.1: %J_where.type) {
  682. // CHECK:STDOUT: %M.loc9_17.2: %J_where.type = bind_symbolic_name M, 0 [symbolic = %M.loc9_17.2 (constants.%M)]
  683. // CHECK:STDOUT: %M.patt.loc9_17.2: %J_where.type = symbolic_binding_pattern M, 0 [symbolic = %M.patt.loc9_17.2 (constants.%M.patt)]
  684. // CHECK:STDOUT:
  685. // CHECK:STDOUT: !definition:
  686. // CHECK:STDOUT:
  687. // CHECK:STDOUT: fn(%M.param_patt: %J_where.type) {
  688. // CHECK:STDOUT: !entry:
  689. // CHECK:STDOUT: return
  690. // CHECK:STDOUT: }
  691. // CHECK:STDOUT: }
  692. // CHECK:STDOUT:
  693. // CHECK:STDOUT: generic fn @Reversed(%N.loc11_13.1: %J_where.type) {
  694. // CHECK:STDOUT: %N.loc11_13.2: %J_where.type = bind_symbolic_name N, 0 [symbolic = %N.loc11_13.2 (constants.%N)]
  695. // CHECK:STDOUT: %N.patt.loc11_13.2: %J_where.type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)]
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: !definition:
  698. // 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)]
  699. // CHECK:STDOUT:
  700. // CHECK:STDOUT: fn(%N.param_patt: %J_where.type) {
  701. // CHECK:STDOUT: !entry:
  702. // CHECK:STDOUT: %Alphabetical.ref: %Alphabetical.type = name_ref Alphabetical, file.%Alphabetical.decl [template = constants.%Alphabetical]
  703. // CHECK:STDOUT: %N.ref: %J_where.type = name_ref N, %N.loc11_13.1 [symbolic = %N.loc11_13.2 (constants.%N)]
  704. // 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)]
  705. // CHECK:STDOUT: %Alphabetical.call: init %empty_tuple.type = call %Alphabetical.specific_fn.loc12_3.1()
  706. // CHECK:STDOUT: return
  707. // CHECK:STDOUT: }
  708. // CHECK:STDOUT: }
  709. // CHECK:STDOUT:
  710. // CHECK:STDOUT: specific @Alphabetical(constants.%M) {
  711. // CHECK:STDOUT: %M.loc9_17.2 => constants.%M
  712. // CHECK:STDOUT: %M.patt.loc9_17.2 => constants.%M
  713. // CHECK:STDOUT: }
  714. // CHECK:STDOUT:
  715. // CHECK:STDOUT: specific @Reversed(constants.%N) {
  716. // CHECK:STDOUT: %N.loc11_13.2 => constants.%N
  717. // CHECK:STDOUT: %N.patt.loc11_13.2 => constants.%N
  718. // CHECK:STDOUT: }
  719. // CHECK:STDOUT:
  720. // CHECK:STDOUT: specific @Alphabetical(constants.%N) {
  721. // CHECK:STDOUT: %M.loc9_17.2 => constants.%N
  722. // CHECK:STDOUT: %M.patt.loc9_17.2 => constants.%N
  723. // CHECK:STDOUT:
  724. // CHECK:STDOUT: !definition:
  725. // CHECK:STDOUT: }
  726. // CHECK:STDOUT:
  727. // CHECK:STDOUT: specific @Alphabetical(@Reversed.%N.loc11_13.2) {}
  728. // CHECK:STDOUT:
  729. // CHECK:STDOUT: --- fail_rewrites_mismatch_right.carbon
  730. // CHECK:STDOUT:
  731. // CHECK:STDOUT: constants {
  732. // CHECK:STDOUT: %O.type: type = facet_type <@O> [template]
  733. // CHECK:STDOUT: %Self.75a: %O.type = bind_symbolic_name Self, 0 [symbolic]
  734. // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %O.type, type [template]
  735. // CHECK:STDOUT: %assoc0.20f: %assoc_type = assoc_entity element0, @O.%P [template]
  736. // CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic]
  737. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self [symbolic]
  738. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic]
  739. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  740. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  741. // CHECK:STDOUT: %O_where.type.a0c: type = facet_type <@O where %impl.elem0 = %i32> [template]
  742. // CHECK:STDOUT: %Q: %O_where.type.a0c = bind_symbolic_name Q, 0 [symbolic]
  743. // CHECK:STDOUT: %Q.patt: %O_where.type.a0c = symbolic_binding_pattern Q, 0 [symbolic]
  744. // CHECK:STDOUT: %WithInteger.type: type = fn_type @WithInteger [template]
  745. // CHECK:STDOUT: %WithInteger: %WithInteger.type = struct_value () [template]
  746. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  747. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  748. // CHECK:STDOUT: %O_where.type.0f2: type = facet_type <@O where %impl.elem0 = bool> [template]
  749. // CHECK:STDOUT: %R: %O_where.type.0f2 = bind_symbolic_name R, 0 [symbolic]
  750. // CHECK:STDOUT: %R.patt: %O_where.type.0f2 = symbolic_binding_pattern R, 0 [symbolic]
  751. // CHECK:STDOUT: %WithBool.type: type = fn_type @WithBool [template]
  752. // CHECK:STDOUT: %WithBool: %WithBool.type = struct_value () [template]
  753. // CHECK:STDOUT: }
  754. // CHECK:STDOUT:
  755. // CHECK:STDOUT: imports {
  756. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  757. // CHECK:STDOUT: .Int = %import_ref.187
  758. // CHECK:STDOUT: .Bool = %import_ref.f7c
  759. // CHECK:STDOUT: .ImplicitAs = %import_ref.a69
  760. // CHECK:STDOUT: import Core//prelude
  761. // CHECK:STDOUT: import Core//prelude/...
  762. // CHECK:STDOUT: }
  763. // CHECK:STDOUT: }
  764. // CHECK:STDOUT:
  765. // CHECK:STDOUT: file {
  766. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  767. // CHECK:STDOUT: .Core = imports.%Core
  768. // CHECK:STDOUT: .O = %O.decl
  769. // CHECK:STDOUT: .WithInteger = %WithInteger.decl
  770. // CHECK:STDOUT: .WithBool = %WithBool.decl
  771. // CHECK:STDOUT: }
  772. // CHECK:STDOUT: %Core.import = import Core
  773. // CHECK:STDOUT: %O.decl: type = interface_decl @O [template = constants.%O.type] {} {}
  774. // CHECK:STDOUT: %WithInteger.decl: %WithInteger.type = fn_decl @WithInteger [template = constants.%WithInteger] {
  775. // CHECK:STDOUT: %Q.patt.loc8_16.1: %O_where.type.a0c = symbolic_binding_pattern Q, 0 [symbolic = %Q.patt.loc8_16.2 (constants.%Q.patt)]
  776. // CHECK:STDOUT: %Q.param_patt: %O_where.type.a0c = value_param_pattern %Q.patt.loc8_16.1, runtime_param<invalid> [symbolic = %Q.patt.loc8_16.2 (constants.%Q.patt)]
  777. // CHECK:STDOUT: } {
  778. // CHECK:STDOUT: %Q.param: %O_where.type.a0c = value_param runtime_param<invalid>
  779. // CHECK:STDOUT: %.loc8_22.1: type = splice_block %.loc8_22.2 [template = constants.%O_where.type.a0c] {
  780. // CHECK:STDOUT: %O.ref: type = name_ref O, file.%O.decl [template = constants.%O.type]
  781. // CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  782. // CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  783. // CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @O.%assoc0 [template = constants.%assoc0.20f]
  784. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit]
  785. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0]
  786. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  787. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  788. // CHECK:STDOUT: %.loc8_22.2: type = where_expr %.Self [template = constants.%O_where.type.a0c] {
  789. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32
  790. // CHECK:STDOUT: }
  791. // CHECK:STDOUT: }
  792. // CHECK:STDOUT: %Q.loc8_16.1: %O_where.type.a0c = bind_symbolic_name Q, 0, %Q.param [symbolic = %Q.loc8_16.2 (constants.%Q)]
  793. // CHECK:STDOUT: }
  794. // CHECK:STDOUT: %WithBool.decl: %WithBool.type = fn_decl @WithBool [template = constants.%WithBool] {
  795. // CHECK:STDOUT: %R.patt.loc10_13.1: %O_where.type.0f2 = symbolic_binding_pattern R, 0 [symbolic = %R.patt.loc10_13.2 (constants.%R.patt)]
  796. // CHECK:STDOUT: %R.param_patt: %O_where.type.0f2 = value_param_pattern %R.patt.loc10_13.1, runtime_param<invalid> [symbolic = %R.patt.loc10_13.2 (constants.%R.patt)]
  797. // CHECK:STDOUT: } {
  798. // CHECK:STDOUT: %R.param: %O_where.type.0f2 = value_param runtime_param<invalid>
  799. // CHECK:STDOUT: %.loc10_19.1: type = splice_block %.loc10_19.2 [template = constants.%O_where.type.0f2] {
  800. // CHECK:STDOUT: %O.ref: type = name_ref O, file.%O.decl [template = constants.%O.type]
  801. // CHECK:STDOUT: %.Self: %O.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  802. // CHECK:STDOUT: %.Self.ref: %O.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  803. // CHECK:STDOUT: %P.ref: %assoc_type = name_ref P, @O.%assoc0 [template = constants.%assoc0.20f]
  804. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit]
  805. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0]
  806. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  807. // CHECK:STDOUT: %.loc10_30.1: type = value_of_initializer %bool.make_type [template = bool]
  808. // CHECK:STDOUT: %.loc10_30.2: type = converted %bool.make_type, %.loc10_30.1 [template = bool]
  809. // CHECK:STDOUT: %.loc10_19.2: type = where_expr %.Self [template = constants.%O_where.type.0f2] {
  810. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_30.2
  811. // CHECK:STDOUT: }
  812. // CHECK:STDOUT: }
  813. // CHECK:STDOUT: %R.loc10_13.1: %O_where.type.0f2 = bind_symbolic_name R, 0, %R.param [symbolic = %R.loc10_13.2 (constants.%R)]
  814. // CHECK:STDOUT: }
  815. // CHECK:STDOUT: }
  816. // CHECK:STDOUT:
  817. // CHECK:STDOUT: interface @O {
  818. // CHECK:STDOUT: %Self: %O.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.75a]
  819. // CHECK:STDOUT: %P: type = assoc_const_decl P [template]
  820. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %P [template = constants.%assoc0.20f]
  821. // CHECK:STDOUT:
  822. // CHECK:STDOUT: !members:
  823. // CHECK:STDOUT: .Self = %Self
  824. // CHECK:STDOUT: .P = %assoc0
  825. // CHECK:STDOUT: witness = (%P)
  826. // CHECK:STDOUT: }
  827. // CHECK:STDOUT:
  828. // CHECK:STDOUT: generic fn @WithInteger(%Q.loc8_16.1: %O_where.type.a0c) {
  829. // CHECK:STDOUT: %Q.loc8_16.2: %O_where.type.a0c = bind_symbolic_name Q, 0 [symbolic = %Q.loc8_16.2 (constants.%Q)]
  830. // CHECK:STDOUT: %Q.patt.loc8_16.2: %O_where.type.a0c = symbolic_binding_pattern Q, 0 [symbolic = %Q.patt.loc8_16.2 (constants.%Q.patt)]
  831. // CHECK:STDOUT:
  832. // CHECK:STDOUT: !definition:
  833. // CHECK:STDOUT:
  834. // CHECK:STDOUT: fn(%Q.param_patt: %O_where.type.a0c) {
  835. // CHECK:STDOUT: !entry:
  836. // CHECK:STDOUT: return
  837. // CHECK:STDOUT: }
  838. // CHECK:STDOUT: }
  839. // CHECK:STDOUT:
  840. // CHECK:STDOUT: generic fn @WithBool(%R.loc10_13.1: %O_where.type.0f2) {
  841. // CHECK:STDOUT: %R.loc10_13.2: %O_where.type.0f2 = bind_symbolic_name R, 0 [symbolic = %R.loc10_13.2 (constants.%R)]
  842. // CHECK:STDOUT: %R.patt.loc10_13.2: %O_where.type.0f2 = symbolic_binding_pattern R, 0 [symbolic = %R.patt.loc10_13.2 (constants.%R.patt)]
  843. // CHECK:STDOUT:
  844. // CHECK:STDOUT: !definition:
  845. // CHECK:STDOUT:
  846. // CHECK:STDOUT: fn(%R.param_patt: %O_where.type.0f2) {
  847. // CHECK:STDOUT: !entry:
  848. // CHECK:STDOUT: %WithInteger.ref: %WithInteger.type = name_ref WithInteger, file.%WithInteger.decl [template = constants.%WithInteger]
  849. // CHECK:STDOUT: %R.ref: %O_where.type.0f2 = name_ref R, %R.loc10_13.1 [symbolic = %R.loc10_13.2 (constants.%R)]
  850. // CHECK:STDOUT: %.loc21: %O_where.type.a0c = converted %R.ref, <error> [template = <error>]
  851. // CHECK:STDOUT: return
  852. // CHECK:STDOUT: }
  853. // CHECK:STDOUT: }
  854. // CHECK:STDOUT:
  855. // CHECK:STDOUT: specific @WithInteger(constants.%Q) {
  856. // CHECK:STDOUT: %Q.loc8_16.2 => constants.%Q
  857. // CHECK:STDOUT: %Q.patt.loc8_16.2 => constants.%Q
  858. // CHECK:STDOUT: }
  859. // CHECK:STDOUT:
  860. // CHECK:STDOUT: specific @WithBool(constants.%R) {
  861. // CHECK:STDOUT: %R.loc10_13.2 => constants.%R
  862. // CHECK:STDOUT: %R.patt.loc10_13.2 => constants.%R
  863. // CHECK:STDOUT: }
  864. // CHECK:STDOUT:
  865. // CHECK:STDOUT: --- fail_rewrites_mismatch_left.carbon
  866. // CHECK:STDOUT:
  867. // CHECK:STDOUT: constants {
  868. // CHECK:STDOUT: %S.type: type = facet_type <@S> [template]
  869. // CHECK:STDOUT: %Self.27b: %S.type = bind_symbolic_name Self, 0 [symbolic]
  870. // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %S.type, type [template]
  871. // CHECK:STDOUT: %assoc0.e49: %assoc_type = assoc_entity element0, @S.%T [template]
  872. // CHECK:STDOUT: %assoc1: %assoc_type = assoc_entity element1, @S.%U [template]
  873. // CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic]
  874. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  875. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self [symbolic]
  876. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic]
  877. // CHECK:STDOUT: %S_where.type.e40: type = facet_type <@S where %impl.elem0 = %empty_tuple.type> [template]
  878. // CHECK:STDOUT: %V: %S_where.type.e40 = bind_symbolic_name V, 0 [symbolic]
  879. // CHECK:STDOUT: %V.patt: %S_where.type.e40 = symbolic_binding_pattern V, 0 [symbolic]
  880. // CHECK:STDOUT: %WithT.type: type = fn_type @WithT [template]
  881. // CHECK:STDOUT: %WithT: %WithT.type = struct_value () [template]
  882. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit, element1 [symbolic]
  883. // CHECK:STDOUT: %S_where.type.357: type = facet_type <@S where %impl.elem1 = %empty_tuple.type> [template]
  884. // CHECK:STDOUT: %W: %S_where.type.357 = bind_symbolic_name W, 0 [symbolic]
  885. // CHECK:STDOUT: %W.patt: %S_where.type.357 = symbolic_binding_pattern W, 0 [symbolic]
  886. // CHECK:STDOUT: %WithU.type: type = fn_type @WithU [template]
  887. // CHECK:STDOUT: %WithU: %WithU.type = struct_value () [template]
  888. // CHECK:STDOUT: }
  889. // CHECK:STDOUT:
  890. // CHECK:STDOUT: imports {
  891. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  892. // CHECK:STDOUT: .ImplicitAs = %import_ref.a69
  893. // CHECK:STDOUT: import Core//prelude
  894. // CHECK:STDOUT: import Core//prelude/...
  895. // CHECK:STDOUT: }
  896. // CHECK:STDOUT: }
  897. // CHECK:STDOUT:
  898. // CHECK:STDOUT: file {
  899. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  900. // CHECK:STDOUT: .Core = imports.%Core
  901. // CHECK:STDOUT: .S = %S.decl
  902. // CHECK:STDOUT: .WithT = %WithT.decl
  903. // CHECK:STDOUT: .WithU = %WithU.decl
  904. // CHECK:STDOUT: }
  905. // CHECK:STDOUT: %Core.import = import Core
  906. // CHECK:STDOUT: %S.decl: type = interface_decl @S [template = constants.%S.type] {} {}
  907. // CHECK:STDOUT: %WithT.decl: %WithT.type = fn_decl @WithT [template = constants.%WithT] {
  908. // CHECK:STDOUT: %V.patt.loc9_10.1: %S_where.type.e40 = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc9_10.2 (constants.%V.patt)]
  909. // CHECK:STDOUT: %V.param_patt: %S_where.type.e40 = value_param_pattern %V.patt.loc9_10.1, runtime_param<invalid> [symbolic = %V.patt.loc9_10.2 (constants.%V.patt)]
  910. // CHECK:STDOUT: } {
  911. // CHECK:STDOUT: %V.param: %S_where.type.e40 = value_param runtime_param<invalid>
  912. // CHECK:STDOUT: %.loc9_16.1: type = splice_block %.loc9_16.2 [template = constants.%S_where.type.e40] {
  913. // CHECK:STDOUT: %S.ref: type = name_ref S, file.%S.decl [template = constants.%S.type]
  914. // CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  915. // CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  916. // CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @S.%assoc0 [template = constants.%assoc0.e49]
  917. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit]
  918. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0]
  919. // CHECK:STDOUT: %.loc9_28.1: %empty_tuple.type = tuple_literal ()
  920. // CHECK:STDOUT: %.loc9_28.2: type = converted %.loc9_28.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  921. // CHECK:STDOUT: %.loc9_16.2: type = where_expr %.Self [template = constants.%S_where.type.e40] {
  922. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_28.2
  923. // CHECK:STDOUT: }
  924. // CHECK:STDOUT: }
  925. // CHECK:STDOUT: %V.loc9_10.1: %S_where.type.e40 = bind_symbolic_name V, 0, %V.param [symbolic = %V.loc9_10.2 (constants.%V)]
  926. // CHECK:STDOUT: }
  927. // CHECK:STDOUT: %WithU.decl: %WithU.type = fn_decl @WithU [template = constants.%WithU] {
  928. // CHECK:STDOUT: %W.patt.loc11_10.1: %S_where.type.357 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_10.2 (constants.%W.patt)]
  929. // CHECK:STDOUT: %W.param_patt: %S_where.type.357 = value_param_pattern %W.patt.loc11_10.1, runtime_param<invalid> [symbolic = %W.patt.loc11_10.2 (constants.%W.patt)]
  930. // CHECK:STDOUT: } {
  931. // CHECK:STDOUT: %W.param: %S_where.type.357 = value_param runtime_param<invalid>
  932. // CHECK:STDOUT: %.loc11_16.1: type = splice_block %.loc11_16.2 [template = constants.%S_where.type.357] {
  933. // CHECK:STDOUT: %S.ref: type = name_ref S, file.%S.decl [template = constants.%S.type]
  934. // CHECK:STDOUT: %.Self: %S.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  935. // CHECK:STDOUT: %.Self.ref: %S.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  936. // CHECK:STDOUT: %U.ref: %assoc_type = name_ref U, @S.%assoc1 [template = constants.%assoc1]
  937. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit]
  938. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit, element1 [symbolic = constants.%impl.elem1]
  939. // CHECK:STDOUT: %.loc11_28.1: %empty_tuple.type = tuple_literal ()
  940. // CHECK:STDOUT: %.loc11_28.2: type = converted %.loc11_28.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  941. // CHECK:STDOUT: %.loc11_16.2: type = where_expr %.Self [template = constants.%S_where.type.357] {
  942. // CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc11_28.2
  943. // CHECK:STDOUT: }
  944. // CHECK:STDOUT: }
  945. // CHECK:STDOUT: %W.loc11_10.1: %S_where.type.357 = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc11_10.2 (constants.%W)]
  946. // CHECK:STDOUT: }
  947. // CHECK:STDOUT: }
  948. // CHECK:STDOUT:
  949. // CHECK:STDOUT: interface @S {
  950. // CHECK:STDOUT: %Self: %S.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.27b]
  951. // CHECK:STDOUT: %T: type = assoc_const_decl T [template]
  952. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %T [template = constants.%assoc0.e49]
  953. // CHECK:STDOUT: %U: type = assoc_const_decl U [template]
  954. // CHECK:STDOUT: %assoc1: %assoc_type = assoc_entity element1, %U [template = constants.%assoc1]
  955. // CHECK:STDOUT:
  956. // CHECK:STDOUT: !members:
  957. // CHECK:STDOUT: .Self = %Self
  958. // CHECK:STDOUT: .T = %assoc0
  959. // CHECK:STDOUT: .U = %assoc1
  960. // CHECK:STDOUT: witness = (%T, %U)
  961. // CHECK:STDOUT: }
  962. // CHECK:STDOUT:
  963. // CHECK:STDOUT: generic fn @WithT(%V.loc9_10.1: %S_where.type.e40) {
  964. // CHECK:STDOUT: %V.loc9_10.2: %S_where.type.e40 = bind_symbolic_name V, 0 [symbolic = %V.loc9_10.2 (constants.%V)]
  965. // CHECK:STDOUT: %V.patt.loc9_10.2: %S_where.type.e40 = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc9_10.2 (constants.%V.patt)]
  966. // CHECK:STDOUT:
  967. // CHECK:STDOUT: !definition:
  968. // CHECK:STDOUT:
  969. // CHECK:STDOUT: fn(%V.param_patt: %S_where.type.e40) {
  970. // CHECK:STDOUT: !entry:
  971. // CHECK:STDOUT: return
  972. // CHECK:STDOUT: }
  973. // CHECK:STDOUT: }
  974. // CHECK:STDOUT:
  975. // CHECK:STDOUT: generic fn @WithU(%W.loc11_10.1: %S_where.type.357) {
  976. // CHECK:STDOUT: %W.loc11_10.2: %S_where.type.357 = bind_symbolic_name W, 0 [symbolic = %W.loc11_10.2 (constants.%W)]
  977. // CHECK:STDOUT: %W.patt.loc11_10.2: %S_where.type.357 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_10.2 (constants.%W.patt)]
  978. // CHECK:STDOUT:
  979. // CHECK:STDOUT: !definition:
  980. // CHECK:STDOUT:
  981. // CHECK:STDOUT: fn(%W.param_patt: %S_where.type.357) {
  982. // CHECK:STDOUT: !entry:
  983. // CHECK:STDOUT: %WithT.ref: %WithT.type = name_ref WithT, file.%WithT.decl [template = constants.%WithT]
  984. // CHECK:STDOUT: %W.ref: %S_where.type.357 = name_ref W, %W.loc11_10.1 [symbolic = %W.loc11_10.2 (constants.%W)]
  985. // CHECK:STDOUT: %.loc22: %S_where.type.e40 = converted %W.ref, <error> [template = <error>]
  986. // CHECK:STDOUT: return
  987. // CHECK:STDOUT: }
  988. // CHECK:STDOUT: }
  989. // CHECK:STDOUT:
  990. // CHECK:STDOUT: specific @WithT(constants.%V) {
  991. // CHECK:STDOUT: %V.loc9_10.2 => constants.%V
  992. // CHECK:STDOUT: %V.patt.loc9_10.2 => constants.%V
  993. // CHECK:STDOUT: }
  994. // CHECK:STDOUT:
  995. // CHECK:STDOUT: specific @WithU(constants.%W) {
  996. // CHECK:STDOUT: %W.loc11_10.2 => constants.%W
  997. // CHECK:STDOUT: %W.patt.loc11_10.2 => constants.%W
  998. // CHECK:STDOUT: }
  999. // CHECK:STDOUT:
  1000. // CHECK:STDOUT: --- fail_import_rewrites.carbon
  1001. // CHECK:STDOUT:
  1002. // CHECK:STDOUT: constants {
  1003. // CHECK:STDOUT: %Calls.type: type = fn_type @Calls [template]
  1004. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  1005. // CHECK:STDOUT: %Calls: %Calls.type = struct_value () [template]
  1006. // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [template]
  1007. // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [template]
  1008. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  1009. // CHECK:STDOUT: %N.type: type = facet_type <@N> [template]
  1010. // CHECK:STDOUT: %.Self.9aa: %N.type = bind_symbolic_name .Self [symbolic]
  1011. // CHECK:STDOUT: %.Self.as_wit.cef: <witness> = facet_access_witness %.Self.9aa [symbolic]
  1012. // CHECK:STDOUT: %impl.elem0.51b: type = impl_witness_access %.Self.as_wit.cef, element0 [symbolic]
  1013. // CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0.51b = %empty_struct_type> [template]
  1014. // CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic]
  1015. // CHECK:STDOUT: %T.patt: %N_where.type = symbolic_binding_pattern T, 0 [symbolic]
  1016. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  1017. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  1018. // CHECK:STDOUT: %NestedRewrite.type: type = fn_type @NestedRewrite [template]
  1019. // CHECK:STDOUT: %NestedRewrite: %NestedRewrite.type = struct_value () [template]
  1020. // CHECK:STDOUT: %A.type: type = facet_type <@A> [template]
  1021. // CHECK:STDOUT: %.Self.3ca: %A.type = bind_symbolic_name .Self [symbolic]
  1022. // CHECK:STDOUT: %.Self.as_wit.794: <witness> = facet_access_witness %.Self.3ca [symbolic]
  1023. // CHECK:STDOUT: %impl.elem0.1d3: type = impl_witness_access %.Self.as_wit.794, element0 [symbolic]
  1024. // CHECK:STDOUT: %A_where.type.ef9: type = facet_type <@A where %impl.elem0.1d3 = bool> [template]
  1025. // CHECK:STDOUT: %.Self.e46: %A_where.type.ef9 = bind_symbolic_name .Self [symbolic]
  1026. // CHECK:STDOUT: %.Self.as_wit.a35: <witness> = facet_access_witness %.Self.e46 [symbolic]
  1027. // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %.Self.as_wit.a35, element1 [symbolic]
  1028. // CHECK:STDOUT: %A_where.type.791: type = facet_type <@A where %impl.elem1 = %empty_tuple.type and %impl.elem0.1d3 = bool> [template]
  1029. // CHECK:STDOUT: %D: %A_where.type.791 = bind_symbolic_name D, 0 [symbolic]
  1030. // CHECK:STDOUT: %D.patt: %A_where.type.791 = symbolic_binding_pattern D, 0 [symbolic]
  1031. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  1032. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  1033. // CHECK:STDOUT: }
  1034. // CHECK:STDOUT:
  1035. // CHECK:STDOUT: imports {
  1036. // CHECK:STDOUT: %import_ref.a90 = import_ref Main//equal_constraint, N, unloaded
  1037. // CHECK:STDOUT: %import_ref.439: %Equal.type = import_ref Main//equal_constraint, Equal, loaded [template = constants.%Equal]
  1038. // CHECK:STDOUT: %import_ref.fdd = import_ref Main//nested_rewrites, A, unloaded
  1039. // CHECK:STDOUT: %import_ref.b00: %NestedRewrite.type = import_ref Main//nested_rewrites, NestedRewrite, loaded [template = constants.%NestedRewrite]
  1040. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1041. // CHECK:STDOUT: .Bool = %import_ref.f7c
  1042. // CHECK:STDOUT: .ImplicitAs = %import_ref.a69
  1043. // CHECK:STDOUT: .Int = %import_ref.187
  1044. // CHECK:STDOUT: import Core//prelude
  1045. // CHECK:STDOUT: import Core//prelude/...
  1046. // CHECK:STDOUT: }
  1047. // CHECK:STDOUT: %import_ref.6a8 = import_ref Main//equal_constraint, inst17 [no loc], unloaded
  1048. // CHECK:STDOUT: %import_ref.d17 = import_ref Main//equal_constraint, loc5_15, unloaded
  1049. // CHECK:STDOUT: %import_ref.77a = import_ref Main//equal_constraint, P, unloaded
  1050. // CHECK:STDOUT: %import_ref.b09 = import_ref Main//nested_rewrites, inst17 [no loc], unloaded
  1051. // CHECK:STDOUT: %import_ref.2a9 = import_ref Main//nested_rewrites, loc5_15, unloaded
  1052. // CHECK:STDOUT: %import_ref.508 = import_ref Main//nested_rewrites, loc6_15, unloaded
  1053. // CHECK:STDOUT: %import_ref.75c = import_ref Main//nested_rewrites, B, unloaded
  1054. // CHECK:STDOUT: %import_ref.aff = import_ref Main//nested_rewrites, C, unloaded
  1055. // CHECK:STDOUT: }
  1056. // CHECK:STDOUT:
  1057. // CHECK:STDOUT: file {
  1058. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1059. // CHECK:STDOUT: .N = imports.%import_ref.a90
  1060. // CHECK:STDOUT: .Equal = imports.%import_ref.439
  1061. // CHECK:STDOUT: .A = imports.%import_ref.fdd
  1062. // CHECK:STDOUT: .NestedRewrite = imports.%import_ref.b00
  1063. // CHECK:STDOUT: .Core = imports.%Core
  1064. // CHECK:STDOUT: .Calls = %Calls.decl
  1065. // CHECK:STDOUT: }
  1066. // CHECK:STDOUT: %Core.import = import Core
  1067. // CHECK:STDOUT: %default.import = import <invalid>
  1068. // CHECK:STDOUT: %Calls.decl: %Calls.type = fn_decl @Calls [template = constants.%Calls] {} {}
  1069. // CHECK:STDOUT: }
  1070. // CHECK:STDOUT:
  1071. // CHECK:STDOUT: interface @N [from "equal_constraint.carbon"] {
  1072. // CHECK:STDOUT: !members:
  1073. // CHECK:STDOUT: .Self = imports.%import_ref.6a8
  1074. // CHECK:STDOUT: .P = imports.%import_ref.d17
  1075. // CHECK:STDOUT: witness = (imports.%import_ref.77a)
  1076. // CHECK:STDOUT: }
  1077. // CHECK:STDOUT:
  1078. // CHECK:STDOUT: interface @A [from "nested_rewrites.carbon"] {
  1079. // CHECK:STDOUT: !members:
  1080. // CHECK:STDOUT: .Self = imports.%import_ref.b09
  1081. // CHECK:STDOUT: .B = imports.%import_ref.2a9
  1082. // CHECK:STDOUT: .C = imports.%import_ref.508
  1083. // CHECK:STDOUT: witness = (imports.%import_ref.75c, imports.%import_ref.aff)
  1084. // CHECK:STDOUT: }
  1085. // CHECK:STDOUT:
  1086. // CHECK:STDOUT: fn @Calls() {
  1087. // CHECK:STDOUT: !entry:
  1088. // CHECK:STDOUT: %Equal.ref: %Equal.type = name_ref Equal, imports.%import_ref.439 [template = constants.%Equal]
  1089. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  1090. // CHECK:STDOUT: %.loc19: %N_where.type = converted %bool.make_type, <error> [template = <error>]
  1091. // CHECK:STDOUT: %NestedRewrite.ref: %NestedRewrite.type = name_ref NestedRewrite, imports.%import_ref.b00 [template = constants.%NestedRewrite]
  1092. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  1093. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  1094. // CHECK:STDOUT: %.loc32: %A_where.type.791 = converted %i32, <error> [template = <error>]
  1095. // CHECK:STDOUT: return
  1096. // CHECK:STDOUT: }
  1097. // CHECK:STDOUT:
  1098. // CHECK:STDOUT: generic fn @Equal(constants.%T: %N_where.type) [from "equal_constraint.carbon"] {
  1099. // CHECK:STDOUT: %T: %N_where.type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1100. // CHECK:STDOUT: %T.patt: %N_where.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  1101. // CHECK:STDOUT:
  1102. // CHECK:STDOUT: fn(%T.param_patt: %N_where.type);
  1103. // CHECK:STDOUT: }
  1104. // CHECK:STDOUT:
  1105. // CHECK:STDOUT: generic fn @NestedRewrite(constants.%D: %A_where.type.791) [from "nested_rewrites.carbon"] {
  1106. // CHECK:STDOUT: %D: %A_where.type.791 = bind_symbolic_name D, 0 [symbolic = %D (constants.%D)]
  1107. // CHECK:STDOUT: %D.patt: %A_where.type.791 = symbolic_binding_pattern D, 0 [symbolic = %D.patt (constants.%D.patt)]
  1108. // CHECK:STDOUT:
  1109. // CHECK:STDOUT: fn(%D.param_patt: %A_where.type.791);
  1110. // CHECK:STDOUT: }
  1111. // CHECK:STDOUT:
  1112. // CHECK:STDOUT: specific @Equal(constants.%T) {
  1113. // CHECK:STDOUT: %T => constants.%T
  1114. // CHECK:STDOUT: %T.patt => constants.%T
  1115. // CHECK:STDOUT: }
  1116. // CHECK:STDOUT:
  1117. // CHECK:STDOUT: specific @NestedRewrite(constants.%D) {
  1118. // CHECK:STDOUT: %D => constants.%D
  1119. // CHECK:STDOUT: %D.patt => constants.%D
  1120. // CHECK:STDOUT: }
  1121. // CHECK:STDOUT:
  1122. // CHECK:STDOUT: --- fail_check_rewrite_constraints.carbon
  1123. // CHECK:STDOUT:
  1124. // CHECK:STDOUT: constants {
  1125. // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
  1126. // CHECK:STDOUT: %Self.fb7: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1127. // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %I.type, type [template]
  1128. // CHECK:STDOUT: %assoc0.ea2: %assoc_type = assoc_entity element0, @I.%Member [template]
  1129. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic]
  1130. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self [symbolic]
  1131. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic]
  1132. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template]
  1133. // CHECK:STDOUT: %X.patt: <error> = symbolic_binding_pattern X, 0 [symbolic]
  1134. // CHECK:STDOUT: %RewriteTypeMismatch.type: type = fn_type @RewriteTypeMismatch [template]
  1135. // CHECK:STDOUT: %RewriteTypeMismatch: %RewriteTypeMismatch.type = struct_value () [template]
  1136. // CHECK:STDOUT: }
  1137. // CHECK:STDOUT:
  1138. // CHECK:STDOUT: imports {
  1139. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1140. // CHECK:STDOUT: .ImplicitAs = %import_ref.a69
  1141. // CHECK:STDOUT: import Core//prelude
  1142. // CHECK:STDOUT: import Core//prelude/...
  1143. // CHECK:STDOUT: }
  1144. // CHECK:STDOUT: }
  1145. // CHECK:STDOUT:
  1146. // CHECK:STDOUT: file {
  1147. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1148. // CHECK:STDOUT: .Core = imports.%Core
  1149. // CHECK:STDOUT: .I = %I.decl
  1150. // CHECK:STDOUT: .RewriteTypeMismatch = %RewriteTypeMismatch.decl
  1151. // CHECK:STDOUT: }
  1152. // CHECK:STDOUT: %Core.import = import Core
  1153. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
  1154. // CHECK:STDOUT: %RewriteTypeMismatch.decl: %RewriteTypeMismatch.type = fn_decl @RewriteTypeMismatch [template = constants.%RewriteTypeMismatch] {
  1155. // CHECK:STDOUT: %X.patt.loc16_24.1: <error> = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc16_24.2 (constants.%X.patt)]
  1156. // CHECK:STDOUT: %X.param_patt: <error> = value_param_pattern %X.patt.loc16_24.1, runtime_param<invalid> [symbolic = %X.patt.loc16_24.2 (constants.%X.patt)]
  1157. // CHECK:STDOUT: } {
  1158. // CHECK:STDOUT: %X.param: <error> = value_param runtime_param<invalid>
  1159. // CHECK:STDOUT: %.loc16_30.1: type = splice_block %.loc16_30.2 [template = <error>] {
  1160. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  1161. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self]
  1162. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
  1163. // CHECK:STDOUT: %Member.ref: %assoc_type = name_ref Member, @I.%assoc0 [template = constants.%assoc0.ea2]
  1164. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit]
  1165. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0]
  1166. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2]
  1167. // CHECK:STDOUT: %.loc16_46: type = converted %int_2, <error> [template = <error>]
  1168. // CHECK:STDOUT: %.loc16_30.2: type = where_expr %.Self [template = <error>] {
  1169. // CHECK:STDOUT: requirement_rewrite %impl.elem0, <error>
  1170. // CHECK:STDOUT: }
  1171. // CHECK:STDOUT: }
  1172. // CHECK:STDOUT: %X: <error> = bind_symbolic_name X, 0, %X.param [template = <error>]
  1173. // CHECK:STDOUT: }
  1174. // CHECK:STDOUT: }
  1175. // CHECK:STDOUT:
  1176. // CHECK:STDOUT: interface @I {
  1177. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.fb7]
  1178. // CHECK:STDOUT: %Member: type = assoc_const_decl Member [template]
  1179. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %Member [template = constants.%assoc0.ea2]
  1180. // CHECK:STDOUT:
  1181. // CHECK:STDOUT: !members:
  1182. // CHECK:STDOUT: .Self = %Self
  1183. // CHECK:STDOUT: .Member = %assoc0
  1184. // CHECK:STDOUT: witness = (%Member)
  1185. // CHECK:STDOUT: }
  1186. // CHECK:STDOUT:
  1187. // CHECK:STDOUT: generic fn @RewriteTypeMismatch(%X: <error>) {
  1188. // CHECK:STDOUT: %X.patt.loc16_24.2: <error> = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc16_24.2 (constants.%X.patt)]
  1189. // CHECK:STDOUT:
  1190. // CHECK:STDOUT: fn(%X.param_patt: <error>);
  1191. // CHECK:STDOUT: }
  1192. // CHECK:STDOUT:
  1193. // CHECK:STDOUT: specific @RewriteTypeMismatch(<error>) {
  1194. // CHECK:STDOUT: %X.patt.loc16_24.2 => <error>
  1195. // CHECK:STDOUT: }
  1196. // CHECK:STDOUT:
  1197. // CHECK:STDOUT: --- fail_todo_let.carbon
  1198. // CHECK:STDOUT:
  1199. // CHECK:STDOUT: constants {
  1200. // CHECK:STDOUT: %A.type: type = facet_type <@A> [template]
  1201. // CHECK:STDOUT: %Self.2a0: %A.type = bind_symbolic_name Self, 0 [symbolic]
  1202. // CHECK:STDOUT: %D: type = class_type @D [template]
  1203. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  1204. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  1205. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [template]
  1206. // CHECK:STDOUT: %type_where: type = facet_type <type where TODO> [template]
  1207. // CHECK:STDOUT: }
  1208. // CHECK:STDOUT:
  1209. // CHECK:STDOUT: imports {
  1210. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1211. // CHECK:STDOUT: .ImplicitAs = %import_ref.a69
  1212. // CHECK:STDOUT: import Core//prelude
  1213. // CHECK:STDOUT: import Core//prelude/...
  1214. // CHECK:STDOUT: }
  1215. // CHECK:STDOUT: }
  1216. // CHECK:STDOUT:
  1217. // CHECK:STDOUT: file {
  1218. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1219. // CHECK:STDOUT: .Core = imports.%Core
  1220. // CHECK:STDOUT: .A = %A.decl
  1221. // CHECK:STDOUT: .D = %D.decl
  1222. // CHECK:STDOUT: .B = @__global_init.%B
  1223. // CHECK:STDOUT: }
  1224. // CHECK:STDOUT: %Core.import = import Core
  1225. // CHECK:STDOUT: %A.decl: type = interface_decl @A [template = constants.%A.type] {} {}
  1226. // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {}
  1227. // CHECK:STDOUT: impl_decl @impl [template] {} {
  1228. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D]
  1229. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A.type]
  1230. // CHECK:STDOUT: }
  1231. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [template = constants.%impl_witness]
  1232. // CHECK:STDOUT: }
  1233. // CHECK:STDOUT:
  1234. // CHECK:STDOUT: interface @A {
  1235. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2a0]
  1236. // CHECK:STDOUT:
  1237. // CHECK:STDOUT: !members:
  1238. // CHECK:STDOUT: .Self = %Self
  1239. // CHECK:STDOUT: witness = ()
  1240. // CHECK:STDOUT: }
  1241. // CHECK:STDOUT:
  1242. // CHECK:STDOUT: impl @impl: %D.ref as %A.ref {
  1243. // CHECK:STDOUT: !members:
  1244. // CHECK:STDOUT: witness = file.%impl_witness
  1245. // CHECK:STDOUT: }
  1246. // CHECK:STDOUT:
  1247. // CHECK:STDOUT: class @D {
  1248. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  1249. // CHECK:STDOUT:
  1250. // CHECK:STDOUT: !members:
  1251. // CHECK:STDOUT: .Self = constants.%D
  1252. // CHECK:STDOUT: complete_type_witness = %complete_type
  1253. // CHECK:STDOUT: }
  1254. // CHECK:STDOUT:
  1255. // CHECK:STDOUT: fn @__global_init() {
  1256. // CHECK:STDOUT: !entry:
  1257. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D]
  1258. // CHECK:STDOUT: %.loc15: %type_where = converted %D.ref, <error> [template = <error>]
  1259. // CHECK:STDOUT: %B: %type_where = bind_name B, <error>
  1260. // CHECK:STDOUT: return
  1261. // CHECK:STDOUT: }
  1262. // CHECK:STDOUT:
  1263. // CHECK:STDOUT: --- fail_type_does_not_implement_where.carbon
  1264. // CHECK:STDOUT:
  1265. // CHECK:STDOUT: constants {
  1266. // CHECK:STDOUT: %E.type: type = facet_type <@E> [template]
  1267. // CHECK:STDOUT: %Self.342: %E.type = bind_symbolic_name Self, 0 [symbolic]
  1268. // CHECK:STDOUT: %assoc_type: type = assoc_entity_type %E.type, type [template]
  1269. // CHECK:STDOUT: %assoc0.4b1: %assoc_type = assoc_entity element0, @E.%F [template]
  1270. // CHECK:STDOUT: %assoc1: %assoc_type = assoc_entity element1, @E.%G [template]
  1271. // CHECK:STDOUT: %.Self.da5: %E.type = bind_symbolic_name .Self [symbolic]
  1272. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  1273. // CHECK:STDOUT: %.Self.as_wit.f42: <witness> = facet_access_witness %.Self.da5 [symbolic]
  1274. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit.f42, element0 [symbolic]
  1275. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  1276. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  1277. // CHECK:STDOUT: %impl.elem1.91f: type = impl_witness_access %.Self.as_wit.f42, element1 [symbolic]
  1278. // CHECK:STDOUT: %E_where.type.366: type = facet_type <@E where %impl.elem1.91f = %empty_tuple.type and %impl.elem0 = bool> [template]
  1279. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
  1280. // CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
  1281. // CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
  1282. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  1283. // CHECK:STDOUT: %E_where.type.324: type = facet_type <@E where %impl.elem0 = %empty_struct_type> [template]
  1284. // CHECK:STDOUT: %.Self.665: %E_where.type.324 = bind_symbolic_name .Self [symbolic]
  1285. // CHECK:STDOUT: %.Self.as_wit.bb3: <witness> = facet_access_witness %.Self.665 [symbolic]
  1286. // CHECK:STDOUT: %impl.elem1.244: type = impl_witness_access %.Self.as_wit.bb3, element1 [symbolic]
  1287. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  1288. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  1289. // CHECK:STDOUT: %E_where.type.dbc: type = facet_type <@E where %impl.elem1.244 = %i32 and %impl.elem0 = %empty_struct_type> [template]
  1290. // CHECK:STDOUT: %E_where.type.503: type = facet_type <@E where %impl.elem0 = %impl.elem1.91f> [template]
  1291. // CHECK:STDOUT: }
  1292. // CHECK:STDOUT:
  1293. // CHECK:STDOUT: imports {
  1294. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1295. // CHECK:STDOUT: .Bool = %import_ref.f7c
  1296. // CHECK:STDOUT: .Float = %import_ref.20b
  1297. // CHECK:STDOUT: .ImplicitAs = %import_ref.a69
  1298. // CHECK:STDOUT: .Int = %import_ref.187
  1299. // CHECK:STDOUT: import Core//prelude
  1300. // CHECK:STDOUT: import Core//prelude/...
  1301. // CHECK:STDOUT: }
  1302. // CHECK:STDOUT: }
  1303. // CHECK:STDOUT:
  1304. // CHECK:STDOUT: file {
  1305. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1306. // CHECK:STDOUT: .Core = imports.%Core
  1307. // CHECK:STDOUT: .E = %E.decl
  1308. // CHECK:STDOUT: .H = @__global_init.%H
  1309. // CHECK:STDOUT: .J = @__global_init.%J
  1310. // CHECK:STDOUT: .K = @__global_init.%K
  1311. // CHECK:STDOUT: }
  1312. // CHECK:STDOUT: %Core.import = import Core
  1313. // CHECK:STDOUT: %E.decl: type = interface_decl @E [template = constants.%E.type] {} {}
  1314. // CHECK:STDOUT: }
  1315. // CHECK:STDOUT:
  1316. // CHECK:STDOUT: interface @E {
  1317. // CHECK:STDOUT: %Self: %E.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.342]
  1318. // CHECK:STDOUT: %F: type = assoc_const_decl F [template]
  1319. // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %F [template = constants.%assoc0.4b1]
  1320. // CHECK:STDOUT: %G: type = assoc_const_decl G [template]
  1321. // CHECK:STDOUT: %assoc1: %assoc_type = assoc_entity element1, %G [template = constants.%assoc1]
  1322. // CHECK:STDOUT:
  1323. // CHECK:STDOUT: !members:
  1324. // CHECK:STDOUT: .Self = %Self
  1325. // CHECK:STDOUT: .F = %assoc0
  1326. // CHECK:STDOUT: .G = %assoc1
  1327. // CHECK:STDOUT: witness = (%F, %G)
  1328. // CHECK:STDOUT: }
  1329. // CHECK:STDOUT:
  1330. // CHECK:STDOUT: fn @__global_init() {
  1331. // CHECK:STDOUT: !entry:
  1332. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
  1333. // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64]
  1334. // CHECK:STDOUT: %.loc18: %E_where.type.366 = converted %float.make_type, <error> [template = <error>]
  1335. // CHECK:STDOUT: %H: %E_where.type.366 = bind_name H, <error>
  1336. // CHECK:STDOUT: %bool.make_type.loc27: init type = call constants.%Bool() [template = bool]
  1337. // CHECK:STDOUT: %.loc27: %E_where.type.dbc = converted %bool.make_type.loc27, <error> [template = <error>]
  1338. // CHECK:STDOUT: %J: %E_where.type.dbc = bind_name J, <error>
  1339. // CHECK:STDOUT: %bool.make_type.loc35: init type = call constants.%Bool() [template = bool]
  1340. // CHECK:STDOUT: %.loc35: %E_where.type.503 = converted %bool.make_type.loc35, <error> [template = <error>]
  1341. // CHECK:STDOUT: %K: %E_where.type.503 = bind_name K, <error>
  1342. // CHECK:STDOUT: return
  1343. // CHECK:STDOUT: }
  1344. // CHECK:STDOUT: