equal_rewrite.carbon 101 KB

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