index.carbon 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/operators/overloaded/index.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/overloaded/index.carbon
  14. // --- core_wrong_index_with.carbon
  15. package Core library "[[@TEST_NAME]]";
  16. class IndexWith {}
  17. // --- fail_wrong_index_with.carbon
  18. library "[[@TEST_NAME]]";
  19. import Core library "core_wrong_index_with";
  20. // CHECK:STDERR: fail_wrong_index_with.carbon:[[@LINE+4]]:10: error: value of type `type` is not callable [CallToNonCallable]
  21. // CHECK:STDERR: fn F() { 0[1]; }
  22. // CHECK:STDERR: ^~~~
  23. // CHECK:STDERR:
  24. fn F() { 0[1]; }
  25. // --- fail_missing_index_with.carbon
  26. library "[[@TEST_NAME]]";
  27. // CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+4]]:10: error: name `Core.IndexWith` implicitly referenced here, but not found [CoreNameNotFound]
  28. // CHECK:STDERR: fn F() { 0[1]; }
  29. // CHECK:STDERR: ^~~~
  30. // CHECK:STDERR:
  31. fn F() { 0[1]; }
  32. // --- core_wrong_arg_count.carbon
  33. package Core library "[[@TEST_NAME]]";
  34. interface IndexWith(SubscriptType:! type, ElementType:! type) {
  35. fn At[self: Self](subscript: SubscriptType) -> ElementType;
  36. }
  37. // --- fail_wrong_arg_count.carbon
  38. library "[[@TEST_NAME]]";
  39. import Core library "core_wrong_arg_count";
  40. class C {}
  41. impl C as Core.IndexWith((), ()) {
  42. fn At[self: Self](subscript: ()) -> () {
  43. return ();
  44. }
  45. }
  46. fn F() {
  47. let c: C = {};
  48. // CHECK:STDERR: fail_wrong_arg_count.carbon:[[@LINE+7]]:3: error: 1 argument passed to generic interface expecting 2 arguments [CallArgCountMismatch]
  49. // CHECK:STDERR: c[()];
  50. // CHECK:STDERR: ^~~~~
  51. // CHECK:STDERR: core_wrong_arg_count.carbon:4:1: note: calling generic interface declared here [InCallToEntity]
  52. // CHECK:STDERR: interface IndexWith(SubscriptType:! type, ElementType:! type) {
  53. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  54. // CHECK:STDERR:
  55. c[()];
  56. }
  57. // CHECK:STDOUT: --- core_wrong_index_with.carbon
  58. // CHECK:STDOUT:
  59. // CHECK:STDOUT: constants {
  60. // CHECK:STDOUT: %IndexWith: type = class_type @IndexWith [concrete]
  61. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  62. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  63. // CHECK:STDOUT: }
  64. // CHECK:STDOUT:
  65. // CHECK:STDOUT: file {
  66. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  67. // CHECK:STDOUT: .IndexWith = %IndexWith.decl
  68. // CHECK:STDOUT: }
  69. // CHECK:STDOUT: %IndexWith.decl: type = class_decl @IndexWith [concrete = constants.%IndexWith] {} {}
  70. // CHECK:STDOUT: }
  71. // CHECK:STDOUT:
  72. // CHECK:STDOUT: class @IndexWith {
  73. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  74. // CHECK:STDOUT: complete_type_witness = %complete_type
  75. // CHECK:STDOUT:
  76. // CHECK:STDOUT: !members:
  77. // CHECK:STDOUT: .Self = constants.%IndexWith
  78. // CHECK:STDOUT: }
  79. // CHECK:STDOUT:
  80. // CHECK:STDOUT: --- fail_wrong_index_with.carbon
  81. // CHECK:STDOUT:
  82. // CHECK:STDOUT: constants {
  83. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  84. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  85. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  86. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  87. // CHECK:STDOUT: %IndexWith: type = class_type @IndexWith [concrete]
  88. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  89. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  90. // CHECK:STDOUT: }
  91. // CHECK:STDOUT:
  92. // CHECK:STDOUT: imports {
  93. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  94. // CHECK:STDOUT: .IndexWith = %Core.IndexWith
  95. // CHECK:STDOUT: import Core//prelude
  96. // CHECK:STDOUT: import Core//core_wrong_index_with
  97. // CHECK:STDOUT: import Core//prelude/...
  98. // CHECK:STDOUT: }
  99. // CHECK:STDOUT: %Core.IndexWith: type = import_ref Core//core_wrong_index_with, IndexWith, loaded [concrete = constants.%IndexWith]
  100. // CHECK:STDOUT: %Core.import_ref.8f2: <witness> = import_ref Core//core_wrong_index_with, loc{{\d+_\d+}}, loaded [concrete = constants.%complete_type]
  101. // CHECK:STDOUT: %Core.import_ref.4c7 = import_ref Core//core_wrong_index_with, inst{{[0-9A-F]+}} [no loc], unloaded
  102. // CHECK:STDOUT: }
  103. // CHECK:STDOUT:
  104. // CHECK:STDOUT: file {
  105. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  106. // CHECK:STDOUT: .Core = imports.%Core
  107. // CHECK:STDOUT: .F = %F.decl
  108. // CHECK:STDOUT: }
  109. // CHECK:STDOUT: %Core.import = import Core
  110. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  111. // CHECK:STDOUT: }
  112. // CHECK:STDOUT:
  113. // CHECK:STDOUT: class @IndexWith [from "core_wrong_index_with.carbon"] {
  114. // CHECK:STDOUT: complete_type_witness = imports.%Core.import_ref.8f2
  115. // CHECK:STDOUT:
  116. // CHECK:STDOUT: !members:
  117. // CHECK:STDOUT: .Self = imports.%Core.import_ref.4c7
  118. // CHECK:STDOUT: }
  119. // CHECK:STDOUT:
  120. // CHECK:STDOUT: fn @F() {
  121. // CHECK:STDOUT: !entry:
  122. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  123. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  124. // CHECK:STDOUT: return
  125. // CHECK:STDOUT: }
  126. // CHECK:STDOUT:
  127. // CHECK:STDOUT: --- fail_missing_index_with.carbon
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: constants {
  130. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  131. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  132. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  133. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  134. // CHECK:STDOUT: }
  135. // CHECK:STDOUT:
  136. // CHECK:STDOUT: imports {
  137. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  138. // CHECK:STDOUT: .IndexWith = <poisoned>
  139. // CHECK:STDOUT: import Core//prelude
  140. // CHECK:STDOUT: import Core//prelude/...
  141. // CHECK:STDOUT: }
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: file {
  145. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  146. // CHECK:STDOUT: .Core = imports.%Core
  147. // CHECK:STDOUT: .F = %F.decl
  148. // CHECK:STDOUT: }
  149. // CHECK:STDOUT: %Core.import = import Core
  150. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  151. // CHECK:STDOUT: }
  152. // CHECK:STDOUT:
  153. // CHECK:STDOUT: fn @F() {
  154. // CHECK:STDOUT: !entry:
  155. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  156. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  157. // CHECK:STDOUT: return
  158. // CHECK:STDOUT: }
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: --- core_wrong_arg_count.carbon
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: constants {
  163. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  164. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  165. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic]
  166. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  167. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic]
  168. // CHECK:STDOUT: %IndexWith.type.68b: type = generic_interface_type @IndexWith [concrete]
  169. // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.68b = struct_value () [concrete]
  170. // CHECK:STDOUT: %IndexWith.type.960: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic]
  171. // CHECK:STDOUT: %Self: %IndexWith.type.960 = symbolic_binding Self, 2 [symbolic]
  172. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 2, %Self [symbolic]
  173. // CHECK:STDOUT: %pattern_type.314: type = pattern_type %Self.binding.as_type [symbolic]
  174. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %SubscriptType [symbolic]
  175. // CHECK:STDOUT: %pattern_type.946: type = pattern_type %ElementType [symbolic]
  176. // CHECK:STDOUT: %IndexWith.At.type: type = fn_type @IndexWith.At, @IndexWith(%SubscriptType, %ElementType) [symbolic]
  177. // CHECK:STDOUT: %IndexWith.At: %IndexWith.At.type = struct_value () [symbolic]
  178. // CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType, %ElementType) [symbolic]
  179. // CHECK:STDOUT: %assoc0: %IndexWith.assoc_type = assoc_entity element0, @IndexWith.%IndexWith.At.decl [symbolic]
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT:
  182. // CHECK:STDOUT: file {
  183. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  184. // CHECK:STDOUT: .IndexWith = %IndexWith.decl
  185. // CHECK:STDOUT: }
  186. // CHECK:STDOUT: %IndexWith.decl: %IndexWith.type.68b = interface_decl @IndexWith [concrete = constants.%IndexWith.generic] {
  187. // CHECK:STDOUT: %SubscriptType.patt: %pattern_type.98f = symbolic_binding_pattern SubscriptType, 0 [concrete]
  188. // CHECK:STDOUT: %ElementType.patt: %pattern_type.98f = symbolic_binding_pattern ElementType, 1 [concrete]
  189. // CHECK:STDOUT: } {
  190. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  191. // CHECK:STDOUT: %SubscriptType.loc4_21.2: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType.loc4_21.1 (constants.%SubscriptType)]
  192. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  193. // CHECK:STDOUT: %ElementType.loc4_43.2: type = symbolic_binding ElementType, 1 [symbolic = %ElementType.loc4_43.1 (constants.%ElementType)]
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT:
  197. // CHECK:STDOUT: generic interface @IndexWith(%SubscriptType.loc4_21.2: type, %ElementType.loc4_43.2: type) {
  198. // CHECK:STDOUT: %SubscriptType.loc4_21.1: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType.loc4_21.1 (constants.%SubscriptType)]
  199. // CHECK:STDOUT: %ElementType.loc4_43.1: type = symbolic_binding ElementType, 1 [symbolic = %ElementType.loc4_43.1 (constants.%ElementType)]
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: !definition:
  202. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.loc4_21.1, %ElementType.loc4_43.1)> [symbolic = %IndexWith.type (constants.%IndexWith.type.960)]
  203. // CHECK:STDOUT: %Self.loc4_63.2: @IndexWith.%IndexWith.type (%IndexWith.type.960) = symbolic_binding Self, 2 [symbolic = %Self.loc4_63.2 (constants.%Self)]
  204. // CHECK:STDOUT: %IndexWith.At.type: type = fn_type @IndexWith.At, @IndexWith(%SubscriptType.loc4_21.1, %ElementType.loc4_43.1) [symbolic = %IndexWith.At.type (constants.%IndexWith.At.type)]
  205. // CHECK:STDOUT: %IndexWith.At: @IndexWith.%IndexWith.At.type (%IndexWith.At.type) = struct_value () [symbolic = %IndexWith.At (constants.%IndexWith.At)]
  206. // CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType.loc4_21.1, %ElementType.loc4_43.1) [symbolic = %IndexWith.assoc_type (constants.%IndexWith.assoc_type)]
  207. // CHECK:STDOUT: %assoc0.loc5_61.2: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type) = assoc_entity element0, %IndexWith.At.decl [symbolic = %assoc0.loc5_61.2 (constants.%assoc0)]
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: interface {
  210. // CHECK:STDOUT: %Self.loc4_63.1: @IndexWith.%IndexWith.type (%IndexWith.type.960) = symbolic_binding Self, 2 [symbolic = %Self.loc4_63.2 (constants.%Self)]
  211. // CHECK:STDOUT: %IndexWith.At.decl: @IndexWith.%IndexWith.At.type (%IndexWith.At.type) = fn_decl @IndexWith.At [symbolic = @IndexWith.%IndexWith.At (constants.%IndexWith.At)] {
  212. // CHECK:STDOUT: %self.patt: @IndexWith.At.%pattern_type.loc5_9 (%pattern_type.314) = value_binding_pattern self [concrete]
  213. // CHECK:STDOUT: %self.param_patt: @IndexWith.At.%pattern_type.loc5_9 (%pattern_type.314) = value_param_pattern %self.patt, call_param0 [concrete]
  214. // CHECK:STDOUT: %subscript.patt: @IndexWith.At.%pattern_type.loc5_21 (%pattern_type.51d) = value_binding_pattern subscript [concrete]
  215. // CHECK:STDOUT: %subscript.param_patt: @IndexWith.At.%pattern_type.loc5_21 (%pattern_type.51d) = value_param_pattern %subscript.patt, call_param1 [concrete]
  216. // CHECK:STDOUT: %return.patt: @IndexWith.At.%pattern_type.loc5_47 (%pattern_type.946) = return_slot_pattern [concrete]
  217. // CHECK:STDOUT: %return.param_patt: @IndexWith.At.%pattern_type.loc5_47 (%pattern_type.946) = out_param_pattern %return.patt, call_param2 [concrete]
  218. // CHECK:STDOUT: } {
  219. // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, @IndexWith.%ElementType.loc4_43.2 [symbolic = %ElementType (constants.%ElementType)]
  220. // CHECK:STDOUT: %self.param: @IndexWith.At.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
  221. // CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.3 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
  222. // CHECK:STDOUT: %.loc5_15.2: @IndexWith.At.%IndexWith.type (%IndexWith.type.960) = specific_constant @IndexWith.%Self.loc4_63.1, @IndexWith(constants.%SubscriptType, constants.%ElementType) [symbolic = %Self (constants.%Self)]
  223. // CHECK:STDOUT: %Self.ref: @IndexWith.At.%IndexWith.type (%IndexWith.type.960) = name_ref Self, %.loc5_15.2 [symbolic = %Self (constants.%Self)]
  224. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  225. // CHECK:STDOUT: %.loc5_15.3: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT: %self: @IndexWith.At.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
  228. // CHECK:STDOUT: %subscript.param: @IndexWith.At.%SubscriptType (%SubscriptType) = value_param call_param1
  229. // CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, @IndexWith.%SubscriptType.loc4_21.2 [symbolic = %SubscriptType (constants.%SubscriptType)]
  230. // CHECK:STDOUT: %subscript: @IndexWith.At.%SubscriptType (%SubscriptType) = value_binding subscript, %subscript.param
  231. // CHECK:STDOUT: %return.param: ref @IndexWith.At.%ElementType (%ElementType) = out_param call_param2
  232. // CHECK:STDOUT: %return: ref @IndexWith.At.%ElementType (%ElementType) = return_slot %return.param
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT: %assoc0.loc5_61.1: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type) = assoc_entity element0, %IndexWith.At.decl [symbolic = %assoc0.loc5_61.2 (constants.%assoc0)]
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: !members:
  237. // CHECK:STDOUT: .Self = %Self.loc4_63.1
  238. // CHECK:STDOUT: .SubscriptType = <poisoned>
  239. // CHECK:STDOUT: .ElementType = <poisoned>
  240. // CHECK:STDOUT: .At = %assoc0.loc5_61.1
  241. // CHECK:STDOUT: witness = (%IndexWith.At.decl)
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: !requires:
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT: }
  246. // CHECK:STDOUT:
  247. // CHECK:STDOUT: generic fn @IndexWith.At(@IndexWith.%SubscriptType.loc4_21.2: type, @IndexWith.%ElementType.loc4_43.2: type, @IndexWith.%Self.loc4_63.1: @IndexWith.%IndexWith.type (%IndexWith.type.960)) {
  248. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)]
  249. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic = %ElementType (constants.%ElementType)]
  250. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.960)]
  251. // CHECK:STDOUT: %Self: @IndexWith.At.%IndexWith.type (%IndexWith.type.960) = symbolic_binding Self, 2 [symbolic = %Self (constants.%Self)]
  252. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 2, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  253. // CHECK:STDOUT: %pattern_type.loc5_9: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.loc5_9 (constants.%pattern_type.314)]
  254. // CHECK:STDOUT: %pattern_type.loc5_21: type = pattern_type %SubscriptType [symbolic = %pattern_type.loc5_21 (constants.%pattern_type.51d)]
  255. // CHECK:STDOUT: %pattern_type.loc5_47: type = pattern_type %ElementType [symbolic = %pattern_type.loc5_47 (constants.%pattern_type.946)]
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: fn(%self.param: @IndexWith.At.%Self.binding.as_type (%Self.binding.as_type), %subscript.param: @IndexWith.At.%SubscriptType (%SubscriptType)) -> @IndexWith.At.%ElementType (%ElementType);
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType, constants.%ElementType) {
  261. // CHECK:STDOUT: %SubscriptType.loc4_21.1 => constants.%SubscriptType
  262. // CHECK:STDOUT: %ElementType.loc4_43.1 => constants.%ElementType
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: specific @IndexWith.At(constants.%SubscriptType, constants.%ElementType, constants.%Self) {
  266. // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType
  267. // CHECK:STDOUT: %ElementType => constants.%ElementType
  268. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.960
  269. // CHECK:STDOUT: %Self => constants.%Self
  270. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  271. // CHECK:STDOUT: %pattern_type.loc5_9 => constants.%pattern_type.314
  272. // CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.51d
  273. // CHECK:STDOUT: %pattern_type.loc5_47 => constants.%pattern_type.946
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: --- fail_wrong_arg_count.carbon
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: constants {
  279. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  280. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  281. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  282. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  283. // CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete]
  284. // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete]
  285. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic]
  286. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic]
  287. // CHECK:STDOUT: %IndexWith.type.79c: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic]
  288. // CHECK:STDOUT: %Self.042: %IndexWith.type.79c = symbolic_binding Self, 2 [symbolic]
  289. // CHECK:STDOUT: %IndexWith.assoc_type.cae: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType, %ElementType) [symbolic]
  290. // CHECK:STDOUT: %assoc0.abb: %IndexWith.assoc_type.cae = assoc_entity element0, imports.%Core.import_ref.e47 [symbolic]
  291. // CHECK:STDOUT: %IndexWith.At.type.7b0: type = fn_type @IndexWith.At, @IndexWith(%SubscriptType, %ElementType) [symbolic]
  292. // CHECK:STDOUT: %IndexWith.At.62b: %IndexWith.At.type.7b0 = struct_value () [symbolic]
  293. // CHECK:STDOUT: %pattern_type.946: type = pattern_type %ElementType [symbolic]
  294. // CHECK:STDOUT: %Self.binding.as_type.b66: type = symbolic_binding_type Self, 2, %Self.042 [symbolic]
  295. // CHECK:STDOUT: %pattern_type.0bf: type = pattern_type %Self.binding.as_type.b66 [symbolic]
  296. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %SubscriptType [symbolic]
  297. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  298. // CHECK:STDOUT: %IndexWith.type.5ee: type = facet_type <@IndexWith, @IndexWith(%empty_tuple.type, %empty_tuple.type)> [concrete]
  299. // CHECK:STDOUT: %IndexWith.impl_witness: <witness> = impl_witness file.%IndexWith.impl_witness_table [concrete]
  300. // CHECK:STDOUT: %Self.a75: %IndexWith.type.5ee = symbolic_binding Self, 2 [symbolic]
  301. // CHECK:STDOUT: %IndexWith.At.type.1a9: type = fn_type @IndexWith.At, @IndexWith(%empty_tuple.type, %empty_tuple.type) [concrete]
  302. // CHECK:STDOUT: %IndexWith.At.721: %IndexWith.At.type.1a9 = struct_value () [concrete]
  303. // CHECK:STDOUT: %IndexWith.assoc_type.d10: type = assoc_entity_type @IndexWith, @IndexWith(%empty_tuple.type, %empty_tuple.type) [concrete]
  304. // CHECK:STDOUT: %assoc0.78f: %IndexWith.assoc_type.d10 = assoc_entity element0, imports.%Core.import_ref.e47 [concrete]
  305. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  306. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  307. // CHECK:STDOUT: %C.as.IndexWith.impl.At.type: type = fn_type @C.as.IndexWith.impl.At [concrete]
  308. // CHECK:STDOUT: %C.as.IndexWith.impl.At: %C.as.IndexWith.impl.At.type = struct_value () [concrete]
  309. // CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.5ee = facet_value %C, (%IndexWith.impl_witness) [concrete]
  310. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  311. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  312. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  313. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  314. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  315. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  316. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  317. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.857: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  318. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.68a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.857 = struct_value () [concrete]
  319. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.68a, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  320. // CHECK:STDOUT: }
  321. // CHECK:STDOUT:
  322. // CHECK:STDOUT: imports {
  323. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  324. // CHECK:STDOUT: .IndexWith = %Core.IndexWith
  325. // CHECK:STDOUT: .Destroy = %Core.Destroy
  326. // CHECK:STDOUT: import Core//prelude
  327. // CHECK:STDOUT: import Core//core_wrong_arg_count
  328. // CHECK:STDOUT: import Core//prelude/...
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//core_wrong_arg_count, IndexWith, loaded [concrete = constants.%IndexWith.generic]
  331. // CHECK:STDOUT: %Core.import_ref.206 = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, unloaded
  332. // CHECK:STDOUT: %Core.import_ref.012 = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, unloaded
  333. // CHECK:STDOUT: %Core.At: @IndexWith.%IndexWith.At.type (%IndexWith.At.type.7b0) = import_ref Core//core_wrong_arg_count, At, loaded [symbolic = @IndexWith.%IndexWith.At (constants.%IndexWith.At.62b)]
  334. // CHECK:STDOUT: %Core.import_ref.b3bc94.1: type = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%SubscriptType (constants.%SubscriptType)]
  335. // CHECK:STDOUT: %Core.import_ref.8e8b42.1: type = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%ElementType (constants.%ElementType)]
  336. // CHECK:STDOUT: %Core.import_ref.e47 = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, unloaded
  337. // CHECK:STDOUT: %Core.import_ref.b3bc94.2: type = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%SubscriptType (constants.%SubscriptType)]
  338. // CHECK:STDOUT: %Core.import_ref.8e8b42.2: type = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%ElementType (constants.%ElementType)]
  339. // CHECK:STDOUT: %Core.import_ref.ec5: @IndexWith.%IndexWith.type (%IndexWith.type.79c) = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%Self (constants.%Self.042)]
  340. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  341. // CHECK:STDOUT: }
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: file {
  344. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  345. // CHECK:STDOUT: .Core = imports.%Core
  346. // CHECK:STDOUT: .C = %C.decl
  347. // CHECK:STDOUT: .F = %F.decl
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT: %Core.import = import Core
  350. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  351. // CHECK:STDOUT: impl_decl @C.as.IndexWith.impl [concrete] {} {
  352. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  353. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  354. // CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic]
  355. // CHECK:STDOUT: %.loc8_27: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  356. // CHECK:STDOUT: %.loc8_31: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  357. // CHECK:STDOUT: %.loc8_32.1: type = converted %.loc8_27, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  358. // CHECK:STDOUT: %.loc8_32.2: type = converted %.loc8_31, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  359. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%empty_tuple.type, constants.%empty_tuple.type)> [concrete = constants.%IndexWith.type.5ee]
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (@C.as.IndexWith.impl.%C.as.IndexWith.impl.At.decl), @C.as.IndexWith.impl [concrete]
  362. // CHECK:STDOUT: %IndexWith.impl_witness: <witness> = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness]
  363. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: generic interface @IndexWith(imports.%Core.import_ref.b3bc94.1: type, imports.%Core.import_ref.8e8b42.1: type) [from "core_wrong_arg_count.carbon"] {
  367. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)]
  368. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic = %ElementType (constants.%ElementType)]
  369. // CHECK:STDOUT:
  370. // CHECK:STDOUT: !definition:
  371. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.79c)]
  372. // CHECK:STDOUT: %Self: @IndexWith.%IndexWith.type (%IndexWith.type.79c) = symbolic_binding Self, 2 [symbolic = %Self (constants.%Self.042)]
  373. // CHECK:STDOUT: %IndexWith.At.type: type = fn_type @IndexWith.At, @IndexWith(%SubscriptType, %ElementType) [symbolic = %IndexWith.At.type (constants.%IndexWith.At.type.7b0)]
  374. // CHECK:STDOUT: %IndexWith.At: @IndexWith.%IndexWith.At.type (%IndexWith.At.type.7b0) = struct_value () [symbolic = %IndexWith.At (constants.%IndexWith.At.62b)]
  375. // CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType, %ElementType) [symbolic = %IndexWith.assoc_type (constants.%IndexWith.assoc_type.cae)]
  376. // CHECK:STDOUT: %assoc0: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type.cae) = assoc_entity element0, imports.%Core.import_ref.e47 [symbolic = %assoc0 (constants.%assoc0.abb)]
  377. // CHECK:STDOUT:
  378. // CHECK:STDOUT: interface {
  379. // CHECK:STDOUT: !members:
  380. // CHECK:STDOUT: .Self = imports.%Core.import_ref.206
  381. // CHECK:STDOUT: .At = imports.%Core.import_ref.012
  382. // CHECK:STDOUT: witness = (imports.%Core.At)
  383. // CHECK:STDOUT:
  384. // CHECK:STDOUT: !requires:
  385. // CHECK:STDOUT: }
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: impl @C.as.IndexWith.impl: %C.ref as %IndexWith.type {
  389. // CHECK:STDOUT: %C.as.IndexWith.impl.At.decl: %C.as.IndexWith.impl.At.type = fn_decl @C.as.IndexWith.impl.At [concrete = constants.%C.as.IndexWith.impl.At] {
  390. // CHECK:STDOUT: %self.patt: %pattern_type.c48 = value_binding_pattern self [concrete]
  391. // CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete]
  392. // CHECK:STDOUT: %subscript.patt: %pattern_type.cb1 = value_binding_pattern subscript [concrete]
  393. // CHECK:STDOUT: %subscript.param_patt: %pattern_type.cb1 = value_param_pattern %subscript.patt, call_param1 [concrete]
  394. // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete]
  395. // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param2 [concrete]
  396. // CHECK:STDOUT: } {
  397. // CHECK:STDOUT: %.loc9_40.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  398. // CHECK:STDOUT: %.loc9_40.2: type = converted %.loc9_40.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  399. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  400. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.IndexWith.impl.%C.ref [concrete = constants.%C]
  401. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  402. // CHECK:STDOUT: %subscript.param: %empty_tuple.type = value_param call_param1
  403. // CHECK:STDOUT: %.loc9_33.1: type = splice_block %.loc9_33.3 [concrete = constants.%empty_tuple.type] {
  404. // CHECK:STDOUT: %.loc9_33.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  405. // CHECK:STDOUT: %.loc9_33.3: type = converted %.loc9_33.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  406. // CHECK:STDOUT: }
  407. // CHECK:STDOUT: %subscript: %empty_tuple.type = value_binding subscript, %subscript.param
  408. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param2
  409. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  410. // CHECK:STDOUT: }
  411. // CHECK:STDOUT:
  412. // CHECK:STDOUT: !members:
  413. // CHECK:STDOUT: .At = %C.as.IndexWith.impl.At.decl
  414. // CHECK:STDOUT: witness = file.%IndexWith.impl_witness
  415. // CHECK:STDOUT: }
  416. // CHECK:STDOUT:
  417. // CHECK:STDOUT: class @C {
  418. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  419. // CHECK:STDOUT: complete_type_witness = %complete_type
  420. // CHECK:STDOUT:
  421. // CHECK:STDOUT: !members:
  422. // CHECK:STDOUT: .Self = constants.%C
  423. // CHECK:STDOUT: }
  424. // CHECK:STDOUT:
  425. // CHECK:STDOUT: generic fn @IndexWith.At(imports.%Core.import_ref.b3bc94.2: type, imports.%Core.import_ref.8e8b42.2: type, imports.%Core.import_ref.ec5: @IndexWith.%IndexWith.type (%IndexWith.type.79c)) [from "core_wrong_arg_count.carbon"] {
  426. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)]
  427. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic = %ElementType (constants.%ElementType)]
  428. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.79c)]
  429. // CHECK:STDOUT: %Self: @IndexWith.At.%IndexWith.type (%IndexWith.type.79c) = symbolic_binding Self, 2 [symbolic = %Self (constants.%Self.042)]
  430. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 2, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.b66)]
  431. // CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.0bf)]
  432. // CHECK:STDOUT: %pattern_type.2: type = pattern_type %SubscriptType [symbolic = %pattern_type.2 (constants.%pattern_type.51d)]
  433. // CHECK:STDOUT: %pattern_type.3: type = pattern_type %ElementType [symbolic = %pattern_type.3 (constants.%pattern_type.946)]
  434. // CHECK:STDOUT:
  435. // CHECK:STDOUT: fn;
  436. // CHECK:STDOUT: }
  437. // CHECK:STDOUT:
  438. // CHECK:STDOUT: fn @C.as.IndexWith.impl.At(%self.param: %C, %subscript.param: %empty_tuple.type) -> %empty_tuple.type {
  439. // CHECK:STDOUT: !entry:
  440. // CHECK:STDOUT: %.loc10_13.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  441. // CHECK:STDOUT: %.loc10_13.2: init %empty_tuple.type = tuple_init () to %return [concrete = constants.%empty_tuple]
  442. // CHECK:STDOUT: %.loc10_14: init %empty_tuple.type = converted %.loc10_13.1, %.loc10_13.2 [concrete = constants.%empty_tuple]
  443. // CHECK:STDOUT: return %.loc10_14 to %return
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: fn @F() {
  447. // CHECK:STDOUT: !entry:
  448. // CHECK:STDOUT: name_binding_decl {
  449. // CHECK:STDOUT: %c.patt: %pattern_type.c48 = value_binding_pattern c [concrete]
  450. // CHECK:STDOUT: }
  451. // CHECK:STDOUT: %.loc15_15.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  452. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  453. // CHECK:STDOUT: %.loc15_15.2: ref %C = temporary_storage
  454. // CHECK:STDOUT: %.loc15_15.3: init %C = class_init (), %.loc15_15.2 [concrete = constants.%C.val]
  455. // CHECK:STDOUT: %.loc15_15.4: ref %C = temporary %.loc15_15.2, %.loc15_15.3
  456. // CHECK:STDOUT: %.loc15_15.5: ref %C = converted %.loc15_15.1, %.loc15_15.4
  457. // CHECK:STDOUT: %.loc15_15.6: %C = acquire_value %.loc15_15.5
  458. // CHECK:STDOUT: %c: %C = value_binding c, %.loc15_15.6
  459. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  460. // CHECK:STDOUT: %.loc23: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  461. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc15_15.4, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.68a
  462. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.68a, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  463. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc15_15.4, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  464. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%.loc15_15.4)
  465. // CHECK:STDOUT: return
  466. // CHECK:STDOUT: }
  467. // CHECK:STDOUT:
  468. // CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType, constants.%ElementType) {
  469. // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType
  470. // CHECK:STDOUT: %ElementType => constants.%ElementType
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT:
  473. // CHECK:STDOUT: specific @IndexWith.At(constants.%SubscriptType, constants.%ElementType, constants.%Self.042) {
  474. // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType
  475. // CHECK:STDOUT: %ElementType => constants.%ElementType
  476. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.79c
  477. // CHECK:STDOUT: %Self => constants.%Self.042
  478. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.b66
  479. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.0bf
  480. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.51d
  481. // CHECK:STDOUT: %pattern_type.3 => constants.%pattern_type.946
  482. // CHECK:STDOUT: }
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: specific @IndexWith(constants.%empty_tuple.type, constants.%empty_tuple.type) {
  485. // CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type
  486. // CHECK:STDOUT: %ElementType => constants.%empty_tuple.type
  487. // CHECK:STDOUT:
  488. // CHECK:STDOUT: !definition:
  489. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.5ee
  490. // CHECK:STDOUT: %Self => constants.%Self.a75
  491. // CHECK:STDOUT: %IndexWith.At.type => constants.%IndexWith.At.type.1a9
  492. // CHECK:STDOUT: %IndexWith.At => constants.%IndexWith.At.721
  493. // CHECK:STDOUT: %IndexWith.assoc_type => constants.%IndexWith.assoc_type.d10
  494. // CHECK:STDOUT: %assoc0 => constants.%assoc0.78f
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: specific @IndexWith.At(constants.%empty_tuple.type, constants.%empty_tuple.type, constants.%IndexWith.facet) {
  498. // CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type
  499. // CHECK:STDOUT: %ElementType => constants.%empty_tuple.type
  500. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.5ee
  501. // CHECK:STDOUT: %Self => constants.%IndexWith.facet
  502. // CHECK:STDOUT: %Self.binding.as_type => constants.%C
  503. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.c48
  504. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.cb1
  505. // CHECK:STDOUT: %pattern_type.3 => constants.%pattern_type.cb1
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT: