array.carbon 118 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542
  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/int.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/deduce/array.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/deduce/array.carbon
  14. // --- type_only.carbon
  15. library "[[@TEST_NAME]]";
  16. class C {}
  17. fn F[T:! type](a: array(T, 3)) -> T { return F(a); }
  18. fn G() -> C {
  19. var a: array(C, 3) = ({}, {}, {});
  20. return F(a);
  21. }
  22. // --- bound_only.carbon
  23. library "[[@TEST_NAME]]";
  24. class C {}
  25. fn F[N:! Core.IntLiteral()](a: array(C, N)) -> i32 { return N; }
  26. fn G() -> i32 {
  27. var a: array(C, 3) = ({}, {}, {});
  28. return F(a);
  29. }
  30. // --- type_and_bound.carbon
  31. library "[[@TEST_NAME]]";
  32. class C {}
  33. fn F[T:! type, N:! Core.IntLiteral()](a: array(T, N)) {}
  34. fn G() {
  35. var a: array(C, 3) = ({}, {}, {});
  36. F(a);
  37. }
  38. // --- fail_bound_mismatch.carbon
  39. library "[[@TEST_NAME]]";
  40. class C {}
  41. fn F[T:! type](a: array(T, 2)) -> T { return F(a); }
  42. fn G() -> C {
  43. // TODO: We succeed at deducing T here but fail to convert. Is this the right behavior?
  44. var a: array(C, 3) = ({}, {}, {});
  45. // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+10]]:12: error: cannot implicitly convert expression of type `array(C, 3)` to `array(C, 2)` [ConversionFailure]
  46. // CHECK:STDERR: return F(a);
  47. // CHECK:STDERR: ^
  48. // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+7]]:12: note: type `array(C, 3)` does not implement interface `Core.ImplicitAs(array(C, 2))` [MissingImplInMemberAccessNote]
  49. // CHECK:STDERR: return F(a);
  50. // CHECK:STDERR: ^
  51. // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE-11]]:16: note: initializing function parameter [InCallToFunctionParam]
  52. // CHECK:STDERR: fn F[T:! type](a: array(T, 2)) -> T { return F(a); }
  53. // CHECK:STDERR: ^~~~~~~~~~~~~~
  54. // CHECK:STDERR:
  55. return F(a);
  56. }
  57. // --- fail_type_mismatch.carbon
  58. library "[[@TEST_NAME]]";
  59. class C {}
  60. class D {}
  61. fn F[N:! Core.IntLiteral()](a: array(C, N)) -> i32 { return N; }
  62. fn G() -> i32 {
  63. // TODO: We succeed at deducing N here but fail to convert. Is this the right behavior?
  64. var a: array(D, 3) = ({}, {}, {});
  65. // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+10]]:12: error: cannot implicitly convert expression of type `array(D, 3)` to `array(C, 3)` [ConversionFailure]
  66. // CHECK:STDERR: return F(a);
  67. // CHECK:STDERR: ^
  68. // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:12: note: type `array(D, 3)` does not implement interface `Core.ImplicitAs(array(C, 3))` [MissingImplInMemberAccessNote]
  69. // CHECK:STDERR: return F(a);
  70. // CHECK:STDERR: ^
  71. // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-11]]:29: note: initializing function parameter [InCallToFunctionParam]
  72. // CHECK:STDERR: fn F[N:! Core.IntLiteral()](a: array(C, N)) -> i32 { return N; }
  73. // CHECK:STDERR: ^~~~~~~~~~~~~~
  74. // CHECK:STDERR:
  75. return F(a);
  76. }
  77. // --- fail_bound_type_mismatch.carbon
  78. library "[[@TEST_NAME]]";
  79. class C {}
  80. fn F[N:! i32](a: array(C, N)) -> i32 { return N; }
  81. fn G() -> i32 {
  82. var a: array(C, 3) = ({}, {}, {});
  83. // TODO: This fails because the array bound in `F` is effectively
  84. // `N.(ImplicitAs(IntLiteral).Convert)()`
  85. // which we can't deduce through. We should decide if we want to support
  86. // deductions of that form. If not, it'd be nice to diagnose this situation
  87. // better.
  88. // CHECK:STDERR: fail_bound_type_mismatch.carbon:[[@LINE+7]]:10: error: cannot deduce value for generic parameter `N` [DeductionIncomplete]
  89. // CHECK:STDERR: return F(a);
  90. // CHECK:STDERR: ^~~~
  91. // CHECK:STDERR: fail_bound_type_mismatch.carbon:[[@LINE-12]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  92. // CHECK:STDERR: fn F[N:! i32](a: array(C, N)) -> i32 { return N; }
  93. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94. // CHECK:STDERR:
  95. return F(a);
  96. }
  97. // --- fail_todo_array_length_from_tuple.carbon
  98. library "[[@TEST_NAME]]";
  99. class C {}
  100. fn F[N:! i32](a: array(C, N)) {}
  101. fn G() {
  102. // TODO: Deduce N as 3 from the tuple's size.
  103. //
  104. // CHECK:STDERR: fail_todo_array_length_from_tuple.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `N` [DeductionIncomplete]
  105. // CHECK:STDERR: F(({}, {}, {}));
  106. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  107. // CHECK:STDERR: fail_todo_array_length_from_tuple.carbon:[[@LINE-8]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  108. // CHECK:STDERR: fn F[N:! i32](a: array(C, N)) {}
  109. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  110. // CHECK:STDERR:
  111. F(({}, {}, {}));
  112. }
  113. // CHECK:STDOUT: --- type_only.carbon
  114. // CHECK:STDOUT:
  115. // CHECK:STDOUT: constants {
  116. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  117. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  118. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  119. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  120. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  121. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  122. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  123. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  124. // CHECK:STDOUT: %array_type.d35: type = array_type %int_3, %T [symbolic]
  125. // CHECK:STDOUT: %pattern_type.f88: type = pattern_type %array_type.d35 [symbolic]
  126. // CHECK:STDOUT: %pattern_type.e68: type = pattern_type %T [symbolic]
  127. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  128. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  129. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  130. // CHECK:STDOUT: %require_complete.4b7: <witness> = require_complete_type %T [symbolic]
  131. // CHECK:STDOUT: %require_complete.e8a: <witness> = require_complete_type %array_type.d35 [symbolic]
  132. // CHECK:STDOUT: %F.specific_fn.96e: <specific function> = specific_function %F, @F(%T) [symbolic]
  133. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  134. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  135. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  136. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  137. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  138. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  139. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  140. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  141. // CHECK:STDOUT: %tuple: %tuple.type.8d4 = tuple_value (%empty_struct, %empty_struct, %empty_struct) [concrete]
  142. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  143. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  144. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  145. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  146. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  147. // CHECK:STDOUT: %F.specific_fn.04a: <specific function> = specific_function %F, @F(%C) [concrete]
  148. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  149. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  150. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  151. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  152. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014 = struct_value () [concrete]
  153. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  154. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT:
  157. // CHECK:STDOUT: imports {
  158. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  159. // CHECK:STDOUT: .Destroy = %Core.Destroy
  160. // CHECK:STDOUT: import Core//prelude
  161. // CHECK:STDOUT: import Core//prelude/...
  162. // CHECK:STDOUT: }
  163. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  164. // CHECK:STDOUT: }
  165. // CHECK:STDOUT:
  166. // CHECK:STDOUT: file {
  167. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  168. // CHECK:STDOUT: .Core = imports.%Core
  169. // CHECK:STDOUT: .C = %C.decl
  170. // CHECK:STDOUT: .F = %F.decl
  171. // CHECK:STDOUT: .G = %G.decl
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT: %Core.import = import Core
  174. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  175. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  176. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  177. // CHECK:STDOUT: %a.patt: @F.%pattern_type.loc6_16 (%pattern_type.f88) = value_binding_pattern a [concrete]
  178. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc6_16 (%pattern_type.f88) = value_param_pattern %a.patt, call_param0 [concrete]
  179. // CHECK:STDOUT: %return.patt: @F.%pattern_type.loc6_32 (%pattern_type.e68) = return_slot_pattern [concrete]
  180. // CHECK:STDOUT: %return.param_patt: @F.%pattern_type.loc6_32 (%pattern_type.e68) = out_param_pattern %return.patt, call_param1 [concrete]
  181. // CHECK:STDOUT: } {
  182. // CHECK:STDOUT: %T.ref.loc6_35: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  183. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  184. // CHECK:STDOUT: %T.loc6_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  185. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_29.1 (%array_type.d35) = value_param call_param0
  186. // CHECK:STDOUT: %.loc6_29: type = splice_block %array_type.loc6_29.2 [symbolic = %array_type.loc6_29.1 (constants.%array_type.d35)] {
  187. // CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  188. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  189. // CHECK:STDOUT: %array_type.loc6_29.2: type = array_type %int_3, %T.ref.loc6_25 [symbolic = %array_type.loc6_29.1 (constants.%array_type.d35)]
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT: %a: @F.%array_type.loc6_29.1 (%array_type.d35) = value_binding a, %a.param
  192. // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.1 (%T) = out_param call_param1
  193. // CHECK:STDOUT: %return: ref @F.%T.loc6_6.1 (%T) = return_slot %return.param
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  196. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  197. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param0 [concrete]
  198. // CHECK:STDOUT: } {
  199. // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
  200. // CHECK:STDOUT: %return.param: ref %C = out_param call_param0
  201. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT: }
  204. // CHECK:STDOUT:
  205. // CHECK:STDOUT: class @C {
  206. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  207. // CHECK:STDOUT: complete_type_witness = %complete_type
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: !members:
  210. // CHECK:STDOUT: .Self = constants.%C
  211. // CHECK:STDOUT: }
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type) {
  214. // CHECK:STDOUT: %T.loc6_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  215. // CHECK:STDOUT: %array_type.loc6_29.1: type = array_type constants.%int_3, %T.loc6_6.1 [symbolic = %array_type.loc6_29.1 (constants.%array_type.d35)]
  216. // CHECK:STDOUT: %pattern_type.loc6_16: type = pattern_type %array_type.loc6_29.1 [symbolic = %pattern_type.loc6_16 (constants.%pattern_type.f88)]
  217. // CHECK:STDOUT: %pattern_type.loc6_32: type = pattern_type %T.loc6_6.1 [symbolic = %pattern_type.loc6_32 (constants.%pattern_type.e68)]
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: !definition:
  220. // CHECK:STDOUT: %require_complete.loc6_32: <witness> = require_complete_type %T.loc6_6.1 [symbolic = %require_complete.loc6_32 (constants.%require_complete.4b7)]
  221. // CHECK:STDOUT: %require_complete.loc6_17: <witness> = require_complete_type %array_type.loc6_29.1 [symbolic = %require_complete.loc6_17 (constants.%require_complete.e8a)]
  222. // CHECK:STDOUT: %F.specific_fn.loc6_46.2: <specific function> = specific_function constants.%F, @F(%T.loc6_6.1) [symbolic = %F.specific_fn.loc6_46.2 (constants.%F.specific_fn.96e)]
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_29.1 (%array_type.d35)) -> %return.param: @F.%T.loc6_6.1 (%T) {
  225. // CHECK:STDOUT: !entry:
  226. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  227. // CHECK:STDOUT: %a.ref: @F.%array_type.loc6_29.1 (%array_type.d35) = name_ref a, %a
  228. // CHECK:STDOUT: %F.specific_fn.loc6_46.1: <specific function> = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc6_46.2 (constants.%F.specific_fn.96e)]
  229. // CHECK:STDOUT: %.loc6_32: ref @F.%T.loc6_6.1 (%T) = splice_block %return {}
  230. // CHECK:STDOUT: %F.call: init @F.%T.loc6_6.1 (%T) = call %F.specific_fn.loc6_46.1(%a.ref) to %.loc6_32
  231. // CHECK:STDOUT: return %F.call to %return
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: fn @G() -> %return.param: %C {
  236. // CHECK:STDOUT: !entry:
  237. // CHECK:STDOUT: name_binding_decl {
  238. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = ref_binding_pattern a [concrete]
  239. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  242. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  243. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  244. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  245. // CHECK:STDOUT: %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1) [concrete = constants.%tuple]
  246. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  247. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  248. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  249. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  250. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  251. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  252. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  253. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  254. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  255. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  256. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  257. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  258. // CHECK:STDOUT: %.loc9_35.8: init %array_type.002 = array_init (%.loc9_35.3, %.loc9_35.5, %.loc9_35.7) to %a.var [concrete = constants.%array]
  259. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  260. // CHECK:STDOUT: assign %a.var, %.loc9_3
  261. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  262. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [concrete = constants.%C]
  263. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  264. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref.loc9 [concrete = constants.%array_type.002]
  265. // CHECK:STDOUT: }
  266. // CHECK:STDOUT: %a: ref %array_type.002 = ref_binding a, %a.var
  267. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  268. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  269. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C) [concrete = constants.%F.specific_fn.04a]
  270. // CHECK:STDOUT: %.loc8: ref %C = splice_block %return {}
  271. // CHECK:STDOUT: %.loc10: %array_type.002 = acquire_value %a.ref
  272. // CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(%.loc10) to %.loc8
  273. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9cb
  274. // 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.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  275. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  276. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  277. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  278. // CHECK:STDOUT: return %F.call to %return
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: specific @F(constants.%T) {
  282. // CHECK:STDOUT: %T.loc6_6.1 => constants.%T
  283. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.d35
  284. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.f88
  285. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.e68
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: !definition:
  288. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%require_complete.4b7
  289. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%require_complete.e8a
  290. // CHECK:STDOUT: %F.specific_fn.loc6_46.2 => constants.%F.specific_fn.96e
  291. // CHECK:STDOUT: }
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: specific @F(constants.%C) {
  294. // CHECK:STDOUT: %T.loc6_6.1 => constants.%C
  295. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.002
  296. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.a63
  297. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.c48
  298. // CHECK:STDOUT:
  299. // CHECK:STDOUT: !definition:
  300. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%complete_type.357
  301. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.dd1
  302. // CHECK:STDOUT: %F.specific_fn.loc6_46.2 => constants.%F.specific_fn.04a
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: --- bound_only.carbon
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: constants {
  308. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  309. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  310. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  311. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  312. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  313. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  314. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  315. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  316. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  317. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  318. // CHECK:STDOUT: %array_type.60b: type = array_type %N, %C [symbolic]
  319. // CHECK:STDOUT: %pattern_type.e6e: type = pattern_type %array_type.60b [symbolic]
  320. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  321. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  322. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  323. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  324. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  325. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  326. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  327. // CHECK:STDOUT: %require_complete.3ac: <witness> = require_complete_type %array_type.60b [symbolic]
  328. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  329. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  330. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  331. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  332. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  333. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  334. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.2a1: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51 = struct_value () [symbolic]
  335. // CHECK:STDOUT: %ImplicitAs.impl_witness.bc9: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.132, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  336. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.51e: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  337. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.51e = struct_value () [concrete]
  338. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.bc9) [concrete]
  339. // CHECK:STDOUT: %.322: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  340. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.349: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [symbolic]
  341. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  342. // CHECK:STDOUT: %bound_method.693: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  343. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.693(%N) [symbolic]
  344. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  345. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  346. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  347. // CHECK:STDOUT: %array_type.002: type = array_type %int_3.1ba, %C [concrete]
  348. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  349. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  350. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  351. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  352. // CHECK:STDOUT: %tuple: %tuple.type.8d4 = tuple_value (%empty_struct, %empty_struct, %empty_struct) [concrete]
  353. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  354. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  355. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  356. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  357. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  358. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%int_3.1ba) [concrete]
  359. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  360. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  361. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  362. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  363. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014 = struct_value () [concrete]
  364. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  365. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  366. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [concrete]
  367. // CHECK:STDOUT: %bound_method.def: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  368. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  369. // CHECK:STDOUT: }
  370. // CHECK:STDOUT:
  371. // CHECK:STDOUT: imports {
  372. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  373. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  374. // CHECK:STDOUT: .Int = %Core.Int
  375. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  376. // CHECK:STDOUT: .Destroy = %Core.Destroy
  377. // CHECK:STDOUT: import Core//prelude
  378. // CHECK:STDOUT: import Core//prelude/...
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  381. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  382. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  383. // CHECK:STDOUT: %Core.import_ref.e24: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.2a1)]
  384. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.132 = impl_witness_table (%Core.import_ref.e24), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  385. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: file {
  389. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  390. // CHECK:STDOUT: .Core = imports.%Core
  391. // CHECK:STDOUT: .C = %C.decl
  392. // CHECK:STDOUT: .F = %F.decl
  393. // CHECK:STDOUT: .G = %G.decl
  394. // CHECK:STDOUT: }
  395. // CHECK:STDOUT: %Core.import = import Core
  396. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  397. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  398. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete]
  399. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.e6e) = value_binding_pattern a [concrete]
  400. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.e6e) = value_param_pattern %a.patt, call_param0 [concrete]
  401. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  402. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  403. // CHECK:STDOUT: } {
  404. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  405. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  406. // CHECK:STDOUT: %.loc6_26.1: type = splice_block %.loc6_26.3 [concrete = Core.IntLiteral] {
  407. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  408. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  409. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  410. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  411. // CHECK:STDOUT: %.loc6_26.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  412. // CHECK:STDOUT: %.loc6_26.3: type = converted %IntLiteral.call, %.loc6_26.2 [concrete = Core.IntLiteral]
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT: %N.loc6_6.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N)]
  415. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_42.1 (%array_type.60b) = value_param call_param0
  416. // CHECK:STDOUT: %.loc6_42: type = splice_block %array_type.loc6_42.2 [symbolic = %array_type.loc6_42.1 (constants.%array_type.60b)] {
  417. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  418. // CHECK:STDOUT: %N.ref.loc6_41: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)]
  419. // CHECK:STDOUT: %array_type.loc6_42.2: type = array_type %N.ref.loc6_41, %C.ref [symbolic = %array_type.loc6_42.1 (constants.%array_type.60b)]
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT: %a: @F.%array_type.loc6_42.1 (%array_type.60b) = value_binding a, %a.param
  422. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  423. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  424. // CHECK:STDOUT: }
  425. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  426. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  427. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  428. // CHECK:STDOUT: } {
  429. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  430. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  431. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  432. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  433. // CHECK:STDOUT: }
  434. // CHECK:STDOUT: }
  435. // CHECK:STDOUT:
  436. // CHECK:STDOUT: class @C {
  437. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  438. // CHECK:STDOUT: complete_type_witness = %complete_type
  439. // CHECK:STDOUT:
  440. // CHECK:STDOUT: !members:
  441. // CHECK:STDOUT: .Self = constants.%C
  442. // CHECK:STDOUT: }
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: generic fn @F(%N.loc6_6.2: Core.IntLiteral) {
  445. // CHECK:STDOUT: %N.loc6_6.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N)]
  446. // CHECK:STDOUT: %array_type.loc6_42.1: type = array_type %N.loc6_6.1, constants.%C [symbolic = %array_type.loc6_42.1 (constants.%array_type.60b)]
  447. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_42.1 [symbolic = %pattern_type (constants.%pattern_type.e6e)]
  448. // CHECK:STDOUT:
  449. // CHECK:STDOUT: !definition:
  450. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc6_42.1 [symbolic = %require_complete (constants.%require_complete.3ac)]
  451. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc6_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.349)]
  452. // CHECK:STDOUT: %bound_method.loc6_62.3: <bound method> = bound_method %N.loc6_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_62.3 (constants.%bound_method.693)]
  453. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2: init %i32 = call %bound_method.loc6_62.3(%N.loc6_6.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_42.1 (%array_type.60b)) -> %i32 {
  456. // CHECK:STDOUT: !entry:
  457. // CHECK:STDOUT: %N.ref.loc6_61: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)]
  458. // CHECK:STDOUT: %impl.elem0: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  459. // CHECK:STDOUT: %bound_method.loc6_62.1: <bound method> = bound_method %N.ref.loc6_61, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.349)]
  460. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  461. // CHECK:STDOUT: %bound_method.loc6_62.2: <bound method> = bound_method %N.ref.loc6_61, %specific_fn [symbolic = %bound_method.loc6_62.3 (constants.%bound_method.693)]
  462. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.1: init %i32 = call %bound_method.loc6_62.2(%N.ref.loc6_61) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  463. // CHECK:STDOUT: %.loc6_62: init %i32 = converted %N.ref.loc6_61, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  464. // CHECK:STDOUT: return %.loc6_62 to %return
  465. // CHECK:STDOUT: }
  466. // CHECK:STDOUT: }
  467. // CHECK:STDOUT:
  468. // CHECK:STDOUT: fn @G() -> %i32 {
  469. // CHECK:STDOUT: !entry:
  470. // CHECK:STDOUT: name_binding_decl {
  471. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = ref_binding_pattern a [concrete]
  472. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  473. // CHECK:STDOUT: }
  474. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  475. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  476. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  477. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  478. // CHECK:STDOUT: %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1) [concrete = constants.%tuple]
  479. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  480. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  481. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  482. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  483. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  484. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  485. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  486. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  487. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  488. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  489. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  490. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  491. // CHECK:STDOUT: %.loc9_35.8: init %array_type.002 = array_init (%.loc9_35.3, %.loc9_35.5, %.loc9_35.7) to %a.var [concrete = constants.%array]
  492. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  493. // CHECK:STDOUT: assign %a.var, %.loc9_3
  494. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  495. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  496. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  497. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref [concrete = constants.%array_type.002]
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT: %a: ref %array_type.002 = ref_binding a, %a.var
  500. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  501. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  502. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%int_3.1ba) [concrete = constants.%F.specific_fn]
  503. // CHECK:STDOUT: %.loc10: %array_type.002 = acquire_value %a.ref
  504. // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%.loc10)
  505. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9cb
  506. // 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.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  507. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  508. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  509. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  510. // CHECK:STDOUT: return %F.call to %return
  511. // CHECK:STDOUT: }
  512. // CHECK:STDOUT:
  513. // CHECK:STDOUT: specific @F(constants.%N) {
  514. // CHECK:STDOUT: %N.loc6_6.1 => constants.%N
  515. // CHECK:STDOUT: %array_type.loc6_42.1 => constants.%array_type.60b
  516. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e6e
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: specific @F(constants.%int_3.1ba) {
  520. // CHECK:STDOUT: %N.loc6_6.1 => constants.%int_3.1ba
  521. // CHECK:STDOUT: %array_type.loc6_42.1 => constants.%array_type.002
  522. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a63
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: !definition:
  525. // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1
  526. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d
  527. // CHECK:STDOUT: %bound_method.loc6_62.3 => constants.%bound_method.def
  528. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 => constants.%int_3.822
  529. // CHECK:STDOUT: }
  530. // CHECK:STDOUT:
  531. // CHECK:STDOUT: --- type_and_bound.carbon
  532. // CHECK:STDOUT:
  533. // CHECK:STDOUT: constants {
  534. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  535. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  536. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  537. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  538. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  539. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  540. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  541. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  542. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  543. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  544. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 1 [symbolic]
  545. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  546. // CHECK:STDOUT: %array_type.6e5: type = array_type %N, %T [symbolic]
  547. // CHECK:STDOUT: %pattern_type.377: type = pattern_type %array_type.6e5 [symbolic]
  548. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  549. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  550. // CHECK:STDOUT: %require_complete.088: <witness> = require_complete_type %array_type.6e5 [symbolic]
  551. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  552. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  553. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  554. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  555. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  556. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  557. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  558. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  559. // CHECK:STDOUT: %tuple: %tuple.type.8d4 = tuple_value (%empty_struct, %empty_struct, %empty_struct) [concrete]
  560. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  561. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  562. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  563. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  564. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  565. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%C, %int_3) [concrete]
  566. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  567. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  568. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  569. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  570. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014 = struct_value () [concrete]
  571. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  572. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  573. // CHECK:STDOUT: }
  574. // CHECK:STDOUT:
  575. // CHECK:STDOUT: imports {
  576. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  577. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  578. // CHECK:STDOUT: .Destroy = %Core.Destroy
  579. // CHECK:STDOUT: import Core//prelude
  580. // CHECK:STDOUT: import Core//prelude/...
  581. // CHECK:STDOUT: }
  582. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  583. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  584. // CHECK:STDOUT: }
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: file {
  587. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  588. // CHECK:STDOUT: .Core = imports.%Core
  589. // CHECK:STDOUT: .C = %C.decl
  590. // CHECK:STDOUT: .F = %F.decl
  591. // CHECK:STDOUT: .G = %G.decl
  592. // CHECK:STDOUT: }
  593. // CHECK:STDOUT: %Core.import = import Core
  594. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  595. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  596. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  597. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 1 [concrete]
  598. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.377) = value_binding_pattern a [concrete]
  599. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.377) = value_param_pattern %a.patt, call_param0 [concrete]
  600. // CHECK:STDOUT: } {
  601. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  602. // CHECK:STDOUT: %T.loc6_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  603. // CHECK:STDOUT: %.loc6_36.1: type = splice_block %.loc6_36.3 [concrete = Core.IntLiteral] {
  604. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  605. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  606. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  607. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  608. // CHECK:STDOUT: %.loc6_36.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  609. // CHECK:STDOUT: %.loc6_36.3: type = converted %IntLiteral.call, %.loc6_36.2 [concrete = Core.IntLiteral]
  610. // CHECK:STDOUT: }
  611. // CHECK:STDOUT: %N.loc6_16.2: Core.IntLiteral = symbolic_binding N, 1 [symbolic = %N.loc6_16.1 (constants.%N)]
  612. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_52.1 (%array_type.6e5) = value_param call_param0
  613. // CHECK:STDOUT: %.loc6_52: type = splice_block %array_type.loc6_52.2 [symbolic = %array_type.loc6_52.1 (constants.%array_type.6e5)] {
  614. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  615. // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc6_16.2 [symbolic = %N.loc6_16.1 (constants.%N)]
  616. // CHECK:STDOUT: %array_type.loc6_52.2: type = array_type %N.ref, %T.ref [symbolic = %array_type.loc6_52.1 (constants.%array_type.6e5)]
  617. // CHECK:STDOUT: }
  618. // CHECK:STDOUT: %a: @F.%array_type.loc6_52.1 (%array_type.6e5) = value_binding a, %a.param
  619. // CHECK:STDOUT: }
  620. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
  621. // CHECK:STDOUT: }
  622. // CHECK:STDOUT:
  623. // CHECK:STDOUT: class @C {
  624. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  625. // CHECK:STDOUT: complete_type_witness = %complete_type
  626. // CHECK:STDOUT:
  627. // CHECK:STDOUT: !members:
  628. // CHECK:STDOUT: .Self = constants.%C
  629. // CHECK:STDOUT: }
  630. // CHECK:STDOUT:
  631. // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type, %N.loc6_16.2: Core.IntLiteral) {
  632. // CHECK:STDOUT: %T.loc6_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  633. // CHECK:STDOUT: %N.loc6_16.1: Core.IntLiteral = symbolic_binding N, 1 [symbolic = %N.loc6_16.1 (constants.%N)]
  634. // CHECK:STDOUT: %array_type.loc6_52.1: type = array_type %N.loc6_16.1, %T.loc6_6.1 [symbolic = %array_type.loc6_52.1 (constants.%array_type.6e5)]
  635. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_52.1 [symbolic = %pattern_type (constants.%pattern_type.377)]
  636. // CHECK:STDOUT:
  637. // CHECK:STDOUT: !definition:
  638. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc6_52.1 [symbolic = %require_complete (constants.%require_complete.088)]
  639. // CHECK:STDOUT:
  640. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_52.1 (%array_type.6e5)) {
  641. // CHECK:STDOUT: !entry:
  642. // CHECK:STDOUT: return
  643. // CHECK:STDOUT: }
  644. // CHECK:STDOUT: }
  645. // CHECK:STDOUT:
  646. // CHECK:STDOUT: fn @G() {
  647. // CHECK:STDOUT: !entry:
  648. // CHECK:STDOUT: name_binding_decl {
  649. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = ref_binding_pattern a [concrete]
  650. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  651. // CHECK:STDOUT: }
  652. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  653. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  654. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  655. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  656. // CHECK:STDOUT: %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1) [concrete = constants.%tuple]
  657. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  658. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  659. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  660. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  661. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  662. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  663. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  664. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  665. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  666. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  667. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  668. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  669. // CHECK:STDOUT: %.loc9_35.8: init %array_type.002 = array_init (%.loc9_35.3, %.loc9_35.5, %.loc9_35.7) to %a.var [concrete = constants.%array]
  670. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  671. // CHECK:STDOUT: assign %a.var, %.loc9_3
  672. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  673. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  674. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  675. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref [concrete = constants.%array_type.002]
  676. // CHECK:STDOUT: }
  677. // CHECK:STDOUT: %a: ref %array_type.002 = ref_binding a, %a.var
  678. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  679. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  680. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C, constants.%int_3) [concrete = constants.%F.specific_fn]
  681. // CHECK:STDOUT: %.loc10: %array_type.002 = acquire_value %a.ref
  682. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc10)
  683. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9cb
  684. // 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.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  685. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  686. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  687. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  688. // CHECK:STDOUT: return
  689. // CHECK:STDOUT: }
  690. // CHECK:STDOUT:
  691. // CHECK:STDOUT: specific @F(constants.%T, constants.%N) {
  692. // CHECK:STDOUT: %T.loc6_6.1 => constants.%T
  693. // CHECK:STDOUT: %N.loc6_16.1 => constants.%N
  694. // CHECK:STDOUT: %array_type.loc6_52.1 => constants.%array_type.6e5
  695. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.377
  696. // CHECK:STDOUT: }
  697. // CHECK:STDOUT:
  698. // CHECK:STDOUT: specific @F(constants.%C, constants.%int_3) {
  699. // CHECK:STDOUT: %T.loc6_6.1 => constants.%C
  700. // CHECK:STDOUT: %N.loc6_16.1 => constants.%int_3
  701. // CHECK:STDOUT: %array_type.loc6_52.1 => constants.%array_type.002
  702. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a63
  703. // CHECK:STDOUT:
  704. // CHECK:STDOUT: !definition:
  705. // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1
  706. // CHECK:STDOUT: }
  707. // CHECK:STDOUT:
  708. // CHECK:STDOUT: --- fail_bound_mismatch.carbon
  709. // CHECK:STDOUT:
  710. // CHECK:STDOUT: constants {
  711. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  712. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  713. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  714. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  715. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  716. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  717. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  718. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  719. // CHECK:STDOUT: %array_type.f24: type = array_type %int_2, %T [symbolic]
  720. // CHECK:STDOUT: %pattern_type.cb6: type = pattern_type %array_type.f24 [symbolic]
  721. // CHECK:STDOUT: %pattern_type.e6836e.1: type = pattern_type %T [symbolic]
  722. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  723. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  724. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  725. // CHECK:STDOUT: %require_complete.4b7: <witness> = require_complete_type %T [symbolic]
  726. // CHECK:STDOUT: %require_complete.174: <witness> = require_complete_type %array_type.f24 [symbolic]
  727. // CHECK:STDOUT: %F.specific_fn.96e: <specific function> = specific_function %F, @F(%T) [symbolic]
  728. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  729. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  730. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  731. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  732. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  733. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  734. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  735. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  736. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  737. // CHECK:STDOUT: %tuple: %tuple.type.8d4 = tuple_value (%empty_struct, %empty_struct, %empty_struct) [concrete]
  738. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  739. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  740. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  741. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  742. // CHECK:STDOUT: %array_type.15a: type = array_type %int_2, %C [concrete]
  743. // CHECK:STDOUT: %pattern_type.114: type = pattern_type %array_type.15a [concrete]
  744. // CHECK:STDOUT: %F.specific_fn.04a: <specific function> = specific_function %F, @F(%C) [concrete]
  745. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  746. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  747. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  748. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  749. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  750. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  751. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014 = struct_value () [concrete]
  752. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  753. // CHECK:STDOUT: %complete_type.8eb: <witness> = complete_type_witness %array_type.15a [concrete]
  754. // CHECK:STDOUT: }
  755. // CHECK:STDOUT:
  756. // CHECK:STDOUT: imports {
  757. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  758. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  759. // CHECK:STDOUT: .Destroy = %Core.Destroy
  760. // CHECK:STDOUT: import Core//prelude
  761. // CHECK:STDOUT: import Core//prelude/...
  762. // CHECK:STDOUT: }
  763. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  764. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  765. // CHECK:STDOUT: }
  766. // CHECK:STDOUT:
  767. // CHECK:STDOUT: file {
  768. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  769. // CHECK:STDOUT: .Core = imports.%Core
  770. // CHECK:STDOUT: .C = %C.decl
  771. // CHECK:STDOUT: .F = %F.decl
  772. // CHECK:STDOUT: .G = %G.decl
  773. // CHECK:STDOUT: }
  774. // CHECK:STDOUT: %Core.import = import Core
  775. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  776. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  777. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  778. // CHECK:STDOUT: %a.patt: @F.%pattern_type.loc6_16 (%pattern_type.cb6) = value_binding_pattern a [concrete]
  779. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc6_16 (%pattern_type.cb6) = value_param_pattern %a.patt, call_param0 [concrete]
  780. // CHECK:STDOUT: %return.patt: @F.%pattern_type.loc6_32 (%pattern_type.e6836e.1) = return_slot_pattern [concrete]
  781. // CHECK:STDOUT: %return.param_patt: @F.%pattern_type.loc6_32 (%pattern_type.e6836e.1) = out_param_pattern %return.patt, call_param1 [concrete]
  782. // CHECK:STDOUT: } {
  783. // CHECK:STDOUT: %T.ref.loc6_35: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  784. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  785. // CHECK:STDOUT: %T.loc6_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  786. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_29.1 (%array_type.f24) = value_param call_param0
  787. // CHECK:STDOUT: %.loc6_29: type = splice_block %array_type.loc6_29.2 [symbolic = %array_type.loc6_29.1 (constants.%array_type.f24)] {
  788. // CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  789. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  790. // CHECK:STDOUT: %array_type.loc6_29.2: type = array_type %int_2, %T.ref.loc6_25 [symbolic = %array_type.loc6_29.1 (constants.%array_type.f24)]
  791. // CHECK:STDOUT: }
  792. // CHECK:STDOUT: %a: @F.%array_type.loc6_29.1 (%array_type.f24) = value_binding a, %a.param
  793. // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.1 (%T) = out_param call_param1
  794. // CHECK:STDOUT: %return: ref @F.%T.loc6_6.1 (%T) = return_slot %return.param
  795. // CHECK:STDOUT: }
  796. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  797. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  798. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param0 [concrete]
  799. // CHECK:STDOUT: } {
  800. // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
  801. // CHECK:STDOUT: %return.param: ref %C = out_param call_param0
  802. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  803. // CHECK:STDOUT: }
  804. // CHECK:STDOUT: }
  805. // CHECK:STDOUT:
  806. // CHECK:STDOUT: class @C {
  807. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  808. // CHECK:STDOUT: complete_type_witness = %complete_type
  809. // CHECK:STDOUT:
  810. // CHECK:STDOUT: !members:
  811. // CHECK:STDOUT: .Self = constants.%C
  812. // CHECK:STDOUT: }
  813. // CHECK:STDOUT:
  814. // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type) {
  815. // CHECK:STDOUT: %T.loc6_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  816. // CHECK:STDOUT: %array_type.loc6_29.1: type = array_type constants.%int_2, %T.loc6_6.1 [symbolic = %array_type.loc6_29.1 (constants.%array_type.f24)]
  817. // CHECK:STDOUT: %pattern_type.loc6_16: type = pattern_type %array_type.loc6_29.1 [symbolic = %pattern_type.loc6_16 (constants.%pattern_type.cb6)]
  818. // CHECK:STDOUT: %pattern_type.loc6_32: type = pattern_type %T.loc6_6.1 [symbolic = %pattern_type.loc6_32 (constants.%pattern_type.e6836e.1)]
  819. // CHECK:STDOUT:
  820. // CHECK:STDOUT: !definition:
  821. // CHECK:STDOUT: %require_complete.loc6_32: <witness> = require_complete_type %T.loc6_6.1 [symbolic = %require_complete.loc6_32 (constants.%require_complete.4b7)]
  822. // CHECK:STDOUT: %require_complete.loc6_17: <witness> = require_complete_type %array_type.loc6_29.1 [symbolic = %require_complete.loc6_17 (constants.%require_complete.174)]
  823. // CHECK:STDOUT: %F.specific_fn.loc6_46.2: <specific function> = specific_function constants.%F, @F(%T.loc6_6.1) [symbolic = %F.specific_fn.loc6_46.2 (constants.%F.specific_fn.96e)]
  824. // CHECK:STDOUT:
  825. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_29.1 (%array_type.f24)) -> %return.param: @F.%T.loc6_6.1 (%T) {
  826. // CHECK:STDOUT: !entry:
  827. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  828. // CHECK:STDOUT: %a.ref: @F.%array_type.loc6_29.1 (%array_type.f24) = name_ref a, %a
  829. // CHECK:STDOUT: %F.specific_fn.loc6_46.1: <specific function> = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc6_46.2 (constants.%F.specific_fn.96e)]
  830. // CHECK:STDOUT: %.loc6_32: ref @F.%T.loc6_6.1 (%T) = splice_block %return {}
  831. // CHECK:STDOUT: %F.call: init @F.%T.loc6_6.1 (%T) = call %F.specific_fn.loc6_46.1(%a.ref) to %.loc6_32
  832. // CHECK:STDOUT: return %F.call to %return
  833. // CHECK:STDOUT: }
  834. // CHECK:STDOUT: }
  835. // CHECK:STDOUT:
  836. // CHECK:STDOUT: fn @G() -> %return.param: %C {
  837. // CHECK:STDOUT: !entry:
  838. // CHECK:STDOUT: name_binding_decl {
  839. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = ref_binding_pattern a [concrete]
  840. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  841. // CHECK:STDOUT: }
  842. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  843. // CHECK:STDOUT: %.loc10_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  844. // CHECK:STDOUT: %.loc10_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  845. // CHECK:STDOUT: %.loc10_34.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  846. // CHECK:STDOUT: %.loc10_35.1: %tuple.type.8d4 = tuple_literal (%.loc10_26.1, %.loc10_30.1, %.loc10_34.1) [concrete = constants.%tuple]
  847. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  848. // CHECK:STDOUT: %.loc10_35.2: ref %C = array_index %a.var, %int_0
  849. // CHECK:STDOUT: %.loc10_26.2: init %C = class_init (), %.loc10_35.2 [concrete = constants.%C.val]
  850. // CHECK:STDOUT: %.loc10_35.3: init %C = converted %.loc10_26.1, %.loc10_26.2 [concrete = constants.%C.val]
  851. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  852. // CHECK:STDOUT: %.loc10_35.4: ref %C = array_index %a.var, %int_1
  853. // CHECK:STDOUT: %.loc10_30.2: init %C = class_init (), %.loc10_35.4 [concrete = constants.%C.val]
  854. // CHECK:STDOUT: %.loc10_35.5: init %C = converted %.loc10_30.1, %.loc10_30.2 [concrete = constants.%C.val]
  855. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  856. // CHECK:STDOUT: %.loc10_35.6: ref %C = array_index %a.var, %int_2
  857. // CHECK:STDOUT: %.loc10_34.2: init %C = class_init (), %.loc10_35.6 [concrete = constants.%C.val]
  858. // CHECK:STDOUT: %.loc10_35.7: init %C = converted %.loc10_34.1, %.loc10_34.2 [concrete = constants.%C.val]
  859. // CHECK:STDOUT: %.loc10_35.8: init %array_type.002 = array_init (%.loc10_35.3, %.loc10_35.5, %.loc10_35.7) to %a.var [concrete = constants.%array]
  860. // CHECK:STDOUT: %.loc10_3: init %array_type.002 = converted %.loc10_35.1, %.loc10_35.8 [concrete = constants.%array]
  861. // CHECK:STDOUT: assign %a.var, %.loc10_3
  862. // CHECK:STDOUT: %.loc10_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  863. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [concrete = constants.%C]
  864. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  865. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref.loc10 [concrete = constants.%array_type.002]
  866. // CHECK:STDOUT: }
  867. // CHECK:STDOUT: %a: ref %array_type.002 = ref_binding a, %a.var
  868. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  869. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  870. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C) [concrete = constants.%F.specific_fn.04a]
  871. // CHECK:STDOUT: %.loc8: ref %C = splice_block %return {}
  872. // CHECK:STDOUT: %.loc21: %array_type.15a = converted %a.ref, <error> [concrete = <error>]
  873. // CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(<error>) to %.loc8
  874. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9cb
  875. // 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.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  876. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  877. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  878. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  879. // CHECK:STDOUT: return %F.call to %return
  880. // CHECK:STDOUT: }
  881. // CHECK:STDOUT:
  882. // CHECK:STDOUT: specific @F(constants.%T) {
  883. // CHECK:STDOUT: %T.loc6_6.1 => constants.%T
  884. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.f24
  885. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.cb6
  886. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.e6836e.1
  887. // CHECK:STDOUT:
  888. // CHECK:STDOUT: !definition:
  889. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%require_complete.4b7
  890. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%require_complete.174
  891. // CHECK:STDOUT: %F.specific_fn.loc6_46.2 => constants.%F.specific_fn.96e
  892. // CHECK:STDOUT: }
  893. // CHECK:STDOUT:
  894. // CHECK:STDOUT: specific @F(constants.%C) {
  895. // CHECK:STDOUT: %T.loc6_6.1 => constants.%C
  896. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.15a
  897. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.114
  898. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.c48
  899. // CHECK:STDOUT:
  900. // CHECK:STDOUT: !definition:
  901. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%complete_type.357
  902. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.8eb
  903. // CHECK:STDOUT: %F.specific_fn.loc6_46.2 => constants.%F.specific_fn.04a
  904. // CHECK:STDOUT: }
  905. // CHECK:STDOUT:
  906. // CHECK:STDOUT: --- fail_type_mismatch.carbon
  907. // CHECK:STDOUT:
  908. // CHECK:STDOUT: constants {
  909. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  910. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  911. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  912. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  913. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  914. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  915. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  916. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  917. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  918. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  919. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  920. // CHECK:STDOUT: %array_type.60b: type = array_type %N, %C [symbolic]
  921. // CHECK:STDOUT: %pattern_type.e6e: type = pattern_type %array_type.60b [symbolic]
  922. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  923. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  924. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  925. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  926. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  927. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  928. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  929. // CHECK:STDOUT: %require_complete.3ac: <witness> = require_complete_type %array_type.60b [symbolic]
  930. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  931. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  932. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  933. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  934. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  935. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  936. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.2a1: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51 = struct_value () [symbolic]
  937. // CHECK:STDOUT: %ImplicitAs.impl_witness.bc9: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.132, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  938. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.51e: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  939. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.51e = struct_value () [concrete]
  940. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.bc9) [concrete]
  941. // CHECK:STDOUT: %.322: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  942. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.349: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [symbolic]
  943. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  944. // CHECK:STDOUT: %bound_method.693: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  945. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.693(%N) [symbolic]
  946. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  947. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  948. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  949. // CHECK:STDOUT: %array_type.fe4: type = array_type %int_3.1ba, %D [concrete]
  950. // CHECK:STDOUT: %ptr.af6: type = ptr_type %array_type.fe4 [concrete]
  951. // CHECK:STDOUT: %pattern_type.f30: type = pattern_type %array_type.fe4 [concrete]
  952. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  953. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  954. // CHECK:STDOUT: %tuple: %tuple.type.8d4 = tuple_value (%empty_struct, %empty_struct, %empty_struct) [concrete]
  955. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  956. // CHECK:STDOUT: %D.val: %D = struct_value () [concrete]
  957. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  958. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  959. // CHECK:STDOUT: %array: %array_type.fe4 = tuple_value (%D.val, %D.val, %D.val) [concrete]
  960. // CHECK:STDOUT: %array_type.002: type = array_type %int_3.1ba, %C [concrete]
  961. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  962. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%int_3.1ba) [concrete]
  963. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  964. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  965. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.fe4, () [concrete]
  966. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.fb8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  967. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.e08: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.fb8 = struct_value () [concrete]
  968. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.e08, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  969. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  970. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [concrete]
  971. // CHECK:STDOUT: %bound_method.def: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  972. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  973. // CHECK:STDOUT: }
  974. // CHECK:STDOUT:
  975. // CHECK:STDOUT: imports {
  976. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  977. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  978. // CHECK:STDOUT: .Int = %Core.Int
  979. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  980. // CHECK:STDOUT: .Destroy = %Core.Destroy
  981. // CHECK:STDOUT: import Core//prelude
  982. // CHECK:STDOUT: import Core//prelude/...
  983. // CHECK:STDOUT: }
  984. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  985. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  986. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  987. // CHECK:STDOUT: %Core.import_ref.e24: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.2a1)]
  988. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.132 = impl_witness_table (%Core.import_ref.e24), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  989. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  990. // CHECK:STDOUT: }
  991. // CHECK:STDOUT:
  992. // CHECK:STDOUT: file {
  993. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  994. // CHECK:STDOUT: .Core = imports.%Core
  995. // CHECK:STDOUT: .C = %C.decl
  996. // CHECK:STDOUT: .D = %D.decl
  997. // CHECK:STDOUT: .F = %F.decl
  998. // CHECK:STDOUT: .G = %G.decl
  999. // CHECK:STDOUT: }
  1000. // CHECK:STDOUT: %Core.import = import Core
  1001. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1002. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1003. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  1004. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete]
  1005. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.e6e) = value_binding_pattern a [concrete]
  1006. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.e6e) = value_param_pattern %a.patt, call_param0 [concrete]
  1007. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1008. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1009. // CHECK:STDOUT: } {
  1010. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1011. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1012. // CHECK:STDOUT: %.loc7_26.1: type = splice_block %.loc7_26.3 [concrete = Core.IntLiteral] {
  1013. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1014. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  1015. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  1016. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  1017. // CHECK:STDOUT: %.loc7_26.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  1018. // CHECK:STDOUT: %.loc7_26.3: type = converted %IntLiteral.call, %.loc7_26.2 [concrete = Core.IntLiteral]
  1019. // CHECK:STDOUT: }
  1020. // CHECK:STDOUT: %N.loc7_6.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc7_6.1 (constants.%N)]
  1021. // CHECK:STDOUT: %a.param: @F.%array_type.loc7_42.1 (%array_type.60b) = value_param call_param0
  1022. // CHECK:STDOUT: %.loc7_42: type = splice_block %array_type.loc7_42.2 [symbolic = %array_type.loc7_42.1 (constants.%array_type.60b)] {
  1023. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1024. // CHECK:STDOUT: %N.ref.loc7_41: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)]
  1025. // CHECK:STDOUT: %array_type.loc7_42.2: type = array_type %N.ref.loc7_41, %C.ref [symbolic = %array_type.loc7_42.1 (constants.%array_type.60b)]
  1026. // CHECK:STDOUT: }
  1027. // CHECK:STDOUT: %a: @F.%array_type.loc7_42.1 (%array_type.60b) = value_binding a, %a.param
  1028. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1029. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1030. // CHECK:STDOUT: }
  1031. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  1032. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1033. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  1034. // CHECK:STDOUT: } {
  1035. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1036. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1037. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  1038. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1039. // CHECK:STDOUT: }
  1040. // CHECK:STDOUT: }
  1041. // CHECK:STDOUT:
  1042. // CHECK:STDOUT: class @C {
  1043. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1044. // CHECK:STDOUT: complete_type_witness = %complete_type
  1045. // CHECK:STDOUT:
  1046. // CHECK:STDOUT: !members:
  1047. // CHECK:STDOUT: .Self = constants.%C
  1048. // CHECK:STDOUT: }
  1049. // CHECK:STDOUT:
  1050. // CHECK:STDOUT: class @D {
  1051. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1052. // CHECK:STDOUT: complete_type_witness = %complete_type
  1053. // CHECK:STDOUT:
  1054. // CHECK:STDOUT: !members:
  1055. // CHECK:STDOUT: .Self = constants.%D
  1056. // CHECK:STDOUT: }
  1057. // CHECK:STDOUT:
  1058. // CHECK:STDOUT: generic fn @F(%N.loc7_6.2: Core.IntLiteral) {
  1059. // CHECK:STDOUT: %N.loc7_6.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc7_6.1 (constants.%N)]
  1060. // CHECK:STDOUT: %array_type.loc7_42.1: type = array_type %N.loc7_6.1, constants.%C [symbolic = %array_type.loc7_42.1 (constants.%array_type.60b)]
  1061. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_42.1 [symbolic = %pattern_type (constants.%pattern_type.e6e)]
  1062. // CHECK:STDOUT:
  1063. // CHECK:STDOUT: !definition:
  1064. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc7_42.1 [symbolic = %require_complete (constants.%require_complete.3ac)]
  1065. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc7_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.349)]
  1066. // CHECK:STDOUT: %bound_method.loc7_62.3: <bound method> = bound_method %N.loc7_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc7_62.3 (constants.%bound_method.693)]
  1067. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2: init %i32 = call %bound_method.loc7_62.3(%N.loc7_6.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  1068. // CHECK:STDOUT:
  1069. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc7_42.1 (%array_type.60b)) -> %i32 {
  1070. // CHECK:STDOUT: !entry:
  1071. // CHECK:STDOUT: %N.ref.loc7_61: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)]
  1072. // CHECK:STDOUT: %impl.elem0: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  1073. // CHECK:STDOUT: %bound_method.loc7_62.1: <bound method> = bound_method %N.ref.loc7_61, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.349)]
  1074. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1075. // CHECK:STDOUT: %bound_method.loc7_62.2: <bound method> = bound_method %N.ref.loc7_61, %specific_fn [symbolic = %bound_method.loc7_62.3 (constants.%bound_method.693)]
  1076. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.1: init %i32 = call %bound_method.loc7_62.2(%N.ref.loc7_61) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  1077. // CHECK:STDOUT: %.loc7_62: init %i32 = converted %N.ref.loc7_61, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  1078. // CHECK:STDOUT: return %.loc7_62 to %return
  1079. // CHECK:STDOUT: }
  1080. // CHECK:STDOUT: }
  1081. // CHECK:STDOUT:
  1082. // CHECK:STDOUT: fn @G() -> %i32 {
  1083. // CHECK:STDOUT: !entry:
  1084. // CHECK:STDOUT: name_binding_decl {
  1085. // CHECK:STDOUT: %a.patt: %pattern_type.f30 = ref_binding_pattern a [concrete]
  1086. // CHECK:STDOUT: %a.var_patt: %pattern_type.f30 = var_pattern %a.patt [concrete]
  1087. // CHECK:STDOUT: }
  1088. // CHECK:STDOUT: %a.var: ref %array_type.fe4 = var %a.var_patt
  1089. // CHECK:STDOUT: %.loc11_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1090. // CHECK:STDOUT: %.loc11_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1091. // CHECK:STDOUT: %.loc11_34.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1092. // CHECK:STDOUT: %.loc11_35.1: %tuple.type.8d4 = tuple_literal (%.loc11_26.1, %.loc11_30.1, %.loc11_34.1) [concrete = constants.%tuple]
  1093. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  1094. // CHECK:STDOUT: %.loc11_35.2: ref %D = array_index %a.var, %int_0
  1095. // CHECK:STDOUT: %.loc11_26.2: init %D = class_init (), %.loc11_35.2 [concrete = constants.%D.val]
  1096. // CHECK:STDOUT: %.loc11_35.3: init %D = converted %.loc11_26.1, %.loc11_26.2 [concrete = constants.%D.val]
  1097. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  1098. // CHECK:STDOUT: %.loc11_35.4: ref %D = array_index %a.var, %int_1
  1099. // CHECK:STDOUT: %.loc11_30.2: init %D = class_init (), %.loc11_35.4 [concrete = constants.%D.val]
  1100. // CHECK:STDOUT: %.loc11_35.5: init %D = converted %.loc11_30.1, %.loc11_30.2 [concrete = constants.%D.val]
  1101. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  1102. // CHECK:STDOUT: %.loc11_35.6: ref %D = array_index %a.var, %int_2
  1103. // CHECK:STDOUT: %.loc11_34.2: init %D = class_init (), %.loc11_35.6 [concrete = constants.%D.val]
  1104. // CHECK:STDOUT: %.loc11_35.7: init %D = converted %.loc11_34.1, %.loc11_34.2 [concrete = constants.%D.val]
  1105. // CHECK:STDOUT: %.loc11_35.8: init %array_type.fe4 = array_init (%.loc11_35.3, %.loc11_35.5, %.loc11_35.7) to %a.var [concrete = constants.%array]
  1106. // CHECK:STDOUT: %.loc11_3: init %array_type.fe4 = converted %.loc11_35.1, %.loc11_35.8 [concrete = constants.%array]
  1107. // CHECK:STDOUT: assign %a.var, %.loc11_3
  1108. // CHECK:STDOUT: %.loc11_20: type = splice_block %array_type [concrete = constants.%array_type.fe4] {
  1109. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1110. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  1111. // CHECK:STDOUT: %array_type: type = array_type %int_3, %D.ref [concrete = constants.%array_type.fe4]
  1112. // CHECK:STDOUT: }
  1113. // CHECK:STDOUT: %a: ref %array_type.fe4 = ref_binding a, %a.var
  1114. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  1115. // CHECK:STDOUT: %a.ref: ref %array_type.fe4 = name_ref a, %a
  1116. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%int_3.1ba) [concrete = constants.%F.specific_fn]
  1117. // CHECK:STDOUT: %.loc22: %array_type.002 = converted %a.ref, <error> [concrete = <error>]
  1118. // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(<error>)
  1119. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.e08
  1120. // 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.e08, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  1121. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  1122. // CHECK:STDOUT: %addr: %ptr.af6 = addr_of %a.var
  1123. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  1124. // CHECK:STDOUT: return %F.call to %return
  1125. // CHECK:STDOUT: }
  1126. // CHECK:STDOUT:
  1127. // CHECK:STDOUT: specific @F(constants.%N) {
  1128. // CHECK:STDOUT: %N.loc7_6.1 => constants.%N
  1129. // CHECK:STDOUT: %array_type.loc7_42.1 => constants.%array_type.60b
  1130. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e6e
  1131. // CHECK:STDOUT: }
  1132. // CHECK:STDOUT:
  1133. // CHECK:STDOUT: specific @F(constants.%int_3.1ba) {
  1134. // CHECK:STDOUT: %N.loc7_6.1 => constants.%int_3.1ba
  1135. // CHECK:STDOUT: %array_type.loc7_42.1 => constants.%array_type.002
  1136. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a63
  1137. // CHECK:STDOUT:
  1138. // CHECK:STDOUT: !definition:
  1139. // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1
  1140. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d
  1141. // CHECK:STDOUT: %bound_method.loc7_62.3 => constants.%bound_method.def
  1142. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 => constants.%int_3.822
  1143. // CHECK:STDOUT: }
  1144. // CHECK:STDOUT:
  1145. // CHECK:STDOUT: --- fail_bound_type_mismatch.carbon
  1146. // CHECK:STDOUT:
  1147. // CHECK:STDOUT: constants {
  1148. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1149. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1150. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1151. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1152. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1153. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1154. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1155. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1156. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1157. // CHECK:STDOUT: %N.586: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  1158. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1159. // CHECK:STDOUT: %N.fe8: %i32 = symbolic_binding N, 0 [symbolic]
  1160. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  1161. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1162. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1163. // CHECK:STDOUT: %ImplicitAs.type.7a9: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  1164. // CHECK:STDOUT: %ImplicitAs.Convert.type.71e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete]
  1165. // CHECK:STDOUT: %From: Core.IntLiteral = symbolic_binding From, 0 [symbolic]
  1166. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.2c2: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic]
  1167. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.cdf: %Int.as.ImplicitAs.impl.Convert.type.2c2 = struct_value () [symbolic]
  1168. // CHECK:STDOUT: %ImplicitAs.impl_witness.972: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.783, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  1169. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.592: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  1170. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.047: %Int.as.ImplicitAs.impl.Convert.type.592 = struct_value () [concrete]
  1171. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.7a9 = facet_value %i32, (%ImplicitAs.impl_witness.972) [concrete]
  1172. // CHECK:STDOUT: %.63b: type = fn_type_with_self_type %ImplicitAs.Convert.type.71e, %ImplicitAs.facet [concrete]
  1173. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.fe8, %Int.as.ImplicitAs.impl.Convert.047 [symbolic]
  1174. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Int.as.ImplicitAs.impl.Convert.047, @Int.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  1175. // CHECK:STDOUT: %bound_method.490: <bound method> = bound_method %N.fe8, %Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  1176. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.490(%N.fe8) [symbolic]
  1177. // CHECK:STDOUT: %array_type.580: type = array_type %Int.as.ImplicitAs.impl.Convert.call, %C [symbolic]
  1178. // CHECK:STDOUT: %pattern_type.054: type = pattern_type %array_type.580 [symbolic]
  1179. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1180. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1181. // CHECK:STDOUT: %require_complete.ecf: <witness> = require_complete_type %array_type.580 [symbolic]
  1182. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  1183. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  1184. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.24b: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N.586) [symbolic]
  1185. // CHECK:STDOUT: %Int.as.Copy.impl.Op.c95: %Int.as.Copy.impl.Op.type.24b = struct_value () [symbolic]
  1186. // CHECK:STDOUT: %Copy.impl_witness.fb7: <witness> = impl_witness imports.%Copy.impl_witness_table.b6a, @Int.as.Copy.impl(%int_32) [concrete]
  1187. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.469: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
  1188. // CHECK:STDOUT: %Int.as.Copy.impl.Op.dfd: %Int.as.Copy.impl.Op.type.469 = struct_value () [concrete]
  1189. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.fb7) [concrete]
  1190. // CHECK:STDOUT: %.65f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
  1191. // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: <bound method> = bound_method %N.fe8, %Int.as.Copy.impl.Op.dfd [symbolic]
  1192. // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.dfd, @Int.as.Copy.impl.Op(%int_32) [concrete]
  1193. // CHECK:STDOUT: %bound_method.f2b: <bound method> = bound_method %N.fe8, %Int.as.Copy.impl.Op.specific_fn [symbolic]
  1194. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1195. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1196. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  1197. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  1198. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  1199. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  1200. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  1201. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  1202. // CHECK:STDOUT: %tuple.5c1: %tuple.type.8d4 = tuple_value (%empty_struct, %empty_struct, %empty_struct) [concrete]
  1203. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  1204. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  1205. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  1206. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  1207. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  1208. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1209. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  1210. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  1211. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  1212. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.014 = struct_value () [concrete]
  1213. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  1214. // CHECK:STDOUT: }
  1215. // CHECK:STDOUT:
  1216. // CHECK:STDOUT: imports {
  1217. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1218. // CHECK:STDOUT: .Int = %Core.Int
  1219. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1220. // CHECK:STDOUT: .Copy = %Core.Copy
  1221. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1222. // CHECK:STDOUT: import Core//prelude
  1223. // CHECK:STDOUT: import Core//prelude/...
  1224. // CHECK:STDOUT: }
  1225. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1226. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1227. // CHECK:STDOUT: %Core.import_ref.a86: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.2c2) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.cdf)]
  1228. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.783 = impl_witness_table (%Core.import_ref.a86), @Int.as.ImplicitAs.impl [concrete]
  1229. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  1230. // CHECK:STDOUT: %Core.import_ref.d12: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.24b) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.c95)]
  1231. // CHECK:STDOUT: %Copy.impl_witness_table.b6a = impl_witness_table (%Core.import_ref.d12), @Int.as.Copy.impl [concrete]
  1232. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1233. // CHECK:STDOUT: }
  1234. // CHECK:STDOUT:
  1235. // CHECK:STDOUT: file {
  1236. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1237. // CHECK:STDOUT: .Core = imports.%Core
  1238. // CHECK:STDOUT: .C = %C.decl
  1239. // CHECK:STDOUT: .F = %F.decl
  1240. // CHECK:STDOUT: .G = %G.decl
  1241. // CHECK:STDOUT: }
  1242. // CHECK:STDOUT: %Core.import = import Core
  1243. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1244. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  1245. // CHECK:STDOUT: %N.patt: %pattern_type.7ce = symbolic_binding_pattern N, 0 [concrete]
  1246. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.054) = value_binding_pattern a [concrete]
  1247. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.054) = value_param_pattern %a.patt, call_param0 [concrete]
  1248. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1249. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1250. // CHECK:STDOUT: } {
  1251. // CHECK:STDOUT: %int_32.loc6_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1252. // CHECK:STDOUT: %i32.loc6_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1253. // CHECK:STDOUT: %.loc6_10: type = splice_block %i32.loc6_10 [concrete = constants.%i32] {
  1254. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1255. // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1256. // CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1257. // CHECK:STDOUT: }
  1258. // CHECK:STDOUT: %N.loc6_6.2: %i32 = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N.fe8)]
  1259. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_28.1 (%array_type.580) = value_param call_param0
  1260. // CHECK:STDOUT: %.loc6_28: type = splice_block %array_type.loc6_28.2 [symbolic = %array_type.loc6_28.1 (constants.%array_type.580)] {
  1261. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1262. // CHECK:STDOUT: %N.ref.loc6_27: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.fe8)]
  1263. // CHECK:STDOUT: %impl.elem0.loc6_27: %.63b = impl_witness_access constants.%ImplicitAs.impl_witness.972, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.047]
  1264. // CHECK:STDOUT: %bound_method.loc6_27.2: <bound method> = bound_method %N.ref.loc6_27, %impl.elem0.loc6_27 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)]
  1265. // CHECK:STDOUT: %specific_fn.loc6_27: <specific function> = specific_function %impl.elem0.loc6_27, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn]
  1266. // CHECK:STDOUT: %bound_method.loc6_27.3: <bound method> = bound_method %N.ref.loc6_27, %specific_fn.loc6_27 [symbolic = %bound_method.loc6_27.1 (constants.%bound_method.490)]
  1267. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.2: init Core.IntLiteral = call %bound_method.loc6_27.3(%N.ref.loc6_27) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1268. // CHECK:STDOUT: %.loc6_27.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc6_27.2 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1269. // CHECK:STDOUT: %.loc6_27.2: Core.IntLiteral = converted %N.ref.loc6_27, %.loc6_27.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1270. // CHECK:STDOUT: %array_type.loc6_28.2: type = array_type %.loc6_27.2, %C.ref [symbolic = %array_type.loc6_28.1 (constants.%array_type.580)]
  1271. // CHECK:STDOUT: }
  1272. // CHECK:STDOUT: %a: @F.%array_type.loc6_28.1 (%array_type.580) = value_binding a, %a.param
  1273. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1274. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1275. // CHECK:STDOUT: }
  1276. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  1277. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1278. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  1279. // CHECK:STDOUT: } {
  1280. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1281. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1282. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  1283. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1284. // CHECK:STDOUT: }
  1285. // CHECK:STDOUT: }
  1286. // CHECK:STDOUT:
  1287. // CHECK:STDOUT: class @C {
  1288. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1289. // CHECK:STDOUT: complete_type_witness = %complete_type
  1290. // CHECK:STDOUT:
  1291. // CHECK:STDOUT: !members:
  1292. // CHECK:STDOUT: .Self = constants.%C
  1293. // CHECK:STDOUT: }
  1294. // CHECK:STDOUT:
  1295. // CHECK:STDOUT: generic fn @F(%N.loc6_6.2: %i32) {
  1296. // CHECK:STDOUT: %N.loc6_6.1: %i32 = symbolic_binding N, 0 [symbolic = %N.loc6_6.1 (constants.%N.fe8)]
  1297. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc6_6.1, constants.%Int.as.ImplicitAs.impl.Convert.047 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)]
  1298. // CHECK:STDOUT: %bound_method.loc6_27.1: <bound method> = bound_method %N.loc6_6.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_27.1 (constants.%bound_method.490)]
  1299. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1: init Core.IntLiteral = call %bound_method.loc6_27.1(%N.loc6_6.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1300. // CHECK:STDOUT: %array_type.loc6_28.1: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1, constants.%C [symbolic = %array_type.loc6_28.1 (constants.%array_type.580)]
  1301. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_28.1 [symbolic = %pattern_type (constants.%pattern_type.054)]
  1302. // CHECK:STDOUT:
  1303. // CHECK:STDOUT: !definition:
  1304. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc6_28.1 [symbolic = %require_complete (constants.%require_complete.ecf)]
  1305. // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: <bound method> = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.dfd [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound)]
  1306. // CHECK:STDOUT: %bound_method.loc6_47.3: <bound method> = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.specific_fn [symbolic = %bound_method.loc6_47.3 (constants.%bound_method.f2b)]
  1307. // CHECK:STDOUT:
  1308. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_28.1 (%array_type.580)) -> %i32 {
  1309. // CHECK:STDOUT: !entry:
  1310. // CHECK:STDOUT: %N.ref.loc6_47: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.fe8)]
  1311. // CHECK:STDOUT: %impl.elem0.loc6_47: %.65f = impl_witness_access constants.%Copy.impl_witness.fb7, element0 [concrete = constants.%Int.as.Copy.impl.Op.dfd]
  1312. // CHECK:STDOUT: %bound_method.loc6_47.1: <bound method> = bound_method %N.ref.loc6_47, %impl.elem0.loc6_47 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound)]
  1313. // CHECK:STDOUT: %specific_fn.loc6_47: <specific function> = specific_function %impl.elem0.loc6_47, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
  1314. // CHECK:STDOUT: %bound_method.loc6_47.2: <bound method> = bound_method %N.ref.loc6_47, %specific_fn.loc6_47 [symbolic = %bound_method.loc6_47.3 (constants.%bound_method.f2b)]
  1315. // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_47.2(%N.ref.loc6_47) [symbolic = %N.loc6_6.1 (constants.%N.fe8)]
  1316. // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return
  1317. // CHECK:STDOUT: }
  1318. // CHECK:STDOUT: }
  1319. // CHECK:STDOUT:
  1320. // CHECK:STDOUT: fn @G() -> %i32 {
  1321. // CHECK:STDOUT: !entry:
  1322. // CHECK:STDOUT: name_binding_decl {
  1323. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = ref_binding_pattern a [concrete]
  1324. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  1325. // CHECK:STDOUT: }
  1326. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  1327. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1328. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1329. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1330. // CHECK:STDOUT: %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1) [concrete = constants.%tuple.5c1]
  1331. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  1332. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  1333. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  1334. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  1335. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  1336. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  1337. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  1338. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  1339. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  1340. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  1341. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  1342. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  1343. // CHECK:STDOUT: %.loc9_35.8: init %array_type.002 = array_init (%.loc9_35.3, %.loc9_35.5, %.loc9_35.7) to %a.var [concrete = constants.%array]
  1344. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  1345. // CHECK:STDOUT: assign %a.var, %.loc9_3
  1346. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  1347. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1348. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  1349. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref [concrete = constants.%array_type.002]
  1350. // CHECK:STDOUT: }
  1351. // CHECK:STDOUT: %a: ref %array_type.002 = ref_binding a, %a.var
  1352. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  1353. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  1354. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9cb
  1355. // 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.9cb, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  1356. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  1357. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  1358. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  1359. // CHECK:STDOUT: return <error> to %return
  1360. // CHECK:STDOUT: }
  1361. // CHECK:STDOUT:
  1362. // CHECK:STDOUT: specific @F(constants.%N.fe8) {
  1363. // CHECK:STDOUT: %N.loc6_6.1 => constants.%N.fe8
  1364. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound
  1365. // CHECK:STDOUT: %bound_method.loc6_27.1 => constants.%bound_method.490
  1366. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 => constants.%Int.as.ImplicitAs.impl.Convert.call
  1367. // CHECK:STDOUT: %array_type.loc6_28.1 => constants.%array_type.580
  1368. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.054
  1369. // CHECK:STDOUT: }
  1370. // CHECK:STDOUT:
  1371. // CHECK:STDOUT: --- fail_todo_array_length_from_tuple.carbon
  1372. // CHECK:STDOUT:
  1373. // CHECK:STDOUT: constants {
  1374. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1375. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1376. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1377. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1378. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1379. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1380. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1381. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1382. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1383. // CHECK:STDOUT: %N.fe8: %i32 = symbolic_binding N, 0 [symbolic]
  1384. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  1385. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1386. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1387. // CHECK:STDOUT: %ImplicitAs.type.7a9: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  1388. // CHECK:STDOUT: %ImplicitAs.Convert.type.71e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete]
  1389. // CHECK:STDOUT: %From: Core.IntLiteral = symbolic_binding From, 0 [symbolic]
  1390. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.2c2: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic]
  1391. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.cdf: %Int.as.ImplicitAs.impl.Convert.type.2c2 = struct_value () [symbolic]
  1392. // CHECK:STDOUT: %ImplicitAs.impl_witness.972: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.783, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  1393. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.592: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  1394. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.047: %Int.as.ImplicitAs.impl.Convert.type.592 = struct_value () [concrete]
  1395. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.7a9 = facet_value %i32, (%ImplicitAs.impl_witness.972) [concrete]
  1396. // CHECK:STDOUT: %.63b: type = fn_type_with_self_type %ImplicitAs.Convert.type.71e, %ImplicitAs.facet [concrete]
  1397. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.fe8, %Int.as.ImplicitAs.impl.Convert.047 [symbolic]
  1398. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Int.as.ImplicitAs.impl.Convert.047, @Int.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  1399. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %N.fe8, %Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  1400. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method(%N.fe8) [symbolic]
  1401. // CHECK:STDOUT: %array_type: type = array_type %Int.as.ImplicitAs.impl.Convert.call, %C [symbolic]
  1402. // CHECK:STDOUT: %pattern_type.054: type = pattern_type %array_type [symbolic]
  1403. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1404. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1405. // CHECK:STDOUT: %require_complete.ecf: <witness> = require_complete_type %array_type [symbolic]
  1406. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1407. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1408. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  1409. // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  1410. // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%empty_struct, %empty_struct, %empty_struct) [concrete]
  1411. // CHECK:STDOUT: }
  1412. // CHECK:STDOUT:
  1413. // CHECK:STDOUT: imports {
  1414. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1415. // CHECK:STDOUT: .Int = %Core.Int
  1416. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1417. // CHECK:STDOUT: import Core//prelude
  1418. // CHECK:STDOUT: import Core//prelude/...
  1419. // CHECK:STDOUT: }
  1420. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1421. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1422. // CHECK:STDOUT: %Core.import_ref.a86: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.2c2) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.cdf)]
  1423. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.783 = impl_witness_table (%Core.import_ref.a86), @Int.as.ImplicitAs.impl [concrete]
  1424. // CHECK:STDOUT: }
  1425. // CHECK:STDOUT:
  1426. // CHECK:STDOUT: file {
  1427. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1428. // CHECK:STDOUT: .Core = imports.%Core
  1429. // CHECK:STDOUT: .C = %C.decl
  1430. // CHECK:STDOUT: .F = %F.decl
  1431. // CHECK:STDOUT: .G = %G.decl
  1432. // CHECK:STDOUT: }
  1433. // CHECK:STDOUT: %Core.import = import Core
  1434. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1435. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  1436. // CHECK:STDOUT: %N.patt: %pattern_type.7ce = symbolic_binding_pattern N, 0 [concrete]
  1437. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.054) = value_binding_pattern a [concrete]
  1438. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.054) = value_param_pattern %a.patt, call_param0 [concrete]
  1439. // CHECK:STDOUT: } {
  1440. // CHECK:STDOUT: %.loc5_10: type = splice_block %i32 [concrete = constants.%i32] {
  1441. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1442. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1443. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1444. // CHECK:STDOUT: }
  1445. // CHECK:STDOUT: %N.loc5_6.2: %i32 = symbolic_binding N, 0 [symbolic = %N.loc5_6.1 (constants.%N.fe8)]
  1446. // CHECK:STDOUT: %a.param: @F.%array_type.loc5_28.1 (%array_type) = value_param call_param0
  1447. // CHECK:STDOUT: %.loc5_28: type = splice_block %array_type.loc5_28.2 [symbolic = %array_type.loc5_28.1 (constants.%array_type)] {
  1448. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1449. // CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc5_6.2 [symbolic = %N.loc5_6.1 (constants.%N.fe8)]
  1450. // CHECK:STDOUT: %impl.elem0: %.63b = impl_witness_access constants.%ImplicitAs.impl_witness.972, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.047]
  1451. // CHECK:STDOUT: %bound_method.loc5_27.2: <bound method> = bound_method %N.ref, %impl.elem0 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)]
  1452. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn]
  1453. // CHECK:STDOUT: %bound_method.loc5_27.3: <bound method> = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc5_27.1 (constants.%bound_method)]
  1454. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_27.2: init Core.IntLiteral = call %bound_method.loc5_27.3(%N.ref) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1455. // CHECK:STDOUT: %.loc5_27.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc5_27.2 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1456. // CHECK:STDOUT: %.loc5_27.2: Core.IntLiteral = converted %N.ref, %.loc5_27.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1457. // CHECK:STDOUT: %array_type.loc5_28.2: type = array_type %.loc5_27.2, %C.ref [symbolic = %array_type.loc5_28.1 (constants.%array_type)]
  1458. // CHECK:STDOUT: }
  1459. // CHECK:STDOUT: %a: @F.%array_type.loc5_28.1 (%array_type) = value_binding a, %a.param
  1460. // CHECK:STDOUT: }
  1461. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
  1462. // CHECK:STDOUT: }
  1463. // CHECK:STDOUT:
  1464. // CHECK:STDOUT: class @C {
  1465. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1466. // CHECK:STDOUT: complete_type_witness = %complete_type
  1467. // CHECK:STDOUT:
  1468. // CHECK:STDOUT: !members:
  1469. // CHECK:STDOUT: .Self = constants.%C
  1470. // CHECK:STDOUT: }
  1471. // CHECK:STDOUT:
  1472. // CHECK:STDOUT: generic fn @F(%N.loc5_6.2: %i32) {
  1473. // CHECK:STDOUT: %N.loc5_6.1: %i32 = symbolic_binding N, 0 [symbolic = %N.loc5_6.1 (constants.%N.fe8)]
  1474. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc5_6.1, constants.%Int.as.ImplicitAs.impl.Convert.047 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)]
  1475. // CHECK:STDOUT: %bound_method.loc5_27.1: <bound method> = bound_method %N.loc5_6.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc5_27.1 (constants.%bound_method)]
  1476. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1: init Core.IntLiteral = call %bound_method.loc5_27.1(%N.loc5_6.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1477. // CHECK:STDOUT: %array_type.loc5_28.1: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1, constants.%C [symbolic = %array_type.loc5_28.1 (constants.%array_type)]
  1478. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc5_28.1 [symbolic = %pattern_type (constants.%pattern_type.054)]
  1479. // CHECK:STDOUT:
  1480. // CHECK:STDOUT: !definition:
  1481. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc5_28.1 [symbolic = %require_complete (constants.%require_complete.ecf)]
  1482. // CHECK:STDOUT:
  1483. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc5_28.1 (%array_type)) {
  1484. // CHECK:STDOUT: !entry:
  1485. // CHECK:STDOUT: return
  1486. // CHECK:STDOUT: }
  1487. // CHECK:STDOUT: }
  1488. // CHECK:STDOUT:
  1489. // CHECK:STDOUT: fn @G() {
  1490. // CHECK:STDOUT: !entry:
  1491. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  1492. // CHECK:STDOUT: %.loc17_7: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1493. // CHECK:STDOUT: %.loc17_11: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1494. // CHECK:STDOUT: %.loc17_15: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  1495. // CHECK:STDOUT: %.loc17_16: %tuple.type = tuple_literal (%.loc17_7, %.loc17_11, %.loc17_15) [concrete = constants.%tuple]
  1496. // CHECK:STDOUT: return
  1497. // CHECK:STDOUT: }
  1498. // CHECK:STDOUT:
  1499. // CHECK:STDOUT: specific @F(constants.%N.fe8) {
  1500. // CHECK:STDOUT: %N.loc5_6.1 => constants.%N.fe8
  1501. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound
  1502. // CHECK:STDOUT: %bound_method.loc5_27.1 => constants.%bound_method
  1503. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc5_27.1 => constants.%Int.as.ImplicitAs.impl.Convert.call
  1504. // CHECK:STDOUT: %array_type.loc5_28.1 => constants.%array_type
  1505. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.054
  1506. // CHECK:STDOUT: }
  1507. // CHECK:STDOUT: