index.carbon 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon
  10. // --- fail_wrong_index_with.carbon
  11. library "[[@TEST_NAME]]";
  12. namespace Core;
  13. class Core.IndexWith {}
  14. // CHECK:STDERR: fail_wrong_index_with.carbon:[[@LINE+4]]:10: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable]
  15. // CHECK:STDERR: fn F() { 0[1]; }
  16. // CHECK:STDERR: ^~~~
  17. // CHECK:STDERR:
  18. fn F() { 0[1]; }
  19. // --- fail_missing_index_with.carbon
  20. library "[[@TEST_NAME]]";
  21. // CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+7]]:10: error: `Core.IndexWith` implicitly referenced here, but package `Core` not found [CoreNotFound]
  22. // CHECK:STDERR: fn F() { 0[1]; }
  23. // CHECK:STDERR: ^~~~
  24. // CHECK:STDERR:
  25. // CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+3]]:10: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable]
  26. // CHECK:STDERR: fn F() { 0[1]; }
  27. // CHECK:STDERR: ^~~~
  28. fn F() { 0[1]; }
  29. // --- wrong_arg_count.carbon
  30. library "[[@TEST_NAME]]";
  31. namespace Core;
  32. interface Core.IndexWith(SubscriptType:! type) {
  33. fn At[self: Self](subscript: SubscriptType) -> ();
  34. }
  35. impl () as Core.IndexWith(()) {
  36. fn At[self: Self](subscript: ()) -> () {
  37. return ();
  38. }
  39. }
  40. fn F() { ()[()]; }
  41. // CHECK:STDOUT: --- fail_wrong_index_with.carbon
  42. // CHECK:STDOUT:
  43. // CHECK:STDOUT: constants {
  44. // CHECK:STDOUT: %IndexWith: type = class_type @IndexWith [template]
  45. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  46. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  47. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  48. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  49. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template]
  50. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
  51. // CHECK:STDOUT: }
  52. // CHECK:STDOUT:
  53. // CHECK:STDOUT: file {
  54. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  55. // CHECK:STDOUT: .Core = %Core
  56. // CHECK:STDOUT: .F = %F.decl
  57. // CHECK:STDOUT: }
  58. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {
  59. // CHECK:STDOUT: .IndexWith = %IndexWith.decl
  60. // CHECK:STDOUT: }
  61. // CHECK:STDOUT: %IndexWith.decl: type = class_decl @IndexWith [template = constants.%IndexWith] {} {}
  62. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
  63. // CHECK:STDOUT: }
  64. // CHECK:STDOUT:
  65. // CHECK:STDOUT: class @IndexWith {
  66. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  67. // CHECK:STDOUT:
  68. // CHECK:STDOUT: !members:
  69. // CHECK:STDOUT: .Self = constants.%IndexWith
  70. // CHECK:STDOUT: complete_type_witness = %complete_type
  71. // CHECK:STDOUT: }
  72. // CHECK:STDOUT:
  73. // CHECK:STDOUT: fn @F() {
  74. // CHECK:STDOUT: !entry:
  75. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
  76. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
  77. // CHECK:STDOUT: return
  78. // CHECK:STDOUT: }
  79. // CHECK:STDOUT:
  80. // CHECK:STDOUT: --- fail_missing_index_with.carbon
  81. // CHECK:STDOUT:
  82. // CHECK:STDOUT: constants {
  83. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  84. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  85. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template]
  86. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
  87. // CHECK:STDOUT: }
  88. // CHECK:STDOUT:
  89. // CHECK:STDOUT: file {
  90. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  91. // CHECK:STDOUT: .F = %F.decl
  92. // CHECK:STDOUT: }
  93. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
  94. // CHECK:STDOUT: }
  95. // CHECK:STDOUT:
  96. // CHECK:STDOUT: fn @F() {
  97. // CHECK:STDOUT: !entry:
  98. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
  99. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
  100. // CHECK:STDOUT: return
  101. // CHECK:STDOUT: }
  102. // CHECK:STDOUT:
  103. // CHECK:STDOUT: --- wrong_arg_count.carbon
  104. // CHECK:STDOUT:
  105. // CHECK:STDOUT: constants {
  106. // CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic]
  107. // CHECK:STDOUT: %SubscriptType.patt: type = symbolic_binding_pattern SubscriptType, 0 [symbolic]
  108. // CHECK:STDOUT: %IndexWith.type.232: type = generic_interface_type @IndexWith [template]
  109. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  110. // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.232 = struct_value () [template]
  111. // CHECK:STDOUT: %IndexWith.type.4f1: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic]
  112. // CHECK:STDOUT: %Self: %IndexWith.type.4f1 = bind_symbolic_name Self, 1 [symbolic]
  113. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  114. // CHECK:STDOUT: %At.type.ca2: type = fn_type @At.1, @IndexWith(%SubscriptType) [symbolic]
  115. // CHECK:STDOUT: %At.5ab: %At.type.ca2 = struct_value () [symbolic]
  116. // CHECK:STDOUT: %At.assoc_type.2b4: type = assoc_entity_type %IndexWith.type.4f1, %At.type.ca2 [symbolic]
  117. // CHECK:STDOUT: %assoc0.d12: %At.assoc_type.2b4 = assoc_entity element0, @IndexWith.%At.decl [symbolic]
  118. // CHECK:STDOUT: %IndexWith.type.63e: type = facet_type <@IndexWith, @IndexWith(%empty_tuple.type)> [template]
  119. // CHECK:STDOUT: %At.type.87b: type = fn_type @At.1, @IndexWith(%empty_tuple.type) [template]
  120. // CHECK:STDOUT: %At.d3b: %At.type.87b = struct_value () [template]
  121. // CHECK:STDOUT: %At.assoc_type.837: type = assoc_entity_type %IndexWith.type.63e, %At.type.87b [template]
  122. // CHECK:STDOUT: %assoc0.df5: %At.assoc_type.837 = assoc_entity element0, @IndexWith.%At.decl [template]
  123. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%At.decl) [template]
  124. // CHECK:STDOUT: %At.type.304: type = fn_type @At.2 [template]
  125. // CHECK:STDOUT: %At.4cb: %At.type.304 = struct_value () [template]
  126. // CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.4f1 = facet_value %empty_tuple.type, %impl_witness [symbolic]
  127. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template]
  128. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  129. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  130. // CHECK:STDOUT: %At.bound: <bound method> = bound_method %empty_tuple, %At.4cb [template]
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT:
  133. // CHECK:STDOUT: file {
  134. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  135. // CHECK:STDOUT: .Core = %Core
  136. // CHECK:STDOUT: .F = %F.decl
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {
  139. // CHECK:STDOUT: .IndexWith = %IndexWith.decl
  140. // CHECK:STDOUT: }
  141. // CHECK:STDOUT: %IndexWith.decl: %IndexWith.type.232 = interface_decl @IndexWith [template = constants.%IndexWith.generic] {
  142. // CHECK:STDOUT: %SubscriptType.patt.loc5_26.1: type = symbolic_binding_pattern SubscriptType, 0 [symbolic = %SubscriptType.patt.loc5_26.2 (constants.%SubscriptType.patt)]
  143. // CHECK:STDOUT: %SubscriptType.param_patt: type = value_param_pattern %SubscriptType.patt.loc5_26.1, runtime_param<invalid> [symbolic = %SubscriptType.patt.loc5_26.2 (constants.%SubscriptType.patt)]
  144. // CHECK:STDOUT: } {
  145. // CHECK:STDOUT: %SubscriptType.param: type = value_param runtime_param<invalid>
  146. // CHECK:STDOUT: %SubscriptType.loc5_26.1: type = bind_symbolic_name SubscriptType, 0, %SubscriptType.param [symbolic = %SubscriptType.loc5_26.2 (constants.%SubscriptType)]
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT: impl_decl @impl [template] {} {
  149. // CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal ()
  150. // CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  151. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, file.%Core [template = file.%Core]
  152. // CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.232 = name_ref IndexWith, file.%IndexWith.decl [template = constants.%IndexWith.generic]
  153. // CHECK:STDOUT: %.loc9_28: %empty_tuple.type = tuple_literal ()
  154. // CHECK:STDOUT: %.loc9_29: type = converted %.loc9_28, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  155. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%empty_tuple.type)> [template = constants.%IndexWith.type.63e]
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%At.decl) [template = constants.%impl_witness]
  158. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
  159. // CHECK:STDOUT: }
  160. // CHECK:STDOUT:
  161. // CHECK:STDOUT: generic interface @IndexWith(%SubscriptType.loc5_26.1: type) {
  162. // CHECK:STDOUT: %SubscriptType.loc5_26.2: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType.loc5_26.2 (constants.%SubscriptType)]
  163. // CHECK:STDOUT: %SubscriptType.patt.loc5_26.2: type = symbolic_binding_pattern SubscriptType, 0 [symbolic = %SubscriptType.patt.loc5_26.2 (constants.%SubscriptType.patt)]
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: !definition:
  166. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.loc5_26.2)> [symbolic = %IndexWith.type (constants.%IndexWith.type.4f1)]
  167. // CHECK:STDOUT: %Self.2: %IndexWith.type.4f1 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  168. // CHECK:STDOUT: %At.type: type = fn_type @At.1, @IndexWith(%SubscriptType.loc5_26.2) [symbolic = %At.type (constants.%At.type.ca2)]
  169. // CHECK:STDOUT: %At: @IndexWith.%At.type (%At.type.ca2) = struct_value () [symbolic = %At (constants.%At.5ab)]
  170. // CHECK:STDOUT: %At.assoc_type: type = assoc_entity_type @IndexWith.%IndexWith.type (%IndexWith.type.4f1), @IndexWith.%At.type (%At.type.ca2) [symbolic = %At.assoc_type (constants.%At.assoc_type.2b4)]
  171. // CHECK:STDOUT: %assoc0.loc6_52.2: @IndexWith.%At.assoc_type (%At.assoc_type.2b4) = assoc_entity element0, %At.decl [symbolic = %assoc0.loc6_52.2 (constants.%assoc0.d12)]
  172. // CHECK:STDOUT:
  173. // CHECK:STDOUT: interface {
  174. // CHECK:STDOUT: %Self.1: @IndexWith.%IndexWith.type (%IndexWith.type.4f1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  175. // CHECK:STDOUT: %At.decl: @IndexWith.%At.type (%At.type.ca2) = fn_decl @At.1 [symbolic = @IndexWith.%At (constants.%At.5ab)] {
  176. // CHECK:STDOUT: %self.patt: @At.1.%Self.as_type.loc6_15.1 (%Self.as_type) = binding_pattern self
  177. // CHECK:STDOUT: %self.param_patt: @At.1.%Self.as_type.loc6_15.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0
  178. // CHECK:STDOUT: %subscript.patt: @At.1.%SubscriptType (%SubscriptType) = binding_pattern subscript
  179. // CHECK:STDOUT: %subscript.param_patt: @At.1.%SubscriptType (%SubscriptType) = value_param_pattern %subscript.patt, runtime_param1
  180. // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern
  181. // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param2
  182. // CHECK:STDOUT: } {
  183. // CHECK:STDOUT: %.loc6_51.1: %empty_tuple.type = tuple_literal ()
  184. // CHECK:STDOUT: %.loc6_51.2: type = converted %.loc6_51.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  185. // CHECK:STDOUT: %self.param: @At.1.%Self.as_type.loc6_15.1 (%Self.as_type) = value_param runtime_param0
  186. // CHECK:STDOUT: %.loc6_15.1: type = splice_block %.loc6_15.3 [symbolic = %Self.as_type.loc6_15.1 (constants.%Self.as_type)] {
  187. // CHECK:STDOUT: %.loc6_15.2: @At.1.%IndexWith.type (%IndexWith.type.4f1) = specific_constant @IndexWith.%Self.1, @IndexWith(constants.%SubscriptType) [symbolic = %Self (constants.%Self)]
  188. // CHECK:STDOUT: %Self.ref: @At.1.%IndexWith.type (%IndexWith.type.4f1) = name_ref Self, %.loc6_15.2 [symbolic = %Self (constants.%Self)]
  189. // CHECK:STDOUT: %Self.as_type.loc6_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_15.1 (constants.%Self.as_type)]
  190. // CHECK:STDOUT: %.loc6_15.3: type = converted %Self.ref, %Self.as_type.loc6_15.2 [symbolic = %Self.as_type.loc6_15.1 (constants.%Self.as_type)]
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT: %self: @At.1.%Self.as_type.loc6_15.1 (%Self.as_type) = bind_name self, %self.param
  193. // CHECK:STDOUT: %subscript.param: @At.1.%SubscriptType (%SubscriptType) = value_param runtime_param1
  194. // CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, @IndexWith.%SubscriptType.loc5_26.1 [symbolic = %SubscriptType (constants.%SubscriptType)]
  195. // CHECK:STDOUT: %subscript: @At.1.%SubscriptType (%SubscriptType) = bind_name subscript, %subscript.param
  196. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param2
  197. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  198. // CHECK:STDOUT: }
  199. // CHECK:STDOUT: %assoc0.loc6_52.1: @IndexWith.%At.assoc_type (%At.assoc_type.2b4) = assoc_entity element0, %At.decl [symbolic = %assoc0.loc6_52.2 (constants.%assoc0.d12)]
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: !members:
  202. // CHECK:STDOUT: .Self = %Self.1
  203. // CHECK:STDOUT: .At = %assoc0.loc6_52.1
  204. // CHECK:STDOUT: witness = (%At.decl)
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: impl @impl: %.loc9_7.2 as %IndexWith.type {
  209. // CHECK:STDOUT: %At.decl: %At.type.304 = fn_decl @At.2 [template = constants.%At.4cb] {
  210. // CHECK:STDOUT: %self.patt: %empty_tuple.type = binding_pattern self
  211. // CHECK:STDOUT: %self.param_patt: %empty_tuple.type = value_param_pattern %self.patt, runtime_param0
  212. // CHECK:STDOUT: %subscript.patt: %empty_tuple.type = binding_pattern subscript
  213. // CHECK:STDOUT: %subscript.param_patt: %empty_tuple.type = value_param_pattern %subscript.patt, runtime_param1
  214. // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern
  215. // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param2
  216. // CHECK:STDOUT: } {
  217. // CHECK:STDOUT: %.loc10_40.1: %empty_tuple.type = tuple_literal ()
  218. // CHECK:STDOUT: %.loc10_40.2: type = converted %.loc10_40.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  219. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param runtime_param0
  220. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc9_7.2 [template = constants.%empty_tuple.type]
  221. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  222. // CHECK:STDOUT: %subscript.param: %empty_tuple.type = value_param runtime_param1
  223. // CHECK:STDOUT: %.loc10_33.1: type = splice_block %.loc10_33.3 [template = constants.%empty_tuple.type] {
  224. // CHECK:STDOUT: %.loc10_33.2: %empty_tuple.type = tuple_literal ()
  225. // CHECK:STDOUT: %.loc10_33.3: type = converted %.loc10_33.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT: %subscript: %empty_tuple.type = bind_name subscript, %subscript.param
  228. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param2
  229. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  230. // CHECK:STDOUT: }
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: !members:
  233. // CHECK:STDOUT: .At = %At.decl
  234. // CHECK:STDOUT: witness = file.%impl_witness
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: generic fn @At.1(@IndexWith.%SubscriptType.loc5_26.1: type, @IndexWith.%Self.1: @IndexWith.%IndexWith.type (%IndexWith.type.4f1)) {
  238. // CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)]
  239. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.4f1)]
  240. // CHECK:STDOUT: %Self: %IndexWith.type.4f1 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
  241. // CHECK:STDOUT: %Self.as_type.loc6_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_15.1 (constants.%Self.as_type)]
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: fn[%self.param_patt: @At.1.%Self.as_type.loc6_15.1 (%Self.as_type)](%subscript.param_patt: @At.1.%SubscriptType (%SubscriptType)) -> %empty_tuple.type;
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: fn @At.2[%self.param_patt: %empty_tuple.type](%subscript.param_patt: %empty_tuple.type) -> %empty_tuple.type {
  247. // CHECK:STDOUT: !entry:
  248. // CHECK:STDOUT: %.loc11_13: %empty_tuple.type = tuple_literal ()
  249. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple]
  250. // CHECK:STDOUT: %.loc11_14: %empty_tuple.type = converted %.loc11_13, %empty_tuple [template = constants.%empty_tuple]
  251. // CHECK:STDOUT: return %.loc11_14
  252. // CHECK:STDOUT: }
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: fn @F() {
  255. // CHECK:STDOUT: !entry:
  256. // CHECK:STDOUT: %.loc15_11.1: %empty_tuple.type = tuple_literal ()
  257. // CHECK:STDOUT: %.loc15_14: %empty_tuple.type = tuple_literal ()
  258. // CHECK:STDOUT: %empty_tuple.loc15_11: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple]
  259. // CHECK:STDOUT: %.loc15_11.2: %empty_tuple.type = converted %.loc15_11.1, %empty_tuple.loc15_11 [template = constants.%empty_tuple]
  260. // CHECK:STDOUT: %empty_tuple.loc15_14: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple]
  261. // CHECK:STDOUT: %.loc15_15: %empty_tuple.type = converted %.loc15_14, %empty_tuple.loc15_14 [template = constants.%empty_tuple]
  262. // CHECK:STDOUT: %impl.elem0: %At.type.87b = impl_witness_access constants.%impl_witness, element0 [template = constants.%At.4cb]
  263. // CHECK:STDOUT: %At.bound: <bound method> = bound_method %.loc15_11.2, %impl.elem0 [template = constants.%At.bound]
  264. // CHECK:STDOUT: %At.call: init %empty_tuple.type = call %At.bound(%.loc15_11.2, %.loc15_15)
  265. // CHECK:STDOUT: return
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType) {
  269. // CHECK:STDOUT: %SubscriptType.loc5_26.2 => constants.%SubscriptType
  270. // CHECK:STDOUT: %SubscriptType.patt.loc5_26.2 => constants.%SubscriptType
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT:
  273. // CHECK:STDOUT: specific @At.1(constants.%SubscriptType, constants.%Self) {
  274. // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType
  275. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.4f1
  276. // CHECK:STDOUT: %Self => constants.%Self
  277. // CHECK:STDOUT: %Self.as_type.loc6_15.1 => constants.%Self.as_type
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: specific @IndexWith(@At.1.%SubscriptType) {}
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: specific @IndexWith(%SubscriptType.loc5_26.2) {}
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: specific @IndexWith(constants.%empty_tuple.type) {
  285. // CHECK:STDOUT: %SubscriptType.loc5_26.2 => constants.%empty_tuple.type
  286. // CHECK:STDOUT: %SubscriptType.patt.loc5_26.2 => constants.%empty_tuple.type
  287. // CHECK:STDOUT:
  288. // CHECK:STDOUT: !definition:
  289. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.63e
  290. // CHECK:STDOUT: %Self.2 => constants.%Self
  291. // CHECK:STDOUT: %At.type => constants.%At.type.87b
  292. // CHECK:STDOUT: %At => constants.%At.d3b
  293. // CHECK:STDOUT: %At.assoc_type => constants.%At.assoc_type.837
  294. // CHECK:STDOUT: %assoc0.loc6_52.2 => constants.%assoc0.df5
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT:
  297. // CHECK:STDOUT: specific @At.1(constants.%empty_tuple.type, constants.%IndexWith.facet) {
  298. // CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type
  299. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.63e
  300. // CHECK:STDOUT: %Self => constants.%IndexWith.facet
  301. // CHECK:STDOUT: %Self.as_type.loc6_15.1 => constants.%empty_tuple.type
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: