extend_name_lookup.carbon 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/named_constraint/extend_name_lookup.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/named_constraint/extend_name_lookup.carbon
  12. // --- facet_type_extends_and_constraint_extends.carbon
  13. library "[[@TEST_NAME]]";
  14. interface Z { fn ZF(); }
  15. interface Y { fn YF(); }
  16. constraint W {
  17. extend require impls Z;
  18. require impls Y;
  19. }
  20. //@dump-sem-ir-begin
  21. fn F(T:! W) {
  22. // Extends Z.
  23. T.ZF();
  24. // Does not extend Y.
  25. T.(Y.YF)();
  26. }
  27. //@dump-sem-ir-end
  28. // --- fail_name_lookup_in_constraint_does_not_extend.carbon
  29. library "[[@TEST_NAME]]";
  30. interface Z { fn ZF(); }
  31. constraint W {
  32. require impls Z;
  33. }
  34. fn F(T:! W) {
  35. // Does not extend Z.
  36. interface Y { fn YF(); }
  37. // CHECK:STDERR: fail_name_lookup_in_constraint_does_not_extend.carbon:[[@LINE+4]]:3: error: member name `ZF` not found in `W` [MemberNameNotFoundInSpecificScope]
  38. // CHECK:STDERR: T.ZF();
  39. // CHECK:STDERR: ^~~~
  40. // CHECK:STDERR:
  41. T.ZF();
  42. }
  43. // --- facet_type_does_not_extend_and_constraint_extends.carbon
  44. library "[[@TEST_NAME]]";
  45. interface Z { fn ZF(); }
  46. interface Y { fn YF(); }
  47. constraint W {
  48. extend require impls Z;
  49. require impls Y;
  50. }
  51. //@dump-sem-ir-begin
  52. fn F(T:! type where .Self impls W) {
  53. // T does not extend Z.
  54. T.(Z.ZF)();
  55. // T does not extend Y.
  56. T.(Y.YF)();
  57. }
  58. //@dump-sem-ir-end
  59. // --- fail_name_lookup_in_facet_type_does_not_extend.carbon
  60. library "[[@TEST_NAME]]";
  61. interface Z { fn ZF(); }
  62. interface Y { fn YF(); }
  63. constraint W {
  64. extend require impls Z;
  65. require impls Y;
  66. }
  67. fn F(T:! type where .Self impls W) {
  68. // T does not extend Z.
  69. // CHECK:STDERR: fail_name_lookup_in_facet_type_does_not_extend.carbon:[[@LINE+4]]:3: error: member name `ZF` not found [MemberNameNotFound]
  70. // CHECK:STDERR: T.ZF();
  71. // CHECK:STDERR: ^~~~
  72. // CHECK:STDERR:
  73. T.ZF();
  74. // T does not extend Y.
  75. // CHECK:STDERR: fail_name_lookup_in_facet_type_does_not_extend.carbon:[[@LINE+4]]:3: error: member name `YF` not found [MemberNameNotFound]
  76. // CHECK:STDERR: T.YF();
  77. // CHECK:STDERR: ^~~~
  78. // CHECK:STDERR:
  79. T.YF();
  80. }
  81. // CHECK:STDOUT: --- facet_type_extends_and_constraint_extends.carbon
  82. // CHECK:STDOUT:
  83. // CHECK:STDOUT: constants {
  84. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  85. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  86. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  87. // CHECK:STDOUT: %assoc0.0cc: %Z.assoc_type = assoc_entity element0, @Z.WithSelf.%Z.WithSelf.ZF.decl [concrete]
  88. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  89. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  90. // CHECK:STDOUT: %assoc0.2e5: %Y.assoc_type = assoc_entity element0, @Y.WithSelf.%Y.WithSelf.YF.decl [concrete]
  91. // CHECK:STDOUT: %W.type: type = facet_type <@W> [concrete]
  92. // CHECK:STDOUT: %pattern_type: type = pattern_type %W.type [concrete]
  93. // CHECK:STDOUT: %T: %W.type = symbolic_binding T, 0 [symbolic]
  94. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  95. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  96. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  97. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Z [symbolic]
  98. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %T.as_type, (%Z.lookup_impl_witness) [symbolic]
  99. // CHECK:STDOUT: %Z.WithSelf.ZF.type.00a: type = fn_type @Z.WithSelf.ZF, @Z.WithSelf(%Z.facet) [symbolic]
  100. // CHECK:STDOUT: %.4e3: type = fn_type_with_self_type %Z.WithSelf.ZF.type.00a, %Z.facet [symbolic]
  101. // CHECK:STDOUT: %impl.elem0.f10: %.4e3 = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic]
  102. // CHECK:STDOUT: %specific_impl_fn.b85: <specific function> = specific_impl_function %impl.elem0.f10, @Z.WithSelf.ZF(%Z.facet) [symbolic]
  103. // CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Y [symbolic]
  104. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %T.as_type, (%Y.lookup_impl_witness) [symbolic]
  105. // CHECK:STDOUT: %Y.WithSelf.YF.type.73e: type = fn_type @Y.WithSelf.YF, @Y.WithSelf(%Y.facet) [symbolic]
  106. // CHECK:STDOUT: %.ff4: type = fn_type_with_self_type %Y.WithSelf.YF.type.73e, %Y.facet [symbolic]
  107. // CHECK:STDOUT: %impl.elem0.1cb: %.ff4 = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic]
  108. // CHECK:STDOUT: %specific_impl_fn.ee5: <specific function> = specific_impl_function %impl.elem0.1cb, @Y.WithSelf.YF(%Y.facet) [symbolic]
  109. // CHECK:STDOUT: }
  110. // CHECK:STDOUT:
  111. // CHECK:STDOUT: file {
  112. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  113. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  114. // CHECK:STDOUT: } {
  115. // CHECK:STDOUT: %.loc12: type = splice_block %W.ref [concrete = constants.%W.type] {
  116. // CHECK:STDOUT: <elided>
  117. // CHECK:STDOUT: %W.ref: type = name_ref W, file.%W.decl [concrete = constants.%W.type]
  118. // CHECK:STDOUT: }
  119. // CHECK:STDOUT: %T.loc12_7.2: %W.type = symbolic_binding T, 0 [symbolic = %T.loc12_7.1 (constants.%T)]
  120. // CHECK:STDOUT: }
  121. // CHECK:STDOUT: }
  122. // CHECK:STDOUT:
  123. // CHECK:STDOUT: generic fn @F(%T.loc12_7.2: %W.type) {
  124. // CHECK:STDOUT: %T.loc12_7.1: %W.type = symbolic_binding T, 0 [symbolic = %T.loc12_7.1 (constants.%T)]
  125. // CHECK:STDOUT:
  126. // CHECK:STDOUT: !definition:
  127. // CHECK:STDOUT: %T.as_type.loc14_4.2: type = facet_access_type %T.loc12_7.1 [symbolic = %T.as_type.loc14_4.2 (constants.%T.as_type)]
  128. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc12_7.1, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
  129. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %T.as_type.loc14_4.2, (%Z.lookup_impl_witness) [symbolic = %Z.facet (constants.%Z.facet)]
  130. // CHECK:STDOUT: %Z.WithSelf.ZF.type: type = fn_type @Z.WithSelf.ZF, @Z.WithSelf(%Z.facet) [symbolic = %Z.WithSelf.ZF.type (constants.%Z.WithSelf.ZF.type.00a)]
  131. // CHECK:STDOUT: %.loc14_4.2: type = fn_type_with_self_type %Z.WithSelf.ZF.type, %Z.facet [symbolic = %.loc14_4.2 (constants.%.4e3)]
  132. // CHECK:STDOUT: %impl.elem0.loc14_4.2: @F.%.loc14_4.2 (%.4e3) = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.f10)]
  133. // CHECK:STDOUT: %specific_impl_fn.loc14_4.2: <specific function> = specific_impl_function %impl.elem0.loc14_4.2, @Z.WithSelf.ZF(%Z.facet) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.b85)]
  134. // CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc12_7.1, @Y [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness)]
  135. // CHECK:STDOUT: %Y.facet.loc16_4.2: %Y.type = facet_value %T.as_type.loc14_4.2, (%Y.lookup_impl_witness) [symbolic = %Y.facet.loc16_4.2 (constants.%Y.facet)]
  136. // CHECK:STDOUT: %Y.WithSelf.YF.type: type = fn_type @Y.WithSelf.YF, @Y.WithSelf(%Y.facet.loc16_4.2) [symbolic = %Y.WithSelf.YF.type (constants.%Y.WithSelf.YF.type.73e)]
  137. // CHECK:STDOUT: %.loc16_4.2: type = fn_type_with_self_type %Y.WithSelf.YF.type, %Y.facet.loc16_4.2 [symbolic = %.loc16_4.2 (constants.%.ff4)]
  138. // CHECK:STDOUT: %impl.elem0.loc16_4.2: @F.%.loc16_4.2 (%.ff4) = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.1cb)]
  139. // CHECK:STDOUT: %specific_impl_fn.loc16_4.2: <specific function> = specific_impl_function %impl.elem0.loc16_4.2, @Y.WithSelf.YF(%Y.facet.loc16_4.2) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.ee5)]
  140. // CHECK:STDOUT:
  141. // CHECK:STDOUT: fn() {
  142. // CHECK:STDOUT: !entry:
  143. // CHECK:STDOUT: %T.ref.loc14: %W.type = name_ref T, %T.loc12_7.2 [symbolic = %T.loc12_7.1 (constants.%T)]
  144. // CHECK:STDOUT: %T.as_type.loc14_4.1: type = facet_access_type %T.ref.loc14 [symbolic = %T.as_type.loc14_4.2 (constants.%T.as_type)]
  145. // CHECK:STDOUT: %.loc14_4.1: type = converted %T.ref.loc14, %T.as_type.loc14_4.1 [symbolic = %T.as_type.loc14_4.2 (constants.%T.as_type)]
  146. // CHECK:STDOUT: %ZF.ref: %Z.assoc_type = name_ref ZF, @Z.WithSelf.%assoc0 [concrete = constants.%assoc0.0cc]
  147. // CHECK:STDOUT: %impl.elem0.loc14_4.1: @F.%.loc14_4.2 (%.4e3) = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.f10)]
  148. // CHECK:STDOUT: %specific_impl_fn.loc14_4.1: <specific function> = specific_impl_function %impl.elem0.loc14_4.1, @Z.WithSelf.ZF(constants.%Z.facet) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.b85)]
  149. // CHECK:STDOUT: %Z.WithSelf.ZF.call: init %empty_tuple.type = call %specific_impl_fn.loc14_4.1()
  150. // CHECK:STDOUT: %T.ref.loc16: %W.type = name_ref T, %T.loc12_7.2 [symbolic = %T.loc12_7.1 (constants.%T)]
  151. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
  152. // CHECK:STDOUT: %YF.ref: %Y.assoc_type = name_ref YF, @Y.WithSelf.%assoc0 [concrete = constants.%assoc0.2e5]
  153. // CHECK:STDOUT: %T.as_type.loc16: type = facet_access_type %T.ref.loc16 [symbolic = %T.as_type.loc14_4.2 (constants.%T.as_type)]
  154. // CHECK:STDOUT: %Y.facet.loc16_4.1: %Y.type = facet_value %T.as_type.loc16, (constants.%Y.lookup_impl_witness) [symbolic = %Y.facet.loc16_4.2 (constants.%Y.facet)]
  155. // CHECK:STDOUT: %.loc16_4.1: %Y.type = converted %T.ref.loc16, %Y.facet.loc16_4.1 [symbolic = %Y.facet.loc16_4.2 (constants.%Y.facet)]
  156. // CHECK:STDOUT: %impl.elem0.loc16_4.1: @F.%.loc16_4.2 (%.ff4) = impl_witness_access constants.%Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.1cb)]
  157. // CHECK:STDOUT: %specific_impl_fn.loc16_4.1: <specific function> = specific_impl_function %impl.elem0.loc16_4.1, @Y.WithSelf.YF(constants.%Y.facet) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.ee5)]
  158. // CHECK:STDOUT: %Y.WithSelf.YF.call: init %empty_tuple.type = call %specific_impl_fn.loc16_4.1()
  159. // CHECK:STDOUT: return
  160. // CHECK:STDOUT: }
  161. // CHECK:STDOUT: }
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: specific @F(constants.%T) {
  164. // CHECK:STDOUT: %T.loc12_7.1 => constants.%T
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: --- facet_type_does_not_extend_and_constraint_extends.carbon
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: constants {
  170. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  171. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  172. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  173. // CHECK:STDOUT: %assoc0.0cc: %Z.assoc_type = assoc_entity element0, @Z.WithSelf.%Z.WithSelf.ZF.decl [concrete]
  174. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  175. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  176. // CHECK:STDOUT: %assoc0.2e5: %Y.assoc_type = assoc_entity element0, @Y.WithSelf.%Y.WithSelf.YF.decl [concrete]
  177. // CHECK:STDOUT: %W.type: type = facet_type <@W> [concrete]
  178. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  179. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  180. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  181. // CHECK:STDOUT: %type_where: type = facet_type <type> [concrete]
  182. // CHECK:STDOUT: %pattern_type: type = pattern_type %type_where [concrete]
  183. // CHECK:STDOUT: %T: %type_where = symbolic_binding T, 0 [symbolic]
  184. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  185. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  186. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  187. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Z [symbolic]
  188. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %T.as_type, (%Z.lookup_impl_witness) [symbolic]
  189. // CHECK:STDOUT: %Z.WithSelf.ZF.type.00a: type = fn_type @Z.WithSelf.ZF, @Z.WithSelf(%Z.facet) [symbolic]
  190. // CHECK:STDOUT: %.4e3: type = fn_type_with_self_type %Z.WithSelf.ZF.type.00a, %Z.facet [symbolic]
  191. // CHECK:STDOUT: %impl.elem0.f10: %.4e3 = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic]
  192. // CHECK:STDOUT: %specific_impl_fn.b85: <specific function> = specific_impl_function %impl.elem0.f10, @Z.WithSelf.ZF(%Z.facet) [symbolic]
  193. // CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %T, @Y [symbolic]
  194. // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %T.as_type, (%Y.lookup_impl_witness) [symbolic]
  195. // CHECK:STDOUT: %Y.WithSelf.YF.type.73e: type = fn_type @Y.WithSelf.YF, @Y.WithSelf(%Y.facet) [symbolic]
  196. // CHECK:STDOUT: %.ff4: type = fn_type_with_self_type %Y.WithSelf.YF.type.73e, %Y.facet [symbolic]
  197. // CHECK:STDOUT: %impl.elem0.1cb: %.ff4 = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic]
  198. // CHECK:STDOUT: %specific_impl_fn.ee5: <specific function> = specific_impl_function %impl.elem0.1cb, @Y.WithSelf.YF(%Y.facet) [symbolic]
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: file {
  202. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  203. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  204. // CHECK:STDOUT: } {
  205. // CHECK:STDOUT: %.loc12_15.1: type = splice_block %.loc12_15.2 [concrete = constants.%type_where] {
  206. // CHECK:STDOUT: <elided>
  207. // CHECK:STDOUT: %.loc12_10: type = type_literal type [concrete = type]
  208. // CHECK:STDOUT: <elided>
  209. // CHECK:STDOUT: %.Self.ref: %type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self]
  210. // CHECK:STDOUT: %W.ref: type = name_ref W, file.%W.decl [concrete = constants.%W.type]
  211. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  212. // CHECK:STDOUT: %.loc12_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  213. // CHECK:STDOUT: %.loc12_15.2: type = where_expr [concrete = constants.%type_where] {
  214. // CHECK:STDOUT: requirement_base_facet_type %.loc12_10
  215. // CHECK:STDOUT: requirement_impls %.loc12_21, %W.ref
  216. // CHECK:STDOUT: }
  217. // CHECK:STDOUT: }
  218. // CHECK:STDOUT: %T.loc12_7.2: %type_where = symbolic_binding T, 0 [symbolic = %T.loc12_7.1 (constants.%T)]
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT: }
  221. // CHECK:STDOUT:
  222. // CHECK:STDOUT: generic fn @F(%T.loc12_7.2: %type_where) {
  223. // CHECK:STDOUT: %T.loc12_7.1: %type_where = symbolic_binding T, 0 [symbolic = %T.loc12_7.1 (constants.%T)]
  224. // CHECK:STDOUT:
  225. // CHECK:STDOUT: !definition:
  226. // CHECK:STDOUT: %T.as_type.loc14_4.2: type = facet_access_type %T.loc12_7.1 [symbolic = %T.as_type.loc14_4.2 (constants.%T.as_type)]
  227. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc12_7.1, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
  228. // CHECK:STDOUT: %Z.facet.loc14_4.2: %Z.type = facet_value %T.as_type.loc14_4.2, (%Z.lookup_impl_witness) [symbolic = %Z.facet.loc14_4.2 (constants.%Z.facet)]
  229. // CHECK:STDOUT: %Z.WithSelf.ZF.type: type = fn_type @Z.WithSelf.ZF, @Z.WithSelf(%Z.facet.loc14_4.2) [symbolic = %Z.WithSelf.ZF.type (constants.%Z.WithSelf.ZF.type.00a)]
  230. // CHECK:STDOUT: %.loc14_4.2: type = fn_type_with_self_type %Z.WithSelf.ZF.type, %Z.facet.loc14_4.2 [symbolic = %.loc14_4.2 (constants.%.4e3)]
  231. // CHECK:STDOUT: %impl.elem0.loc14_4.2: @F.%.loc14_4.2 (%.4e3) = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.f10)]
  232. // CHECK:STDOUT: %specific_impl_fn.loc14_4.2: <specific function> = specific_impl_function %impl.elem0.loc14_4.2, @Z.WithSelf.ZF(%Z.facet.loc14_4.2) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.b85)]
  233. // CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc12_7.1, @Y [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness)]
  234. // CHECK:STDOUT: %Y.facet.loc16_4.2: %Y.type = facet_value %T.as_type.loc14_4.2, (%Y.lookup_impl_witness) [symbolic = %Y.facet.loc16_4.2 (constants.%Y.facet)]
  235. // CHECK:STDOUT: %Y.WithSelf.YF.type: type = fn_type @Y.WithSelf.YF, @Y.WithSelf(%Y.facet.loc16_4.2) [symbolic = %Y.WithSelf.YF.type (constants.%Y.WithSelf.YF.type.73e)]
  236. // CHECK:STDOUT: %.loc16_4.2: type = fn_type_with_self_type %Y.WithSelf.YF.type, %Y.facet.loc16_4.2 [symbolic = %.loc16_4.2 (constants.%.ff4)]
  237. // CHECK:STDOUT: %impl.elem0.loc16_4.2: @F.%.loc16_4.2 (%.ff4) = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.1cb)]
  238. // CHECK:STDOUT: %specific_impl_fn.loc16_4.2: <specific function> = specific_impl_function %impl.elem0.loc16_4.2, @Y.WithSelf.YF(%Y.facet.loc16_4.2) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.ee5)]
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: fn() {
  241. // CHECK:STDOUT: !entry:
  242. // CHECK:STDOUT: %T.ref.loc14: %type_where = name_ref T, %T.loc12_7.2 [symbolic = %T.loc12_7.1 (constants.%T)]
  243. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  244. // CHECK:STDOUT: %ZF.ref: %Z.assoc_type = name_ref ZF, @Z.WithSelf.%assoc0 [concrete = constants.%assoc0.0cc]
  245. // CHECK:STDOUT: %T.as_type.loc14_4.1: type = facet_access_type %T.ref.loc14 [symbolic = %T.as_type.loc14_4.2 (constants.%T.as_type)]
  246. // CHECK:STDOUT: %Z.facet.loc14_4.1: %Z.type = facet_value %T.as_type.loc14_4.1, (constants.%Z.lookup_impl_witness) [symbolic = %Z.facet.loc14_4.2 (constants.%Z.facet)]
  247. // CHECK:STDOUT: %.loc14_4.1: %Z.type = converted %T.ref.loc14, %Z.facet.loc14_4.1 [symbolic = %Z.facet.loc14_4.2 (constants.%Z.facet)]
  248. // CHECK:STDOUT: %impl.elem0.loc14_4.1: @F.%.loc14_4.2 (%.4e3) = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.f10)]
  249. // CHECK:STDOUT: %specific_impl_fn.loc14_4.1: <specific function> = specific_impl_function %impl.elem0.loc14_4.1, @Z.WithSelf.ZF(constants.%Z.facet) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.b85)]
  250. // CHECK:STDOUT: %Z.WithSelf.ZF.call: init %empty_tuple.type = call %specific_impl_fn.loc14_4.1()
  251. // CHECK:STDOUT: %T.ref.loc16: %type_where = name_ref T, %T.loc12_7.2 [symbolic = %T.loc12_7.1 (constants.%T)]
  252. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
  253. // CHECK:STDOUT: %YF.ref: %Y.assoc_type = name_ref YF, @Y.WithSelf.%assoc0 [concrete = constants.%assoc0.2e5]
  254. // CHECK:STDOUT: %T.as_type.loc16: type = facet_access_type %T.ref.loc16 [symbolic = %T.as_type.loc14_4.2 (constants.%T.as_type)]
  255. // CHECK:STDOUT: %Y.facet.loc16_4.1: %Y.type = facet_value %T.as_type.loc16, (constants.%Y.lookup_impl_witness) [symbolic = %Y.facet.loc16_4.2 (constants.%Y.facet)]
  256. // CHECK:STDOUT: %.loc16_4.1: %Y.type = converted %T.ref.loc16, %Y.facet.loc16_4.1 [symbolic = %Y.facet.loc16_4.2 (constants.%Y.facet)]
  257. // CHECK:STDOUT: %impl.elem0.loc16_4.1: @F.%.loc16_4.2 (%.ff4) = impl_witness_access constants.%Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.1cb)]
  258. // CHECK:STDOUT: %specific_impl_fn.loc16_4.1: <specific function> = specific_impl_function %impl.elem0.loc16_4.1, @Y.WithSelf.YF(constants.%Y.facet) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.ee5)]
  259. // CHECK:STDOUT: %Y.WithSelf.YF.call: init %empty_tuple.type = call %specific_impl_fn.loc16_4.1()
  260. // CHECK:STDOUT: return
  261. // CHECK:STDOUT: }
  262. // CHECK:STDOUT: }
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: specific @F(constants.%T) {
  265. // CHECK:STDOUT: %T.loc12_7.1 => constants.%T
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT: