index.carbon 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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[unused self: Self](unused 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.958 = 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.958
  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: %pattern_type.98f: type = pattern_type type [concrete]
  166. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic]
  167. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic]
  168. // CHECK:STDOUT: %IndexWith.type.a3a: type = generic_interface_type @IndexWith [concrete]
  169. // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.a3a = struct_value () [concrete]
  170. // CHECK:STDOUT: %IndexWith.type.2c3: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic]
  171. // CHECK:STDOUT: %Self: %IndexWith.type.2c3 = symbolic_binding Self, 2 [symbolic]
  172. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  173. // CHECK:STDOUT: %pattern_type.9fd: type = pattern_type %Self.as_type [symbolic]
  174. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %SubscriptType [symbolic]
  175. // CHECK:STDOUT: %.822: Core.Form = init_form %ElementType [symbolic]
  176. // CHECK:STDOUT: %pattern_type.946: type = pattern_type %ElementType [symbolic]
  177. // CHECK:STDOUT: %IndexWith.WithSelf.At.type: type = fn_type @IndexWith.WithSelf.At, @IndexWith.WithSelf(%SubscriptType, %ElementType, %Self) [symbolic]
  178. // CHECK:STDOUT: %IndexWith.WithSelf.At: %IndexWith.WithSelf.At.type = struct_value () [symbolic]
  179. // CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType, %ElementType) [symbolic]
  180. // CHECK:STDOUT: %assoc0: %IndexWith.assoc_type = assoc_entity element0, @IndexWith.WithSelf.%IndexWith.WithSelf.At.decl [symbolic]
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: file {
  184. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  185. // CHECK:STDOUT: .IndexWith = %IndexWith.decl
  186. // CHECK:STDOUT: }
  187. // CHECK:STDOUT: %IndexWith.decl: %IndexWith.type.a3a = interface_decl @IndexWith [concrete = constants.%IndexWith.generic] {
  188. // CHECK:STDOUT: %SubscriptType.patt: %pattern_type.98f = symbolic_binding_pattern SubscriptType, 0 [concrete]
  189. // CHECK:STDOUT: %ElementType.patt: %pattern_type.98f = symbolic_binding_pattern ElementType, 1 [concrete]
  190. // CHECK:STDOUT: } {
  191. // CHECK:STDOUT: %.loc4_37.1: type = splice_block %.loc4_37.2 [concrete = type] {
  192. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  193. // CHECK:STDOUT: %.loc4_37.2: type = type_literal type [concrete = type]
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT: %SubscriptType.loc4_34.2: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType.loc4_34.1 (constants.%SubscriptType)]
  196. // CHECK:STDOUT: %.loc4_57.1: type = splice_block %.loc4_57.2 [concrete = type] {
  197. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  198. // CHECK:STDOUT: %.loc4_57.2: type = type_literal type [concrete = type]
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT: %ElementType.loc4_54.2: type = symbolic_binding ElementType, 1 [symbolic = %ElementType.loc4_54.1 (constants.%ElementType)]
  201. // CHECK:STDOUT: }
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT:
  204. // CHECK:STDOUT: generic interface @IndexWith(%SubscriptType.loc4_34.2: type, %ElementType.loc4_54.2: type) {
  205. // CHECK:STDOUT: %SubscriptType.loc4_34.1: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType.loc4_34.1 (constants.%SubscriptType)]
  206. // CHECK:STDOUT: %ElementType.loc4_54.1: type = symbolic_binding ElementType, 1 [symbolic = %ElementType.loc4_54.1 (constants.%ElementType)]
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: !definition:
  209. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.loc4_34.1, %ElementType.loc4_54.1)> [symbolic = %IndexWith.type (constants.%IndexWith.type.2c3)]
  210. // CHECK:STDOUT: %Self.loc4_63.2: @IndexWith.%IndexWith.type (%IndexWith.type.2c3) = symbolic_binding Self, 2 [symbolic = %Self.loc4_63.2 (constants.%Self)]
  211. // CHECK:STDOUT:
  212. // CHECK:STDOUT: interface {
  213. // CHECK:STDOUT: %Self.loc4_63.1: @IndexWith.%IndexWith.type (%IndexWith.type.2c3) = symbolic_binding Self, 2 [symbolic = %Self.loc4_63.2 (constants.%Self)]
  214. // CHECK:STDOUT: %IndexWith.WithSelf.decl = interface_with_self_decl @IndexWith [concrete]
  215. // CHECK:STDOUT:
  216. // CHECK:STDOUT: !with Self:
  217. // CHECK:STDOUT: %IndexWith.WithSelf.At.decl: @IndexWith.WithSelf.%IndexWith.WithSelf.At.type (%IndexWith.WithSelf.At.type) = fn_decl @IndexWith.WithSelf.At [symbolic = @IndexWith.WithSelf.%IndexWith.WithSelf.At (constants.%IndexWith.WithSelf.At)] {
  218. // CHECK:STDOUT: %self.param_patt: @IndexWith.WithSelf.At.%pattern_type.loc5_13 (%pattern_type.9fd) = value_param_pattern [concrete]
  219. // CHECK:STDOUT: %self.patt: @IndexWith.WithSelf.At.%pattern_type.loc5_13 (%pattern_type.9fd) = at_binding_pattern self, %self.param_patt [concrete]
  220. // CHECK:STDOUT: %subscript.param_patt: @IndexWith.WithSelf.At.%pattern_type.loc5_30 (%pattern_type.51d) = value_param_pattern [concrete]
  221. // CHECK:STDOUT: %subscript.patt: @IndexWith.WithSelf.At.%pattern_type.loc5_30 (%pattern_type.51d) = at_binding_pattern subscript, %subscript.param_patt [concrete]
  222. // CHECK:STDOUT: %return.param_patt: @IndexWith.WithSelf.At.%pattern_type.loc5_50 (%pattern_type.946) = out_param_pattern [concrete]
  223. // CHECK:STDOUT: %return.patt: @IndexWith.WithSelf.At.%pattern_type.loc5_50 (%pattern_type.946) = return_slot_pattern %return.param_patt, %ElementType.ref [concrete]
  224. // CHECK:STDOUT: } {
  225. // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, @IndexWith.%ElementType.loc4_54.2 [symbolic = %ElementType (constants.%ElementType)]
  226. // CHECK:STDOUT: %.loc5_50.2: Core.Form = init_form %ElementType.ref [symbolic = %.loc5_50.1 (constants.%.822)]
  227. // CHECK:STDOUT: %self.param: @IndexWith.WithSelf.At.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0
  228. // CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.3 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] {
  229. // CHECK:STDOUT: %.loc5_15.2: @IndexWith.WithSelf.At.%IndexWith.type (%IndexWith.type.2c3) = specific_constant @IndexWith.%Self.loc4_63.1, @IndexWith(constants.%SubscriptType, constants.%ElementType) [symbolic = %Self (constants.%Self)]
  230. // CHECK:STDOUT: %Self.ref: @IndexWith.WithSelf.At.%IndexWith.type (%IndexWith.type.2c3) = name_ref Self, %.loc5_15.2 [symbolic = %Self (constants.%Self)]
  231. // CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  232. // CHECK:STDOUT: %.loc5_15.3: type = converted %Self.ref, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT: %self: @IndexWith.WithSelf.At.%Self.as_type.loc5_15.1 (%Self.as_type) = value_binding self, %self.param
  235. // CHECK:STDOUT: %subscript.param: @IndexWith.WithSelf.At.%SubscriptType (%SubscriptType) = value_param call_param1
  236. // CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, @IndexWith.%SubscriptType.loc4_34.2 [symbolic = %SubscriptType (constants.%SubscriptType)]
  237. // CHECK:STDOUT: %subscript: @IndexWith.WithSelf.At.%SubscriptType (%SubscriptType) = value_binding subscript, %subscript.param
  238. // CHECK:STDOUT: %return.param: ref @IndexWith.WithSelf.At.%ElementType (%ElementType) = out_param call_param2
  239. // CHECK:STDOUT: %return: ref @IndexWith.WithSelf.At.%ElementType (%ElementType) = return_slot %return.param
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT: %assoc0.loc5_61.1: @IndexWith.WithSelf.%IndexWith.assoc_type (%IndexWith.assoc_type) = assoc_entity element0, %IndexWith.WithSelf.At.decl [symbolic = %assoc0.loc5_61.2 (constants.%assoc0)]
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: !members:
  244. // CHECK:STDOUT: .Self = %Self.loc4_63.1
  245. // CHECK:STDOUT: .SubscriptType = <poisoned>
  246. // CHECK:STDOUT: .ElementType = <poisoned>
  247. // CHECK:STDOUT: .SubscriptType = <poisoned>
  248. // CHECK:STDOUT: .ElementType = <poisoned>
  249. // CHECK:STDOUT: .At = @IndexWith.WithSelf.%assoc0.loc5_61.1
  250. // CHECK:STDOUT: witness = (@IndexWith.WithSelf.%IndexWith.WithSelf.At.decl)
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: !requires:
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: generic fn @IndexWith.WithSelf.At(@IndexWith.%SubscriptType.loc4_34.2: type, @IndexWith.%ElementType.loc4_54.2: type, @IndexWith.%Self.loc4_63.1: @IndexWith.%IndexWith.type (%IndexWith.type.2c3)) {
  257. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)]
  258. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic = %ElementType (constants.%ElementType)]
  259. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.2c3)]
  260. // CHECK:STDOUT: %Self: @IndexWith.WithSelf.At.%IndexWith.type (%IndexWith.type.2c3) = symbolic_binding Self, 2 [symbolic = %Self (constants.%Self)]
  261. // CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  262. // CHECK:STDOUT: %pattern_type.loc5_13: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type.loc5_13 (constants.%pattern_type.9fd)]
  263. // CHECK:STDOUT: %pattern_type.loc5_30: type = pattern_type %SubscriptType [symbolic = %pattern_type.loc5_30 (constants.%pattern_type.51d)]
  264. // CHECK:STDOUT: %.loc5_50.1: Core.Form = init_form %ElementType [symbolic = %.loc5_50.1 (constants.%.822)]
  265. // CHECK:STDOUT: %pattern_type.loc5_50: type = pattern_type %ElementType [symbolic = %pattern_type.loc5_50 (constants.%pattern_type.946)]
  266. // CHECK:STDOUT:
  267. // CHECK:STDOUT: fn(%self.param: @IndexWith.WithSelf.At.%Self.as_type.loc5_15.1 (%Self.as_type), %subscript.param: @IndexWith.WithSelf.At.%SubscriptType (%SubscriptType)) -> out %return.param: @IndexWith.WithSelf.At.%ElementType (%ElementType);
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType, constants.%ElementType) {
  271. // CHECK:STDOUT: %SubscriptType.loc4_34.1 => constants.%SubscriptType
  272. // CHECK:STDOUT: %ElementType.loc4_54.1 => constants.%ElementType
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: specific @IndexWith.WithSelf(constants.%SubscriptType, constants.%ElementType, constants.%Self) {}
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: specific @IndexWith.WithSelf.At(constants.%SubscriptType, constants.%ElementType, constants.%Self) {
  278. // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType
  279. // CHECK:STDOUT: %ElementType => constants.%ElementType
  280. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.2c3
  281. // CHECK:STDOUT: %Self => constants.%Self
  282. // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type
  283. // CHECK:STDOUT: %pattern_type.loc5_13 => constants.%pattern_type.9fd
  284. // CHECK:STDOUT: %pattern_type.loc5_30 => constants.%pattern_type.51d
  285. // CHECK:STDOUT: %.loc5_50.1 => constants.%.822
  286. // CHECK:STDOUT: %pattern_type.loc5_50 => constants.%pattern_type.946
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: --- fail_wrong_arg_count.carbon
  290. // CHECK:STDOUT:
  291. // CHECK:STDOUT: constants {
  292. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  293. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  294. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  295. // CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete]
  296. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  297. // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete]
  298. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic]
  299. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic]
  300. // CHECK:STDOUT: %IndexWith.type.1e9: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic]
  301. // CHECK:STDOUT: %Self.b10: %IndexWith.type.1e9 = symbolic_binding Self, 2 [symbolic]
  302. // CHECK:STDOUT: %IndexWith.WithSelf.At.type.a9f: type = fn_type @IndexWith.WithSelf.At, @IndexWith.WithSelf(%SubscriptType, %ElementType, %Self.b10) [symbolic]
  303. // CHECK:STDOUT: %IndexWith.WithSelf.At.a38: %IndexWith.WithSelf.At.type.a9f = struct_value () [symbolic]
  304. // CHECK:STDOUT: %pattern_type.946: type = pattern_type %ElementType [symbolic]
  305. // CHECK:STDOUT: %Self.as_type.6f2: type = facet_access_type %Self.b10 [symbolic]
  306. // CHECK:STDOUT: %pattern_type.35b: type = pattern_type %Self.as_type.6f2 [symbolic]
  307. // CHECK:STDOUT: %.822: Core.Form = init_form %ElementType [symbolic]
  308. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %SubscriptType [symbolic]
  309. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  310. // CHECK:STDOUT: %IndexWith.type.483: type = facet_type <@IndexWith, @IndexWith(%empty_tuple.type, %empty_tuple.type)> [concrete]
  311. // CHECK:STDOUT: %IndexWith.impl_witness: <witness> = impl_witness @C.as.IndexWith.impl.%IndexWith.impl_witness_table [concrete]
  312. // CHECK:STDOUT: %Self.f44: %IndexWith.type.483 = symbolic_binding Self, 2 [symbolic]
  313. // CHECK:STDOUT: %IndexWith.WithSelf.At.type.9fb: type = fn_type @IndexWith.WithSelf.At, @IndexWith.WithSelf(%empty_tuple.type, %empty_tuple.type, %Self.b10) [symbolic]
  314. // CHECK:STDOUT: %IndexWith.WithSelf.At.0b7: %IndexWith.WithSelf.At.type.9fb = struct_value () [symbolic]
  315. // CHECK:STDOUT: %IndexWith.assoc_type.d10: type = assoc_entity_type @IndexWith, @IndexWith(%empty_tuple.type, %empty_tuple.type) [concrete]
  316. // CHECK:STDOUT: %assoc0.6a8: %IndexWith.assoc_type.d10 = assoc_entity element0, imports.%Core.import_ref.d74 [concrete]
  317. // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete]
  318. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  319. // CHECK:STDOUT: %.262: Core.Form = init_form %empty_tuple.type [concrete]
  320. // CHECK:STDOUT: %C.as.IndexWith.impl.At.type: type = fn_type @C.as.IndexWith.impl.At [concrete]
  321. // CHECK:STDOUT: %C.as.IndexWith.impl.At: %C.as.IndexWith.impl.At.type = struct_value () [concrete]
  322. // CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.483 = facet_value %C, (%IndexWith.impl_witness) [concrete]
  323. // CHECK:STDOUT: %IndexWith.WithSelf.At.type.10d: type = fn_type @IndexWith.WithSelf.At, @IndexWith.WithSelf(%empty_tuple.type, %empty_tuple.type, %IndexWith.facet) [concrete]
  324. // CHECK:STDOUT: %IndexWith.WithSelf.At.6ef: %IndexWith.WithSelf.At.type.10d = struct_value () [concrete]
  325. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  326. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  327. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  328. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  329. // CHECK:STDOUT: %.5ea: ref %C = temporary invalid, %C.val [concrete]
  330. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  331. // CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc15_15.2 [concrete]
  332. // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete]
  333. // CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.5ea, %Destroy.Op.651ba6.2 [concrete]
  334. // CHECK:STDOUT: }
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: imports {
  337. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  338. // CHECK:STDOUT: .IndexWith = %Core.IndexWith
  339. // CHECK:STDOUT: .Destroy = %Core.Destroy
  340. // CHECK:STDOUT: import Core//prelude
  341. // CHECK:STDOUT: import Core//core_wrong_arg_count
  342. // CHECK:STDOUT: import Core//prelude/...
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//core_wrong_arg_count, IndexWith, loaded [concrete = constants.%IndexWith.generic]
  345. // CHECK:STDOUT: %Core.import_ref.1c4 = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, unloaded
  346. // CHECK:STDOUT: %Core.At: @IndexWith.WithSelf.%IndexWith.WithSelf.At.type (%IndexWith.WithSelf.At.type.a9f) = import_ref Core//core_wrong_arg_count, At, loaded [symbolic = @IndexWith.WithSelf.%IndexWith.WithSelf.At (constants.%IndexWith.WithSelf.At.a38)]
  347. // CHECK:STDOUT: %Core.import_ref.d74 = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, unloaded
  348. // CHECK:STDOUT: %Core.import_ref.b3bc94.2: type = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%SubscriptType (constants.%SubscriptType)]
  349. // CHECK:STDOUT: %Core.import_ref.8e8b42.2: type = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%ElementType (constants.%ElementType)]
  350. // CHECK:STDOUT: %Core.import_ref.83171e.2: @IndexWith.%IndexWith.type (%IndexWith.type.1e9) = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%Self (constants.%Self.b10)]
  351. // CHECK:STDOUT: %Core.import_ref.60d = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, unloaded
  352. // CHECK:STDOUT: %Core.import_ref.b3bc94.3: type = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%SubscriptType (constants.%SubscriptType)]
  353. // CHECK:STDOUT: %Core.import_ref.8e8b42.3: type = import_ref Core//core_wrong_arg_count, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%ElementType (constants.%ElementType)]
  354. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: file {
  358. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  359. // CHECK:STDOUT: .Core = imports.%Core
  360. // CHECK:STDOUT: .C = %C.decl
  361. // CHECK:STDOUT: .F = %F.decl
  362. // CHECK:STDOUT: }
  363. // CHECK:STDOUT: %Core.import = import Core
  364. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  365. // CHECK:STDOUT: impl_decl @C.as.IndexWith.impl [concrete] {} {
  366. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  367. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  368. // CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic]
  369. // CHECK:STDOUT: %.loc8_27: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  370. // CHECK:STDOUT: %.loc8_31: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  371. // CHECK:STDOUT: %.loc8_32.1: type = converted %.loc8_27, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  372. // CHECK:STDOUT: %.loc8_32.2: type = converted %.loc8_31, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  373. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%empty_tuple.type, constants.%empty_tuple.type)> [concrete = constants.%IndexWith.type.483]
  374. // CHECK:STDOUT: }
  375. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  376. // CHECK:STDOUT: }
  377. // CHECK:STDOUT:
  378. // CHECK:STDOUT: generic interface @IndexWith(imports.%Core.import_ref.b3bc94.3: type, imports.%Core.import_ref.8e8b42.3: type) [from "core_wrong_arg_count.carbon"] {
  379. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)]
  380. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic = %ElementType (constants.%ElementType)]
  381. // CHECK:STDOUT:
  382. // CHECK:STDOUT: !definition:
  383. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.1e9)]
  384. // CHECK:STDOUT: %Self: @IndexWith.%IndexWith.type (%IndexWith.type.1e9) = symbolic_binding Self, 2 [symbolic = %Self (constants.%Self.b10)]
  385. // CHECK:STDOUT:
  386. // CHECK:STDOUT: interface {
  387. // CHECK:STDOUT: !members:
  388. // CHECK:STDOUT: .Self = imports.%Core.import_ref.60d
  389. // CHECK:STDOUT: .At = imports.%Core.import_ref.1c4
  390. // CHECK:STDOUT: witness = (imports.%Core.At)
  391. // CHECK:STDOUT:
  392. // CHECK:STDOUT: !requires:
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT: }
  395. // CHECK:STDOUT:
  396. // CHECK:STDOUT: impl @C.as.IndexWith.impl: %C.ref as %IndexWith.type {
  397. // 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] {
  398. // CHECK:STDOUT: %self.param_patt: %pattern_type.7c7 = value_param_pattern [concrete]
  399. // CHECK:STDOUT: %self.patt: %pattern_type.7c7 = at_binding_pattern self, %self.param_patt [concrete]
  400. // CHECK:STDOUT: %subscript.param_patt: %pattern_type.cb1 = value_param_pattern [concrete]
  401. // CHECK:STDOUT: %subscript.patt: %pattern_type.cb1 = at_binding_pattern subscript, %subscript.param_patt [concrete]
  402. // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern [concrete]
  403. // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc9_54.2 [concrete]
  404. // CHECK:STDOUT: } {
  405. // CHECK:STDOUT: %.loc9_54.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  406. // CHECK:STDOUT: %.loc9_54.2: type = converted %.loc9_54.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  407. // CHECK:STDOUT: %.loc9_54.3: Core.Form = init_form %.loc9_54.2 [concrete = constants.%.262]
  408. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  409. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.IndexWith.impl.%C.ref [concrete = constants.%C]
  410. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  411. // CHECK:STDOUT: %subscript.param: %empty_tuple.type = value_param call_param1
  412. // CHECK:STDOUT: %.loc9_47.1: type = splice_block %.loc9_47.3 [concrete = constants.%empty_tuple.type] {
  413. // CHECK:STDOUT: %.loc9_47.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  414. // CHECK:STDOUT: %.loc9_47.3: type = converted %.loc9_47.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  415. // CHECK:STDOUT: }
  416. // CHECK:STDOUT: %subscript: %empty_tuple.type = value_binding subscript, %subscript.param
  417. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param2
  418. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  419. // CHECK:STDOUT: }
  420. // CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (%C.as.IndexWith.impl.At.decl), @C.as.IndexWith.impl [concrete]
  421. // CHECK:STDOUT: %IndexWith.impl_witness: <witness> = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness]
  422. // CHECK:STDOUT:
  423. // CHECK:STDOUT: !members:
  424. // CHECK:STDOUT: .At = %C.as.IndexWith.impl.At.decl
  425. // CHECK:STDOUT: witness = %IndexWith.impl_witness
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: class @C {
  429. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  430. // CHECK:STDOUT: complete_type_witness = %complete_type
  431. // CHECK:STDOUT:
  432. // CHECK:STDOUT: !members:
  433. // CHECK:STDOUT: .Self = constants.%C
  434. // CHECK:STDOUT: }
  435. // CHECK:STDOUT:
  436. // CHECK:STDOUT: generic fn @IndexWith.WithSelf.At(imports.%Core.import_ref.b3bc94.2: type, imports.%Core.import_ref.8e8b42.2: type, imports.%Core.import_ref.83171e.2: @IndexWith.%IndexWith.type (%IndexWith.type.1e9)) [from "core_wrong_arg_count.carbon"] {
  437. // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)]
  438. // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic = %ElementType (constants.%ElementType)]
  439. // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.1e9)]
  440. // CHECK:STDOUT: %Self: @IndexWith.WithSelf.At.%IndexWith.type (%IndexWith.type.1e9) = symbolic_binding Self, 2 [symbolic = %Self (constants.%Self.b10)]
  441. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.6f2)]
  442. // CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.35b)]
  443. // CHECK:STDOUT: %pattern_type.2: type = pattern_type %SubscriptType [symbolic = %pattern_type.2 (constants.%pattern_type.51d)]
  444. // CHECK:STDOUT: %.1: Core.Form = init_form %ElementType [symbolic = %.1 (constants.%.822)]
  445. // CHECK:STDOUT: %pattern_type.3: type = pattern_type %ElementType [symbolic = %pattern_type.3 (constants.%pattern_type.946)]
  446. // CHECK:STDOUT:
  447. // CHECK:STDOUT: fn;
  448. // CHECK:STDOUT: }
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: fn @C.as.IndexWith.impl.At(%self.param: %C, %subscript.param: %empty_tuple.type) -> out %return.param: %empty_tuple.type {
  451. // CHECK:STDOUT: !entry:
  452. // CHECK:STDOUT: %.loc10_13.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  453. // CHECK:STDOUT: %.loc10_13.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
  454. // CHECK:STDOUT: %.loc10_14: init %empty_tuple.type = converted %.loc10_13.1, %.loc10_13.2 [concrete = constants.%empty_tuple]
  455. // CHECK:STDOUT: return %.loc10_14
  456. // CHECK:STDOUT: }
  457. // CHECK:STDOUT:
  458. // CHECK:STDOUT: fn @F() {
  459. // CHECK:STDOUT: !entry:
  460. // CHECK:STDOUT: name_binding_decl {
  461. // CHECK:STDOUT: %c.patt: %pattern_type.7c7 = value_binding_pattern c [concrete]
  462. // CHECK:STDOUT: }
  463. // CHECK:STDOUT: %.loc15_15.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  464. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  465. // CHECK:STDOUT: %.loc15_15.2: ref %C = temporary_storage
  466. // CHECK:STDOUT: %.loc15_15.3: init %C to %.loc15_15.2 = class_init () [concrete = constants.%C.val]
  467. // CHECK:STDOUT: %.loc15_15.4: init %C = converted %.loc15_15.1, %.loc15_15.3 [concrete = constants.%C.val]
  468. // CHECK:STDOUT: %.loc15_15.5: ref %C = temporary %.loc15_15.2, %.loc15_15.4 [concrete = constants.%.5ea]
  469. // CHECK:STDOUT: %.loc15_15.6: %C = acquire_value %.loc15_15.5 [concrete = constants.%C.val]
  470. // CHECK:STDOUT: %c: %C = value_binding c, %.loc15_15.6
  471. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  472. // CHECK:STDOUT: %.loc23: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  473. // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.5ea)
  474. // CHECK:STDOUT: return
  475. // CHECK:STDOUT: }
  476. // CHECK:STDOUT:
  477. // CHECK:STDOUT: fn @Destroy.Op.loc15_15.1(%self.param: ref %empty_struct_type) = "no_op";
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: fn @Destroy.Op.loc15_15.2(%self.param: ref %C) {
  480. // CHECK:STDOUT: !entry:
  481. // CHECK:STDOUT: return
  482. // CHECK:STDOUT: }
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType, constants.%ElementType) {
  485. // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType
  486. // CHECK:STDOUT: %ElementType => constants.%ElementType
  487. // CHECK:STDOUT: }
  488. // CHECK:STDOUT:
  489. // CHECK:STDOUT: specific @IndexWith.WithSelf(constants.%SubscriptType, constants.%ElementType, constants.%Self.b10) {}
  490. // CHECK:STDOUT:
  491. // CHECK:STDOUT: specific @IndexWith.WithSelf.At(constants.%SubscriptType, constants.%ElementType, constants.%Self.b10) {
  492. // CHECK:STDOUT: %SubscriptType => constants.%SubscriptType
  493. // CHECK:STDOUT: %ElementType => constants.%ElementType
  494. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.1e9
  495. // CHECK:STDOUT: %Self => constants.%Self.b10
  496. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.6f2
  497. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.35b
  498. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.51d
  499. // CHECK:STDOUT: %.1 => constants.%.822
  500. // CHECK:STDOUT: %pattern_type.3 => constants.%pattern_type.946
  501. // CHECK:STDOUT: }
  502. // CHECK:STDOUT:
  503. // CHECK:STDOUT: specific @IndexWith(constants.%empty_tuple.type, constants.%empty_tuple.type) {
  504. // CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type
  505. // CHECK:STDOUT: %ElementType => constants.%empty_tuple.type
  506. // CHECK:STDOUT:
  507. // CHECK:STDOUT: !definition:
  508. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.483
  509. // CHECK:STDOUT: %Self => constants.%Self.f44
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT:
  512. // CHECK:STDOUT: specific @IndexWith.WithSelf(constants.%empty_tuple.type, constants.%empty_tuple.type, constants.%Self.b10) {
  513. // CHECK:STDOUT: !definition:
  514. // CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type
  515. // CHECK:STDOUT: %ElementType => constants.%empty_tuple.type
  516. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.483
  517. // CHECK:STDOUT: %Self => constants.%Self.b10
  518. // CHECK:STDOUT: %IndexWith.WithSelf.At.type => constants.%IndexWith.WithSelf.At.type.9fb
  519. // CHECK:STDOUT: %IndexWith.WithSelf.At => constants.%IndexWith.WithSelf.At.0b7
  520. // CHECK:STDOUT: %IndexWith.assoc_type => constants.%IndexWith.assoc_type.d10
  521. // CHECK:STDOUT: %assoc0 => constants.%assoc0.6a8
  522. // CHECK:STDOUT: }
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: specific @IndexWith.WithSelf(constants.%empty_tuple.type, constants.%empty_tuple.type, constants.%IndexWith.facet) {
  525. // CHECK:STDOUT: !definition:
  526. // CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type
  527. // CHECK:STDOUT: %ElementType => constants.%empty_tuple.type
  528. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.483
  529. // CHECK:STDOUT: %Self => constants.%IndexWith.facet
  530. // CHECK:STDOUT: %IndexWith.WithSelf.At.type => constants.%IndexWith.WithSelf.At.type.10d
  531. // CHECK:STDOUT: %IndexWith.WithSelf.At => constants.%IndexWith.WithSelf.At.6ef
  532. // CHECK:STDOUT: %IndexWith.assoc_type => constants.%IndexWith.assoc_type.d10
  533. // CHECK:STDOUT: %assoc0 => constants.%assoc0.6a8
  534. // CHECK:STDOUT: }
  535. // CHECK:STDOUT:
  536. // CHECK:STDOUT: specific @IndexWith.WithSelf.At(constants.%empty_tuple.type, constants.%empty_tuple.type, constants.%IndexWith.facet) {
  537. // CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type
  538. // CHECK:STDOUT: %ElementType => constants.%empty_tuple.type
  539. // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.483
  540. // CHECK:STDOUT: %Self => constants.%IndexWith.facet
  541. // CHECK:STDOUT: %Self.as_type => constants.%C
  542. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.7c7
  543. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.cb1
  544. // CHECK:STDOUT: %.1 => constants.%.262
  545. // CHECK:STDOUT: %pattern_type.3 => constants.%pattern_type.cb1
  546. // CHECK:STDOUT: }
  547. // CHECK:STDOUT: