compound_member_access.carbon 116 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/compound_member_access.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/compound_member_access.carbon
  14. // --- associated_constant.carbon
  15. library "[[@TEST_NAME]]";
  16. interface J {
  17. let U:! type;
  18. }
  19. // Simple member access.
  20. fn Simple1(T:! J, unused S:! T.U) {}
  21. // This should be equivalent to `Simple1` above, but using compound member access.
  22. fn Compound1(V:! J, unused W:! V.(J.U)) {}
  23. // --- non_instance.carbon
  24. library "[[@TEST_NAME]]";
  25. interface K1 {
  26. fn Q1();
  27. }
  28. // Simple member access.
  29. fn Simple2(T:! K1) {
  30. T.Q1();
  31. }
  32. // This should be equivalent to `Simple2` above, but using compound member access.
  33. fn Compound2(V:! K1) {
  34. V.(K1.Q1)();
  35. }
  36. // --- fail_caller_instance_interface_not.carbon
  37. library "[[@TEST_NAME]]";
  38. interface K2 {
  39. fn Q2();
  40. }
  41. // Simple member access allows this.
  42. fn Simple3(T:! K2, x: T) {
  43. x.Q2();
  44. }
  45. // Compound member access does not. It tries to convert `y` to `K2`, but only
  46. // its type `V` can.
  47. fn Compound3(V:! K2, y: V) {
  48. // CHECK:STDERR: fail_caller_instance_interface_not.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `V` into type implementing `K2` [ConversionFailureNonTypeToFacet]
  49. // CHECK:STDERR: y.(K2.Q2)();
  50. // CHECK:STDERR: ^~~~~~~~~
  51. // CHECK:STDERR: fail_caller_instance_interface_not.carbon:[[@LINE+4]]:3: note: type `V` does not implement interface `Core.ImplicitAs(K2)` [MissingImplInMemberAccessNote]
  52. // CHECK:STDERR: y.(K2.Q2)();
  53. // CHECK:STDERR: ^~~~~~~~~
  54. // CHECK:STDERR:
  55. y.(K2.Q2)();
  56. }
  57. // --- instance.carbon
  58. library "[[@TEST_NAME]]";
  59. interface L1 {
  60. fn R1[self: Self]();
  61. fn S1[ref self: Self]();
  62. }
  63. // Simple member access.
  64. fn Simple4(T:! L1, x: T, p: T*) {
  65. x.R1();
  66. p->S1();
  67. }
  68. // This should be equivalent to `Simple4` above, but using compound member access.
  69. fn Compound4(V:! L1, y: V, p: V*) {
  70. y.(L1.R1)();
  71. p->(L1.S1)();
  72. }
  73. // --- fail_interface_instance_caller_not.carbon
  74. library "[[@TEST_NAME]]";
  75. interface L2 {
  76. fn R2[self: Self]();
  77. fn S2[ref self: Self]();
  78. }
  79. // Simple member access. Fails since calling an instance method without an object.
  80. fn Simple5(T:! L2) {
  81. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall]
  82. // CHECK:STDERR: T.R2();
  83. // CHECK:STDERR: ^~~~~~
  84. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-9]]:3: note: calling function declared here [InCallToFunction]
  85. // CHECK:STDERR: fn R2[self: Self]();
  86. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  87. // CHECK:STDERR:
  88. T.R2();
  89. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall]
  90. // CHECK:STDERR: T.S2();
  91. // CHECK:STDERR: ^~~~~~
  92. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-16]]:3: note: calling function declared here [InCallToFunction]
  93. // CHECK:STDERR: fn S2[ref self: Self]();
  94. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
  95. // CHECK:STDERR:
  96. T.S2();
  97. }
  98. // TODO: Expected to fail in the same way as `Simple5`.
  99. fn Compound5(V:! L2) {
  100. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+4]]:3: error: cannot access member of interface `L2` in type `L2` that does not implement that interface [MissingImplInMemberAccess]
  101. // CHECK:STDERR: V.(L2.R2)();
  102. // CHECK:STDERR: ^~~~~~~~~
  103. // CHECK:STDERR:
  104. V.(L2.R2)();
  105. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+4]]:3: error: cannot access member of interface `L2` in type `L2` that does not implement that interface [MissingImplInMemberAccess]
  106. // CHECK:STDERR: V.(L2.S2)();
  107. // CHECK:STDERR: ^~~~~~~~~
  108. // CHECK:STDERR:
  109. V.(L2.S2)();
  110. }
  111. // --- fail_combine_non_instance.carbon
  112. library "[[@TEST_NAME]]";
  113. interface A {
  114. fn G();
  115. }
  116. class C {}
  117. impl C as A {
  118. fn G() {}
  119. }
  120. // Since `A.G` is a non-instance method, compound member access may only be
  121. // used with a type, not an instance.
  122. fn Fails() {
  123. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `C` into type implementing `A` [ConversionFailureNonTypeToFacet]
  124. // CHECK:STDERR: ({} as C).((A & A).G)();
  125. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  126. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+4]]:3: note: type `C` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
  127. // CHECK:STDERR: ({} as C).((A & A).G)();
  128. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  129. // CHECK:STDERR:
  130. ({} as C).((A & A).G)();
  131. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `C` into type implementing `A` [ConversionFailureNonTypeToFacet]
  132. // CHECK:STDERR: (({} as C) as (C as (A & A))).((A & A).G)();
  133. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  134. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+4]]:3: note: type `C` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
  135. // CHECK:STDERR: (({} as C) as (C as (A & A))).((A & A).G)();
  136. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  137. // CHECK:STDERR:
  138. (({} as C) as (C as (A & A))).((A & A).G)();
  139. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `C` into type implementing `A` [ConversionFailureNonTypeToFacet]
  140. // CHECK:STDERR: (({} as C) as (C as (A & A))).(A.G)();
  141. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  142. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+4]]:3: note: type `C` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
  143. // CHECK:STDERR: (({} as C) as (C as (A & A))).(A.G)();
  144. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  145. // CHECK:STDERR:
  146. (({} as C) as (C as (A & A))).(A.G)();
  147. }
  148. // --- allowed_combine_non_instance.carbon
  149. library "[[@TEST_NAME]]";
  150. interface A {
  151. fn G();
  152. }
  153. class C {}
  154. impl C as A {
  155. fn G() {}
  156. }
  157. fn Works() {
  158. C.((A & A).G)();
  159. (C as (A & A)).((A & A).G)();
  160. (C as (A & A)).(A.G)();
  161. }
  162. // CHECK:STDOUT: --- associated_constant.carbon
  163. // CHECK:STDOUT:
  164. // CHECK:STDOUT: constants {
  165. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  166. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic]
  167. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  168. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  169. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  170. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  171. // CHECK:STDOUT: %T: %J.type = symbolic_binding T, 0 [symbolic]
  172. // CHECK:STDOUT: %pattern_type.f76: type = pattern_type %J.type [concrete]
  173. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic]
  174. // CHECK:STDOUT: %J.lookup_impl_witness.264a02.1: <witness> = lookup_impl_witness %T, @J [symbolic]
  175. // CHECK:STDOUT: %impl.elem0.5607ef.1: type = impl_witness_access %J.lookup_impl_witness.264a02.1, element0 [symbolic]
  176. // CHECK:STDOUT: %S: %impl.elem0.5607ef.1 = symbolic_binding S, 1 [symbolic]
  177. // CHECK:STDOUT: %pattern_type.ad6d12.1: type = pattern_type %impl.elem0.5607ef.1 [symbolic]
  178. // CHECK:STDOUT: %Simple1.type: type = fn_type @Simple1 [concrete]
  179. // CHECK:STDOUT: %Simple1: %Simple1.type = struct_value () [concrete]
  180. // CHECK:STDOUT: %V: %J.type = symbolic_binding V, 0 [symbolic]
  181. // CHECK:STDOUT: %J.lookup_impl_witness.264a02.2: <witness> = lookup_impl_witness %V, @J [symbolic]
  182. // CHECK:STDOUT: %impl.elem0.5607ef.2: type = impl_witness_access %J.lookup_impl_witness.264a02.2, element0 [symbolic]
  183. // CHECK:STDOUT: %W: %impl.elem0.5607ef.2 = symbolic_binding W, 1 [symbolic]
  184. // CHECK:STDOUT: %pattern_type.ad6d12.2: type = pattern_type %impl.elem0.5607ef.2 [symbolic]
  185. // CHECK:STDOUT: %Compound1.type: type = fn_type @Compound1 [concrete]
  186. // CHECK:STDOUT: %Compound1: %Compound1.type = struct_value () [concrete]
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT:
  189. // CHECK:STDOUT: imports {
  190. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  191. // CHECK:STDOUT: import Core//prelude
  192. // CHECK:STDOUT: import Core//prelude/...
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: file {
  197. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  198. // CHECK:STDOUT: .Core = imports.%Core
  199. // CHECK:STDOUT: .J = %J.decl
  200. // CHECK:STDOUT: .Simple1 = %Simple1.decl
  201. // CHECK:STDOUT: .Compound1 = %Compound1.decl
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT: %Core.import = import Core
  204. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  205. // CHECK:STDOUT: %Simple1.decl: %Simple1.type = fn_decl @Simple1 [concrete = constants.%Simple1] {
  206. // CHECK:STDOUT: %T.patt: %pattern_type.f76 = symbolic_binding_pattern T, 0 [concrete]
  207. // CHECK:STDOUT: %S.patt: @Simple1.%pattern_type (%pattern_type.ad6d12.1) = symbolic_binding_pattern S, 1 [concrete]
  208. // CHECK:STDOUT: } {
  209. // CHECK:STDOUT: %.loc8_16: type = splice_block %J.ref [concrete = constants.%J.type] {
  210. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  211. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT: %T.loc8_12.2: %J.type = symbolic_binding T, 0 [symbolic = %T.loc8_12.1 (constants.%T)]
  214. // CHECK:STDOUT: %.loc8_31.1: type = splice_block %impl.elem0.loc8_31.2 [symbolic = %impl.elem0.loc8_31.1 (constants.%impl.elem0.5607ef.1)] {
  215. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  216. // CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc8_12.2 [symbolic = %T.loc8_12.1 (constants.%T)]
  217. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  218. // CHECK:STDOUT: %.loc8_31.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  219. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  220. // CHECK:STDOUT: %impl.elem0.loc8_31.2: type = impl_witness_access constants.%J.lookup_impl_witness.264a02.1, element0 [symbolic = %impl.elem0.loc8_31.1 (constants.%impl.elem0.5607ef.1)]
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT: %S.loc8_26.2: @Simple1.%impl.elem0.loc8_31.1 (%impl.elem0.5607ef.1) = symbolic_binding S, 1 [symbolic = %S.loc8_26.1 (constants.%S)]
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT: %Compound1.decl: %Compound1.type = fn_decl @Compound1 [concrete = constants.%Compound1] {
  225. // CHECK:STDOUT: %V.patt: %pattern_type.f76 = symbolic_binding_pattern V, 0 [concrete]
  226. // CHECK:STDOUT: %W.patt: @Compound1.%pattern_type (%pattern_type.ad6d12.2) = symbolic_binding_pattern W, 1 [concrete]
  227. // CHECK:STDOUT: } {
  228. // CHECK:STDOUT: %.loc11_18: type = splice_block %J.ref.loc11_18 [concrete = constants.%J.type] {
  229. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  230. // CHECK:STDOUT: %J.ref.loc11_18: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT: %V.loc11_14.2: %J.type = symbolic_binding V, 0 [symbolic = %V.loc11_14.1 (constants.%V)]
  233. // CHECK:STDOUT: %.loc11_33: type = splice_block %impl.elem0.loc11_33.2 [symbolic = %impl.elem0.loc11_33.1 (constants.%impl.elem0.5607ef.2)] {
  234. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  235. // CHECK:STDOUT: %V.ref: %J.type = name_ref V, %V.loc11_14.2 [symbolic = %V.loc11_14.1 (constants.%V)]
  236. // CHECK:STDOUT: %J.ref.loc11_35: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  237. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  238. // CHECK:STDOUT: %impl.elem0.loc11_33.2: type = impl_witness_access constants.%J.lookup_impl_witness.264a02.2, element0 [symbolic = %impl.elem0.loc11_33.1 (constants.%impl.elem0.5607ef.2)]
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT: %W.loc11_28.2: @Compound1.%impl.elem0.loc11_33.1 (%impl.elem0.5607ef.2) = symbolic_binding W, 1 [symbolic = %W.loc11_28.1 (constants.%W)]
  241. // CHECK:STDOUT: }
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: interface @J {
  245. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  246. // CHECK:STDOUT: interface_with_self_decl @J [concrete]
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: !with Self:
  249. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  250. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0]
  251. // CHECK:STDOUT: }
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: !members:
  254. // CHECK:STDOUT: .Self = %Self
  255. // CHECK:STDOUT: .U = @U.%assoc0
  256. // CHECK:STDOUT: witness = (%U)
  257. // CHECK:STDOUT:
  258. // CHECK:STDOUT: !requires:
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: generic fn @Simple1(%T.loc8_12.2: %J.type, %S.loc8_26.2: @Simple1.%impl.elem0.loc8_31.1 (%impl.elem0.5607ef.1)) {
  262. // CHECK:STDOUT: %T.loc8_12.1: %J.type = symbolic_binding T, 0 [symbolic = %T.loc8_12.1 (constants.%T)]
  263. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc8_12.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  264. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_12.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264a02.1)]
  265. // CHECK:STDOUT: %impl.elem0.loc8_31.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_31.1 (constants.%impl.elem0.5607ef.1)]
  266. // CHECK:STDOUT: %S.loc8_26.1: @Simple1.%impl.elem0.loc8_31.1 (%impl.elem0.5607ef.1) = symbolic_binding S, 1 [symbolic = %S.loc8_26.1 (constants.%S)]
  267. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc8_31.1 [symbolic = %pattern_type (constants.%pattern_type.ad6d12.1)]
  268. // CHECK:STDOUT:
  269. // CHECK:STDOUT: !definition:
  270. // CHECK:STDOUT:
  271. // CHECK:STDOUT: fn() {
  272. // CHECK:STDOUT: !entry:
  273. // CHECK:STDOUT: return
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: generic fn @Compound1(%V.loc11_14.2: %J.type, %W.loc11_28.2: @Compound1.%impl.elem0.loc11_33.1 (%impl.elem0.5607ef.2)) {
  278. // CHECK:STDOUT: %V.loc11_14.1: %J.type = symbolic_binding V, 0 [symbolic = %V.loc11_14.1 (constants.%V)]
  279. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %V.loc11_14.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.264a02.2)]
  280. // CHECK:STDOUT: %impl.elem0.loc11_33.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_33.1 (constants.%impl.elem0.5607ef.2)]
  281. // CHECK:STDOUT: %W.loc11_28.1: @Compound1.%impl.elem0.loc11_33.1 (%impl.elem0.5607ef.2) = symbolic_binding W, 1 [symbolic = %W.loc11_28.1 (constants.%W)]
  282. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc11_33.1 [symbolic = %pattern_type (constants.%pattern_type.ad6d12.2)]
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: !definition:
  285. // CHECK:STDOUT:
  286. // CHECK:STDOUT: fn() {
  287. // CHECK:STDOUT: !entry:
  288. // CHECK:STDOUT: return
  289. // CHECK:STDOUT: }
  290. // CHECK:STDOUT: }
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: specific @J(constants.%Self) {
  293. // CHECK:STDOUT: !definition:
  294. // CHECK:STDOUT: }
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: specific @J(constants.%T) {
  297. // CHECK:STDOUT: !definition:
  298. // CHECK:STDOUT: }
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: specific @Simple1(constants.%T, constants.%S) {
  301. // CHECK:STDOUT: %T.loc8_12.1 => constants.%T
  302. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  303. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264a02.1
  304. // CHECK:STDOUT: %impl.elem0.loc8_31.1 => constants.%impl.elem0.5607ef.1
  305. // CHECK:STDOUT: %S.loc8_26.1 => constants.%S
  306. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad6d12.1
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: specific @J(constants.%V) {
  310. // CHECK:STDOUT: !definition:
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT:
  313. // CHECK:STDOUT: specific @Compound1(constants.%V, constants.%W) {
  314. // CHECK:STDOUT: %V.loc11_14.1 => constants.%V
  315. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.264a02.2
  316. // CHECK:STDOUT: %impl.elem0.loc11_33.1 => constants.%impl.elem0.5607ef.2
  317. // CHECK:STDOUT: %W.loc11_28.1 => constants.%W
  318. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad6d12.2
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT:
  321. // CHECK:STDOUT: --- non_instance.carbon
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: constants {
  324. // CHECK:STDOUT: %K1.type: type = facet_type <@K1> [concrete]
  325. // CHECK:STDOUT: %Self: %K1.type = symbolic_binding Self, 0 [symbolic]
  326. // CHECK:STDOUT: %K1.WithSelf.Q1.type.cab: type = fn_type @K1.WithSelf.Q1, @K1(%Self) [symbolic]
  327. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  328. // CHECK:STDOUT: %K1.WithSelf.Q1.d38: %K1.WithSelf.Q1.type.cab = struct_value () [symbolic]
  329. // CHECK:STDOUT: %K1.assoc_type: type = assoc_entity_type @K1 [concrete]
  330. // CHECK:STDOUT: %assoc0: %K1.assoc_type = assoc_entity element0, @K1.%K1.WithSelf.Q1.decl [concrete]
  331. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  332. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  333. // CHECK:STDOUT: %T: %K1.type = symbolic_binding T, 0 [symbolic]
  334. // CHECK:STDOUT: %pattern_type: type = pattern_type %K1.type [concrete]
  335. // CHECK:STDOUT: %Simple2.type: type = fn_type @Simple2 [concrete]
  336. // CHECK:STDOUT: %Simple2: %Simple2.type = struct_value () [concrete]
  337. // CHECK:STDOUT: %K1.WithSelf.Q1.type.0b941d.1: type = fn_type @K1.WithSelf.Q1, @K1(%T) [symbolic]
  338. // CHECK:STDOUT: %K1.WithSelf.Q1.2b1e8b.1: %K1.WithSelf.Q1.type.0b941d.1 = struct_value () [symbolic]
  339. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic]
  340. // CHECK:STDOUT: %K1.lookup_impl_witness.962f78.1: <witness> = lookup_impl_witness %T, @K1 [symbolic]
  341. // CHECK:STDOUT: %.838067.1: type = fn_type_with_self_type %K1.WithSelf.Q1.type.0b941d.1, %T [symbolic]
  342. // CHECK:STDOUT: %impl.elem0.6aa105.1: %.838067.1 = impl_witness_access %K1.lookup_impl_witness.962f78.1, element0 [symbolic]
  343. // CHECK:STDOUT: %specific_impl_fn.c7d99a.1: <specific function> = specific_impl_function %impl.elem0.6aa105.1, @K1.WithSelf.Q1(%T) [symbolic]
  344. // CHECK:STDOUT: %V: %K1.type = symbolic_binding V, 0 [symbolic]
  345. // CHECK:STDOUT: %Compound2.type: type = fn_type @Compound2 [concrete]
  346. // CHECK:STDOUT: %Compound2: %Compound2.type = struct_value () [concrete]
  347. // CHECK:STDOUT: %K1.lookup_impl_witness.962f78.2: <witness> = lookup_impl_witness %V, @K1 [symbolic]
  348. // CHECK:STDOUT: %K1.WithSelf.Q1.type.0b941d.2: type = fn_type @K1.WithSelf.Q1, @K1(%V) [symbolic]
  349. // CHECK:STDOUT: %K1.WithSelf.Q1.2b1e8b.2: %K1.WithSelf.Q1.type.0b941d.2 = struct_value () [symbolic]
  350. // CHECK:STDOUT: %.838067.2: type = fn_type_with_self_type %K1.WithSelf.Q1.type.0b941d.2, %V [symbolic]
  351. // CHECK:STDOUT: %impl.elem0.6aa105.2: %.838067.2 = impl_witness_access %K1.lookup_impl_witness.962f78.2, element0 [symbolic]
  352. // CHECK:STDOUT: %specific_impl_fn.c7d99a.2: <specific function> = specific_impl_function %impl.elem0.6aa105.2, @K1.WithSelf.Q1(%V) [symbolic]
  353. // CHECK:STDOUT: }
  354. // CHECK:STDOUT:
  355. // CHECK:STDOUT: imports {
  356. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  357. // CHECK:STDOUT: import Core//prelude
  358. // CHECK:STDOUT: import Core//prelude/...
  359. // CHECK:STDOUT: }
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: file {
  363. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  364. // CHECK:STDOUT: .Core = imports.%Core
  365. // CHECK:STDOUT: .K1 = %K1.decl
  366. // CHECK:STDOUT: .Simple2 = %Simple2.decl
  367. // CHECK:STDOUT: .Compound2 = %Compound2.decl
  368. // CHECK:STDOUT: }
  369. // CHECK:STDOUT: %Core.import = import Core
  370. // CHECK:STDOUT: %K1.decl: type = interface_decl @K1 [concrete = constants.%K1.type] {} {}
  371. // CHECK:STDOUT: %Simple2.decl: %Simple2.type = fn_decl @Simple2 [concrete = constants.%Simple2] {
  372. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  373. // CHECK:STDOUT: } {
  374. // CHECK:STDOUT: %.loc8: type = splice_block %K1.ref [concrete = constants.%K1.type] {
  375. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  376. // CHECK:STDOUT: %K1.ref: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type]
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT: %T.loc8_12.2: %K1.type = symbolic_binding T, 0 [symbolic = %T.loc8_12.1 (constants.%T)]
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT: %Compound2.decl: %Compound2.type = fn_decl @Compound2 [concrete = constants.%Compound2] {
  381. // CHECK:STDOUT: %V.patt: %pattern_type = symbolic_binding_pattern V, 0 [concrete]
  382. // CHECK:STDOUT: } {
  383. // CHECK:STDOUT: %.loc13: type = splice_block %K1.ref.loc13 [concrete = constants.%K1.type] {
  384. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  385. // CHECK:STDOUT: %K1.ref.loc13: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type]
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT: %V.loc13_14.2: %K1.type = symbolic_binding V, 0 [symbolic = %V.loc13_14.1 (constants.%V)]
  388. // CHECK:STDOUT: }
  389. // CHECK:STDOUT: }
  390. // CHECK:STDOUT:
  391. // CHECK:STDOUT: interface @K1 {
  392. // CHECK:STDOUT: %Self.loc3: %K1.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  393. // CHECK:STDOUT: interface_with_self_decl @K1 [concrete]
  394. // CHECK:STDOUT:
  395. // CHECK:STDOUT: !with Self:
  396. // CHECK:STDOUT: %K1.WithSelf.Q1.decl: @K1.%K1.WithSelf.Q1.type (%K1.WithSelf.Q1.type.cab) = fn_decl @K1.WithSelf.Q1 [symbolic = @K1.%K1.WithSelf.Q1 (constants.%K1.WithSelf.Q1.d38)] {} {}
  397. // CHECK:STDOUT: %assoc0: %K1.assoc_type = assoc_entity element0, %K1.WithSelf.Q1.decl [concrete = constants.%assoc0]
  398. // CHECK:STDOUT:
  399. // CHECK:STDOUT: !members:
  400. // CHECK:STDOUT: .Self = %Self.loc3
  401. // CHECK:STDOUT: .Q1 = %assoc0
  402. // CHECK:STDOUT: witness = (%K1.WithSelf.Q1.decl)
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: !requires:
  405. // CHECK:STDOUT: }
  406. // CHECK:STDOUT:
  407. // CHECK:STDOUT: generic fn @K1.WithSelf.Q1(@K1.%Self.loc3: %K1.type) {
  408. // CHECK:STDOUT: fn();
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT:
  411. // CHECK:STDOUT: generic fn @Simple2(%T.loc8_12.2: %K1.type) {
  412. // CHECK:STDOUT: %T.loc8_12.1: %K1.type = symbolic_binding T, 0 [symbolic = %T.loc8_12.1 (constants.%T)]
  413. // CHECK:STDOUT:
  414. // CHECK:STDOUT: !definition:
  415. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc8_12.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  416. // CHECK:STDOUT: %K1.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_12.1, @K1 [symbolic = %K1.lookup_impl_witness (constants.%K1.lookup_impl_witness.962f78.1)]
  417. // CHECK:STDOUT: %K1.WithSelf.Q1.type: type = fn_type @K1.WithSelf.Q1, @K1(%T.loc8_12.1) [symbolic = %K1.WithSelf.Q1.type (constants.%K1.WithSelf.Q1.type.0b941d.1)]
  418. // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type %K1.WithSelf.Q1.type, %T.loc8_12.1 [symbolic = %.loc9_4.2 (constants.%.838067.1)]
  419. // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Simple2.%.loc9_4.2 (%.838067.1) = impl_witness_access %K1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0.6aa105.1)]
  420. // CHECK:STDOUT: %specific_impl_fn.loc9_4.2: <specific function> = specific_impl_function %impl.elem0.loc9_4.2, @K1.WithSelf.Q1(%T.loc8_12.1) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn.c7d99a.1)]
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: fn() {
  423. // CHECK:STDOUT: !entry:
  424. // CHECK:STDOUT: %T.ref: %K1.type = name_ref T, %T.loc8_12.2 [symbolic = %T.loc8_12.1 (constants.%T)]
  425. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  426. // CHECK:STDOUT: %.loc9_4.1: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  427. // CHECK:STDOUT: %Q1.ref: %K1.assoc_type = name_ref Q1, @K1.%assoc0 [concrete = constants.%assoc0]
  428. // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Simple2.%.loc9_4.2 (%.838067.1) = impl_witness_access constants.%K1.lookup_impl_witness.962f78.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0.6aa105.1)]
  429. // CHECK:STDOUT: %specific_impl_fn.loc9_4.1: <specific function> = specific_impl_function %impl.elem0.loc9_4.1, @K1.WithSelf.Q1(constants.%T) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn.c7d99a.1)]
  430. // CHECK:STDOUT: %K1.WithSelf.Q1.call: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1()
  431. // CHECK:STDOUT: return
  432. // CHECK:STDOUT: }
  433. // CHECK:STDOUT: }
  434. // CHECK:STDOUT:
  435. // CHECK:STDOUT: generic fn @Compound2(%V.loc13_14.2: %K1.type) {
  436. // CHECK:STDOUT: %V.loc13_14.1: %K1.type = symbolic_binding V, 0 [symbolic = %V.loc13_14.1 (constants.%V)]
  437. // CHECK:STDOUT:
  438. // CHECK:STDOUT: !definition:
  439. // CHECK:STDOUT: %K1.lookup_impl_witness: <witness> = lookup_impl_witness %V.loc13_14.1, @K1 [symbolic = %K1.lookup_impl_witness (constants.%K1.lookup_impl_witness.962f78.2)]
  440. // CHECK:STDOUT: %K1.WithSelf.Q1.type: type = fn_type @K1.WithSelf.Q1, @K1(%V.loc13_14.1) [symbolic = %K1.WithSelf.Q1.type (constants.%K1.WithSelf.Q1.type.0b941d.2)]
  441. // CHECK:STDOUT: %.loc14: type = fn_type_with_self_type %K1.WithSelf.Q1.type, %V.loc13_14.1 [symbolic = %.loc14 (constants.%.838067.2)]
  442. // CHECK:STDOUT: %impl.elem0.loc14_4.2: @Compound2.%.loc14 (%.838067.2) = impl_witness_access %K1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.6aa105.2)]
  443. // CHECK:STDOUT: %specific_impl_fn.loc14_4.2: <specific function> = specific_impl_function %impl.elem0.loc14_4.2, @K1.WithSelf.Q1(%V.loc13_14.1) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.c7d99a.2)]
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: fn() {
  446. // CHECK:STDOUT: !entry:
  447. // CHECK:STDOUT: %V.ref: %K1.type = name_ref V, %V.loc13_14.2 [symbolic = %V.loc13_14.1 (constants.%V)]
  448. // CHECK:STDOUT: %K1.ref.loc14: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type]
  449. // CHECK:STDOUT: %Q1.ref: %K1.assoc_type = name_ref Q1, @K1.%assoc0 [concrete = constants.%assoc0]
  450. // CHECK:STDOUT: %impl.elem0.loc14_4.1: @Compound2.%.loc14 (%.838067.2) = impl_witness_access constants.%K1.lookup_impl_witness.962f78.2, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.6aa105.2)]
  451. // CHECK:STDOUT: %specific_impl_fn.loc14_4.1: <specific function> = specific_impl_function %impl.elem0.loc14_4.1, @K1.WithSelf.Q1(constants.%V) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.c7d99a.2)]
  452. // CHECK:STDOUT: %K1.WithSelf.Q1.call: init %empty_tuple.type = call %specific_impl_fn.loc14_4.1()
  453. // CHECK:STDOUT: return
  454. // CHECK:STDOUT: }
  455. // CHECK:STDOUT: }
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: specific @K1(constants.%Self) {
  458. // CHECK:STDOUT: !definition:
  459. // CHECK:STDOUT: %Self.loc4 => constants.%Self
  460. // CHECK:STDOUT: %K1.WithSelf.Q1.type => constants.%K1.WithSelf.Q1.type.cab
  461. // CHECK:STDOUT: %K1.WithSelf.Q1 => constants.%K1.WithSelf.Q1.d38
  462. // CHECK:STDOUT: }
  463. // CHECK:STDOUT:
  464. // CHECK:STDOUT: specific @K1.WithSelf.Q1(constants.%Self) {}
  465. // CHECK:STDOUT:
  466. // CHECK:STDOUT: specific @Simple2(constants.%T) {
  467. // CHECK:STDOUT: %T.loc8_12.1 => constants.%T
  468. // CHECK:STDOUT: }
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: specific @K1(constants.%T) {
  471. // CHECK:STDOUT: !definition:
  472. // CHECK:STDOUT: %Self.loc4 => constants.%T
  473. // CHECK:STDOUT: %K1.WithSelf.Q1.type => constants.%K1.WithSelf.Q1.type.0b941d.1
  474. // CHECK:STDOUT: %K1.WithSelf.Q1 => constants.%K1.WithSelf.Q1.2b1e8b.1
  475. // CHECK:STDOUT: }
  476. // CHECK:STDOUT:
  477. // CHECK:STDOUT: specific @K1.WithSelf.Q1(constants.%T) {}
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: specific @Compound2(constants.%V) {
  480. // CHECK:STDOUT: %V.loc13_14.1 => constants.%V
  481. // CHECK:STDOUT: }
  482. // CHECK:STDOUT:
  483. // CHECK:STDOUT: specific @K1(constants.%V) {
  484. // CHECK:STDOUT: !definition:
  485. // CHECK:STDOUT: %Self.loc4 => constants.%V
  486. // CHECK:STDOUT: %K1.WithSelf.Q1.type => constants.%K1.WithSelf.Q1.type.0b941d.2
  487. // CHECK:STDOUT: %K1.WithSelf.Q1 => constants.%K1.WithSelf.Q1.2b1e8b.2
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: specific @K1.WithSelf.Q1(constants.%V) {}
  491. // CHECK:STDOUT:
  492. // CHECK:STDOUT: --- fail_caller_instance_interface_not.carbon
  493. // CHECK:STDOUT:
  494. // CHECK:STDOUT: constants {
  495. // CHECK:STDOUT: %K2.type: type = facet_type <@K2> [concrete]
  496. // CHECK:STDOUT: %Self.404: %K2.type = symbolic_binding Self, 0 [symbolic]
  497. // CHECK:STDOUT: %K2.WithSelf.Q2.type.0f8: type = fn_type @K2.WithSelf.Q2, @K2(%Self.404) [symbolic]
  498. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  499. // CHECK:STDOUT: %K2.WithSelf.Q2.c3d: %K2.WithSelf.Q2.type.0f8 = struct_value () [symbolic]
  500. // CHECK:STDOUT: %K2.assoc_type: type = assoc_entity_type @K2 [concrete]
  501. // CHECK:STDOUT: %assoc0.5ff: %K2.assoc_type = assoc_entity element0, @K2.%K2.WithSelf.Q2.decl [concrete]
  502. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  503. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  504. // CHECK:STDOUT: %T: %K2.type = symbolic_binding T, 0 [symbolic]
  505. // CHECK:STDOUT: %pattern_type.8cb: type = pattern_type %K2.type [concrete]
  506. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic]
  507. // CHECK:STDOUT: %pattern_type.6a7df6.1: type = pattern_type %T.binding.as_type [symbolic]
  508. // CHECK:STDOUT: %Simple3.type: type = fn_type @Simple3 [concrete]
  509. // CHECK:STDOUT: %Simple3: %Simple3.type = struct_value () [concrete]
  510. // CHECK:STDOUT: %require_complete.57854f.1: <witness> = require_complete_type %T.binding.as_type [symbolic]
  511. // CHECK:STDOUT: %K2.WithSelf.Q2.type.3af: type = fn_type @K2.WithSelf.Q2, @K2(%T) [symbolic]
  512. // CHECK:STDOUT: %K2.WithSelf.Q2.c9a: %K2.WithSelf.Q2.type.3af = struct_value () [symbolic]
  513. // CHECK:STDOUT: %K2.lookup_impl_witness: <witness> = lookup_impl_witness %T, @K2 [symbolic]
  514. // CHECK:STDOUT: %.02c: type = fn_type_with_self_type %K2.WithSelf.Q2.type.3af, %T [symbolic]
  515. // CHECK:STDOUT: %impl.elem0: %.02c = impl_witness_access %K2.lookup_impl_witness, element0 [symbolic]
  516. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @K2.WithSelf.Q2(%T) [symbolic]
  517. // CHECK:STDOUT: %V: %K2.type = symbolic_binding V, 0 [symbolic]
  518. // CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 0, %V [symbolic]
  519. // CHECK:STDOUT: %pattern_type.6a7df6.2: type = pattern_type %V.binding.as_type [symbolic]
  520. // CHECK:STDOUT: %Compound3.type: type = fn_type @Compound3 [concrete]
  521. // CHECK:STDOUT: %Compound3: %Compound3.type = struct_value () [concrete]
  522. // CHECK:STDOUT: %require_complete.57854f.2: <witness> = require_complete_type %V.binding.as_type [symbolic]
  523. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  524. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  525. // CHECK:STDOUT: }
  526. // CHECK:STDOUT:
  527. // CHECK:STDOUT: imports {
  528. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  529. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  530. // CHECK:STDOUT: import Core//prelude
  531. // CHECK:STDOUT: import Core//prelude/...
  532. // CHECK:STDOUT: }
  533. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  534. // CHECK:STDOUT: }
  535. // CHECK:STDOUT:
  536. // CHECK:STDOUT: file {
  537. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  538. // CHECK:STDOUT: .Core = imports.%Core
  539. // CHECK:STDOUT: .K2 = %K2.decl
  540. // CHECK:STDOUT: .Simple3 = %Simple3.decl
  541. // CHECK:STDOUT: .Compound3 = %Compound3.decl
  542. // CHECK:STDOUT: }
  543. // CHECK:STDOUT: %Core.import = import Core
  544. // CHECK:STDOUT: %K2.decl: type = interface_decl @K2 [concrete = constants.%K2.type] {} {}
  545. // CHECK:STDOUT: %Simple3.decl: %Simple3.type = fn_decl @Simple3 [concrete = constants.%Simple3] {
  546. // CHECK:STDOUT: %T.patt: %pattern_type.8cb = symbolic_binding_pattern T, 0 [concrete]
  547. // CHECK:STDOUT: %x.patt: @Simple3.%pattern_type (%pattern_type.6a7df6.1) = value_binding_pattern x [concrete]
  548. // CHECK:STDOUT: %x.param_patt: @Simple3.%pattern_type (%pattern_type.6a7df6.1) = value_param_pattern %x.patt, call_param0 [concrete]
  549. // CHECK:STDOUT: } {
  550. // CHECK:STDOUT: %.loc8_16: type = splice_block %K2.ref [concrete = constants.%K2.type] {
  551. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  552. // CHECK:STDOUT: %K2.ref: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type]
  553. // CHECK:STDOUT: }
  554. // CHECK:STDOUT: %T.loc8_12.2: %K2.type = symbolic_binding T, 0 [symbolic = %T.loc8_12.1 (constants.%T)]
  555. // CHECK:STDOUT: %x.param: @Simple3.%T.binding.as_type (%T.binding.as_type) = value_param call_param0
  556. // CHECK:STDOUT: %.loc8_23.1: type = splice_block %.loc8_23.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
  557. // CHECK:STDOUT: %T.ref: %K2.type = name_ref T, %T.loc8_12.2 [symbolic = %T.loc8_12.1 (constants.%T)]
  558. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  559. // CHECK:STDOUT: %.loc8_23.2: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  560. // CHECK:STDOUT: }
  561. // CHECK:STDOUT: %x: @Simple3.%T.binding.as_type (%T.binding.as_type) = value_binding x, %x.param
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT: %Compound3.decl: %Compound3.type = fn_decl @Compound3 [concrete = constants.%Compound3] {
  564. // CHECK:STDOUT: %V.patt: %pattern_type.8cb = symbolic_binding_pattern V, 0 [concrete]
  565. // CHECK:STDOUT: %y.patt: @Compound3.%pattern_type (%pattern_type.6a7df6.2) = value_binding_pattern y [concrete]
  566. // CHECK:STDOUT: %y.param_patt: @Compound3.%pattern_type (%pattern_type.6a7df6.2) = value_param_pattern %y.patt, call_param0 [concrete]
  567. // CHECK:STDOUT: } {
  568. // CHECK:STDOUT: %.loc14_18: type = splice_block %K2.ref.loc14 [concrete = constants.%K2.type] {
  569. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  570. // CHECK:STDOUT: %K2.ref.loc14: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type]
  571. // CHECK:STDOUT: }
  572. // CHECK:STDOUT: %V.loc14_14.2: %K2.type = symbolic_binding V, 0 [symbolic = %V.loc14_14.1 (constants.%V)]
  573. // CHECK:STDOUT: %y.param: @Compound3.%V.binding.as_type (%V.binding.as_type) = value_param call_param0
  574. // CHECK:STDOUT: %.loc14_25.1: type = splice_block %.loc14_25.2 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] {
  575. // CHECK:STDOUT: %V.ref: %K2.type = name_ref V, %V.loc14_14.2 [symbolic = %V.loc14_14.1 (constants.%V)]
  576. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V.ref [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  577. // CHECK:STDOUT: %.loc14_25.2: type = converted %V.ref, %V.as_type [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  578. // CHECK:STDOUT: }
  579. // CHECK:STDOUT: %y: @Compound3.%V.binding.as_type (%V.binding.as_type) = value_binding y, %y.param
  580. // CHECK:STDOUT: }
  581. // CHECK:STDOUT: }
  582. // CHECK:STDOUT:
  583. // CHECK:STDOUT: interface @K2 {
  584. // CHECK:STDOUT: %Self.loc3: %K2.type = symbolic_binding Self, 0 [symbolic = constants.%Self.404]
  585. // CHECK:STDOUT: interface_with_self_decl @K2 [concrete]
  586. // CHECK:STDOUT:
  587. // CHECK:STDOUT: !with Self:
  588. // CHECK:STDOUT: %K2.WithSelf.Q2.decl: @K2.%K2.WithSelf.Q2.type (%K2.WithSelf.Q2.type.0f8) = fn_decl @K2.WithSelf.Q2 [symbolic = @K2.%K2.WithSelf.Q2 (constants.%K2.WithSelf.Q2.c3d)] {} {}
  589. // CHECK:STDOUT: %assoc0: %K2.assoc_type = assoc_entity element0, %K2.WithSelf.Q2.decl [concrete = constants.%assoc0.5ff]
  590. // CHECK:STDOUT:
  591. // CHECK:STDOUT: !members:
  592. // CHECK:STDOUT: .Self = %Self.loc3
  593. // CHECK:STDOUT: .Q2 = %assoc0
  594. // CHECK:STDOUT: witness = (%K2.WithSelf.Q2.decl)
  595. // CHECK:STDOUT:
  596. // CHECK:STDOUT: !requires:
  597. // CHECK:STDOUT: }
  598. // CHECK:STDOUT:
  599. // CHECK:STDOUT: generic fn @K2.WithSelf.Q2(@K2.%Self.loc3: %K2.type) {
  600. // CHECK:STDOUT: fn();
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT:
  603. // CHECK:STDOUT: generic fn @Simple3(%T.loc8_12.2: %K2.type) {
  604. // CHECK:STDOUT: %T.loc8_12.1: %K2.type = symbolic_binding T, 0 [symbolic = %T.loc8_12.1 (constants.%T)]
  605. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc8_12.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  606. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.6a7df6.1)]
  607. // CHECK:STDOUT:
  608. // CHECK:STDOUT: !definition:
  609. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.57854f.1)]
  610. // CHECK:STDOUT: %K2.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_12.1, @K2 [symbolic = %K2.lookup_impl_witness (constants.%K2.lookup_impl_witness)]
  611. // CHECK:STDOUT: %K2.WithSelf.Q2.type: type = fn_type @K2.WithSelf.Q2, @K2(%T.loc8_12.1) [symbolic = %K2.WithSelf.Q2.type (constants.%K2.WithSelf.Q2.type.3af)]
  612. // CHECK:STDOUT: %.loc9: type = fn_type_with_self_type %K2.WithSelf.Q2.type, %T.loc8_12.1 [symbolic = %.loc9 (constants.%.02c)]
  613. // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Simple3.%.loc9 (%.02c) = impl_witness_access %K2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)]
  614. // CHECK:STDOUT: %specific_impl_fn.loc9_4.2: <specific function> = specific_impl_function %impl.elem0.loc9_4.2, @K2.WithSelf.Q2(%T.loc8_12.1) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)]
  615. // CHECK:STDOUT:
  616. // CHECK:STDOUT: fn(%x.param: @Simple3.%T.binding.as_type (%T.binding.as_type)) {
  617. // CHECK:STDOUT: !entry:
  618. // CHECK:STDOUT: %x.ref: @Simple3.%T.binding.as_type (%T.binding.as_type) = name_ref x, %x
  619. // CHECK:STDOUT: %Q2.ref: %K2.assoc_type = name_ref Q2, @K2.%assoc0 [concrete = constants.%assoc0.5ff]
  620. // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Simple3.%.loc9 (%.02c) = impl_witness_access constants.%K2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)]
  621. // CHECK:STDOUT: %specific_impl_fn.loc9_4.1: <specific function> = specific_impl_function %impl.elem0.loc9_4.1, @K2.WithSelf.Q2(constants.%T) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)]
  622. // CHECK:STDOUT: %K2.WithSelf.Q2.call: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1()
  623. // CHECK:STDOUT: return
  624. // CHECK:STDOUT: }
  625. // CHECK:STDOUT: }
  626. // CHECK:STDOUT:
  627. // CHECK:STDOUT: generic fn @Compound3(%V.loc14_14.2: %K2.type) {
  628. // CHECK:STDOUT: %V.loc14_14.1: %K2.type = symbolic_binding V, 0 [symbolic = %V.loc14_14.1 (constants.%V)]
  629. // CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 0, %V.loc14_14.1 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  630. // CHECK:STDOUT: %pattern_type: type = pattern_type %V.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.6a7df6.2)]
  631. // CHECK:STDOUT:
  632. // CHECK:STDOUT: !definition:
  633. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %V.binding.as_type [symbolic = %require_complete (constants.%require_complete.57854f.2)]
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: fn(%y.param: @Compound3.%V.binding.as_type (%V.binding.as_type)) {
  636. // CHECK:STDOUT: !entry:
  637. // CHECK:STDOUT: %y.ref: @Compound3.%V.binding.as_type (%V.binding.as_type) = name_ref y, %y
  638. // CHECK:STDOUT: %K2.ref.loc22: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type]
  639. // CHECK:STDOUT: %Q2.ref: %K2.assoc_type = name_ref Q2, @K2.%assoc0 [concrete = constants.%assoc0.5ff]
  640. // CHECK:STDOUT: %.loc22: %K2.type = converted %y.ref, <error> [concrete = <error>]
  641. // CHECK:STDOUT: return
  642. // CHECK:STDOUT: }
  643. // CHECK:STDOUT: }
  644. // CHECK:STDOUT:
  645. // CHECK:STDOUT: specific @K2(constants.%Self.404) {
  646. // CHECK:STDOUT: !definition:
  647. // CHECK:STDOUT: %Self.loc4 => constants.%Self.404
  648. // CHECK:STDOUT: %K2.WithSelf.Q2.type => constants.%K2.WithSelf.Q2.type.0f8
  649. // CHECK:STDOUT: %K2.WithSelf.Q2 => constants.%K2.WithSelf.Q2.c3d
  650. // CHECK:STDOUT: }
  651. // CHECK:STDOUT:
  652. // CHECK:STDOUT: specific @K2.WithSelf.Q2(constants.%Self.404) {}
  653. // CHECK:STDOUT:
  654. // CHECK:STDOUT: specific @Simple3(constants.%T) {
  655. // CHECK:STDOUT: %T.loc8_12.1 => constants.%T
  656. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  657. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6a7df6.1
  658. // CHECK:STDOUT: }
  659. // CHECK:STDOUT:
  660. // CHECK:STDOUT: specific @K2(constants.%T) {
  661. // CHECK:STDOUT: !definition:
  662. // CHECK:STDOUT: %Self.loc4 => constants.%T
  663. // CHECK:STDOUT: %K2.WithSelf.Q2.type => constants.%K2.WithSelf.Q2.type.3af
  664. // CHECK:STDOUT: %K2.WithSelf.Q2 => constants.%K2.WithSelf.Q2.c9a
  665. // CHECK:STDOUT: }
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: specific @K2.WithSelf.Q2(constants.%T) {}
  668. // CHECK:STDOUT:
  669. // CHECK:STDOUT: specific @Compound3(constants.%V) {
  670. // CHECK:STDOUT: %V.loc14_14.1 => constants.%V
  671. // CHECK:STDOUT: %V.binding.as_type => constants.%V.binding.as_type
  672. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6a7df6.2
  673. // CHECK:STDOUT: }
  674. // CHECK:STDOUT:
  675. // CHECK:STDOUT: --- instance.carbon
  676. // CHECK:STDOUT:
  677. // CHECK:STDOUT: constants {
  678. // CHECK:STDOUT: %L1.type: type = facet_type <@L1> [concrete]
  679. // CHECK:STDOUT: %Self: %L1.type = symbolic_binding Self, 0 [symbolic]
  680. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic]
  681. // CHECK:STDOUT: %pattern_type.9c1: type = pattern_type %Self.binding.as_type [symbolic]
  682. // CHECK:STDOUT: %L1.WithSelf.R1.type.504: type = fn_type @L1.WithSelf.R1, @L1(%Self) [symbolic]
  683. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  684. // CHECK:STDOUT: %L1.WithSelf.R1.aa4: %L1.WithSelf.R1.type.504 = struct_value () [symbolic]
  685. // CHECK:STDOUT: %L1.assoc_type: type = assoc_entity_type @L1 [concrete]
  686. // CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, @L1.%L1.WithSelf.R1.decl [concrete]
  687. // CHECK:STDOUT: %L1.WithSelf.S1.type.e03: type = fn_type @L1.WithSelf.S1, @L1(%Self) [symbolic]
  688. // CHECK:STDOUT: %L1.WithSelf.S1.480: %L1.WithSelf.S1.type.e03 = struct_value () [symbolic]
  689. // CHECK:STDOUT: %assoc1: %L1.assoc_type = assoc_entity element1, @L1.%L1.WithSelf.S1.decl [concrete]
  690. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  691. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  692. // CHECK:STDOUT: %T: %L1.type = symbolic_binding T, 0 [symbolic]
  693. // CHECK:STDOUT: %pattern_type.a5c: type = pattern_type %L1.type [concrete]
  694. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic]
  695. // CHECK:STDOUT: %pattern_type.352a62.1: type = pattern_type %T.binding.as_type [symbolic]
  696. // CHECK:STDOUT: %ptr.6c1f8e.1: type = ptr_type %T.binding.as_type [symbolic]
  697. // CHECK:STDOUT: %pattern_type.740d56.1: type = pattern_type %ptr.6c1f8e.1 [symbolic]
  698. // CHECK:STDOUT: %Simple4.type: type = fn_type @Simple4 [concrete]
  699. // CHECK:STDOUT: %Simple4: %Simple4.type = struct_value () [concrete]
  700. // CHECK:STDOUT: %require_complete.592d00.1: <witness> = require_complete_type %T.binding.as_type [symbolic]
  701. // CHECK:STDOUT: %require_complete.94a5f1.1: <witness> = require_complete_type %ptr.6c1f8e.1 [symbolic]
  702. // CHECK:STDOUT: %L1.WithSelf.R1.type.0d7469.1: type = fn_type @L1.WithSelf.R1, @L1(%T) [symbolic]
  703. // CHECK:STDOUT: %L1.WithSelf.R1.f22128.1: %L1.WithSelf.R1.type.0d7469.1 = struct_value () [symbolic]
  704. // CHECK:STDOUT: %L1.WithSelf.S1.type.79e6b4.1: type = fn_type @L1.WithSelf.S1, @L1(%T) [symbolic]
  705. // CHECK:STDOUT: %L1.WithSelf.S1.cd5111.1: %L1.WithSelf.S1.type.79e6b4.1 = struct_value () [symbolic]
  706. // CHECK:STDOUT: %L1.lookup_impl_witness.297fbf.1: <witness> = lookup_impl_witness %T, @L1 [symbolic]
  707. // CHECK:STDOUT: %.69b631.1: type = fn_type_with_self_type %L1.WithSelf.R1.type.0d7469.1, %T [symbolic]
  708. // CHECK:STDOUT: %impl.elem0.60b493.1: %.69b631.1 = impl_witness_access %L1.lookup_impl_witness.297fbf.1, element0 [symbolic]
  709. // CHECK:STDOUT: %specific_impl_fn.f023e9.1: <specific function> = specific_impl_function %impl.elem0.60b493.1, @L1.WithSelf.R1(%T) [symbolic]
  710. // CHECK:STDOUT: %.917578.1: type = fn_type_with_self_type %L1.WithSelf.S1.type.79e6b4.1, %T [symbolic]
  711. // CHECK:STDOUT: %impl.elem1.e3fe4c.1: %.917578.1 = impl_witness_access %L1.lookup_impl_witness.297fbf.1, element1 [symbolic]
  712. // CHECK:STDOUT: %specific_impl_fn.2cc093.1: <specific function> = specific_impl_function %impl.elem1.e3fe4c.1, @L1.WithSelf.S1(%T) [symbolic]
  713. // CHECK:STDOUT: %V: %L1.type = symbolic_binding V, 0 [symbolic]
  714. // CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 0, %V [symbolic]
  715. // CHECK:STDOUT: %pattern_type.352a62.2: type = pattern_type %V.binding.as_type [symbolic]
  716. // CHECK:STDOUT: %ptr.6c1f8e.2: type = ptr_type %V.binding.as_type [symbolic]
  717. // CHECK:STDOUT: %pattern_type.740d56.2: type = pattern_type %ptr.6c1f8e.2 [symbolic]
  718. // CHECK:STDOUT: %Compound4.type: type = fn_type @Compound4 [concrete]
  719. // CHECK:STDOUT: %Compound4: %Compound4.type = struct_value () [concrete]
  720. // CHECK:STDOUT: %require_complete.592d00.2: <witness> = require_complete_type %V.binding.as_type [symbolic]
  721. // CHECK:STDOUT: %require_complete.94a5f1.2: <witness> = require_complete_type %ptr.6c1f8e.2 [symbolic]
  722. // CHECK:STDOUT: %L1.lookup_impl_witness.297fbf.2: <witness> = lookup_impl_witness %V, @L1 [symbolic]
  723. // CHECK:STDOUT: %L1.WithSelf.R1.type.0d7469.2: type = fn_type @L1.WithSelf.R1, @L1(%V) [symbolic]
  724. // CHECK:STDOUT: %L1.WithSelf.R1.f22128.2: %L1.WithSelf.R1.type.0d7469.2 = struct_value () [symbolic]
  725. // CHECK:STDOUT: %L1.WithSelf.S1.type.79e6b4.2: type = fn_type @L1.WithSelf.S1, @L1(%V) [symbolic]
  726. // CHECK:STDOUT: %L1.WithSelf.S1.cd5111.2: %L1.WithSelf.S1.type.79e6b4.2 = struct_value () [symbolic]
  727. // CHECK:STDOUT: %.69b631.2: type = fn_type_with_self_type %L1.WithSelf.R1.type.0d7469.2, %V [symbolic]
  728. // CHECK:STDOUT: %impl.elem0.60b493.2: %.69b631.2 = impl_witness_access %L1.lookup_impl_witness.297fbf.2, element0 [symbolic]
  729. // CHECK:STDOUT: %specific_impl_fn.f023e9.2: <specific function> = specific_impl_function %impl.elem0.60b493.2, @L1.WithSelf.R1(%V) [symbolic]
  730. // CHECK:STDOUT: %.917578.2: type = fn_type_with_self_type %L1.WithSelf.S1.type.79e6b4.2, %V [symbolic]
  731. // CHECK:STDOUT: %impl.elem1.e3fe4c.2: %.917578.2 = impl_witness_access %L1.lookup_impl_witness.297fbf.2, element1 [symbolic]
  732. // CHECK:STDOUT: %specific_impl_fn.2cc093.2: <specific function> = specific_impl_function %impl.elem1.e3fe4c.2, @L1.WithSelf.S1(%V) [symbolic]
  733. // CHECK:STDOUT: }
  734. // CHECK:STDOUT:
  735. // CHECK:STDOUT: imports {
  736. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  737. // CHECK:STDOUT: import Core//prelude
  738. // CHECK:STDOUT: import Core//prelude/...
  739. // CHECK:STDOUT: }
  740. // CHECK:STDOUT: }
  741. // CHECK:STDOUT:
  742. // CHECK:STDOUT: file {
  743. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  744. // CHECK:STDOUT: .Core = imports.%Core
  745. // CHECK:STDOUT: .L1 = %L1.decl
  746. // CHECK:STDOUT: .Simple4 = %Simple4.decl
  747. // CHECK:STDOUT: .Compound4 = %Compound4.decl
  748. // CHECK:STDOUT: }
  749. // CHECK:STDOUT: %Core.import = import Core
  750. // CHECK:STDOUT: %L1.decl: type = interface_decl @L1 [concrete = constants.%L1.type] {} {}
  751. // CHECK:STDOUT: %Simple4.decl: %Simple4.type = fn_decl @Simple4 [concrete = constants.%Simple4] {
  752. // CHECK:STDOUT: %T.patt: %pattern_type.a5c = symbolic_binding_pattern T, 0 [concrete]
  753. // CHECK:STDOUT: %x.patt: @Simple4.%pattern_type.loc9_20 (%pattern_type.352a62.1) = value_binding_pattern x [concrete]
  754. // CHECK:STDOUT: %x.param_patt: @Simple4.%pattern_type.loc9_20 (%pattern_type.352a62.1) = value_param_pattern %x.patt, call_param0 [concrete]
  755. // CHECK:STDOUT: %p.patt: @Simple4.%pattern_type.loc9_26 (%pattern_type.740d56.1) = value_binding_pattern p [concrete]
  756. // CHECK:STDOUT: %p.param_patt: @Simple4.%pattern_type.loc9_26 (%pattern_type.740d56.1) = value_param_pattern %p.patt, call_param1 [concrete]
  757. // CHECK:STDOUT: } {
  758. // CHECK:STDOUT: %.loc9_16: type = splice_block %L1.ref [concrete = constants.%L1.type] {
  759. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  760. // CHECK:STDOUT: %L1.ref: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  761. // CHECK:STDOUT: }
  762. // CHECK:STDOUT: %T.loc9_12.2: %L1.type = symbolic_binding T, 0 [symbolic = %T.loc9_12.1 (constants.%T)]
  763. // CHECK:STDOUT: %x.param: @Simple4.%T.binding.as_type (%T.binding.as_type) = value_param call_param0
  764. // CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
  765. // CHECK:STDOUT: %T.ref.loc9_23: %L1.type = name_ref T, %T.loc9_12.2 [symbolic = %T.loc9_12.1 (constants.%T)]
  766. // CHECK:STDOUT: %T.as_type.loc9_23: type = facet_access_type %T.ref.loc9_23 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  767. // CHECK:STDOUT: %.loc9_23.2: type = converted %T.ref.loc9_23, %T.as_type.loc9_23 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  768. // CHECK:STDOUT: }
  769. // CHECK:STDOUT: %x: @Simple4.%T.binding.as_type (%T.binding.as_type) = value_binding x, %x.param
  770. // CHECK:STDOUT: %p.param: @Simple4.%ptr.loc9_30.1 (%ptr.6c1f8e.1) = value_param call_param1
  771. // CHECK:STDOUT: %.loc9_30.1: type = splice_block %ptr.loc9_30.2 [symbolic = %ptr.loc9_30.1 (constants.%ptr.6c1f8e.1)] {
  772. // CHECK:STDOUT: %T.ref.loc9_29: %L1.type = name_ref T, %T.loc9_12.2 [symbolic = %T.loc9_12.1 (constants.%T)]
  773. // CHECK:STDOUT: %T.as_type.loc9_30: type = facet_access_type %T.ref.loc9_29 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  774. // CHECK:STDOUT: %.loc9_30.2: type = converted %T.ref.loc9_29, %T.as_type.loc9_30 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  775. // CHECK:STDOUT: %ptr.loc9_30.2: type = ptr_type %.loc9_30.2 [symbolic = %ptr.loc9_30.1 (constants.%ptr.6c1f8e.1)]
  776. // CHECK:STDOUT: }
  777. // CHECK:STDOUT: %p: @Simple4.%ptr.loc9_30.1 (%ptr.6c1f8e.1) = value_binding p, %p.param
  778. // CHECK:STDOUT: }
  779. // CHECK:STDOUT: %Compound4.decl: %Compound4.type = fn_decl @Compound4 [concrete = constants.%Compound4] {
  780. // CHECK:STDOUT: %V.patt: %pattern_type.a5c = symbolic_binding_pattern V, 0 [concrete]
  781. // CHECK:STDOUT: %y.patt: @Compound4.%pattern_type.loc15_22 (%pattern_type.352a62.2) = value_binding_pattern y [concrete]
  782. // CHECK:STDOUT: %y.param_patt: @Compound4.%pattern_type.loc15_22 (%pattern_type.352a62.2) = value_param_pattern %y.patt, call_param0 [concrete]
  783. // CHECK:STDOUT: %p.patt: @Compound4.%pattern_type.loc15_28 (%pattern_type.740d56.2) = value_binding_pattern p [concrete]
  784. // CHECK:STDOUT: %p.param_patt: @Compound4.%pattern_type.loc15_28 (%pattern_type.740d56.2) = value_param_pattern %p.patt, call_param1 [concrete]
  785. // CHECK:STDOUT: } {
  786. // CHECK:STDOUT: %.loc15_18: type = splice_block %L1.ref.loc15 [concrete = constants.%L1.type] {
  787. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  788. // CHECK:STDOUT: %L1.ref.loc15: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  789. // CHECK:STDOUT: }
  790. // CHECK:STDOUT: %V.loc15_14.2: %L1.type = symbolic_binding V, 0 [symbolic = %V.loc15_14.1 (constants.%V)]
  791. // CHECK:STDOUT: %y.param: @Compound4.%V.binding.as_type (%V.binding.as_type) = value_param call_param0
  792. // CHECK:STDOUT: %.loc15_25.1: type = splice_block %.loc15_25.2 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)] {
  793. // CHECK:STDOUT: %V.ref.loc15_25: %L1.type = name_ref V, %V.loc15_14.2 [symbolic = %V.loc15_14.1 (constants.%V)]
  794. // CHECK:STDOUT: %V.as_type.loc15_25: type = facet_access_type %V.ref.loc15_25 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  795. // CHECK:STDOUT: %.loc15_25.2: type = converted %V.ref.loc15_25, %V.as_type.loc15_25 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  796. // CHECK:STDOUT: }
  797. // CHECK:STDOUT: %y: @Compound4.%V.binding.as_type (%V.binding.as_type) = value_binding y, %y.param
  798. // CHECK:STDOUT: %p.param: @Compound4.%ptr.loc15_32.1 (%ptr.6c1f8e.2) = value_param call_param1
  799. // CHECK:STDOUT: %.loc15_32.1: type = splice_block %ptr.loc15_32.2 [symbolic = %ptr.loc15_32.1 (constants.%ptr.6c1f8e.2)] {
  800. // CHECK:STDOUT: %V.ref.loc15_31: %L1.type = name_ref V, %V.loc15_14.2 [symbolic = %V.loc15_14.1 (constants.%V)]
  801. // CHECK:STDOUT: %V.as_type.loc15_32: type = facet_access_type %V.ref.loc15_31 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  802. // CHECK:STDOUT: %.loc15_32.2: type = converted %V.ref.loc15_31, %V.as_type.loc15_32 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  803. // CHECK:STDOUT: %ptr.loc15_32.2: type = ptr_type %.loc15_32.2 [symbolic = %ptr.loc15_32.1 (constants.%ptr.6c1f8e.2)]
  804. // CHECK:STDOUT: }
  805. // CHECK:STDOUT: %p: @Compound4.%ptr.loc15_32.1 (%ptr.6c1f8e.2) = value_binding p, %p.param
  806. // CHECK:STDOUT: }
  807. // CHECK:STDOUT: }
  808. // CHECK:STDOUT:
  809. // CHECK:STDOUT: interface @L1 {
  810. // CHECK:STDOUT: %Self.loc3: %L1.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  811. // CHECK:STDOUT: interface_with_self_decl @L1 [concrete]
  812. // CHECK:STDOUT:
  813. // CHECK:STDOUT: !with Self:
  814. // CHECK:STDOUT: %L1.WithSelf.R1.decl: @L1.%L1.WithSelf.R1.type (%L1.WithSelf.R1.type.504) = fn_decl @L1.WithSelf.R1 [symbolic = @L1.%L1.WithSelf.R1 (constants.%L1.WithSelf.R1.aa4)] {
  815. // CHECK:STDOUT: %self.patt: @L1.WithSelf.R1.%pattern_type (%pattern_type.9c1) = value_binding_pattern self [concrete]
  816. // CHECK:STDOUT: %self.param_patt: @L1.WithSelf.R1.%pattern_type (%pattern_type.9c1) = value_param_pattern %self.patt, call_param0 [concrete]
  817. // CHECK:STDOUT: } {
  818. // CHECK:STDOUT: %self.param: @L1.WithSelf.R1.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
  819. // CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  820. // CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self.loc3 [symbolic = %Self (constants.%Self)]
  821. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  822. // CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT: %self: @L1.WithSelf.R1.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
  825. // CHECK:STDOUT: }
  826. // CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, %L1.WithSelf.R1.decl [concrete = constants.%assoc0]
  827. // CHECK:STDOUT: %L1.WithSelf.S1.decl: @L1.%L1.WithSelf.S1.type (%L1.WithSelf.S1.type.e03) = fn_decl @L1.WithSelf.S1 [symbolic = @L1.%L1.WithSelf.S1 (constants.%L1.WithSelf.S1.480)] {
  828. // CHECK:STDOUT: %self.patt: @L1.WithSelf.S1.%pattern_type (%pattern_type.9c1) = ref_binding_pattern self [concrete]
  829. // CHECK:STDOUT: %self.param_patt: @L1.WithSelf.S1.%pattern_type (%pattern_type.9c1) = ref_param_pattern %self.patt, call_param0 [concrete]
  830. // CHECK:STDOUT: } {
  831. // CHECK:STDOUT: %self.param: ref @L1.WithSelf.S1.%Self.binding.as_type (%Self.binding.as_type) = ref_param call_param0
  832. // CHECK:STDOUT: %.loc5_19.1: type = splice_block %.loc5_19.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  833. // CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self.loc3 [symbolic = %Self (constants.%Self)]
  834. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  835. // CHECK:STDOUT: %.loc5_19.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  836. // CHECK:STDOUT: }
  837. // CHECK:STDOUT: %self: ref @L1.WithSelf.S1.%Self.binding.as_type (%Self.binding.as_type) = ref_binding self, %self.param
  838. // CHECK:STDOUT: }
  839. // CHECK:STDOUT: %assoc1: %L1.assoc_type = assoc_entity element1, %L1.WithSelf.S1.decl [concrete = constants.%assoc1]
  840. // CHECK:STDOUT:
  841. // CHECK:STDOUT: !members:
  842. // CHECK:STDOUT: .Self = %Self.loc3
  843. // CHECK:STDOUT: .R1 = %assoc0
  844. // CHECK:STDOUT: .S1 = %assoc1
  845. // CHECK:STDOUT: witness = (%L1.WithSelf.R1.decl, %L1.WithSelf.S1.decl)
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: !requires:
  848. // CHECK:STDOUT: }
  849. // CHECK:STDOUT:
  850. // CHECK:STDOUT: generic fn @L1.WithSelf.R1(@L1.%Self.loc3: %L1.type) {
  851. // CHECK:STDOUT: %Self: %L1.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  852. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  853. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.9c1)]
  854. // CHECK:STDOUT:
  855. // CHECK:STDOUT: fn(%self.param: @L1.WithSelf.R1.%Self.binding.as_type (%Self.binding.as_type));
  856. // CHECK:STDOUT: }
  857. // CHECK:STDOUT:
  858. // CHECK:STDOUT: generic fn @L1.WithSelf.S1(@L1.%Self.loc3: %L1.type) {
  859. // CHECK:STDOUT: %Self: %L1.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  860. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  861. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.9c1)]
  862. // CHECK:STDOUT:
  863. // CHECK:STDOUT: fn(%self.param: ref @L1.WithSelf.S1.%Self.binding.as_type (%Self.binding.as_type));
  864. // CHECK:STDOUT: }
  865. // CHECK:STDOUT:
  866. // CHECK:STDOUT: generic fn @Simple4(%T.loc9_12.2: %L1.type) {
  867. // CHECK:STDOUT: %T.loc9_12.1: %L1.type = symbolic_binding T, 0 [symbolic = %T.loc9_12.1 (constants.%T)]
  868. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc9_12.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  869. // CHECK:STDOUT: %pattern_type.loc9_20: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc9_20 (constants.%pattern_type.352a62.1)]
  870. // CHECK:STDOUT: %ptr.loc9_30.1: type = ptr_type %T.binding.as_type [symbolic = %ptr.loc9_30.1 (constants.%ptr.6c1f8e.1)]
  871. // CHECK:STDOUT: %pattern_type.loc9_26: type = pattern_type %ptr.loc9_30.1 [symbolic = %pattern_type.loc9_26 (constants.%pattern_type.740d56.1)]
  872. // CHECK:STDOUT:
  873. // CHECK:STDOUT: !definition:
  874. // CHECK:STDOUT: %require_complete.loc9_21: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc9_21 (constants.%require_complete.592d00.1)]
  875. // CHECK:STDOUT: %require_complete.loc9_27: <witness> = require_complete_type %ptr.loc9_30.1 [symbolic = %require_complete.loc9_27 (constants.%require_complete.94a5f1.1)]
  876. // CHECK:STDOUT: %L1.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc9_12.1, @L1 [symbolic = %L1.lookup_impl_witness (constants.%L1.lookup_impl_witness.297fbf.1)]
  877. // CHECK:STDOUT: %L1.WithSelf.R1.type: type = fn_type @L1.WithSelf.R1, @L1(%T.loc9_12.1) [symbolic = %L1.WithSelf.R1.type (constants.%L1.WithSelf.R1.type.0d7469.1)]
  878. // CHECK:STDOUT: %.loc10: type = fn_type_with_self_type %L1.WithSelf.R1.type, %T.loc9_12.1 [symbolic = %.loc10 (constants.%.69b631.1)]
  879. // CHECK:STDOUT: %impl.elem0.loc10_4.2: @Simple4.%.loc10 (%.69b631.1) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.60b493.1)]
  880. // CHECK:STDOUT: %specific_impl_fn.loc10_4.2: <specific function> = specific_impl_function %impl.elem0.loc10_4.2, @L1.WithSelf.R1(%T.loc9_12.1) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.f023e9.1)]
  881. // CHECK:STDOUT: %L1.WithSelf.S1.type: type = fn_type @L1.WithSelf.S1, @L1(%T.loc9_12.1) [symbolic = %L1.WithSelf.S1.type (constants.%L1.WithSelf.S1.type.79e6b4.1)]
  882. // CHECK:STDOUT: %.loc11_4.2: type = fn_type_with_self_type %L1.WithSelf.S1.type, %T.loc9_12.1 [symbolic = %.loc11_4.2 (constants.%.917578.1)]
  883. // CHECK:STDOUT: %impl.elem1.loc11_4.2: @Simple4.%.loc11_4.2 (%.917578.1) = impl_witness_access %L1.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc11_4.2 (constants.%impl.elem1.e3fe4c.1)]
  884. // CHECK:STDOUT: %specific_impl_fn.loc11_4.2: <specific function> = specific_impl_function %impl.elem1.loc11_4.2, @L1.WithSelf.S1(%T.loc9_12.1) [symbolic = %specific_impl_fn.loc11_4.2 (constants.%specific_impl_fn.2cc093.1)]
  885. // CHECK:STDOUT:
  886. // CHECK:STDOUT: fn(%x.param: @Simple4.%T.binding.as_type (%T.binding.as_type), %p.param: @Simple4.%ptr.loc9_30.1 (%ptr.6c1f8e.1)) {
  887. // CHECK:STDOUT: !entry:
  888. // CHECK:STDOUT: %x.ref: @Simple4.%T.binding.as_type (%T.binding.as_type) = name_ref x, %x
  889. // CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0]
  890. // CHECK:STDOUT: %impl.elem0.loc10_4.1: @Simple4.%.loc10 (%.69b631.1) = impl_witness_access constants.%L1.lookup_impl_witness.297fbf.1, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.60b493.1)]
  891. // CHECK:STDOUT: %bound_method.loc10_4: <bound method> = bound_method %x.ref, %impl.elem0.loc10_4.1
  892. // CHECK:STDOUT: %specific_impl_fn.loc10_4.1: <specific function> = specific_impl_function %impl.elem0.loc10_4.1, @L1.WithSelf.R1(constants.%T) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.f023e9.1)]
  893. // CHECK:STDOUT: %bound_method.loc10_8: <bound method> = bound_method %x.ref, %specific_impl_fn.loc10_4.1
  894. // CHECK:STDOUT: %L1.WithSelf.R1.call: init %empty_tuple.type = call %bound_method.loc10_8(%x.ref)
  895. // CHECK:STDOUT: %p.ref: @Simple4.%ptr.loc9_30.1 (%ptr.6c1f8e.1) = name_ref p, %p
  896. // CHECK:STDOUT: %.loc11_4.1: ref @Simple4.%T.binding.as_type (%T.binding.as_type) = deref %p.ref
  897. // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.%assoc1 [concrete = constants.%assoc1]
  898. // CHECK:STDOUT: %impl.elem1.loc11_4.1: @Simple4.%.loc11_4.2 (%.917578.1) = impl_witness_access constants.%L1.lookup_impl_witness.297fbf.1, element1 [symbolic = %impl.elem1.loc11_4.2 (constants.%impl.elem1.e3fe4c.1)]
  899. // CHECK:STDOUT: %bound_method.loc11_4: <bound method> = bound_method %.loc11_4.1, %impl.elem1.loc11_4.1
  900. // CHECK:STDOUT: %specific_impl_fn.loc11_4.1: <specific function> = specific_impl_function %impl.elem1.loc11_4.1, @L1.WithSelf.S1(constants.%T) [symbolic = %specific_impl_fn.loc11_4.2 (constants.%specific_impl_fn.2cc093.1)]
  901. // CHECK:STDOUT: %bound_method.loc11_9: <bound method> = bound_method %.loc11_4.1, %specific_impl_fn.loc11_4.1
  902. // CHECK:STDOUT: %L1.WithSelf.S1.call: init %empty_tuple.type = call %bound_method.loc11_9(%.loc11_4.1)
  903. // CHECK:STDOUT: return
  904. // CHECK:STDOUT: }
  905. // CHECK:STDOUT: }
  906. // CHECK:STDOUT:
  907. // CHECK:STDOUT: generic fn @Compound4(%V.loc15_14.2: %L1.type) {
  908. // CHECK:STDOUT: %V.loc15_14.1: %L1.type = symbolic_binding V, 0 [symbolic = %V.loc15_14.1 (constants.%V)]
  909. // CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 0, %V.loc15_14.1 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  910. // CHECK:STDOUT: %pattern_type.loc15_22: type = pattern_type %V.binding.as_type [symbolic = %pattern_type.loc15_22 (constants.%pattern_type.352a62.2)]
  911. // CHECK:STDOUT: %ptr.loc15_32.1: type = ptr_type %V.binding.as_type [symbolic = %ptr.loc15_32.1 (constants.%ptr.6c1f8e.2)]
  912. // CHECK:STDOUT: %pattern_type.loc15_28: type = pattern_type %ptr.loc15_32.1 [symbolic = %pattern_type.loc15_28 (constants.%pattern_type.740d56.2)]
  913. // CHECK:STDOUT:
  914. // CHECK:STDOUT: !definition:
  915. // CHECK:STDOUT: %require_complete.loc15_23: <witness> = require_complete_type %V.binding.as_type [symbolic = %require_complete.loc15_23 (constants.%require_complete.592d00.2)]
  916. // CHECK:STDOUT: %require_complete.loc15_29: <witness> = require_complete_type %ptr.loc15_32.1 [symbolic = %require_complete.loc15_29 (constants.%require_complete.94a5f1.2)]
  917. // CHECK:STDOUT: %L1.lookup_impl_witness: <witness> = lookup_impl_witness %V.loc15_14.1, @L1 [symbolic = %L1.lookup_impl_witness (constants.%L1.lookup_impl_witness.297fbf.2)]
  918. // CHECK:STDOUT: %L1.WithSelf.R1.type: type = fn_type @L1.WithSelf.R1, @L1(%V.loc15_14.1) [symbolic = %L1.WithSelf.R1.type (constants.%L1.WithSelf.R1.type.0d7469.2)]
  919. // CHECK:STDOUT: %.loc16: type = fn_type_with_self_type %L1.WithSelf.R1.type, %V.loc15_14.1 [symbolic = %.loc16 (constants.%.69b631.2)]
  920. // CHECK:STDOUT: %impl.elem0.loc16_4.2: @Compound4.%.loc16 (%.69b631.2) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.60b493.2)]
  921. // CHECK:STDOUT: %specific_impl_fn.loc16_4.2: <specific function> = specific_impl_function %impl.elem0.loc16_4.2, @L1.WithSelf.R1(%V.loc15_14.1) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.f023e9.2)]
  922. // CHECK:STDOUT: %L1.WithSelf.S1.type: type = fn_type @L1.WithSelf.S1, @L1(%V.loc15_14.1) [symbolic = %L1.WithSelf.S1.type (constants.%L1.WithSelf.S1.type.79e6b4.2)]
  923. // CHECK:STDOUT: %.loc17_4.2: type = fn_type_with_self_type %L1.WithSelf.S1.type, %V.loc15_14.1 [symbolic = %.loc17_4.2 (constants.%.917578.2)]
  924. // CHECK:STDOUT: %impl.elem1.loc17_4.2: @Compound4.%.loc17_4.2 (%.917578.2) = impl_witness_access %L1.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc17_4.2 (constants.%impl.elem1.e3fe4c.2)]
  925. // CHECK:STDOUT: %specific_impl_fn.loc17_4.2: <specific function> = specific_impl_function %impl.elem1.loc17_4.2, @L1.WithSelf.S1(%V.loc15_14.1) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.2cc093.2)]
  926. // CHECK:STDOUT:
  927. // CHECK:STDOUT: fn(%y.param: @Compound4.%V.binding.as_type (%V.binding.as_type), %p.param: @Compound4.%ptr.loc15_32.1 (%ptr.6c1f8e.2)) {
  928. // CHECK:STDOUT: !entry:
  929. // CHECK:STDOUT: %y.ref: @Compound4.%V.binding.as_type (%V.binding.as_type) = name_ref y, %y
  930. // CHECK:STDOUT: %L1.ref.loc16: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  931. // CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0]
  932. // CHECK:STDOUT: %impl.elem0.loc16_4.1: @Compound4.%.loc16 (%.69b631.2) = impl_witness_access constants.%L1.lookup_impl_witness.297fbf.2, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.60b493.2)]
  933. // CHECK:STDOUT: %bound_method.loc16_4: <bound method> = bound_method %y.ref, %impl.elem0.loc16_4.1
  934. // CHECK:STDOUT: %specific_impl_fn.loc16_4.1: <specific function> = specific_impl_function %impl.elem0.loc16_4.1, @L1.WithSelf.R1(constants.%V) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.f023e9.2)]
  935. // CHECK:STDOUT: %bound_method.loc16_13: <bound method> = bound_method %y.ref, %specific_impl_fn.loc16_4.1
  936. // CHECK:STDOUT: %L1.WithSelf.R1.call: init %empty_tuple.type = call %bound_method.loc16_13(%y.ref)
  937. // CHECK:STDOUT: %p.ref: @Compound4.%ptr.loc15_32.1 (%ptr.6c1f8e.2) = name_ref p, %p
  938. // CHECK:STDOUT: %L1.ref.loc17: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  939. // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.%assoc1 [concrete = constants.%assoc1]
  940. // CHECK:STDOUT: %.loc17_4.1: ref @Compound4.%V.binding.as_type (%V.binding.as_type) = deref %p.ref
  941. // CHECK:STDOUT: %impl.elem1.loc17_4.1: @Compound4.%.loc17_4.2 (%.917578.2) = impl_witness_access constants.%L1.lookup_impl_witness.297fbf.2, element1 [symbolic = %impl.elem1.loc17_4.2 (constants.%impl.elem1.e3fe4c.2)]
  942. // CHECK:STDOUT: %bound_method.loc17_4: <bound method> = bound_method %.loc17_4.1, %impl.elem1.loc17_4.1
  943. // CHECK:STDOUT: %specific_impl_fn.loc17_4.1: <specific function> = specific_impl_function %impl.elem1.loc17_4.1, @L1.WithSelf.S1(constants.%V) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.2cc093.2)]
  944. // CHECK:STDOUT: %bound_method.loc17_14: <bound method> = bound_method %.loc17_4.1, %specific_impl_fn.loc17_4.1
  945. // CHECK:STDOUT: %L1.WithSelf.S1.call: init %empty_tuple.type = call %bound_method.loc17_14(%.loc17_4.1)
  946. // CHECK:STDOUT: return
  947. // CHECK:STDOUT: }
  948. // CHECK:STDOUT: }
  949. // CHECK:STDOUT:
  950. // CHECK:STDOUT: specific @L1(constants.%Self) {
  951. // CHECK:STDOUT: !definition:
  952. // CHECK:STDOUT: %Self.loc4 => constants.%Self
  953. // CHECK:STDOUT: %L1.WithSelf.R1.type => constants.%L1.WithSelf.R1.type.504
  954. // CHECK:STDOUT: %L1.WithSelf.R1 => constants.%L1.WithSelf.R1.aa4
  955. // CHECK:STDOUT: %L1.WithSelf.S1.type => constants.%L1.WithSelf.S1.type.e03
  956. // CHECK:STDOUT: %L1.WithSelf.S1 => constants.%L1.WithSelf.S1.480
  957. // CHECK:STDOUT: }
  958. // CHECK:STDOUT:
  959. // CHECK:STDOUT: specific @L1.WithSelf.R1(constants.%Self) {
  960. // CHECK:STDOUT: %Self => constants.%Self
  961. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  962. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9c1
  963. // CHECK:STDOUT: }
  964. // CHECK:STDOUT:
  965. // CHECK:STDOUT: specific @L1.WithSelf.S1(constants.%Self) {
  966. // CHECK:STDOUT: %Self => constants.%Self
  967. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  968. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9c1
  969. // CHECK:STDOUT: }
  970. // CHECK:STDOUT:
  971. // CHECK:STDOUT: specific @Simple4(constants.%T) {
  972. // CHECK:STDOUT: %T.loc9_12.1 => constants.%T
  973. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  974. // CHECK:STDOUT: %pattern_type.loc9_20 => constants.%pattern_type.352a62.1
  975. // CHECK:STDOUT: %ptr.loc9_30.1 => constants.%ptr.6c1f8e.1
  976. // CHECK:STDOUT: %pattern_type.loc9_26 => constants.%pattern_type.740d56.1
  977. // CHECK:STDOUT: }
  978. // CHECK:STDOUT:
  979. // CHECK:STDOUT: specific @L1(constants.%T) {
  980. // CHECK:STDOUT: !definition:
  981. // CHECK:STDOUT: %Self.loc4 => constants.%T
  982. // CHECK:STDOUT: %L1.WithSelf.R1.type => constants.%L1.WithSelf.R1.type.0d7469.1
  983. // CHECK:STDOUT: %L1.WithSelf.R1 => constants.%L1.WithSelf.R1.f22128.1
  984. // CHECK:STDOUT: %L1.WithSelf.S1.type => constants.%L1.WithSelf.S1.type.79e6b4.1
  985. // CHECK:STDOUT: %L1.WithSelf.S1 => constants.%L1.WithSelf.S1.cd5111.1
  986. // CHECK:STDOUT: }
  987. // CHECK:STDOUT:
  988. // CHECK:STDOUT: specific @L1.WithSelf.R1(constants.%T) {
  989. // CHECK:STDOUT: %Self => constants.%T
  990. // CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type
  991. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.352a62.1
  992. // CHECK:STDOUT: }
  993. // CHECK:STDOUT:
  994. // CHECK:STDOUT: specific @L1.WithSelf.S1(constants.%T) {
  995. // CHECK:STDOUT: %Self => constants.%T
  996. // CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type
  997. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.352a62.1
  998. // CHECK:STDOUT: }
  999. // CHECK:STDOUT:
  1000. // CHECK:STDOUT: specific @Compound4(constants.%V) {
  1001. // CHECK:STDOUT: %V.loc15_14.1 => constants.%V
  1002. // CHECK:STDOUT: %V.binding.as_type => constants.%V.binding.as_type
  1003. // CHECK:STDOUT: %pattern_type.loc15_22 => constants.%pattern_type.352a62.2
  1004. // CHECK:STDOUT: %ptr.loc15_32.1 => constants.%ptr.6c1f8e.2
  1005. // CHECK:STDOUT: %pattern_type.loc15_28 => constants.%pattern_type.740d56.2
  1006. // CHECK:STDOUT: }
  1007. // CHECK:STDOUT:
  1008. // CHECK:STDOUT: specific @L1(constants.%V) {
  1009. // CHECK:STDOUT: !definition:
  1010. // CHECK:STDOUT: %Self.loc4 => constants.%V
  1011. // CHECK:STDOUT: %L1.WithSelf.R1.type => constants.%L1.WithSelf.R1.type.0d7469.2
  1012. // CHECK:STDOUT: %L1.WithSelf.R1 => constants.%L1.WithSelf.R1.f22128.2
  1013. // CHECK:STDOUT: %L1.WithSelf.S1.type => constants.%L1.WithSelf.S1.type.79e6b4.2
  1014. // CHECK:STDOUT: %L1.WithSelf.S1 => constants.%L1.WithSelf.S1.cd5111.2
  1015. // CHECK:STDOUT: }
  1016. // CHECK:STDOUT:
  1017. // CHECK:STDOUT: specific @L1.WithSelf.R1(constants.%V) {
  1018. // CHECK:STDOUT: %Self => constants.%V
  1019. // CHECK:STDOUT: %Self.binding.as_type => constants.%V.binding.as_type
  1020. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.352a62.2
  1021. // CHECK:STDOUT: }
  1022. // CHECK:STDOUT:
  1023. // CHECK:STDOUT: specific @L1.WithSelf.S1(constants.%V) {
  1024. // CHECK:STDOUT: %Self => constants.%V
  1025. // CHECK:STDOUT: %Self.binding.as_type => constants.%V.binding.as_type
  1026. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.352a62.2
  1027. // CHECK:STDOUT: }
  1028. // CHECK:STDOUT:
  1029. // CHECK:STDOUT: --- fail_interface_instance_caller_not.carbon
  1030. // CHECK:STDOUT:
  1031. // CHECK:STDOUT: constants {
  1032. // CHECK:STDOUT: %L2.type: type = facet_type <@L2> [concrete]
  1033. // CHECK:STDOUT: %Self: %L2.type = symbolic_binding Self, 0 [symbolic]
  1034. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic]
  1035. // CHECK:STDOUT: %pattern_type.73b: type = pattern_type %Self.binding.as_type [symbolic]
  1036. // CHECK:STDOUT: %L2.WithSelf.R2.type.e38: type = fn_type @L2.WithSelf.R2, @L2(%Self) [symbolic]
  1037. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1038. // CHECK:STDOUT: %L2.WithSelf.R2.f23: %L2.WithSelf.R2.type.e38 = struct_value () [symbolic]
  1039. // CHECK:STDOUT: %L2.assoc_type: type = assoc_entity_type @L2 [concrete]
  1040. // CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, @L2.%L2.WithSelf.R2.decl [concrete]
  1041. // CHECK:STDOUT: %L2.WithSelf.S2.type.7f8: type = fn_type @L2.WithSelf.S2, @L2(%Self) [symbolic]
  1042. // CHECK:STDOUT: %L2.WithSelf.S2.827: %L2.WithSelf.S2.type.7f8 = struct_value () [symbolic]
  1043. // CHECK:STDOUT: %assoc1: %L2.assoc_type = assoc_entity element1, @L2.%L2.WithSelf.S2.decl [concrete]
  1044. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1045. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1046. // CHECK:STDOUT: %T: %L2.type = symbolic_binding T, 0 [symbolic]
  1047. // CHECK:STDOUT: %pattern_type.5a0: type = pattern_type %L2.type [concrete]
  1048. // CHECK:STDOUT: %Simple5.type: type = fn_type @Simple5 [concrete]
  1049. // CHECK:STDOUT: %Simple5: %Simple5.type = struct_value () [concrete]
  1050. // CHECK:STDOUT: %L2.WithSelf.R2.type.ba3: type = fn_type @L2.WithSelf.R2, @L2(%T) [symbolic]
  1051. // CHECK:STDOUT: %L2.WithSelf.R2.c61: %L2.WithSelf.R2.type.ba3 = struct_value () [symbolic]
  1052. // CHECK:STDOUT: %L2.WithSelf.S2.type.68b: type = fn_type @L2.WithSelf.S2, @L2(%T) [symbolic]
  1053. // CHECK:STDOUT: %L2.WithSelf.S2.470: %L2.WithSelf.S2.type.68b = struct_value () [symbolic]
  1054. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T [symbolic]
  1055. // CHECK:STDOUT: %L2.lookup_impl_witness: <witness> = lookup_impl_witness %T, @L2 [symbolic]
  1056. // CHECK:STDOUT: %.f8e: type = fn_type_with_self_type %L2.WithSelf.R2.type.ba3, %T [symbolic]
  1057. // CHECK:STDOUT: %impl.elem0: %.f8e = impl_witness_access %L2.lookup_impl_witness, element0 [symbolic]
  1058. // CHECK:STDOUT: %pattern_type.0fc: type = pattern_type %T.binding.as_type [symbolic]
  1059. // CHECK:STDOUT: %specific_impl_fn.b6c: <specific function> = specific_impl_function %impl.elem0, @L2.WithSelf.R2(%T) [symbolic]
  1060. // CHECK:STDOUT: %.b1c: type = fn_type_with_self_type %L2.WithSelf.S2.type.68b, %T [symbolic]
  1061. // CHECK:STDOUT: %impl.elem1: %.b1c = impl_witness_access %L2.lookup_impl_witness, element1 [symbolic]
  1062. // CHECK:STDOUT: %specific_impl_fn.b67: <specific function> = specific_impl_function %impl.elem1, @L2.WithSelf.S2(%T) [symbolic]
  1063. // CHECK:STDOUT: %V: %L2.type = symbolic_binding V, 0 [symbolic]
  1064. // CHECK:STDOUT: %Compound5.type: type = fn_type @Compound5 [concrete]
  1065. // CHECK:STDOUT: %Compound5: %Compound5.type = struct_value () [concrete]
  1066. // CHECK:STDOUT: }
  1067. // CHECK:STDOUT:
  1068. // CHECK:STDOUT: imports {
  1069. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1070. // CHECK:STDOUT: import Core//prelude
  1071. // CHECK:STDOUT: import Core//prelude/...
  1072. // CHECK:STDOUT: }
  1073. // CHECK:STDOUT: }
  1074. // CHECK:STDOUT:
  1075. // CHECK:STDOUT: file {
  1076. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1077. // CHECK:STDOUT: .Core = imports.%Core
  1078. // CHECK:STDOUT: .L2 = %L2.decl
  1079. // CHECK:STDOUT: .Simple5 = %Simple5.decl
  1080. // CHECK:STDOUT: .Compound5 = %Compound5.decl
  1081. // CHECK:STDOUT: }
  1082. // CHECK:STDOUT: %Core.import = import Core
  1083. // CHECK:STDOUT: %L2.decl: type = interface_decl @L2 [concrete = constants.%L2.type] {} {}
  1084. // CHECK:STDOUT: %Simple5.decl: %Simple5.type = fn_decl @Simple5 [concrete = constants.%Simple5] {
  1085. // CHECK:STDOUT: %T.patt: %pattern_type.5a0 = symbolic_binding_pattern T, 0 [concrete]
  1086. // CHECK:STDOUT: } {
  1087. // CHECK:STDOUT: %.loc10: type = splice_block %L2.ref [concrete = constants.%L2.type] {
  1088. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1089. // CHECK:STDOUT: %L2.ref: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1090. // CHECK:STDOUT: }
  1091. // CHECK:STDOUT: %T.loc10_12.2: %L2.type = symbolic_binding T, 0 [symbolic = %T.loc10_12.1 (constants.%T)]
  1092. // CHECK:STDOUT: }
  1093. // CHECK:STDOUT: %Compound5.decl: %Compound5.type = fn_decl @Compound5 [concrete = constants.%Compound5] {
  1094. // CHECK:STDOUT: %V.patt: %pattern_type.5a0 = symbolic_binding_pattern V, 0 [concrete]
  1095. // CHECK:STDOUT: } {
  1096. // CHECK:STDOUT: %.loc30: type = splice_block %L2.ref.loc30 [concrete = constants.%L2.type] {
  1097. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1098. // CHECK:STDOUT: %L2.ref.loc30: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1099. // CHECK:STDOUT: }
  1100. // CHECK:STDOUT: %V.loc30_14.2: %L2.type = symbolic_binding V, 0 [symbolic = %V.loc30_14.1 (constants.%V)]
  1101. // CHECK:STDOUT: }
  1102. // CHECK:STDOUT: }
  1103. // CHECK:STDOUT:
  1104. // CHECK:STDOUT: interface @L2 {
  1105. // CHECK:STDOUT: %Self.loc4: %L2.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  1106. // CHECK:STDOUT: interface_with_self_decl @L2 [concrete]
  1107. // CHECK:STDOUT:
  1108. // CHECK:STDOUT: !with Self:
  1109. // CHECK:STDOUT: %L2.WithSelf.R2.decl: @L2.%L2.WithSelf.R2.type (%L2.WithSelf.R2.type.e38) = fn_decl @L2.WithSelf.R2 [symbolic = @L2.%L2.WithSelf.R2 (constants.%L2.WithSelf.R2.f23)] {
  1110. // CHECK:STDOUT: %self.patt: @L2.WithSelf.R2.%pattern_type (%pattern_type.73b) = value_binding_pattern self [concrete]
  1111. // CHECK:STDOUT: %self.param_patt: @L2.WithSelf.R2.%pattern_type (%pattern_type.73b) = value_param_pattern %self.patt, call_param0 [concrete]
  1112. // CHECK:STDOUT: } {
  1113. // CHECK:STDOUT: %self.param: @L2.WithSelf.R2.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
  1114. // CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  1115. // CHECK:STDOUT: %Self.ref: %L2.type = name_ref Self, @L2.%Self.loc4 [symbolic = %Self (constants.%Self)]
  1116. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  1117. // CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  1118. // CHECK:STDOUT: }
  1119. // CHECK:STDOUT: %self: @L2.WithSelf.R2.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
  1120. // CHECK:STDOUT: }
  1121. // CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, %L2.WithSelf.R2.decl [concrete = constants.%assoc0]
  1122. // CHECK:STDOUT: %L2.WithSelf.S2.decl: @L2.%L2.WithSelf.S2.type (%L2.WithSelf.S2.type.7f8) = fn_decl @L2.WithSelf.S2 [symbolic = @L2.%L2.WithSelf.S2 (constants.%L2.WithSelf.S2.827)] {
  1123. // CHECK:STDOUT: %self.patt: @L2.WithSelf.S2.%pattern_type (%pattern_type.73b) = ref_binding_pattern self [concrete]
  1124. // CHECK:STDOUT: %self.param_patt: @L2.WithSelf.S2.%pattern_type (%pattern_type.73b) = ref_param_pattern %self.patt, call_param0 [concrete]
  1125. // CHECK:STDOUT: } {
  1126. // CHECK:STDOUT: %self.param: ref @L2.WithSelf.S2.%Self.binding.as_type (%Self.binding.as_type) = ref_param call_param0
  1127. // CHECK:STDOUT: %.loc6_19.1: type = splice_block %.loc6_19.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  1128. // CHECK:STDOUT: %Self.ref: %L2.type = name_ref Self, @L2.%Self.loc4 [symbolic = %Self (constants.%Self)]
  1129. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  1130. // CHECK:STDOUT: %.loc6_19.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  1131. // CHECK:STDOUT: }
  1132. // CHECK:STDOUT: %self: ref @L2.WithSelf.S2.%Self.binding.as_type (%Self.binding.as_type) = ref_binding self, %self.param
  1133. // CHECK:STDOUT: }
  1134. // CHECK:STDOUT: %assoc1: %L2.assoc_type = assoc_entity element1, %L2.WithSelf.S2.decl [concrete = constants.%assoc1]
  1135. // CHECK:STDOUT:
  1136. // CHECK:STDOUT: !members:
  1137. // CHECK:STDOUT: .Self = %Self.loc4
  1138. // CHECK:STDOUT: .R2 = %assoc0
  1139. // CHECK:STDOUT: .S2 = %assoc1
  1140. // CHECK:STDOUT: witness = (%L2.WithSelf.R2.decl, %L2.WithSelf.S2.decl)
  1141. // CHECK:STDOUT:
  1142. // CHECK:STDOUT: !requires:
  1143. // CHECK:STDOUT: }
  1144. // CHECK:STDOUT:
  1145. // CHECK:STDOUT: generic fn @L2.WithSelf.R2(@L2.%Self.loc4: %L2.type) {
  1146. // CHECK:STDOUT: %Self: %L2.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  1147. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  1148. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.73b)]
  1149. // CHECK:STDOUT:
  1150. // CHECK:STDOUT: fn(%self.param: @L2.WithSelf.R2.%Self.binding.as_type (%Self.binding.as_type));
  1151. // CHECK:STDOUT: }
  1152. // CHECK:STDOUT:
  1153. // CHECK:STDOUT: generic fn @L2.WithSelf.S2(@L2.%Self.loc4: %L2.type) {
  1154. // CHECK:STDOUT: %Self: %L2.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  1155. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  1156. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.73b)]
  1157. // CHECK:STDOUT:
  1158. // CHECK:STDOUT: fn(%self.param: ref @L2.WithSelf.S2.%Self.binding.as_type (%Self.binding.as_type));
  1159. // CHECK:STDOUT: }
  1160. // CHECK:STDOUT:
  1161. // CHECK:STDOUT: generic fn @Simple5(%T.loc10_12.2: %L2.type) {
  1162. // CHECK:STDOUT: %T.loc10_12.1: %L2.type = symbolic_binding T, 0 [symbolic = %T.loc10_12.1 (constants.%T)]
  1163. // CHECK:STDOUT:
  1164. // CHECK:STDOUT: !definition:
  1165. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc10_12.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1166. // CHECK:STDOUT: %L2.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc10_12.1, @L2 [symbolic = %L2.lookup_impl_witness (constants.%L2.lookup_impl_witness)]
  1167. // CHECK:STDOUT: %L2.WithSelf.R2.type: type = fn_type @L2.WithSelf.R2, @L2(%T.loc10_12.1) [symbolic = %L2.WithSelf.R2.type (constants.%L2.WithSelf.R2.type.ba3)]
  1168. // CHECK:STDOUT: %.loc18_4.2: type = fn_type_with_self_type %L2.WithSelf.R2.type, %T.loc10_12.1 [symbolic = %.loc18_4.2 (constants.%.f8e)]
  1169. // CHECK:STDOUT: %impl.elem0.loc18_4.2: @Simple5.%.loc18_4.2 (%.f8e) = impl_witness_access %L2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)]
  1170. // CHECK:STDOUT: %specific_impl_fn.loc18_4.2: <specific function> = specific_impl_function %impl.elem0.loc18_4.2, @L2.WithSelf.R2(%T.loc10_12.1) [symbolic = %specific_impl_fn.loc18_4.2 (constants.%specific_impl_fn.b6c)]
  1171. // CHECK:STDOUT: %L2.WithSelf.S2.type: type = fn_type @L2.WithSelf.S2, @L2(%T.loc10_12.1) [symbolic = %L2.WithSelf.S2.type (constants.%L2.WithSelf.S2.type.68b)]
  1172. // CHECK:STDOUT: %.loc26_4.2: type = fn_type_with_self_type %L2.WithSelf.S2.type, %T.loc10_12.1 [symbolic = %.loc26_4.2 (constants.%.b1c)]
  1173. // CHECK:STDOUT: %impl.elem1.loc26_4.2: @Simple5.%.loc26_4.2 (%.b1c) = impl_witness_access %L2.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)]
  1174. // CHECK:STDOUT: %specific_impl_fn.loc26_4.2: <specific function> = specific_impl_function %impl.elem1.loc26_4.2, @L2.WithSelf.S2(%T.loc10_12.1) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.b67)]
  1175. // CHECK:STDOUT:
  1176. // CHECK:STDOUT: fn() {
  1177. // CHECK:STDOUT: !entry:
  1178. // CHECK:STDOUT: %T.ref.loc18: %L2.type = name_ref T, %T.loc10_12.2 [symbolic = %T.loc10_12.1 (constants.%T)]
  1179. // CHECK:STDOUT: %T.as_type.loc18: type = facet_access_type %T.ref.loc18 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1180. // CHECK:STDOUT: %.loc18_4.1: type = converted %T.ref.loc18, %T.as_type.loc18 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1181. // CHECK:STDOUT: %R2.ref: %L2.assoc_type = name_ref R2, @L2.%assoc0 [concrete = constants.%assoc0]
  1182. // CHECK:STDOUT: %impl.elem0.loc18_4.1: @Simple5.%.loc18_4.2 (%.f8e) = impl_witness_access constants.%L2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)]
  1183. // CHECK:STDOUT: %specific_impl_fn.loc18_4.1: <specific function> = specific_impl_function %impl.elem0.loc18_4.1, @L2.WithSelf.R2(constants.%T) [symbolic = %specific_impl_fn.loc18_4.2 (constants.%specific_impl_fn.b6c)]
  1184. // CHECK:STDOUT: %L2.WithSelf.R2.call: init %empty_tuple.type = call %specific_impl_fn.loc18_4.1(<error>)
  1185. // CHECK:STDOUT: %T.ref.loc26: %L2.type = name_ref T, %T.loc10_12.2 [symbolic = %T.loc10_12.1 (constants.%T)]
  1186. // CHECK:STDOUT: %T.as_type.loc26: type = facet_access_type %T.ref.loc26 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1187. // CHECK:STDOUT: %.loc26_4.1: type = converted %T.ref.loc26, %T.as_type.loc26 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  1188. // CHECK:STDOUT: %S2.ref: %L2.assoc_type = name_ref S2, @L2.%assoc1 [concrete = constants.%assoc1]
  1189. // CHECK:STDOUT: %impl.elem1.loc26_4.1: @Simple5.%.loc26_4.2 (%.b1c) = impl_witness_access constants.%L2.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)]
  1190. // CHECK:STDOUT: %specific_impl_fn.loc26_4.1: <specific function> = specific_impl_function %impl.elem1.loc26_4.1, @L2.WithSelf.S2(constants.%T) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.b67)]
  1191. // CHECK:STDOUT: %L2.WithSelf.S2.call: init %empty_tuple.type = call %specific_impl_fn.loc26_4.1(<error>)
  1192. // CHECK:STDOUT: return
  1193. // CHECK:STDOUT: }
  1194. // CHECK:STDOUT: }
  1195. // CHECK:STDOUT:
  1196. // CHECK:STDOUT: generic fn @Compound5(%V.loc30_14.2: %L2.type) {
  1197. // CHECK:STDOUT: %V.loc30_14.1: %L2.type = symbolic_binding V, 0 [symbolic = %V.loc30_14.1 (constants.%V)]
  1198. // CHECK:STDOUT:
  1199. // CHECK:STDOUT: !definition:
  1200. // CHECK:STDOUT:
  1201. // CHECK:STDOUT: fn() {
  1202. // CHECK:STDOUT: !entry:
  1203. // CHECK:STDOUT: %V.ref.loc35: %L2.type = name_ref V, %V.loc30_14.2 [symbolic = %V.loc30_14.1 (constants.%V)]
  1204. // CHECK:STDOUT: %L2.ref.loc35: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1205. // CHECK:STDOUT: %R2.ref: %L2.assoc_type = name_ref R2, @L2.%assoc0 [concrete = constants.%assoc0]
  1206. // CHECK:STDOUT: %V.ref.loc40: %L2.type = name_ref V, %V.loc30_14.2 [symbolic = %V.loc30_14.1 (constants.%V)]
  1207. // CHECK:STDOUT: %L2.ref.loc40: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1208. // CHECK:STDOUT: %S2.ref: %L2.assoc_type = name_ref S2, @L2.%assoc1 [concrete = constants.%assoc1]
  1209. // CHECK:STDOUT: return
  1210. // CHECK:STDOUT: }
  1211. // CHECK:STDOUT: }
  1212. // CHECK:STDOUT:
  1213. // CHECK:STDOUT: specific @L2(constants.%Self) {
  1214. // CHECK:STDOUT: !definition:
  1215. // CHECK:STDOUT: %Self.loc5 => constants.%Self
  1216. // CHECK:STDOUT: %L2.WithSelf.R2.type => constants.%L2.WithSelf.R2.type.e38
  1217. // CHECK:STDOUT: %L2.WithSelf.R2 => constants.%L2.WithSelf.R2.f23
  1218. // CHECK:STDOUT: %L2.WithSelf.S2.type => constants.%L2.WithSelf.S2.type.7f8
  1219. // CHECK:STDOUT: %L2.WithSelf.S2 => constants.%L2.WithSelf.S2.827
  1220. // CHECK:STDOUT: }
  1221. // CHECK:STDOUT:
  1222. // CHECK:STDOUT: specific @L2.WithSelf.R2(constants.%Self) {
  1223. // CHECK:STDOUT: %Self => constants.%Self
  1224. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  1225. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.73b
  1226. // CHECK:STDOUT: }
  1227. // CHECK:STDOUT:
  1228. // CHECK:STDOUT: specific @L2.WithSelf.S2(constants.%Self) {
  1229. // CHECK:STDOUT: %Self => constants.%Self
  1230. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  1231. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.73b
  1232. // CHECK:STDOUT: }
  1233. // CHECK:STDOUT:
  1234. // CHECK:STDOUT: specific @Simple5(constants.%T) {
  1235. // CHECK:STDOUT: %T.loc10_12.1 => constants.%T
  1236. // CHECK:STDOUT: }
  1237. // CHECK:STDOUT:
  1238. // CHECK:STDOUT: specific @L2(constants.%T) {
  1239. // CHECK:STDOUT: !definition:
  1240. // CHECK:STDOUT: %Self.loc5 => constants.%T
  1241. // CHECK:STDOUT: %L2.WithSelf.R2.type => constants.%L2.WithSelf.R2.type.ba3
  1242. // CHECK:STDOUT: %L2.WithSelf.R2 => constants.%L2.WithSelf.R2.c61
  1243. // CHECK:STDOUT: %L2.WithSelf.S2.type => constants.%L2.WithSelf.S2.type.68b
  1244. // CHECK:STDOUT: %L2.WithSelf.S2 => constants.%L2.WithSelf.S2.470
  1245. // CHECK:STDOUT: }
  1246. // CHECK:STDOUT:
  1247. // CHECK:STDOUT: specific @L2.WithSelf.R2(constants.%T) {
  1248. // CHECK:STDOUT: %Self => constants.%T
  1249. // CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type
  1250. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.0fc
  1251. // CHECK:STDOUT: }
  1252. // CHECK:STDOUT:
  1253. // CHECK:STDOUT: specific @L2.WithSelf.S2(constants.%T) {
  1254. // CHECK:STDOUT: %Self => constants.%T
  1255. // CHECK:STDOUT: %Self.binding.as_type => constants.%T.binding.as_type
  1256. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.0fc
  1257. // CHECK:STDOUT: }
  1258. // CHECK:STDOUT:
  1259. // CHECK:STDOUT: specific @Compound5(constants.%V) {
  1260. // CHECK:STDOUT: %V.loc30_14.1 => constants.%V
  1261. // CHECK:STDOUT: }
  1262. // CHECK:STDOUT:
  1263. // CHECK:STDOUT: --- fail_combine_non_instance.carbon
  1264. // CHECK:STDOUT:
  1265. // CHECK:STDOUT: constants {
  1266. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  1267. // CHECK:STDOUT: %Self.c51: %A.type = symbolic_binding Self, 0 [symbolic]
  1268. // CHECK:STDOUT: %A.WithSelf.G.type.e1d: type = fn_type @A.WithSelf.G, @A(%Self.c51) [symbolic]
  1269. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1270. // CHECK:STDOUT: %A.WithSelf.G.552: %A.WithSelf.G.type.e1d = struct_value () [symbolic]
  1271. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete]
  1272. // CHECK:STDOUT: %assoc0.eb1: %A.assoc_type = assoc_entity element0, @A.%A.WithSelf.G.decl [concrete]
  1273. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1274. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1275. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1276. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness @C.as.A.impl.%A.impl_witness_table [concrete]
  1277. // CHECK:STDOUT: %C.as.A.impl.G.type: type = fn_type @C.as.A.impl.G [concrete]
  1278. // CHECK:STDOUT: %C.as.A.impl.G: %C.as.A.impl.G.type = struct_value () [concrete]
  1279. // CHECK:STDOUT: %A.facet: %A.type = facet_value %C, (%A.impl_witness) [concrete]
  1280. // CHECK:STDOUT: %A.WithSelf.G.type.f93: type = fn_type @A.WithSelf.G, @A(%A.facet) [concrete]
  1281. // CHECK:STDOUT: %A.WithSelf.G.9b2: %A.WithSelf.G.type.f93 = struct_value () [concrete]
  1282. // CHECK:STDOUT: %Fails.type: type = fn_type @Fails [concrete]
  1283. // CHECK:STDOUT: %Fails: %Fails.type = struct_value () [concrete]
  1284. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  1285. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  1286. // CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete]
  1287. // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete]
  1288. // CHECK:STDOUT: %BitAndWith.type.b10: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete]
  1289. // CHECK:STDOUT: %BitAndWith.impl_witness: <witness> = impl_witness imports.%BitAndWith.impl_witness_table [concrete]
  1290. // CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.b10 = facet_value type, (%BitAndWith.impl_witness) [concrete]
  1291. // CHECK:STDOUT: %BitAndWith.WithSelf.Op.type.4bd: type = fn_type @BitAndWith.WithSelf.Op, @BitAndWith(type, %BitAndWith.facet) [concrete]
  1292. // CHECK:STDOUT: %.d15: type = fn_type_with_self_type %BitAndWith.WithSelf.Op.type.4bd, %BitAndWith.facet [concrete]
  1293. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete]
  1294. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete]
  1295. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: <bound method> = bound_method %A.type, %type.as.BitAndWith.impl.Op [concrete]
  1296. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1297. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1298. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1299. // CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete]
  1300. // CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete]
  1301. // CHECK:STDOUT: }
  1302. // CHECK:STDOUT:
  1303. // CHECK:STDOUT: imports {
  1304. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1305. // CHECK:STDOUT: .BitAndWith = %Core.BitAndWith
  1306. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1307. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1308. // CHECK:STDOUT: import Core//prelude
  1309. // CHECK:STDOUT: import Core//prelude/...
  1310. // CHECK:STDOUT: }
  1311. // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic]
  1312. // CHECK:STDOUT: %Core.import_ref.8d3: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op]
  1313. // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.8d3), @type.as.BitAndWith.impl [concrete]
  1314. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1315. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1316. // CHECK:STDOUT: }
  1317. // CHECK:STDOUT:
  1318. // CHECK:STDOUT: file {
  1319. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1320. // CHECK:STDOUT: .Core = imports.%Core
  1321. // CHECK:STDOUT: .A = %A.decl
  1322. // CHECK:STDOUT: .C = %C.decl
  1323. // CHECK:STDOUT: .Fails = %Fails.decl
  1324. // CHECK:STDOUT: }
  1325. // CHECK:STDOUT: %Core.import = import Core
  1326. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  1327. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1328. // CHECK:STDOUT: impl_decl @C.as.A.impl [concrete] {} {
  1329. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1330. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1331. // CHECK:STDOUT: }
  1332. // CHECK:STDOUT: %Fails.decl: %Fails.type = fn_decl @Fails [concrete = constants.%Fails] {} {}
  1333. // CHECK:STDOUT: }
  1334. // CHECK:STDOUT:
  1335. // CHECK:STDOUT: interface @A {
  1336. // CHECK:STDOUT: %Self.loc3: %A.type = symbolic_binding Self, 0 [symbolic = constants.%Self.c51]
  1337. // CHECK:STDOUT: interface_with_self_decl @A [concrete]
  1338. // CHECK:STDOUT:
  1339. // CHECK:STDOUT: !with Self:
  1340. // CHECK:STDOUT: %A.WithSelf.G.decl: @A.%A.WithSelf.G.type (%A.WithSelf.G.type.e1d) = fn_decl @A.WithSelf.G [symbolic = @A.%A.WithSelf.G (constants.%A.WithSelf.G.552)] {} {}
  1341. // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, %A.WithSelf.G.decl [concrete = constants.%assoc0.eb1]
  1342. // CHECK:STDOUT:
  1343. // CHECK:STDOUT: !members:
  1344. // CHECK:STDOUT: .Self = %Self.loc3
  1345. // CHECK:STDOUT: .G = %assoc0
  1346. // CHECK:STDOUT: witness = (%A.WithSelf.G.decl)
  1347. // CHECK:STDOUT:
  1348. // CHECK:STDOUT: !requires:
  1349. // CHECK:STDOUT: }
  1350. // CHECK:STDOUT:
  1351. // CHECK:STDOUT: impl @C.as.A.impl: %C.ref as %A.ref {
  1352. // CHECK:STDOUT: %C.as.A.impl.G.decl: %C.as.A.impl.G.type = fn_decl @C.as.A.impl.G [concrete = constants.%C.as.A.impl.G] {} {}
  1353. // CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (%C.as.A.impl.G.decl), @C.as.A.impl [concrete]
  1354. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness]
  1355. // CHECK:STDOUT:
  1356. // CHECK:STDOUT: !members:
  1357. // CHECK:STDOUT: .G = %C.as.A.impl.G.decl
  1358. // CHECK:STDOUT: witness = %A.impl_witness
  1359. // CHECK:STDOUT: }
  1360. // CHECK:STDOUT:
  1361. // CHECK:STDOUT: class @C {
  1362. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1363. // CHECK:STDOUT: complete_type_witness = %complete_type
  1364. // CHECK:STDOUT:
  1365. // CHECK:STDOUT: !members:
  1366. // CHECK:STDOUT: .Self = constants.%C
  1367. // CHECK:STDOUT: }
  1368. // CHECK:STDOUT:
  1369. // CHECK:STDOUT: generic fn @A.WithSelf.G(@A.%Self.loc3: %A.type) {
  1370. // CHECK:STDOUT: fn();
  1371. // CHECK:STDOUT: }
  1372. // CHECK:STDOUT:
  1373. // CHECK:STDOUT: fn @C.as.A.impl.G() {
  1374. // CHECK:STDOUT: !entry:
  1375. // CHECK:STDOUT: return
  1376. // CHECK:STDOUT: }
  1377. // CHECK:STDOUT:
  1378. // CHECK:STDOUT: fn @Fails() {
  1379. // CHECK:STDOUT: !entry:
  1380. // CHECK:STDOUT: %.loc22_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1381. // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1382. // CHECK:STDOUT: %.loc22_5.2: ref %C = temporary_storage
  1383. // CHECK:STDOUT: %.loc22_5.3: init %C to %.loc22_5.2 = class_init () [concrete = constants.%C.val]
  1384. // CHECK:STDOUT: %.loc22_5.4: ref %C = temporary %.loc22_5.2, %.loc22_5.3
  1385. // CHECK:STDOUT: %.loc22_7: ref %C = converted %.loc22_5.1, %.loc22_5.4
  1386. // CHECK:STDOUT: %A.ref.loc22_15: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1387. // CHECK:STDOUT: %A.ref.loc22_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1388. // CHECK:STDOUT: %impl.elem0.loc22: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1389. // CHECK:STDOUT: %bound_method.loc22: <bound method> = bound_method %A.ref.loc22_15, %impl.elem0.loc22 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1390. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc22: init type = call %bound_method.loc22(%A.ref.loc22_15, %A.ref.loc22_19) [concrete = constants.%A.type]
  1391. // CHECK:STDOUT: %G.ref.loc22: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.eb1]
  1392. // CHECK:STDOUT: %.loc22_12: %A.type = converted %.loc22_7, <error> [concrete = <error>]
  1393. // CHECK:STDOUT: %.loc30_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1394. // CHECK:STDOUT: %C.ref.loc30_11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1395. // CHECK:STDOUT: %.loc30_6.2: ref %C = temporary_storage
  1396. // CHECK:STDOUT: %.loc30_6.3: init %C to %.loc30_6.2 = class_init () [concrete = constants.%C.val]
  1397. // CHECK:STDOUT: %.loc30_6.4: ref %C = temporary %.loc30_6.2, %.loc30_6.3
  1398. // CHECK:STDOUT: %.loc30_8: ref %C = converted %.loc30_6.1, %.loc30_6.4
  1399. // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1400. // CHECK:STDOUT: %A.ref.loc30_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1401. // CHECK:STDOUT: %A.ref.loc30_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1402. // CHECK:STDOUT: %impl.elem0.loc30_26: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1403. // CHECK:STDOUT: %bound_method.loc30_26: <bound method> = bound_method %A.ref.loc30_24, %impl.elem0.loc30_26 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1404. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc30_26: init type = call %bound_method.loc30_26(%A.ref.loc30_24, %A.ref.loc30_28) [concrete = constants.%A.type]
  1405. // CHECK:STDOUT: %.loc30_29.1: type = value_of_initializer %type.as.BitAndWith.impl.Op.call.loc30_26 [concrete = constants.%A.type]
  1406. // CHECK:STDOUT: %.loc30_29.2: type = converted %type.as.BitAndWith.impl.Op.call.loc30_26, %.loc30_29.1 [concrete = constants.%A.type]
  1407. // CHECK:STDOUT: %A.facet.loc30: %A.type = facet_value %C.ref.loc30_18, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1408. // CHECK:STDOUT: %.loc30_20: %A.type = converted %C.ref.loc30_18, %A.facet.loc30 [concrete = constants.%A.facet]
  1409. // CHECK:STDOUT: %as_type.loc30: type = facet_access_type %.loc30_20 [concrete = constants.%C]
  1410. // CHECK:STDOUT: %.loc30_30: type = converted %.loc30_20, %as_type.loc30 [concrete = constants.%C]
  1411. // CHECK:STDOUT: %A.ref.loc30_35: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1412. // CHECK:STDOUT: %A.ref.loc30_39: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1413. // CHECK:STDOUT: %impl.elem0.loc30_37: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1414. // CHECK:STDOUT: %bound_method.loc30_37: <bound method> = bound_method %A.ref.loc30_35, %impl.elem0.loc30_37 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1415. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc30_37: init type = call %bound_method.loc30_37(%A.ref.loc30_35, %A.ref.loc30_39) [concrete = constants.%A.type]
  1416. // CHECK:STDOUT: %G.ref.loc30: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.eb1]
  1417. // CHECK:STDOUT: %.loc30_32: %A.type = converted %.loc30_8, <error> [concrete = <error>]
  1418. // CHECK:STDOUT: %.loc38_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1419. // CHECK:STDOUT: %C.ref.loc38_11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1420. // CHECK:STDOUT: %.loc38_6.2: ref %C = temporary_storage
  1421. // CHECK:STDOUT: %.loc38_6.3: init %C to %.loc38_6.2 = class_init () [concrete = constants.%C.val]
  1422. // CHECK:STDOUT: %.loc38_6.4: ref %C = temporary %.loc38_6.2, %.loc38_6.3
  1423. // CHECK:STDOUT: %.loc38_8: ref %C = converted %.loc38_6.1, %.loc38_6.4
  1424. // CHECK:STDOUT: %C.ref.loc38_18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1425. // CHECK:STDOUT: %A.ref.loc38_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1426. // CHECK:STDOUT: %A.ref.loc38_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1427. // CHECK:STDOUT: %impl.elem0.loc38: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1428. // CHECK:STDOUT: %bound_method.loc38: <bound method> = bound_method %A.ref.loc38_24, %impl.elem0.loc38 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1429. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc38: init type = call %bound_method.loc38(%A.ref.loc38_24, %A.ref.loc38_28) [concrete = constants.%A.type]
  1430. // CHECK:STDOUT: %.loc38_29.1: type = value_of_initializer %type.as.BitAndWith.impl.Op.call.loc38 [concrete = constants.%A.type]
  1431. // CHECK:STDOUT: %.loc38_29.2: type = converted %type.as.BitAndWith.impl.Op.call.loc38, %.loc38_29.1 [concrete = constants.%A.type]
  1432. // CHECK:STDOUT: %A.facet.loc38: %A.type = facet_value %C.ref.loc38_18, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1433. // CHECK:STDOUT: %.loc38_20: %A.type = converted %C.ref.loc38_18, %A.facet.loc38 [concrete = constants.%A.facet]
  1434. // CHECK:STDOUT: %as_type.loc38: type = facet_access_type %.loc38_20 [concrete = constants.%C]
  1435. // CHECK:STDOUT: %.loc38_30: type = converted %.loc38_20, %as_type.loc38 [concrete = constants.%C]
  1436. // CHECK:STDOUT: %A.ref.loc38_34: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1437. // CHECK:STDOUT: %G.ref.loc38: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.eb1]
  1438. // CHECK:STDOUT: %.loc38_32: %A.type = converted %.loc38_8, <error> [concrete = <error>]
  1439. // CHECK:STDOUT: %DestroyOp.bound.loc38: <bound method> = bound_method %.loc38_6.4, constants.%DestroyOp
  1440. // CHECK:STDOUT: %DestroyOp.call.loc38: init %empty_tuple.type = call %DestroyOp.bound.loc38(%.loc38_6.4)
  1441. // CHECK:STDOUT: %DestroyOp.bound.loc30: <bound method> = bound_method %.loc30_6.4, constants.%DestroyOp
  1442. // CHECK:STDOUT: %DestroyOp.call.loc30: init %empty_tuple.type = call %DestroyOp.bound.loc30(%.loc30_6.4)
  1443. // CHECK:STDOUT: %DestroyOp.bound.loc22: <bound method> = bound_method %.loc22_5.4, constants.%DestroyOp
  1444. // CHECK:STDOUT: %DestroyOp.call.loc22: init %empty_tuple.type = call %DestroyOp.bound.loc22(%.loc22_5.4)
  1445. // CHECK:STDOUT: return
  1446. // CHECK:STDOUT: }
  1447. // CHECK:STDOUT:
  1448. // CHECK:STDOUT: fn @DestroyOp(%self.param: ref %C) = "no_op";
  1449. // CHECK:STDOUT:
  1450. // CHECK:STDOUT: specific @A(constants.%Self.c51) {
  1451. // CHECK:STDOUT: !definition:
  1452. // CHECK:STDOUT: %Self.loc4 => constants.%Self.c51
  1453. // CHECK:STDOUT: %A.WithSelf.G.type => constants.%A.WithSelf.G.type.e1d
  1454. // CHECK:STDOUT: %A.WithSelf.G => constants.%A.WithSelf.G.552
  1455. // CHECK:STDOUT: }
  1456. // CHECK:STDOUT:
  1457. // CHECK:STDOUT: specific @A.WithSelf.G(constants.%Self.c51) {}
  1458. // CHECK:STDOUT:
  1459. // CHECK:STDOUT: specific @A(constants.%A.facet) {
  1460. // CHECK:STDOUT: !definition:
  1461. // CHECK:STDOUT: %Self.loc4 => constants.%A.facet
  1462. // CHECK:STDOUT: %A.WithSelf.G.type => constants.%A.WithSelf.G.type.f93
  1463. // CHECK:STDOUT: %A.WithSelf.G => constants.%A.WithSelf.G.9b2
  1464. // CHECK:STDOUT: }
  1465. // CHECK:STDOUT:
  1466. // CHECK:STDOUT: specific @A.WithSelf.G(constants.%A.facet) {}
  1467. // CHECK:STDOUT:
  1468. // CHECK:STDOUT: --- allowed_combine_non_instance.carbon
  1469. // CHECK:STDOUT:
  1470. // CHECK:STDOUT: constants {
  1471. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  1472. // CHECK:STDOUT: %Self.c51: %A.type = symbolic_binding Self, 0 [symbolic]
  1473. // CHECK:STDOUT: %A.WithSelf.G.type.e1d: type = fn_type @A.WithSelf.G, @A(%Self.c51) [symbolic]
  1474. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1475. // CHECK:STDOUT: %A.WithSelf.G.552: %A.WithSelf.G.type.e1d = struct_value () [symbolic]
  1476. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete]
  1477. // CHECK:STDOUT: %assoc0.eb1: %A.assoc_type = assoc_entity element0, @A.%A.WithSelf.G.decl [concrete]
  1478. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1479. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1480. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1481. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness @C.as.A.impl.%A.impl_witness_table [concrete]
  1482. // CHECK:STDOUT: %C.as.A.impl.G.type: type = fn_type @C.as.A.impl.G [concrete]
  1483. // CHECK:STDOUT: %C.as.A.impl.G: %C.as.A.impl.G.type = struct_value () [concrete]
  1484. // CHECK:STDOUT: %A.facet: %A.type = facet_value %C, (%A.impl_witness) [concrete]
  1485. // CHECK:STDOUT: %A.WithSelf.G.type.f93: type = fn_type @A.WithSelf.G, @A(%A.facet) [concrete]
  1486. // CHECK:STDOUT: %A.WithSelf.G.9b2: %A.WithSelf.G.type.f93 = struct_value () [concrete]
  1487. // CHECK:STDOUT: %Works.type: type = fn_type @Works [concrete]
  1488. // CHECK:STDOUT: %Works: %Works.type = struct_value () [concrete]
  1489. // CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete]
  1490. // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete]
  1491. // CHECK:STDOUT: %BitAndWith.type.b10: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete]
  1492. // CHECK:STDOUT: %BitAndWith.impl_witness: <witness> = impl_witness imports.%BitAndWith.impl_witness_table [concrete]
  1493. // CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.b10 = facet_value type, (%BitAndWith.impl_witness) [concrete]
  1494. // CHECK:STDOUT: %BitAndWith.WithSelf.Op.type.4bd: type = fn_type @BitAndWith.WithSelf.Op, @BitAndWith(type, %BitAndWith.facet) [concrete]
  1495. // CHECK:STDOUT: %.d15: type = fn_type_with_self_type %BitAndWith.WithSelf.Op.type.4bd, %BitAndWith.facet [concrete]
  1496. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.type: type = fn_type @type.as.BitAndWith.impl.Op [concrete]
  1497. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op: %type.as.BitAndWith.impl.Op.type = struct_value () [concrete]
  1498. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.bound: <bound method> = bound_method %A.type, %type.as.BitAndWith.impl.Op [concrete]
  1499. // CHECK:STDOUT: %.05a: type = fn_type_with_self_type %A.WithSelf.G.type.f93, %A.facet [concrete]
  1500. // CHECK:STDOUT: }
  1501. // CHECK:STDOUT:
  1502. // CHECK:STDOUT: imports {
  1503. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1504. // CHECK:STDOUT: .BitAndWith = %Core.BitAndWith
  1505. // CHECK:STDOUT: import Core//prelude
  1506. // CHECK:STDOUT: import Core//prelude/...
  1507. // CHECK:STDOUT: }
  1508. // CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/parts/as, BitAndWith, loaded [concrete = constants.%BitAndWith.generic]
  1509. // CHECK:STDOUT: %Core.import_ref.8d3: %type.as.BitAndWith.impl.Op.type = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [concrete = constants.%type.as.BitAndWith.impl.Op]
  1510. // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.8d3), @type.as.BitAndWith.impl [concrete]
  1511. // CHECK:STDOUT: }
  1512. // CHECK:STDOUT:
  1513. // CHECK:STDOUT: file {
  1514. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1515. // CHECK:STDOUT: .Core = imports.%Core
  1516. // CHECK:STDOUT: .A = %A.decl
  1517. // CHECK:STDOUT: .C = %C.decl
  1518. // CHECK:STDOUT: .Works = %Works.decl
  1519. // CHECK:STDOUT: }
  1520. // CHECK:STDOUT: %Core.import = import Core
  1521. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  1522. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1523. // CHECK:STDOUT: impl_decl @C.as.A.impl [concrete] {} {
  1524. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1525. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1526. // CHECK:STDOUT: }
  1527. // CHECK:STDOUT: %Works.decl: %Works.type = fn_decl @Works [concrete = constants.%Works] {} {}
  1528. // CHECK:STDOUT: }
  1529. // CHECK:STDOUT:
  1530. // CHECK:STDOUT: interface @A {
  1531. // CHECK:STDOUT: %Self.loc3: %A.type = symbolic_binding Self, 0 [symbolic = constants.%Self.c51]
  1532. // CHECK:STDOUT: interface_with_self_decl @A [concrete]
  1533. // CHECK:STDOUT:
  1534. // CHECK:STDOUT: !with Self:
  1535. // CHECK:STDOUT: %A.WithSelf.G.decl: @A.%A.WithSelf.G.type (%A.WithSelf.G.type.e1d) = fn_decl @A.WithSelf.G [symbolic = @A.%A.WithSelf.G (constants.%A.WithSelf.G.552)] {} {}
  1536. // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, %A.WithSelf.G.decl [concrete = constants.%assoc0.eb1]
  1537. // CHECK:STDOUT:
  1538. // CHECK:STDOUT: !members:
  1539. // CHECK:STDOUT: .Self = %Self.loc3
  1540. // CHECK:STDOUT: .G = %assoc0
  1541. // CHECK:STDOUT: witness = (%A.WithSelf.G.decl)
  1542. // CHECK:STDOUT:
  1543. // CHECK:STDOUT: !requires:
  1544. // CHECK:STDOUT: }
  1545. // CHECK:STDOUT:
  1546. // CHECK:STDOUT: impl @C.as.A.impl: %C.ref as %A.ref {
  1547. // CHECK:STDOUT: %C.as.A.impl.G.decl: %C.as.A.impl.G.type = fn_decl @C.as.A.impl.G [concrete = constants.%C.as.A.impl.G] {} {}
  1548. // CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (%C.as.A.impl.G.decl), @C.as.A.impl [concrete]
  1549. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness]
  1550. // CHECK:STDOUT:
  1551. // CHECK:STDOUT: !members:
  1552. // CHECK:STDOUT: .G = %C.as.A.impl.G.decl
  1553. // CHECK:STDOUT: witness = %A.impl_witness
  1554. // CHECK:STDOUT: }
  1555. // CHECK:STDOUT:
  1556. // CHECK:STDOUT: class @C {
  1557. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1558. // CHECK:STDOUT: complete_type_witness = %complete_type
  1559. // CHECK:STDOUT:
  1560. // CHECK:STDOUT: !members:
  1561. // CHECK:STDOUT: .Self = constants.%C
  1562. // CHECK:STDOUT: }
  1563. // CHECK:STDOUT:
  1564. // CHECK:STDOUT: generic fn @A.WithSelf.G(@A.%Self.loc3: %A.type) {
  1565. // CHECK:STDOUT: fn();
  1566. // CHECK:STDOUT: }
  1567. // CHECK:STDOUT:
  1568. // CHECK:STDOUT: fn @C.as.A.impl.G() {
  1569. // CHECK:STDOUT: !entry:
  1570. // CHECK:STDOUT: return
  1571. // CHECK:STDOUT: }
  1572. // CHECK:STDOUT:
  1573. // CHECK:STDOUT: fn @Works() {
  1574. // CHECK:STDOUT: !entry:
  1575. // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1576. // CHECK:STDOUT: %A.ref.loc13_7: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1577. // CHECK:STDOUT: %A.ref.loc13_11: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1578. // CHECK:STDOUT: %impl.elem0.loc13_9: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1579. // CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %A.ref.loc13_7, %impl.elem0.loc13_9 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1580. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc13: init type = call %bound_method.loc13(%A.ref.loc13_7, %A.ref.loc13_11) [concrete = constants.%A.type]
  1581. // CHECK:STDOUT: %G.ref.loc13: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.eb1]
  1582. // CHECK:STDOUT: %A.facet.loc13: %A.type = facet_value %C.ref.loc13, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1583. // CHECK:STDOUT: %.loc13: %A.type = converted %C.ref.loc13, %A.facet.loc13 [concrete = constants.%A.facet]
  1584. // CHECK:STDOUT: %impl.elem0.loc13_4: %.05a = impl_witness_access constants.%A.impl_witness, element0 [concrete = constants.%C.as.A.impl.G]
  1585. // CHECK:STDOUT: %C.as.A.impl.G.call.loc13: init %empty_tuple.type = call %impl.elem0.loc13_4()
  1586. // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1587. // CHECK:STDOUT: %A.ref.loc14_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1588. // CHECK:STDOUT: %A.ref.loc14_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1589. // CHECK:STDOUT: %impl.elem0.loc14_12: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1590. // CHECK:STDOUT: %bound_method.loc14_12: <bound method> = bound_method %A.ref.loc14_10, %impl.elem0.loc14_12 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1591. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc14_12: init type = call %bound_method.loc14_12(%A.ref.loc14_10, %A.ref.loc14_14) [concrete = constants.%A.type]
  1592. // CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %type.as.BitAndWith.impl.Op.call.loc14_12 [concrete = constants.%A.type]
  1593. // CHECK:STDOUT: %.loc14_15.2: type = converted %type.as.BitAndWith.impl.Op.call.loc14_12, %.loc14_15.1 [concrete = constants.%A.type]
  1594. // CHECK:STDOUT: %A.facet.loc14: %A.type = facet_value %C.ref.loc14, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1595. // CHECK:STDOUT: %.loc14_6: %A.type = converted %C.ref.loc14, %A.facet.loc14 [concrete = constants.%A.facet]
  1596. // CHECK:STDOUT: %A.ref.loc14_20: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1597. // CHECK:STDOUT: %A.ref.loc14_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1598. // CHECK:STDOUT: %impl.elem0.loc14_22: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1599. // CHECK:STDOUT: %bound_method.loc14_22: <bound method> = bound_method %A.ref.loc14_20, %impl.elem0.loc14_22 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1600. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc14_22: init type = call %bound_method.loc14_22(%A.ref.loc14_20, %A.ref.loc14_24) [concrete = constants.%A.type]
  1601. // CHECK:STDOUT: %G.ref.loc14: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.eb1]
  1602. // CHECK:STDOUT: %impl.elem0.loc14_17: %.05a = impl_witness_access constants.%A.impl_witness, element0 [concrete = constants.%C.as.A.impl.G]
  1603. // CHECK:STDOUT: %C.as.A.impl.G.call.loc14: init %empty_tuple.type = call %impl.elem0.loc14_17()
  1604. // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1605. // CHECK:STDOUT: %A.ref.loc15_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1606. // CHECK:STDOUT: %A.ref.loc15_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1607. // CHECK:STDOUT: %impl.elem0.loc15_12: %.d15 = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%type.as.BitAndWith.impl.Op]
  1608. // CHECK:STDOUT: %bound_method.loc15: <bound method> = bound_method %A.ref.loc15_10, %impl.elem0.loc15_12 [concrete = constants.%type.as.BitAndWith.impl.Op.bound]
  1609. // CHECK:STDOUT: %type.as.BitAndWith.impl.Op.call.loc15: init type = call %bound_method.loc15(%A.ref.loc15_10, %A.ref.loc15_14) [concrete = constants.%A.type]
  1610. // CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %type.as.BitAndWith.impl.Op.call.loc15 [concrete = constants.%A.type]
  1611. // CHECK:STDOUT: %.loc15_15.2: type = converted %type.as.BitAndWith.impl.Op.call.loc15, %.loc15_15.1 [concrete = constants.%A.type]
  1612. // CHECK:STDOUT: %A.facet.loc15: %A.type = facet_value %C.ref.loc15, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1613. // CHECK:STDOUT: %.loc15_6: %A.type = converted %C.ref.loc15, %A.facet.loc15 [concrete = constants.%A.facet]
  1614. // CHECK:STDOUT: %A.ref.loc15_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1615. // CHECK:STDOUT: %G.ref.loc15: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.eb1]
  1616. // CHECK:STDOUT: %impl.elem0.loc15_17: %.05a = impl_witness_access constants.%A.impl_witness, element0 [concrete = constants.%C.as.A.impl.G]
  1617. // CHECK:STDOUT: %C.as.A.impl.G.call.loc15: init %empty_tuple.type = call %impl.elem0.loc15_17()
  1618. // CHECK:STDOUT: return
  1619. // CHECK:STDOUT: }
  1620. // CHECK:STDOUT:
  1621. // CHECK:STDOUT: specific @A(constants.%Self.c51) {
  1622. // CHECK:STDOUT: !definition:
  1623. // CHECK:STDOUT: %Self.loc4 => constants.%Self.c51
  1624. // CHECK:STDOUT: %A.WithSelf.G.type => constants.%A.WithSelf.G.type.e1d
  1625. // CHECK:STDOUT: %A.WithSelf.G => constants.%A.WithSelf.G.552
  1626. // CHECK:STDOUT: }
  1627. // CHECK:STDOUT:
  1628. // CHECK:STDOUT: specific @A.WithSelf.G(constants.%Self.c51) {}
  1629. // CHECK:STDOUT:
  1630. // CHECK:STDOUT: specific @A(constants.%A.facet) {
  1631. // CHECK:STDOUT: !definition:
  1632. // CHECK:STDOUT: %Self.loc4 => constants.%A.facet
  1633. // CHECK:STDOUT: %A.WithSelf.G.type => constants.%A.WithSelf.G.type.f93
  1634. // CHECK:STDOUT: %A.WithSelf.G => constants.%A.WithSelf.G.9b2
  1635. // CHECK:STDOUT: }
  1636. // CHECK:STDOUT:
  1637. // CHECK:STDOUT: specific @A.WithSelf.G(constants.%A.facet) {}
  1638. // CHECK:STDOUT: