fail_expr_category.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/index/fail_expr_category.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_expr_category.carbon
  13. fn F() -> array(i32, 3);
  14. fn G(b: array(i32, 3)) {
  15. // Indexing an array value gives a value.
  16. // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error: cannot take the address of non-reference expression [AddrOfNonRef]
  17. // CHECK:STDERR: var pb: i32* = &b[0];
  18. // CHECK:STDERR: ^
  19. // CHECK:STDERR:
  20. var pb: i32* = &b[0];
  21. // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable]
  22. // CHECK:STDERR: b[0] = 4;
  23. // CHECK:STDERR: ^~~~
  24. // CHECK:STDERR:
  25. b[0] = 4;
  26. // Indexing an ephemeral reference (materialized from an initializing
  27. // expression) gives a value.
  28. // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error: cannot take the address of non-reference expression [AddrOfNonRef]
  29. // CHECK:STDERR: var pf: i32* = &F()[0];
  30. // CHECK:STDERR: ^
  31. // CHECK:STDERR:
  32. var pf: i32* = &F()[0];
  33. // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable]
  34. // CHECK:STDERR: F()[0] = 4;
  35. // CHECK:STDERR: ^~~~~~
  36. // CHECK:STDERR:
  37. F()[0] = 4;
  38. }
  39. // CHECK:STDOUT: --- fail_expr_category.carbon
  40. // CHECK:STDOUT:
  41. // CHECK:STDOUT: constants {
  42. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  43. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  44. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  45. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  46. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  47. // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [concrete]
  48. // CHECK:STDOUT: %pattern_type.5d8: type = pattern_type %array_type [concrete]
  49. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  50. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  51. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  52. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  53. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
  54. // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete]
  55. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  56. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  57. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  58. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  59. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  60. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  61. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.3, @impl.4f9(%To.c80) [symbolic]
  62. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  63. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  64. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.4f9(%int_32) [concrete]
  65. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  66. // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  67. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
  68. // CHECK:STDOUT: %Convert.bound.d04: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
  69. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.3(%int_32) [concrete]
  70. // CHECK:STDOUT: %bound_method.b6e: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn [concrete]
  71. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
  72. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
  73. // CHECK:STDOUT: %Convert.bound.ac3: <bound method> = bound_method %int_4.0c1, %Convert.956 [concrete]
  74. // CHECK:STDOUT: %bound_method.1da: <bound method> = bound_method %int_4.0c1, %Convert.specific_fn [concrete]
  75. // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
  76. // CHECK:STDOUT: }
  77. // CHECK:STDOUT:
  78. // CHECK:STDOUT: imports {
  79. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  80. // CHECK:STDOUT: .Int = %Core.Int
  81. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  82. // CHECK:STDOUT: import Core//prelude
  83. // CHECK:STDOUT: import Core//prelude/...
  84. // CHECK:STDOUT: }
  85. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  86. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  87. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  88. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  89. // CHECK:STDOUT: }
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: file {
  92. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  93. // CHECK:STDOUT: .Core = imports.%Core
  94. // CHECK:STDOUT: .F = %F.decl
  95. // CHECK:STDOUT: .G = %G.decl
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT: %Core.import = import Core
  98. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  99. // CHECK:STDOUT: %return.patt: %pattern_type.5d8 = return_slot_pattern [concrete]
  100. // CHECK:STDOUT: %return.param_patt: %pattern_type.5d8 = out_param_pattern %return.patt, call_param0 [concrete]
  101. // CHECK:STDOUT: } {
  102. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  103. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  104. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  105. // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [concrete = constants.%array_type]
  106. // CHECK:STDOUT: %return.param: ref %array_type = out_param call_param0
  107. // CHECK:STDOUT: %return: ref %array_type = return_slot %return.param
  108. // CHECK:STDOUT: }
  109. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  110. // CHECK:STDOUT: %b.patt: %pattern_type.5d8 = binding_pattern b [concrete]
  111. // CHECK:STDOUT: %b.param_patt: %pattern_type.5d8 = value_param_pattern %b.patt, call_param0 [concrete]
  112. // CHECK:STDOUT: } {
  113. // CHECK:STDOUT: %b.param: %array_type = value_param call_param0
  114. // CHECK:STDOUT: %.loc16: type = splice_block %array_type [concrete = constants.%array_type] {
  115. // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  116. // CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  117. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  118. // CHECK:STDOUT: %array_type: type = array_type %int_3, %i32.loc16 [concrete = constants.%array_type]
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT: %b: %array_type = bind_name b, %b.param
  121. // CHECK:STDOUT: }
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT:
  124. // CHECK:STDOUT: fn @F() -> %return.param: %array_type;
  125. // CHECK:STDOUT:
  126. // CHECK:STDOUT: fn @G(%b.param: %array_type) {
  127. // CHECK:STDOUT: !entry:
  128. // CHECK:STDOUT: name_binding_decl {
  129. // CHECK:STDOUT: %pb.patt: %pattern_type.fe8 = binding_pattern pb [concrete]
  130. // CHECK:STDOUT: %pb.var_patt: %pattern_type.fe8 = var_pattern %pb.patt [concrete]
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT: %pb.var: ref %ptr.235 = var %pb.var_patt
  133. // CHECK:STDOUT: %b.ref.loc22: %array_type = name_ref b, %b
  134. // CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  135. // CHECK:STDOUT: %int_32.loc22_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  136. // CHECK:STDOUT: %i32.loc22_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  137. // CHECK:STDOUT: %impl.elem0.loc22: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  138. // CHECK:STDOUT: %bound_method.loc22_21.1: <bound method> = bound_method %int_0.loc22, %impl.elem0.loc22 [concrete = constants.%Convert.bound.d04]
  139. // CHECK:STDOUT: %specific_fn.loc22: <specific function> = specific_function %impl.elem0.loc22, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  140. // CHECK:STDOUT: %bound_method.loc22_21.2: <bound method> = bound_method %int_0.loc22, %specific_fn.loc22 [concrete = constants.%bound_method.b6e]
  141. // CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %bound_method.loc22_21.2(%int_0.loc22) [concrete = constants.%int_0.6a9]
  142. // CHECK:STDOUT: %.loc22_21.1: %i32 = value_of_initializer %int.convert_checked.loc22 [concrete = constants.%int_0.6a9]
  143. // CHECK:STDOUT: %.loc22_21.2: %i32 = converted %int_0.loc22, %.loc22_21.1 [concrete = constants.%int_0.6a9]
  144. // CHECK:STDOUT: %.loc22_22.1: ref %array_type = value_as_ref %b.ref.loc22
  145. // CHECK:STDOUT: %.loc22_22.2: ref %i32 = array_index %.loc22_22.1, %.loc22_21.2
  146. // CHECK:STDOUT: %.loc22_22.3: %i32 = bind_value %.loc22_22.2
  147. // CHECK:STDOUT: %addr.loc22: %ptr.235 = addr_of <error> [concrete = <error>]
  148. // CHECK:STDOUT: assign %pb.var, %addr.loc22
  149. // CHECK:STDOUT: %.loc22_14: type = splice_block %ptr.loc22 [concrete = constants.%ptr.235] {
  150. // CHECK:STDOUT: %int_32.loc22_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  151. // CHECK:STDOUT: %i32.loc22_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  152. // CHECK:STDOUT: %ptr.loc22: type = ptr_type %i32.loc22_11 [concrete = constants.%ptr.235]
  153. // CHECK:STDOUT: }
  154. // CHECK:STDOUT: %pb: ref %ptr.235 = bind_name pb, %pb.var
  155. // CHECK:STDOUT: %b.ref.loc27: %array_type = name_ref b, %b
  156. // CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  157. // CHECK:STDOUT: %int_32.loc27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  158. // CHECK:STDOUT: %i32.loc27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  159. // CHECK:STDOUT: %impl.elem0.loc27_5: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  160. // CHECK:STDOUT: %bound_method.loc27_5.1: <bound method> = bound_method %int_0.loc27, %impl.elem0.loc27_5 [concrete = constants.%Convert.bound.d04]
  161. // CHECK:STDOUT: %specific_fn.loc27_5: <specific function> = specific_function %impl.elem0.loc27_5, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  162. // CHECK:STDOUT: %bound_method.loc27_5.2: <bound method> = bound_method %int_0.loc27, %specific_fn.loc27_5 [concrete = constants.%bound_method.b6e]
  163. // CHECK:STDOUT: %int.convert_checked.loc27_5: init %i32 = call %bound_method.loc27_5.2(%int_0.loc27) [concrete = constants.%int_0.6a9]
  164. // CHECK:STDOUT: %.loc27_5.1: %i32 = value_of_initializer %int.convert_checked.loc27_5 [concrete = constants.%int_0.6a9]
  165. // CHECK:STDOUT: %.loc27_5.2: %i32 = converted %int_0.loc27, %.loc27_5.1 [concrete = constants.%int_0.6a9]
  166. // CHECK:STDOUT: %.loc27_6.1: ref %array_type = value_as_ref %b.ref.loc27
  167. // CHECK:STDOUT: %.loc27_6.2: ref %i32 = array_index %.loc27_6.1, %.loc27_5.2
  168. // CHECK:STDOUT: %.loc27_6.3: %i32 = bind_value %.loc27_6.2
  169. // CHECK:STDOUT: %int_4.loc27: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  170. // CHECK:STDOUT: %impl.elem0.loc27_8: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  171. // CHECK:STDOUT: %bound_method.loc27_8.1: <bound method> = bound_method %int_4.loc27, %impl.elem0.loc27_8 [concrete = constants.%Convert.bound.ac3]
  172. // CHECK:STDOUT: %specific_fn.loc27_8: <specific function> = specific_function %impl.elem0.loc27_8, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  173. // CHECK:STDOUT: %bound_method.loc27_8.2: <bound method> = bound_method %int_4.loc27, %specific_fn.loc27_8 [concrete = constants.%bound_method.1da]
  174. // CHECK:STDOUT: %int.convert_checked.loc27_8: init %i32 = call %bound_method.loc27_8.2(%int_4.loc27) [concrete = constants.%int_4.940]
  175. // CHECK:STDOUT: %.loc27_8: init %i32 = converted %int_4.loc27, %int.convert_checked.loc27_8 [concrete = constants.%int_4.940]
  176. // CHECK:STDOUT: assign %.loc27_6.3, %.loc27_8
  177. // CHECK:STDOUT: name_binding_decl {
  178. // CHECK:STDOUT: %pf.patt: %pattern_type.fe8 = binding_pattern pf [concrete]
  179. // CHECK:STDOUT: %pf.var_patt: %pattern_type.fe8 = var_pattern %pf.patt [concrete]
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT: %pf.var: ref %ptr.235 = var %pf.var_patt
  182. // CHECK:STDOUT: %F.ref.loc35: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  183. // CHECK:STDOUT: %.loc35_21.1: ref %array_type = temporary_storage
  184. // CHECK:STDOUT: %F.call.loc35: init %array_type = call %F.ref.loc35() to %.loc35_21.1
  185. // CHECK:STDOUT: %int_0.loc35: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  186. // CHECK:STDOUT: %.loc35_21.2: ref %array_type = temporary %.loc35_21.1, %F.call.loc35
  187. // CHECK:STDOUT: %int_32.loc35_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  188. // CHECK:STDOUT: %i32.loc35_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  189. // CHECK:STDOUT: %impl.elem0.loc35: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  190. // CHECK:STDOUT: %bound_method.loc35_23.1: <bound method> = bound_method %int_0.loc35, %impl.elem0.loc35 [concrete = constants.%Convert.bound.d04]
  191. // CHECK:STDOUT: %specific_fn.loc35: <specific function> = specific_function %impl.elem0.loc35, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  192. // CHECK:STDOUT: %bound_method.loc35_23.2: <bound method> = bound_method %int_0.loc35, %specific_fn.loc35 [concrete = constants.%bound_method.b6e]
  193. // CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %bound_method.loc35_23.2(%int_0.loc35) [concrete = constants.%int_0.6a9]
  194. // CHECK:STDOUT: %.loc35_23.1: %i32 = value_of_initializer %int.convert_checked.loc35 [concrete = constants.%int_0.6a9]
  195. // CHECK:STDOUT: %.loc35_23.2: %i32 = converted %int_0.loc35, %.loc35_23.1 [concrete = constants.%int_0.6a9]
  196. // CHECK:STDOUT: %.loc35_24.1: ref %i32 = array_index %.loc35_21.2, %.loc35_23.2
  197. // CHECK:STDOUT: %.loc35_24.2: %i32 = bind_value %.loc35_24.1
  198. // CHECK:STDOUT: %addr.loc35: %ptr.235 = addr_of <error> [concrete = <error>]
  199. // CHECK:STDOUT: assign %pf.var, %addr.loc35
  200. // CHECK:STDOUT: %.loc35_14: type = splice_block %ptr.loc35 [concrete = constants.%ptr.235] {
  201. // CHECK:STDOUT: %int_32.loc35_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  202. // CHECK:STDOUT: %i32.loc35_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  203. // CHECK:STDOUT: %ptr.loc35: type = ptr_type %i32.loc35_11 [concrete = constants.%ptr.235]
  204. // CHECK:STDOUT: }
  205. // CHECK:STDOUT: %pf: ref %ptr.235 = bind_name pf, %pf.var
  206. // CHECK:STDOUT: %F.ref.loc40: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  207. // CHECK:STDOUT: %.loc40_5.1: ref %array_type = temporary_storage
  208. // CHECK:STDOUT: %F.call.loc40: init %array_type = call %F.ref.loc40() to %.loc40_5.1
  209. // CHECK:STDOUT: %int_0.loc40: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  210. // CHECK:STDOUT: %.loc40_5.2: ref %array_type = temporary %.loc40_5.1, %F.call.loc40
  211. // CHECK:STDOUT: %int_32.loc40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  212. // CHECK:STDOUT: %i32.loc40: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  213. // CHECK:STDOUT: %impl.elem0.loc40_7: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  214. // CHECK:STDOUT: %bound_method.loc40_7.1: <bound method> = bound_method %int_0.loc40, %impl.elem0.loc40_7 [concrete = constants.%Convert.bound.d04]
  215. // CHECK:STDOUT: %specific_fn.loc40_7: <specific function> = specific_function %impl.elem0.loc40_7, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  216. // CHECK:STDOUT: %bound_method.loc40_7.2: <bound method> = bound_method %int_0.loc40, %specific_fn.loc40_7 [concrete = constants.%bound_method.b6e]
  217. // CHECK:STDOUT: %int.convert_checked.loc40_7: init %i32 = call %bound_method.loc40_7.2(%int_0.loc40) [concrete = constants.%int_0.6a9]
  218. // CHECK:STDOUT: %.loc40_7.1: %i32 = value_of_initializer %int.convert_checked.loc40_7 [concrete = constants.%int_0.6a9]
  219. // CHECK:STDOUT: %.loc40_7.2: %i32 = converted %int_0.loc40, %.loc40_7.1 [concrete = constants.%int_0.6a9]
  220. // CHECK:STDOUT: %.loc40_8.1: ref %i32 = array_index %.loc40_5.2, %.loc40_7.2
  221. // CHECK:STDOUT: %.loc40_8.2: %i32 = bind_value %.loc40_8.1
  222. // CHECK:STDOUT: %int_4.loc40: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  223. // CHECK:STDOUT: %impl.elem0.loc40_10: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  224. // CHECK:STDOUT: %bound_method.loc40_10.1: <bound method> = bound_method %int_4.loc40, %impl.elem0.loc40_10 [concrete = constants.%Convert.bound.ac3]
  225. // CHECK:STDOUT: %specific_fn.loc40_10: <specific function> = specific_function %impl.elem0.loc40_10, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  226. // CHECK:STDOUT: %bound_method.loc40_10.2: <bound method> = bound_method %int_4.loc40, %specific_fn.loc40_10 [concrete = constants.%bound_method.1da]
  227. // CHECK:STDOUT: %int.convert_checked.loc40_10: init %i32 = call %bound_method.loc40_10.2(%int_4.loc40) [concrete = constants.%int_4.940]
  228. // CHECK:STDOUT: %.loc40_10: init %i32 = converted %int_4.loc40, %int.convert_checked.loc40_10 [concrete = constants.%int_4.940]
  229. // CHECK:STDOUT: assign %.loc40_8.2, %.loc40_10
  230. // CHECK:STDOUT: return
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT: