equal_rewrite.carbon 99 KB

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