fail_assoc_const_alias.carbon 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  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/none.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/fail_assoc_const_alias.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_alias.carbon
  14. // --- core.carbon
  15. package Core;
  16. interface ImplicitAs(Dest:! type) {
  17. fn Convert[self: Self]() -> Dest;
  18. }
  19. // --- fail_alias_to_different_interface.carbon
  20. library "[[@TEST_NAME]]";
  21. import Core;
  22. interface I {
  23. let T:! type;
  24. }
  25. interface J {
  26. alias U = I.T;
  27. // CHECK:STDERR: fail_alias_to_different_interface.carbon:[[@LINE+4]]:13: error: cannot convert type `Self` that implements `J` into type implementing `I` [ConversionFailureFacetToFacet]
  28. // CHECK:STDERR: fn F() -> U;
  29. // CHECK:STDERR: ^
  30. // CHECK:STDERR:
  31. fn F() -> U;
  32. }
  33. // --- alias_to_different_interface_with_requires.carbon
  34. library "[[@TEST_NAME]]";
  35. import Core;
  36. interface I2 {
  37. let T2:! type;
  38. }
  39. interface J2;
  40. impl forall [V:! J2] V as I2 where .T2 = () {}
  41. interface J2 {
  42. alias U2 = I2.T2;
  43. fn F2() -> U2;
  44. }
  45. // --- fail_call_method_alias.carbon
  46. library "[[@TEST_NAME]]";
  47. import Core;
  48. interface A {
  49. fn F[self: Self]() -> type;
  50. }
  51. interface B {
  52. alias F = A.F;
  53. // CHECK:STDERR: fail_call_method_alias.carbon:[[@LINE+4]]:13: error: cannot convert type `Self` that implements `B` into type implementing `A` [ConversionFailureFacetToFacet]
  54. // CHECK:STDERR: fn G() -> F();
  55. // CHECK:STDERR: ^
  56. // CHECK:STDERR:
  57. fn G() -> F();
  58. }
  59. // --- call_with_compound_member_access.carbon
  60. library "[[@TEST_NAME]]";
  61. import Core;
  62. interface C {
  63. fn F[self: Self]();
  64. // TODO: Add `default` once supported.
  65. fn G[self: Self]() {
  66. self.F();
  67. self.(F)();
  68. }
  69. }
  70. // CHECK:STDOUT: --- core.carbon
  71. // CHECK:STDOUT:
  72. // CHECK:STDOUT: constants {
  73. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  74. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  75. // CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic]
  76. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  77. // CHECK:STDOUT: %ImplicitAs.type.595: type = generic_interface_type @ImplicitAs [concrete]
  78. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.595 = struct_value () [concrete]
  79. // CHECK:STDOUT: %ImplicitAs.type.9fe: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  80. // CHECK:STDOUT: %Self: %ImplicitAs.type.9fe = symbolic_binding Self, 1 [symbolic]
  81. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic]
  82. // CHECK:STDOUT: %pattern_type.8de: type = pattern_type %Self.binding.as_type [symbolic]
  83. // CHECK:STDOUT: %.3cf: Core.Form = init_form %Dest, call_param1 [symbolic]
  84. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %Dest [symbolic]
  85. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs(%Dest, %Self) [symbolic]
  86. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert: %ImplicitAs.WithSelf.Convert.type = struct_value () [symbolic]
  87. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  88. // CHECK:STDOUT: %assoc0: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%ImplicitAs.WithSelf.Convert.decl [symbolic]
  89. // CHECK:STDOUT: }
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: file {
  92. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  93. // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
  94. // CHECK:STDOUT: }
  95. // CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.595 = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] {
  96. // CHECK:STDOUT: %Dest.patt: %pattern_type.98f = symbolic_binding_pattern Dest, 0 [concrete]
  97. // CHECK:STDOUT: } {
  98. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  99. // CHECK:STDOUT: %Dest.loc3_22.2: type = symbolic_binding Dest, 0 [symbolic = %Dest.loc3_22.1 (constants.%Dest)]
  100. // CHECK:STDOUT: }
  101. // CHECK:STDOUT: }
  102. // CHECK:STDOUT:
  103. // CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc3_22.2: type) {
  104. // CHECK:STDOUT: %Dest.loc3_22.1: type = symbolic_binding Dest, 0 [symbolic = %Dest.loc3_22.1 (constants.%Dest)]
  105. // CHECK:STDOUT:
  106. // CHECK:STDOUT: !definition:
  107. // CHECK:STDOUT: %ImplicitAs.type.loc3: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc3_22.1)> [symbolic = %ImplicitAs.type.loc3 (constants.%ImplicitAs.type.9fe)]
  108. // CHECK:STDOUT: %Self.loc3_35.2: @ImplicitAs.%ImplicitAs.type.loc3 (%ImplicitAs.type.9fe) = symbolic_binding Self, 1 [symbolic = %Self.loc3_35.2 (constants.%Self)]
  109. // CHECK:STDOUT:
  110. // CHECK:STDOUT: interface {
  111. // CHECK:STDOUT: %Self.loc3_35.1: @ImplicitAs.%ImplicitAs.type.loc3 (%ImplicitAs.type.9fe) = symbolic_binding Self, 1 [symbolic = %Self.loc3_35.2 (constants.%Self)]
  112. // CHECK:STDOUT: interface_with_self_decl @ImplicitAs [concrete]
  113. // CHECK:STDOUT:
  114. // CHECK:STDOUT: !with Self:
  115. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.decl: @ImplicitAs.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type) = fn_decl @ImplicitAs.WithSelf.Convert [symbolic = @ImplicitAs.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert)] {
  116. // CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_14 (%pattern_type.8de) = value_binding_pattern self [concrete]
  117. // CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_14 (%pattern_type.8de) = value_param_pattern %self.patt, call_param0 [concrete]
  118. // CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_28 (%pattern_type.51d) = return_slot_pattern [concrete]
  119. // CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_28 (%pattern_type.51d) = out_param_pattern %return.patt, call_param1 [concrete]
  120. // CHECK:STDOUT: } {
  121. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc3_22.2 [symbolic = %Dest (constants.%Dest)]
  122. // CHECK:STDOUT: %.loc4_31.2: Core.Form = init_form %Dest.ref, call_param1 [symbolic = %.loc4_31.1 (constants.%.3cf)]
  123. // CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
  124. // CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.3 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  125. // CHECK:STDOUT: %.loc4_20.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.9fe) = specific_constant @ImplicitAs.%Self.loc3_35.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self)]
  126. // CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.9fe) = name_ref Self, %.loc4_20.2 [symbolic = %Self (constants.%Self)]
  127. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  128. // CHECK:STDOUT: %.loc4_20.3: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  129. // CHECK:STDOUT: }
  130. // CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
  131. // CHECK:STDOUT: %return.param: ref @ImplicitAs.WithSelf.Convert.%Dest (%Dest) = out_param call_param1
  132. // CHECK:STDOUT: %return: ref @ImplicitAs.WithSelf.Convert.%Dest (%Dest) = return_slot %return.param
  133. // CHECK:STDOUT: }
  134. // CHECK:STDOUT: %assoc0.loc4_35.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0)]
  135. // CHECK:STDOUT:
  136. // CHECK:STDOUT: !members:
  137. // CHECK:STDOUT: .Self = %Self.loc3_35.1
  138. // CHECK:STDOUT: .Dest = <poisoned>
  139. // CHECK:STDOUT: .Dest = <poisoned>
  140. // CHECK:STDOUT: .Convert = %assoc0.loc4_35.1
  141. // CHECK:STDOUT: witness = (%ImplicitAs.WithSelf.Convert.decl)
  142. // CHECK:STDOUT:
  143. // CHECK:STDOUT: !requires:
  144. // CHECK:STDOUT: }
  145. // CHECK:STDOUT: }
  146. // CHECK:STDOUT:
  147. // CHECK:STDOUT: generic fn @ImplicitAs.WithSelf.Convert(@ImplicitAs.%Dest.loc3_22.2: type, @ImplicitAs.%Self.loc3_35.1: @ImplicitAs.%ImplicitAs.type.loc3 (%ImplicitAs.type.9fe)) {
  148. // CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic = %Dest (constants.%Dest)]
  149. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.9fe)]
  150. // CHECK:STDOUT: %Self: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.9fe) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self)]
  151. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  152. // CHECK:STDOUT: %pattern_type.loc4_14: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.loc4_14 (constants.%pattern_type.8de)]
  153. // CHECK:STDOUT: %.loc4_31.1: Core.Form = init_form %Dest, call_param1 [symbolic = %.loc4_31.1 (constants.%.3cf)]
  154. // CHECK:STDOUT: %pattern_type.loc4_28: type = pattern_type %Dest [symbolic = %pattern_type.loc4_28 (constants.%pattern_type.51d)]
  155. // CHECK:STDOUT:
  156. // CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.binding.as_type (%Self.binding.as_type)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%Dest (%Dest);
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  160. // CHECK:STDOUT: %Dest.loc3_22.1 => constants.%Dest
  161. // CHECK:STDOUT: }
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest, constants.%Self) {}
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: specific @ImplicitAs.WithSelf.Convert(constants.%Dest, constants.%Self) {
  166. // CHECK:STDOUT: %Dest => constants.%Dest
  167. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.9fe
  168. // CHECK:STDOUT: %Self => constants.%Self
  169. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  170. // CHECK:STDOUT: %pattern_type.loc4_14 => constants.%pattern_type.8de
  171. // CHECK:STDOUT: %.loc4_31.1 => constants.%.3cf
  172. // CHECK:STDOUT: %pattern_type.loc4_28 => constants.%pattern_type.51d
  173. // CHECK:STDOUT: }
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: --- fail_alias_to_different_interface.carbon
  176. // CHECK:STDOUT:
  177. // CHECK:STDOUT: constants {
  178. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  179. // CHECK:STDOUT: %Self.ab9: %I.type = symbolic_binding Self, 0 [symbolic]
  180. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  181. // CHECK:STDOUT: %assoc0.2e7: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  182. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  183. // CHECK:STDOUT: %Self.8a1: %J.type = symbolic_binding Self, 0 [symbolic]
  184. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.8a1 [symbolic]
  185. // CHECK:STDOUT: %J.WithSelf.F.type: type = fn_type @J.WithSelf.F, @J(%Self.8a1) [symbolic]
  186. // CHECK:STDOUT: %J.WithSelf.F: %J.WithSelf.F.type = struct_value () [symbolic]
  187. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  188. // CHECK:STDOUT: %assoc0.481: %J.assoc_type = assoc_entity element0, @J.%J.WithSelf.F.decl [concrete]
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT:
  191. // CHECK:STDOUT: imports {
  192. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  193. // CHECK:STDOUT: import Core//default
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT:
  197. // CHECK:STDOUT: file {
  198. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  199. // CHECK:STDOUT: .Core = imports.%Core
  200. // CHECK:STDOUT: .I = %I.decl
  201. // CHECK:STDOUT: .J = %J.decl
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT: %Core.import = import Core
  204. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  205. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: interface @I {
  209. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.ab9]
  210. // CHECK:STDOUT: interface_with_self_decl @I [concrete]
  211. // CHECK:STDOUT:
  212. // CHECK:STDOUT: !with Self:
  213. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  214. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0.2e7]
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT:
  217. // CHECK:STDOUT: !members:
  218. // CHECK:STDOUT: .Self = %Self
  219. // CHECK:STDOUT: .T = @T.%assoc0
  220. // CHECK:STDOUT: witness = (%T)
  221. // CHECK:STDOUT:
  222. // CHECK:STDOUT: !requires:
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT:
  225. // CHECK:STDOUT: interface @J {
  226. // CHECK:STDOUT: %Self.loc9: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self.8a1]
  227. // CHECK:STDOUT: interface_with_self_decl @J [concrete]
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: !with Self:
  230. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  231. // CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0.2e7]
  232. // CHECK:STDOUT: %U: %I.assoc_type = alias_binding U, @T.%assoc0 [concrete = constants.%assoc0.2e7]
  233. // CHECK:STDOUT: %J.WithSelf.F.decl: @J.%J.WithSelf.F.type (%J.WithSelf.F.type) = fn_decl @J.WithSelf.F [symbolic = @J.%J.WithSelf.F (constants.%J.WithSelf.F)] {} {
  234. // CHECK:STDOUT: %Self.as_type: type = facet_access_type @J.%Self.loc9 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  235. // CHECK:STDOUT: %U.ref: <error> = name_ref U, <error> [concrete = <error>]
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, %J.WithSelf.F.decl [concrete = constants.%assoc0.481]
  238. // CHECK:STDOUT:
  239. // CHECK:STDOUT: !members:
  240. // CHECK:STDOUT: .Self = %Self.loc9
  241. // CHECK:STDOUT: .I = <poisoned>
  242. // CHECK:STDOUT: .I = <poisoned>
  243. // CHECK:STDOUT: .U = %U
  244. // CHECK:STDOUT: .F = %assoc0
  245. // CHECK:STDOUT: witness = (%J.WithSelf.F.decl)
  246. // CHECK:STDOUT:
  247. // CHECK:STDOUT: !requires:
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self.loc9: %J.type) {
  251. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.8a1)]
  252. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: fn() -> <error>;
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: specific @I(constants.%Self.ab9) {
  258. // CHECK:STDOUT: !definition:
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: specific @J(constants.%Self.8a1) {}
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self.8a1) {
  264. // CHECK:STDOUT: %Self => constants.%Self.8a1
  265. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: --- alias_to_different_interface_with_requires.carbon
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: constants {
  271. // CHECK:STDOUT: %I2.type: type = facet_type <@I2> [concrete]
  272. // CHECK:STDOUT: %Self.36e: %I2.type = symbolic_binding Self, 0 [symbolic]
  273. // CHECK:STDOUT: %I2.assoc_type: type = assoc_entity_type @I2 [concrete]
  274. // CHECK:STDOUT: %assoc0.7c1: %I2.assoc_type = assoc_entity element0, @I2.%T2 [concrete]
  275. // CHECK:STDOUT: %J2.type: type = facet_type <@J2> [concrete]
  276. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  277. // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self]
  278. // CHECK:STDOUT: %V: %J2.type = symbolic_binding V, 0 [symbolic]
  279. // CHECK:STDOUT: %pattern_type.b4f: type = pattern_type %J2.type [concrete]
  280. // CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 0, %V [symbolic]
  281. // CHECK:STDOUT: %.Self.feb: %I2.type = symbolic_binding .Self [symbolic_self]
  282. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  283. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self.feb [symbolic_self]
  284. // CHECK:STDOUT: %I2.lookup_impl_witness.c47: <witness> = lookup_impl_witness %.Self.feb, @I2 [symbolic_self]
  285. // CHECK:STDOUT: %impl.elem0.f1d: type = impl_witness_access %I2.lookup_impl_witness.c47, element0 [symbolic_self]
  286. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  287. // CHECK:STDOUT: %I2_where.type: type = facet_type <@I2 where %impl.elem0.f1d = %empty_tuple.type> [concrete]
  288. // CHECK:STDOUT: %I2.impl_witness.364: <witness> = impl_witness @V.binding.as_type.as.I2.impl.%I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%V) [symbolic]
  289. // CHECK:STDOUT: %I2.facet.beb: %I2.type = facet_value %V.binding.as_type, (%I2.impl_witness.364) [symbolic]
  290. // CHECK:STDOUT: %Self.4a7: %J2.type = symbolic_binding Self, 0 [symbolic]
  291. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.4a7 [symbolic]
  292. // CHECK:STDOUT: %I2.impl_witness.ddb: <witness> = impl_witness @V.binding.as_type.as.I2.impl.%I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%Self.4a7) [symbolic]
  293. // CHECK:STDOUT: %.ef7: require_specific_def_type = require_specific_def @V.binding.as_type.as.I2.impl(%Self.4a7) [symbolic]
  294. // CHECK:STDOUT: %I2.lookup_impl_witness.d97: <witness> = lookup_impl_witness %Self.4a7, @I2 [symbolic]
  295. // CHECK:STDOUT: %I2.facet.7a5: %I2.type = facet_value %Self.binding.as_type, (%I2.lookup_impl_witness.d97) [symbolic]
  296. // CHECK:STDOUT: %impl.elem0.006: type = impl_witness_access %I2.lookup_impl_witness.d97, element0 [symbolic]
  297. // CHECK:STDOUT: %.d9a: Core.Form = init_form %impl.elem0.006, call_param0 [symbolic]
  298. // CHECK:STDOUT: %pattern_type.a14: type = pattern_type %impl.elem0.006 [symbolic]
  299. // CHECK:STDOUT: %J2.WithSelf.F2.type: type = fn_type @J2.WithSelf.F2, @J2(%Self.4a7) [symbolic]
  300. // CHECK:STDOUT: %J2.WithSelf.F2: %J2.WithSelf.F2.type = struct_value () [symbolic]
  301. // CHECK:STDOUT: %J2.assoc_type: type = assoc_entity_type @J2 [concrete]
  302. // CHECK:STDOUT: %assoc0.41c: %J2.assoc_type = assoc_entity element0, @J2.%J2.WithSelf.F2.decl [concrete]
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: imports {
  306. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  307. // CHECK:STDOUT: import Core//default
  308. // CHECK:STDOUT: }
  309. // CHECK:STDOUT: }
  310. // CHECK:STDOUT:
  311. // CHECK:STDOUT: file {
  312. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  313. // CHECK:STDOUT: .Core = imports.%Core
  314. // CHECK:STDOUT: .I2 = %I2.decl
  315. // CHECK:STDOUT: .J2 = %J2.decl.loc9
  316. // CHECK:STDOUT: }
  317. // CHECK:STDOUT: %Core.import = import Core
  318. // CHECK:STDOUT: %I2.decl: type = interface_decl @I2 [concrete = constants.%I2.type] {} {}
  319. // CHECK:STDOUT: %J2.decl.loc9: type = interface_decl @J2 [concrete = constants.%J2.type] {} {}
  320. // CHECK:STDOUT: impl_decl @V.binding.as_type.as.I2.impl [concrete] {
  321. // CHECK:STDOUT: %V.patt: %pattern_type.b4f = symbolic_binding_pattern V, 0 [concrete]
  322. // CHECK:STDOUT: } {
  323. // CHECK:STDOUT: %V.ref: %J2.type = name_ref V, %V.loc11_14.1 [symbolic = %V.loc11_14.2 (constants.%V)]
  324. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V.ref [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  325. // CHECK:STDOUT: %.loc11_22: type = converted %V.ref, %V.as_type [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  326. // CHECK:STDOUT: %I2.ref: type = name_ref I2, file.%I2.decl [concrete = constants.%I2.type]
  327. // CHECK:STDOUT: %.Self.1: %I2.type = symbolic_binding .Self [symbolic_self = constants.%.Self.feb]
  328. // CHECK:STDOUT: %.Self.ref: %I2.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self.feb]
  329. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  330. // CHECK:STDOUT: %.loc11_36: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  331. // CHECK:STDOUT: %T2.ref: %I2.assoc_type = name_ref T2, @T2.%assoc0 [concrete = constants.%assoc0.7c1]
  332. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I2.lookup_impl_witness.c47, element0 [symbolic_self = constants.%impl.elem0.f1d]
  333. // CHECK:STDOUT: %.loc11_43.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  334. // CHECK:STDOUT: %.loc11_43.2: type = converted %.loc11_43.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  335. // CHECK:STDOUT: %.loc11_30: type = where_expr %.Self.1 [concrete = constants.%I2_where.type] {
  336. // CHECK:STDOUT: requirement_base_facet_type constants.%I2.type
  337. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc11_43.2
  338. // CHECK:STDOUT: }
  339. // CHECK:STDOUT: %.loc11_18: type = splice_block %J2.ref [concrete = constants.%J2.type] {
  340. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
  341. // CHECK:STDOUT: %J2.ref: type = name_ref J2, file.%J2.decl.loc9 [concrete = constants.%J2.type]
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT: %V.loc11_14.1: %J2.type = symbolic_binding V, 0 [symbolic = %V.loc11_14.2 (constants.%V)]
  344. // CHECK:STDOUT: }
  345. // CHECK:STDOUT: %J2.decl.loc13: type = interface_decl @J2 [concrete = constants.%J2.type] {} {}
  346. // CHECK:STDOUT: }
  347. // CHECK:STDOUT:
  348. // CHECK:STDOUT: interface @I2 {
  349. // CHECK:STDOUT: %Self: %I2.type = symbolic_binding Self, 0 [symbolic = constants.%Self.36e]
  350. // CHECK:STDOUT: interface_with_self_decl @I2 [concrete]
  351. // CHECK:STDOUT:
  352. // CHECK:STDOUT: !with Self:
  353. // CHECK:STDOUT: %T2: type = assoc_const_decl @T2 [concrete] {
  354. // CHECK:STDOUT: %assoc0: %I2.assoc_type = assoc_entity element0, @I2.%T2 [concrete = constants.%assoc0.7c1]
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: !members:
  358. // CHECK:STDOUT: .Self = %Self
  359. // CHECK:STDOUT: .T2 = @T2.%assoc0
  360. // CHECK:STDOUT: witness = (%T2)
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: !requires:
  363. // CHECK:STDOUT: }
  364. // CHECK:STDOUT:
  365. // CHECK:STDOUT: interface @J2 {
  366. // CHECK:STDOUT: %Self.loc13: %J2.type = symbolic_binding Self, 0 [symbolic = constants.%Self.4a7]
  367. // CHECK:STDOUT: interface_with_self_decl @J2 [concrete]
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: !with Self:
  370. // CHECK:STDOUT: %I2.ref: type = name_ref I2, file.%I2.decl [concrete = constants.%I2.type]
  371. // CHECK:STDOUT: %T2.ref: %I2.assoc_type = name_ref T2, @T2.%assoc0 [concrete = constants.%assoc0.7c1]
  372. // CHECK:STDOUT: %U2: %I2.assoc_type = alias_binding U2, @T2.%assoc0 [concrete = constants.%assoc0.7c1]
  373. // CHECK:STDOUT: %J2.WithSelf.F2.decl: @J2.%J2.WithSelf.F2.type (%J2.WithSelf.F2.type) = fn_decl @J2.WithSelf.F2 [symbolic = @J2.%J2.WithSelf.F2 (constants.%J2.WithSelf.F2)] {
  374. // CHECK:STDOUT: %return.patt: @J2.WithSelf.F2.%pattern_type (%pattern_type.a14) = return_slot_pattern [concrete]
  375. // CHECK:STDOUT: %return.param_patt: @J2.WithSelf.F2.%pattern_type (%pattern_type.a14) = out_param_pattern %return.patt, call_param0 [concrete]
  376. // CHECK:STDOUT: } {
  377. // CHECK:STDOUT: %Self.as_type: type = facet_access_type @J2.%Self.loc13 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  378. // CHECK:STDOUT: %I2.facet.loc15_14.2: %I2.type = facet_value %Self.as_type, (constants.%I2.lookup_impl_witness.d97) [symbolic = %I2.facet.loc15_14.1 (constants.%I2.facet.7a5)]
  379. // CHECK:STDOUT: %.loc15_14.3: %I2.type = converted @J2.%Self.loc13, %I2.facet.loc15_14.2 [symbolic = %I2.facet.loc15_14.1 (constants.%I2.facet.7a5)]
  380. // CHECK:STDOUT: %impl.elem0.loc15_14.2: type = impl_witness_access constants.%I2.lookup_impl_witness.d97, element0 [symbolic = %impl.elem0.loc15_14.1 (constants.%impl.elem0.006)]
  381. // CHECK:STDOUT: %U2.ref: type = name_ref U2, %impl.elem0.loc15_14.2 [symbolic = %impl.elem0.loc15_14.1 (constants.%impl.elem0.006)]
  382. // CHECK:STDOUT: %.loc15_14.4: Core.Form = init_form %U2.ref, call_param0 [symbolic = %.loc15_14.2 (constants.%.d9a)]
  383. // CHECK:STDOUT: %return.param: ref @J2.WithSelf.F2.%impl.elem0.loc15_14.1 (%impl.elem0.006) = out_param call_param0
  384. // CHECK:STDOUT: %return: ref @J2.WithSelf.F2.%impl.elem0.loc15_14.1 (%impl.elem0.006) = return_slot %return.param
  385. // CHECK:STDOUT: }
  386. // CHECK:STDOUT: %assoc0: %J2.assoc_type = assoc_entity element0, %J2.WithSelf.F2.decl [concrete = constants.%assoc0.41c]
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: !members:
  389. // CHECK:STDOUT: .Self = %Self.loc13
  390. // CHECK:STDOUT: .I2 = <poisoned>
  391. // CHECK:STDOUT: .I2 = <poisoned>
  392. // CHECK:STDOUT: .U2 = %U2
  393. // CHECK:STDOUT: .F2 = %assoc0
  394. // CHECK:STDOUT: witness = (%J2.WithSelf.F2.decl)
  395. // CHECK:STDOUT:
  396. // CHECK:STDOUT: !requires:
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT:
  399. // CHECK:STDOUT: generic impl @V.binding.as_type.as.I2.impl(%V.loc11_14.1: %J2.type) {
  400. // CHECK:STDOUT: %V.loc11_14.2: %J2.type = symbolic_binding V, 0 [symbolic = %V.loc11_14.2 (constants.%V)]
  401. // CHECK:STDOUT: %V.binding.as_type: type = symbolic_binding_type V, 0, %V.loc11_14.2 [symbolic = %V.binding.as_type (constants.%V.binding.as_type)]
  402. // CHECK:STDOUT: %I2.impl_witness.loc11_45.2: <witness> = impl_witness %I2.impl_witness_table, @V.binding.as_type.as.I2.impl(%V.loc11_14.2) [symbolic = %I2.impl_witness.loc11_45.2 (constants.%I2.impl_witness.364)]
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: !definition:
  405. // CHECK:STDOUT:
  406. // CHECK:STDOUT: impl: %.loc11_22 as %.loc11_30 {
  407. // CHECK:STDOUT: %I2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @V.binding.as_type.as.I2.impl [concrete]
  408. // CHECK:STDOUT: %I2.impl_witness.loc11_45.1: <witness> = impl_witness %I2.impl_witness_table, @V.binding.as_type.as.I2.impl(constants.%V) [symbolic = %I2.impl_witness.loc11_45.2 (constants.%I2.impl_witness.364)]
  409. // CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  410. // CHECK:STDOUT:
  411. // CHECK:STDOUT: !members:
  412. // CHECK:STDOUT: witness = %I2.impl_witness.loc11_45.1
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT:
  416. // CHECK:STDOUT: generic fn @J2.WithSelf.F2(@J2.%Self.loc13: %J2.type) {
  417. // CHECK:STDOUT: %Self: %J2.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.4a7)]
  418. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  419. // CHECK:STDOUT: %.loc15_14.1: require_specific_def_type = require_specific_def @V.binding.as_type.as.I2.impl(%Self) [symbolic = %.loc15_14.1 (constants.%.ef7)]
  420. // CHECK:STDOUT: %I2.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I2 [symbolic = %I2.lookup_impl_witness (constants.%I2.lookup_impl_witness.d97)]
  421. // CHECK:STDOUT: %I2.facet.loc15_14.1: %I2.type = facet_value %Self.binding.as_type, (%I2.lookup_impl_witness) [symbolic = %I2.facet.loc15_14.1 (constants.%I2.facet.7a5)]
  422. // CHECK:STDOUT: %impl.elem0.loc15_14.1: type = impl_witness_access %I2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_14.1 (constants.%impl.elem0.006)]
  423. // CHECK:STDOUT: %.loc15_14.2: Core.Form = init_form %impl.elem0.loc15_14.1, call_param0 [symbolic = %.loc15_14.2 (constants.%.d9a)]
  424. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc15_14.1 [symbolic = %pattern_type (constants.%pattern_type.a14)]
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: fn() -> out %return.param: @J2.WithSelf.F2.%impl.elem0.loc15_14.1 (%impl.elem0.006);
  427. // CHECK:STDOUT: }
  428. // CHECK:STDOUT:
  429. // CHECK:STDOUT: specific @I2(constants.%Self.36e) {
  430. // CHECK:STDOUT: !definition:
  431. // CHECK:STDOUT: }
  432. // CHECK:STDOUT:
  433. // CHECK:STDOUT: specific @I2(constants.%.Self.feb) {
  434. // CHECK:STDOUT: !definition:
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: specific @V.binding.as_type.as.I2.impl(constants.%V) {
  438. // CHECK:STDOUT: %V.loc11_14.2 => constants.%V
  439. // CHECK:STDOUT: %V.binding.as_type => constants.%V.binding.as_type
  440. // CHECK:STDOUT: %I2.impl_witness.loc11_45.2 => constants.%I2.impl_witness.364
  441. // CHECK:STDOUT: }
  442. // CHECK:STDOUT:
  443. // CHECK:STDOUT: specific @I2(constants.%I2.facet.beb) {
  444. // CHECK:STDOUT: !definition:
  445. // CHECK:STDOUT: }
  446. // CHECK:STDOUT:
  447. // CHECK:STDOUT: specific @J2(constants.%Self.4a7) {}
  448. // CHECK:STDOUT:
  449. // CHECK:STDOUT: specific @V.binding.as_type.as.I2.impl(constants.%Self.4a7) {
  450. // CHECK:STDOUT: %V.loc11_14.2 => constants.%Self.4a7
  451. // CHECK:STDOUT: %V.binding.as_type => constants.%Self.binding.as_type
  452. // CHECK:STDOUT: %I2.impl_witness.loc11_45.2 => constants.%I2.impl_witness.ddb
  453. // CHECK:STDOUT:
  454. // CHECK:STDOUT: !definition:
  455. // CHECK:STDOUT: }
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: specific @I2(constants.%I2.facet.7a5) {
  458. // CHECK:STDOUT: !definition:
  459. // CHECK:STDOUT: }
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: specific @J2.WithSelf.F2(constants.%Self.4a7) {
  462. // CHECK:STDOUT: %Self => constants.%Self.4a7
  463. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  464. // CHECK:STDOUT: %.loc15_14.1 => constants.%.ef7
  465. // CHECK:STDOUT: %I2.lookup_impl_witness => constants.%I2.lookup_impl_witness.d97
  466. // CHECK:STDOUT: %I2.facet.loc15_14.1 => constants.%I2.facet.7a5
  467. // CHECK:STDOUT: %impl.elem0.loc15_14.1 => constants.%impl.elem0.006
  468. // CHECK:STDOUT: %.loc15_14.2 => constants.%.d9a
  469. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a14
  470. // CHECK:STDOUT: }
  471. // CHECK:STDOUT:
  472. // CHECK:STDOUT: --- fail_call_method_alias.carbon
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: constants {
  475. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  476. // CHECK:STDOUT: %Self.c51: %A.type = symbolic_binding Self, 0 [symbolic]
  477. // CHECK:STDOUT: %Self.binding.as_type.55a: type = symbolic_binding_type Self, 0, %Self.c51 [symbolic]
  478. // CHECK:STDOUT: %pattern_type.df1: type = pattern_type %Self.binding.as_type.55a [symbolic]
  479. // CHECK:STDOUT: %.b38: Core.Form = init_form type, call_param1 [concrete]
  480. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  481. // CHECK:STDOUT: %A.WithSelf.F.type: type = fn_type @A.WithSelf.F, @A(%Self.c51) [symbolic]
  482. // CHECK:STDOUT: %A.WithSelf.F: %A.WithSelf.F.type = struct_value () [symbolic]
  483. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete]
  484. // CHECK:STDOUT: %assoc0.24a: %A.assoc_type = assoc_entity element0, @A.%A.WithSelf.F.decl [concrete]
  485. // CHECK:STDOUT: %B.type: type = facet_type <@B> [concrete]
  486. // CHECK:STDOUT: %Self.d0b: %B.type = symbolic_binding Self, 0 [symbolic]
  487. // CHECK:STDOUT: %Self.binding.as_type.8ee: type = symbolic_binding_type Self, 0, %Self.d0b [symbolic]
  488. // CHECK:STDOUT: %B.WithSelf.G.type: type = fn_type @B.WithSelf.G, @B(%Self.d0b) [symbolic]
  489. // CHECK:STDOUT: %B.WithSelf.G: %B.WithSelf.G.type = struct_value () [symbolic]
  490. // CHECK:STDOUT: %B.assoc_type: type = assoc_entity_type @B [concrete]
  491. // CHECK:STDOUT: %assoc0.864: %B.assoc_type = assoc_entity element0, @B.%B.WithSelf.G.decl [concrete]
  492. // CHECK:STDOUT: }
  493. // CHECK:STDOUT:
  494. // CHECK:STDOUT: imports {
  495. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  496. // CHECK:STDOUT: import Core//default
  497. // CHECK:STDOUT: }
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: file {
  501. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  502. // CHECK:STDOUT: .Core = imports.%Core
  503. // CHECK:STDOUT: .A = %A.decl
  504. // CHECK:STDOUT: .B = %B.decl
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT: %Core.import = import Core
  507. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  508. // CHECK:STDOUT: %B.decl: type = interface_decl @B [concrete = constants.%B.type] {} {}
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT:
  511. // CHECK:STDOUT: interface @A {
  512. // CHECK:STDOUT: %Self.loc5: %A.type = symbolic_binding Self, 0 [symbolic = constants.%Self.c51]
  513. // CHECK:STDOUT: interface_with_self_decl @A [concrete]
  514. // CHECK:STDOUT:
  515. // CHECK:STDOUT: !with Self:
  516. // CHECK:STDOUT: %A.WithSelf.F.decl: @A.%A.WithSelf.F.type (%A.WithSelf.F.type) = fn_decl @A.WithSelf.F [symbolic = @A.%A.WithSelf.F (constants.%A.WithSelf.F)] {
  517. // CHECK:STDOUT: %self.patt: @A.WithSelf.F.%pattern_type (%pattern_type.df1) = value_binding_pattern self [concrete]
  518. // CHECK:STDOUT: %self.param_patt: @A.WithSelf.F.%pattern_type (%pattern_type.df1) = value_param_pattern %self.patt, call_param0 [concrete]
  519. // CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern [concrete]
  520. // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern %return.patt, call_param1 [concrete]
  521. // CHECK:STDOUT: } {
  522. // CHECK:STDOUT: %.loc6_25: Core.Form = init_form type, call_param1 [concrete = constants.%.b38]
  523. // CHECK:STDOUT: %self.param: @A.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type.55a) = value_param call_param0
  524. // CHECK:STDOUT: %.loc6_14.1: type = splice_block %.loc6_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.55a)] {
  525. // CHECK:STDOUT: %Self.ref: %A.type = name_ref Self, @A.%Self.loc5 [symbolic = %Self (constants.%Self.c51)]
  526. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.55a)]
  527. // CHECK:STDOUT: %.loc6_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.55a)]
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT: %self: @A.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type.55a) = value_binding self, %self.param
  530. // CHECK:STDOUT: %return.param: ref type = out_param call_param1
  531. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  532. // CHECK:STDOUT: }
  533. // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, %A.WithSelf.F.decl [concrete = constants.%assoc0.24a]
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: !members:
  536. // CHECK:STDOUT: .Self = %Self.loc5
  537. // CHECK:STDOUT: .F = %assoc0
  538. // CHECK:STDOUT: witness = (%A.WithSelf.F.decl)
  539. // CHECK:STDOUT:
  540. // CHECK:STDOUT: !requires:
  541. // CHECK:STDOUT: }
  542. // CHECK:STDOUT:
  543. // CHECK:STDOUT: interface @B {
  544. // CHECK:STDOUT: %Self.loc8: %B.type = symbolic_binding Self, 0 [symbolic = constants.%Self.d0b]
  545. // CHECK:STDOUT: interface_with_self_decl @B [concrete]
  546. // CHECK:STDOUT:
  547. // CHECK:STDOUT: !with Self:
  548. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  549. // CHECK:STDOUT: %F.ref: %A.assoc_type = name_ref F, @A.%assoc0 [concrete = constants.%assoc0.24a]
  550. // CHECK:STDOUT: %F: %A.assoc_type = alias_binding F, @A.%assoc0 [concrete = constants.%assoc0.24a]
  551. // CHECK:STDOUT: %B.WithSelf.G.decl: @B.%B.WithSelf.G.type (%B.WithSelf.G.type) = fn_decl @B.WithSelf.G [symbolic = @B.%B.WithSelf.G (constants.%B.WithSelf.G)] {} {
  552. // CHECK:STDOUT: %Self.as_type: type = facet_access_type @B.%Self.loc8 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.8ee)]
  553. // CHECK:STDOUT: %F.ref: <error> = name_ref F, <error> [concrete = <error>]
  554. // CHECK:STDOUT: }
  555. // CHECK:STDOUT: %assoc0: %B.assoc_type = assoc_entity element0, %B.WithSelf.G.decl [concrete = constants.%assoc0.864]
  556. // CHECK:STDOUT:
  557. // CHECK:STDOUT: !members:
  558. // CHECK:STDOUT: .Self = %Self.loc8
  559. // CHECK:STDOUT: .A = <poisoned>
  560. // CHECK:STDOUT: .A = <poisoned>
  561. // CHECK:STDOUT: .F = %F
  562. // CHECK:STDOUT: .G = %assoc0
  563. // CHECK:STDOUT: witness = (%B.WithSelf.G.decl)
  564. // CHECK:STDOUT:
  565. // CHECK:STDOUT: !requires:
  566. // CHECK:STDOUT: }
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: generic fn @A.WithSelf.F(@A.%Self.loc5: %A.type) {
  569. // CHECK:STDOUT: %Self: %A.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.c51)]
  570. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.55a)]
  571. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.df1)]
  572. // CHECK:STDOUT:
  573. // CHECK:STDOUT: fn(%self.param: @A.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type.55a)) -> out %return.param: type;
  574. // CHECK:STDOUT: }
  575. // CHECK:STDOUT:
  576. // CHECK:STDOUT: generic fn @B.WithSelf.G(@B.%Self.loc8: %B.type) {
  577. // CHECK:STDOUT: %Self: %B.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.d0b)]
  578. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.8ee)]
  579. // CHECK:STDOUT:
  580. // CHECK:STDOUT: fn() -> <error>;
  581. // CHECK:STDOUT: }
  582. // CHECK:STDOUT:
  583. // CHECK:STDOUT: specific @A(constants.%Self.c51) {
  584. // CHECK:STDOUT: !definition:
  585. // CHECK:STDOUT: %Self.loc6 => constants.%Self.c51
  586. // CHECK:STDOUT: %A.WithSelf.F.type => constants.%A.WithSelf.F.type
  587. // CHECK:STDOUT: %A.WithSelf.F => constants.%A.WithSelf.F
  588. // CHECK:STDOUT: }
  589. // CHECK:STDOUT:
  590. // CHECK:STDOUT: specific @A.WithSelf.F(constants.%Self.c51) {
  591. // CHECK:STDOUT: %Self => constants.%Self.c51
  592. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.55a
  593. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.df1
  594. // CHECK:STDOUT: }
  595. // CHECK:STDOUT:
  596. // CHECK:STDOUT: specific @B(constants.%Self.d0b) {}
  597. // CHECK:STDOUT:
  598. // CHECK:STDOUT: specific @B.WithSelf.G(constants.%Self.d0b) {
  599. // CHECK:STDOUT: %Self => constants.%Self.d0b
  600. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.8ee
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT:
  603. // CHECK:STDOUT: --- call_with_compound_member_access.carbon
  604. // CHECK:STDOUT:
  605. // CHECK:STDOUT: constants {
  606. // CHECK:STDOUT: %C.type: type = facet_type <@C> [concrete]
  607. // CHECK:STDOUT: %Self: %C.type = symbolic_binding Self, 0 [symbolic]
  608. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic]
  609. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic]
  610. // CHECK:STDOUT: %C.WithSelf.F.type: type = fn_type @C.WithSelf.F, @C(%Self) [symbolic]
  611. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  612. // CHECK:STDOUT: %C.WithSelf.F: %C.WithSelf.F.type = struct_value () [symbolic]
  613. // CHECK:STDOUT: %C.assoc_type: type = assoc_entity_type @C [concrete]
  614. // CHECK:STDOUT: %assoc0: %C.assoc_type = assoc_entity element0, @C.%C.WithSelf.F.decl [concrete]
  615. // CHECK:STDOUT: %C.WithSelf.G.type: type = fn_type @C.WithSelf.G, @C(%Self) [symbolic]
  616. // CHECK:STDOUT: %C.WithSelf.G: %C.WithSelf.G.type = struct_value () [symbolic]
  617. // CHECK:STDOUT: %assoc1: %C.assoc_type = assoc_entity element1, @C.%C.WithSelf.G.decl [concrete]
  618. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.binding.as_type [symbolic]
  619. // CHECK:STDOUT: %C.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @C [symbolic]
  620. // CHECK:STDOUT: %.018: type = fn_type_with_self_type %C.WithSelf.F.type, %Self [symbolic]
  621. // CHECK:STDOUT: %impl.elem0: %.018 = impl_witness_access %C.lookup_impl_witness, element0 [symbolic]
  622. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @C.WithSelf.F(%Self) [symbolic]
  623. // CHECK:STDOUT: }
  624. // CHECK:STDOUT:
  625. // CHECK:STDOUT: imports {
  626. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  627. // CHECK:STDOUT: import Core//default
  628. // CHECK:STDOUT: }
  629. // CHECK:STDOUT: }
  630. // CHECK:STDOUT:
  631. // CHECK:STDOUT: file {
  632. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  633. // CHECK:STDOUT: .Core = imports.%Core
  634. // CHECK:STDOUT: .C = %C.decl
  635. // CHECK:STDOUT: }
  636. // CHECK:STDOUT: %Core.import = import Core
  637. // CHECK:STDOUT: %C.decl: type = interface_decl @C [concrete = constants.%C.type] {} {}
  638. // CHECK:STDOUT: }
  639. // CHECK:STDOUT:
  640. // CHECK:STDOUT: interface @C {
  641. // CHECK:STDOUT: %Self.loc5: %C.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  642. // CHECK:STDOUT: interface_with_self_decl @C [concrete]
  643. // CHECK:STDOUT:
  644. // CHECK:STDOUT: !with Self:
  645. // CHECK:STDOUT: %C.WithSelf.F.decl: @C.%C.WithSelf.F.type (%C.WithSelf.F.type) = fn_decl @C.WithSelf.F [symbolic = @C.%C.WithSelf.F (constants.%C.WithSelf.F)] {
  646. // CHECK:STDOUT: %self.patt: @C.WithSelf.F.%pattern_type (%pattern_type) = value_binding_pattern self [concrete]
  647. // CHECK:STDOUT: %self.param_patt: @C.WithSelf.F.%pattern_type (%pattern_type) = value_param_pattern %self.patt, call_param0 [concrete]
  648. // CHECK:STDOUT: } {
  649. // CHECK:STDOUT: %self.param: @C.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
  650. // CHECK:STDOUT: %.loc6_14.1: type = splice_block %.loc6_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  651. // CHECK:STDOUT: %Self.ref: %C.type = name_ref Self, @C.%Self.loc5 [symbolic = %Self (constants.%Self)]
  652. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  653. // CHECK:STDOUT: %.loc6_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT: %self: @C.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT: %assoc0: %C.assoc_type = assoc_entity element0, %C.WithSelf.F.decl [concrete = constants.%assoc0]
  658. // CHECK:STDOUT: %C.WithSelf.G.decl: @C.%C.WithSelf.G.type (%C.WithSelf.G.type) = fn_decl @C.WithSelf.G [symbolic = @C.%C.WithSelf.G (constants.%C.WithSelf.G)] {
  659. // CHECK:STDOUT: %self.patt: @C.WithSelf.G.%pattern_type (%pattern_type) = value_binding_pattern self [concrete]
  660. // CHECK:STDOUT: %self.param_patt: @C.WithSelf.G.%pattern_type (%pattern_type) = value_param_pattern %self.patt, call_param0 [concrete]
  661. // CHECK:STDOUT: } {
  662. // CHECK:STDOUT: %self.param: @C.WithSelf.G.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
  663. // CHECK:STDOUT: %.loc8_14.1: type = splice_block %.loc8_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  664. // CHECK:STDOUT: %Self.ref: %C.type = name_ref Self, @C.%Self.loc5 [symbolic = %Self (constants.%Self)]
  665. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  666. // CHECK:STDOUT: %.loc8_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  667. // CHECK:STDOUT: }
  668. // CHECK:STDOUT: %self: @C.WithSelf.G.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
  669. // CHECK:STDOUT: }
  670. // CHECK:STDOUT: %assoc1: %C.assoc_type = assoc_entity element1, %C.WithSelf.G.decl [concrete = constants.%assoc1]
  671. // CHECK:STDOUT:
  672. // CHECK:STDOUT: !members:
  673. // CHECK:STDOUT: .Self = %Self.loc5
  674. // CHECK:STDOUT: .F = %assoc0
  675. // CHECK:STDOUT: .G = %assoc1
  676. // CHECK:STDOUT: witness = (%C.WithSelf.F.decl, %C.WithSelf.G.decl)
  677. // CHECK:STDOUT:
  678. // CHECK:STDOUT: !requires:
  679. // CHECK:STDOUT: }
  680. // CHECK:STDOUT:
  681. // CHECK:STDOUT: generic fn @C.WithSelf.F(@C.%Self.loc5: %C.type) {
  682. // CHECK:STDOUT: %Self: %C.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  683. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  684. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type)]
  685. // CHECK:STDOUT:
  686. // CHECK:STDOUT: fn(%self.param: @C.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type));
  687. // CHECK:STDOUT: }
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: generic fn @C.WithSelf.G(@C.%Self.loc5: %C.type) {
  690. // CHECK:STDOUT: %Self: %C.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
  691. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  692. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type)]
  693. // CHECK:STDOUT:
  694. // CHECK:STDOUT: !definition:
  695. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.binding.as_type [symbolic = %require_complete (constants.%require_complete)]
  696. // CHECK:STDOUT: %C.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @C [symbolic = %C.lookup_impl_witness (constants.%C.lookup_impl_witness)]
  697. // CHECK:STDOUT: %C.WithSelf.F.type: type = fn_type @C.WithSelf.F, @C(%Self) [symbolic = %C.WithSelf.F.type (constants.%C.WithSelf.F.type)]
  698. // CHECK:STDOUT: %.loc9: type = fn_type_with_self_type %C.WithSelf.F.type, %Self [symbolic = %.loc9 (constants.%.018)]
  699. // CHECK:STDOUT: %impl.elem0.loc9_9.2: @C.WithSelf.G.%.loc9 (%.018) = impl_witness_access %C.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_9.2 (constants.%impl.elem0)]
  700. // CHECK:STDOUT: %specific_impl_fn.loc9_9.2: <specific function> = specific_impl_function %impl.elem0.loc9_9.2, @C.WithSelf.F(%Self) [symbolic = %specific_impl_fn.loc9_9.2 (constants.%specific_impl_fn)]
  701. // CHECK:STDOUT:
  702. // CHECK:STDOUT: fn(%self.param: @C.WithSelf.G.%Self.binding.as_type (%Self.binding.as_type)) {
  703. // CHECK:STDOUT: !entry:
  704. // CHECK:STDOUT: %self.ref.loc9: @C.WithSelf.G.%Self.binding.as_type (%Self.binding.as_type) = name_ref self, %self
  705. // CHECK:STDOUT: %F.ref.loc9: %C.assoc_type = name_ref F, @C.%assoc0 [concrete = constants.%assoc0]
  706. // CHECK:STDOUT: %impl.elem0.loc9_9.1: @C.WithSelf.G.%.loc9 (%.018) = impl_witness_access constants.%C.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_9.2 (constants.%impl.elem0)]
  707. // CHECK:STDOUT: %bound_method.loc9_9: <bound method> = bound_method %self.ref.loc9, %impl.elem0.loc9_9.1
  708. // CHECK:STDOUT: %specific_impl_fn.loc9_9.1: <specific function> = specific_impl_function %impl.elem0.loc9_9.1, @C.WithSelf.F(constants.%Self) [symbolic = %specific_impl_fn.loc9_9.2 (constants.%specific_impl_fn)]
  709. // CHECK:STDOUT: %bound_method.loc9_12: <bound method> = bound_method %self.ref.loc9, %specific_impl_fn.loc9_9.1
  710. // CHECK:STDOUT: %C.WithSelf.F.call.loc9: init %empty_tuple.type = call %bound_method.loc9_12(%self.ref.loc9)
  711. // CHECK:STDOUT: %self.ref.loc10: @C.WithSelf.G.%Self.binding.as_type (%Self.binding.as_type) = name_ref self, %self
  712. // CHECK:STDOUT: %impl.elem0.loc10: @C.WithSelf.G.%.loc9 (%.018) = impl_witness_access constants.%C.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_9.2 (constants.%impl.elem0)]
  713. // CHECK:STDOUT: %F.ref.loc10: @C.WithSelf.G.%.loc9 (%.018) = name_ref F, %impl.elem0.loc10 [symbolic = %impl.elem0.loc9_9.2 (constants.%impl.elem0)]
  714. // CHECK:STDOUT: %bound_method.loc10_9: <bound method> = bound_method %self.ref.loc10, %F.ref.loc10
  715. // CHECK:STDOUT: %specific_impl_fn.loc10: <specific function> = specific_impl_function %F.ref.loc10, @C.WithSelf.F(constants.%Self) [symbolic = %specific_impl_fn.loc9_9.2 (constants.%specific_impl_fn)]
  716. // CHECK:STDOUT: %bound_method.loc10_14: <bound method> = bound_method %self.ref.loc10, %specific_impl_fn.loc10
  717. // CHECK:STDOUT: %C.WithSelf.F.call.loc10: init %empty_tuple.type = call %bound_method.loc10_14(%self.ref.loc10)
  718. // CHECK:STDOUT: return
  719. // CHECK:STDOUT: }
  720. // CHECK:STDOUT: }
  721. // CHECK:STDOUT:
  722. // CHECK:STDOUT: specific @C(constants.%Self) {
  723. // CHECK:STDOUT: !definition:
  724. // CHECK:STDOUT: %Self.loc6 => constants.%Self
  725. // CHECK:STDOUT: %C.WithSelf.F.type => constants.%C.WithSelf.F.type
  726. // CHECK:STDOUT: %C.WithSelf.F => constants.%C.WithSelf.F
  727. // CHECK:STDOUT: %C.WithSelf.G.type => constants.%C.WithSelf.G.type
  728. // CHECK:STDOUT: %C.WithSelf.G => constants.%C.WithSelf.G
  729. // CHECK:STDOUT: }
  730. // CHECK:STDOUT:
  731. // CHECK:STDOUT: specific @C.WithSelf.F(constants.%Self) {
  732. // CHECK:STDOUT: %Self => constants.%Self
  733. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  734. // CHECK:STDOUT: %pattern_type => constants.%pattern_type
  735. // CHECK:STDOUT: }
  736. // CHECK:STDOUT:
  737. // CHECK:STDOUT: specific @C.WithSelf.G(constants.%Self) {
  738. // CHECK:STDOUT: %Self => constants.%Self
  739. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  740. // CHECK:STDOUT: %pattern_type => constants.%pattern_type
  741. // CHECK:STDOUT: }
  742. // CHECK:STDOUT: