stringify.carbon 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/generic/stringify.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/stringify.carbon
  10. // --- fail_empty_params.carbon
  11. library "[[@TEST_NAME]]";
  12. class NoParams {}
  13. class EmptyParams() {}
  14. var v: NoParams;
  15. // CHECK:STDERR: fail_empty_params.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `NoParams` to `EmptyParams()` [ImplicitAsConversionFailure]
  16. // CHECK:STDERR: var w: EmptyParams() = v;
  17. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  18. // CHECK:STDERR: fail_empty_params.carbon:[[@LINE+4]]:1: note: type `NoParams` does not implement interface `Core.ImplicitAs(EmptyParams())` [MissingImplInMemberAccessNote]
  19. // CHECK:STDERR: var w: EmptyParams() = v;
  20. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  21. // CHECK:STDERR:
  22. var w: EmptyParams() = v;
  23. // --- fail_nested.carbon
  24. library "[[@TEST_NAME]]";
  25. class Outer(T:! type) {
  26. class Inner(U:! type) {
  27. }
  28. }
  29. var v: Outer({}*);
  30. // TODO: It would be nice to include the `Outer({}*).` prefix in the name of `Inner`.
  31. // CHECK:STDERR: fail_nested.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `Outer({}*)` to `Inner({.a: i32}*)` [ImplicitAsConversionFailure]
  32. // CHECK:STDERR: var w: Outer({}*).Inner({.a: i32}*) = v;
  33. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  34. // CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:1: note: type `Outer({}*)` does not implement interface `Core.ImplicitAs(Inner({.a: i32}*))` [MissingImplInMemberAccessNote]
  35. // CHECK:STDERR: var w: Outer({}*).Inner({.a: i32}*) = v;
  36. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  37. // CHECK:STDERR:
  38. var w: Outer({}*).Inner({.a: i32}*) = v;
  39. // --- fail_int_value.carbon
  40. library "[[@TEST_NAME]]";
  41. class C(N:! i32) {}
  42. // CHECK:STDERR: fail_int_value.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `()` to `C(123)` [ImplicitAsConversionFailure]
  43. // CHECK:STDERR: var v: C(123) = ();
  44. // CHECK:STDERR: ^~~~~~~~~~~~~
  45. // CHECK:STDERR: fail_int_value.carbon:[[@LINE+4]]:1: note: type `()` does not implement interface `Core.ImplicitAs(C(123))` [MissingImplInMemberAccessNote]
  46. // CHECK:STDERR: var v: C(123) = ();
  47. // CHECK:STDERR: ^~~~~~~~~~~~~
  48. // CHECK:STDERR:
  49. var v: C(123) = ();
  50. // --- fail_class_param.carbon
  51. library "[[@TEST_NAME]]";
  52. class D {
  53. var a: i32;
  54. var b: i32;
  55. }
  56. class E(F:! D) {}
  57. // CHECK:STDERR: fail_class_param.carbon:[[@LINE+14]]:8: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant]
  58. // CHECK:STDERR: var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D);
  59. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
  60. // CHECK:STDERR: fail_class_param.carbon:[[@LINE-5]]:9: note: initializing generic parameter `F` declared here [InitializingGenericParam]
  61. // CHECK:STDERR: class E(F:! D) {}
  62. // CHECK:STDERR: ^
  63. // CHECK:STDERR:
  64. // CHECK:STDERR: fail_class_param.carbon:[[@LINE+7]]:36: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant]
  65. // CHECK:STDERR: var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D);
  66. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
  67. // CHECK:STDERR: fail_class_param.carbon:[[@LINE-12]]:9: note: initializing generic parameter `F` declared here [InitializingGenericParam]
  68. // CHECK:STDERR: class E(F:! D) {}
  69. // CHECK:STDERR: ^
  70. // CHECK:STDERR:
  71. var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D);
  72. // CHECK:STDOUT: --- fail_empty_params.carbon
  73. // CHECK:STDOUT:
  74. // CHECK:STDOUT: constants {
  75. // CHECK:STDOUT: %NoParams: type = class_type @NoParams [template]
  76. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  77. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  78. // CHECK:STDOUT: %EmptyParams.type: type = generic_class_type @EmptyParams [template]
  79. // CHECK:STDOUT: %EmptyParams.generic: %EmptyParams.type = struct_value () [template]
  80. // CHECK:STDOUT: %EmptyParams: type = class_type @EmptyParams [template]
  81. // CHECK:STDOUT: }
  82. // CHECK:STDOUT:
  83. // CHECK:STDOUT: imports {
  84. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  85. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  86. // CHECK:STDOUT: import Core//prelude
  87. // CHECK:STDOUT: import Core//prelude/...
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT: }
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: file {
  92. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  93. // CHECK:STDOUT: .Core = imports.%Core
  94. // CHECK:STDOUT: .NoParams = %NoParams.decl
  95. // CHECK:STDOUT: .EmptyParams = %EmptyParams.decl
  96. // CHECK:STDOUT: .v = %v
  97. // CHECK:STDOUT: .w = %w
  98. // CHECK:STDOUT: }
  99. // CHECK:STDOUT: %Core.import = import Core
  100. // CHECK:STDOUT: %NoParams.decl: type = class_decl @NoParams [template = constants.%NoParams] {} {}
  101. // CHECK:STDOUT: %EmptyParams.decl: %EmptyParams.type = class_decl @EmptyParams [template = constants.%EmptyParams.generic] {} {}
  102. // CHECK:STDOUT: name_binding_decl {
  103. // CHECK:STDOUT: %v.patt: %NoParams = binding_pattern v
  104. // CHECK:STDOUT: %.loc7: %NoParams = var_pattern %v.patt
  105. // CHECK:STDOUT: }
  106. // CHECK:STDOUT: %v.var: ref %NoParams = var v
  107. // CHECK:STDOUT: %NoParams.ref: type = name_ref NoParams, %NoParams.decl [template = constants.%NoParams]
  108. // CHECK:STDOUT: %v: ref %NoParams = bind_name v, %v.var
  109. // CHECK:STDOUT: name_binding_decl {
  110. // CHECK:STDOUT: %w.patt: %EmptyParams = binding_pattern w
  111. // CHECK:STDOUT: %.loc15_1: %EmptyParams = var_pattern %w.patt
  112. // CHECK:STDOUT: }
  113. // CHECK:STDOUT: %w.var: ref %EmptyParams = var w
  114. // CHECK:STDOUT: %.loc15_20: type = splice_block %EmptyParams [template = constants.%EmptyParams] {
  115. // CHECK:STDOUT: %EmptyParams.ref: %EmptyParams.type = name_ref EmptyParams, %EmptyParams.decl [template = constants.%EmptyParams.generic]
  116. // CHECK:STDOUT: %EmptyParams: type = class_type @EmptyParams [template = constants.%EmptyParams]
  117. // CHECK:STDOUT: }
  118. // CHECK:STDOUT: %w: ref %EmptyParams = bind_name w, %w.var
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT:
  121. // CHECK:STDOUT: class @NoParams {
  122. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  123. // CHECK:STDOUT: complete_type_witness = %complete_type
  124. // CHECK:STDOUT:
  125. // CHECK:STDOUT: !members:
  126. // CHECK:STDOUT: .Self = constants.%NoParams
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: class @EmptyParams {
  130. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  131. // CHECK:STDOUT: complete_type_witness = %complete_type
  132. // CHECK:STDOUT:
  133. // CHECK:STDOUT: !members:
  134. // CHECK:STDOUT: .Self = constants.%EmptyParams
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: fn @__global_init() {
  138. // CHECK:STDOUT: !entry:
  139. // CHECK:STDOUT: %v.ref: ref %NoParams = name_ref v, file.%v
  140. // CHECK:STDOUT: %.loc15: %EmptyParams = converted %v.ref, <error> [template = <error>]
  141. // CHECK:STDOUT: assign file.%w.var, <error>
  142. // CHECK:STDOUT: return
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT:
  145. // CHECK:STDOUT: --- fail_nested.carbon
  146. // CHECK:STDOUT:
  147. // CHECK:STDOUT: constants {
  148. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  149. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  150. // CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [template]
  151. // CHECK:STDOUT: %Outer.generic: %Outer.type = struct_value () [template]
  152. // CHECK:STDOUT: %Outer.9d6: type = class_type @Outer, @Outer(%T) [symbolic]
  153. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic]
  154. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic]
  155. // CHECK:STDOUT: %Inner.type.eae: type = generic_class_type @Inner, @Outer(%T) [symbolic]
  156. // CHECK:STDOUT: %Inner.generic.137: %Inner.type.eae = struct_value () [symbolic]
  157. // CHECK:STDOUT: %Inner.c71: type = class_type @Inner, @Inner(%T, %U) [symbolic]
  158. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  159. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  160. // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [template]
  161. // CHECK:STDOUT: %Outer.614: type = class_type @Outer, @Outer(%ptr.c28) [template]
  162. // CHECK:STDOUT: %Inner.type.5d2: type = generic_class_type @Inner, @Outer(%ptr.c28) [template]
  163. // CHECK:STDOUT: %Inner.generic.8e6: %Inner.type.5d2 = struct_value () [template]
  164. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  165. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  166. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template]
  167. // CHECK:STDOUT: %ptr.1bb: type = ptr_type %struct_type.a [template]
  168. // CHECK:STDOUT: %Inner.277: type = class_type @Inner, @Inner(%ptr.c28, %ptr.1bb) [template]
  169. // CHECK:STDOUT: }
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: imports {
  172. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  173. // CHECK:STDOUT: .Int = %Core.Int
  174. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  175. // CHECK:STDOUT: import Core//prelude
  176. // CHECK:STDOUT: import Core//prelude/...
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT: }
  179. // CHECK:STDOUT:
  180. // CHECK:STDOUT: file {
  181. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  182. // CHECK:STDOUT: .Core = imports.%Core
  183. // CHECK:STDOUT: .Outer = %Outer.decl
  184. // CHECK:STDOUT: .v = %v
  185. // CHECK:STDOUT: .w = %w
  186. // CHECK:STDOUT: }
  187. // CHECK:STDOUT: %Core.import = import Core
  188. // CHECK:STDOUT: %Outer.decl: %Outer.type = class_decl @Outer [template = constants.%Outer.generic] {
  189. // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  190. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param<invalid> [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  191. // CHECK:STDOUT: } {
  192. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  193. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)]
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT: name_binding_decl {
  196. // CHECK:STDOUT: %v.patt: %Outer.614 = binding_pattern v
  197. // CHECK:STDOUT: %.loc9_1: %Outer.614 = var_pattern %v.patt
  198. // CHECK:STDOUT: }
  199. // CHECK:STDOUT: %v.var: ref %Outer.614 = var v
  200. // CHECK:STDOUT: %.loc9_17: type = splice_block %Outer.loc9 [template = constants.%Outer.614] {
  201. // CHECK:STDOUT: %Outer.ref.loc9: %Outer.type = name_ref Outer, %Outer.decl [template = constants.%Outer.generic]
  202. // CHECK:STDOUT: %.loc9_15: %empty_struct_type = struct_literal ()
  203. // CHECK:STDOUT: %.loc9_16: type = converted %.loc9_15, constants.%empty_struct_type [template = constants.%empty_struct_type]
  204. // CHECK:STDOUT: %ptr.loc9: type = ptr_type %empty_struct_type [template = constants.%ptr.c28]
  205. // CHECK:STDOUT: %Outer.loc9: type = class_type @Outer, @Outer(constants.%ptr.c28) [template = constants.%Outer.614]
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT: %v: ref %Outer.614 = bind_name v, %v.var
  208. // CHECK:STDOUT: name_binding_decl {
  209. // CHECK:STDOUT: %w.patt: %Inner.277 = binding_pattern w
  210. // CHECK:STDOUT: %.loc19_1: %Inner.277 = var_pattern %w.patt
  211. // CHECK:STDOUT: }
  212. // CHECK:STDOUT: %w.var: ref %Inner.277 = var w
  213. // CHECK:STDOUT: %.loc19_35: type = splice_block %Inner [template = constants.%Inner.277] {
  214. // CHECK:STDOUT: %Outer.ref.loc19: %Outer.type = name_ref Outer, %Outer.decl [template = constants.%Outer.generic]
  215. // CHECK:STDOUT: %.loc19_15: %empty_struct_type = struct_literal ()
  216. // CHECK:STDOUT: %.loc19_16: type = converted %.loc19_15, constants.%empty_struct_type [template = constants.%empty_struct_type]
  217. // CHECK:STDOUT: %ptr.loc19_16: type = ptr_type %empty_struct_type [template = constants.%ptr.c28]
  218. // CHECK:STDOUT: %Outer.loc19: type = class_type @Outer, @Outer(constants.%ptr.c28) [template = constants.%Outer.614]
  219. // CHECK:STDOUT: %.loc19_18: %Inner.type.5d2 = specific_constant @Outer.%Inner.decl, @Outer(constants.%ptr.c28) [template = constants.%Inner.generic.8e6]
  220. // CHECK:STDOUT: %Inner.ref: %Inner.type.5d2 = name_ref Inner, %.loc19_18 [template = constants.%Inner.generic.8e6]
  221. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  222. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  223. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a]
  224. // CHECK:STDOUT: %ptr.loc19_34: type = ptr_type %struct_type.a [template = constants.%ptr.1bb]
  225. // CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(constants.%ptr.c28, constants.%ptr.1bb) [template = constants.%Inner.277]
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT: %w: ref %Inner.277 = bind_name w, %w.var
  228. // CHECK:STDOUT: }
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: generic class @Outer(%T.loc4_13.1: type) {
  231. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  232. // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: !definition:
  235. // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T.loc4_13.2) [symbolic = %Inner.type (constants.%Inner.type.eae)]
  236. // CHECK:STDOUT: %Inner.generic: @Outer.%Inner.type (%Inner.type.eae) = struct_value () [symbolic = %Inner.generic (constants.%Inner.generic.137)]
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: class {
  239. // CHECK:STDOUT: %Inner.decl: @Outer.%Inner.type (%Inner.type.eae) = class_decl @Inner [symbolic = @Outer.%Inner.generic (constants.%Inner.generic.137)] {
  240. // CHECK:STDOUT: %U.patt.loc5_15.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc5_15.2 (constants.%U.patt)]
  241. // CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc5_15.1, runtime_param<invalid> [symbolic = %U.patt.loc5_15.2 (constants.%U.patt)]
  242. // CHECK:STDOUT: } {
  243. // CHECK:STDOUT: %U.param: type = value_param runtime_param<invalid>
  244. // CHECK:STDOUT: %U.loc5_15.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc5_15.2 (constants.%U)]
  245. // CHECK:STDOUT: }
  246. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  247. // CHECK:STDOUT: complete_type_witness = %complete_type
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: !members:
  250. // CHECK:STDOUT: .Self = constants.%Outer.9d6
  251. // CHECK:STDOUT: .Inner = %Inner.decl
  252. // CHECK:STDOUT: }
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: generic class @Inner(@Outer.%T.loc4_13.1: type, %U.loc5_15.1: type) {
  256. // CHECK:STDOUT: %U.loc5_15.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc5_15.2 (constants.%U)]
  257. // CHECK:STDOUT: %U.patt.loc5_15.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc5_15.2 (constants.%U.patt)]
  258. // CHECK:STDOUT:
  259. // CHECK:STDOUT: !definition:
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: class {
  262. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  263. // CHECK:STDOUT: complete_type_witness = %complete_type
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: !members:
  266. // CHECK:STDOUT: .Self = constants.%Inner.c71
  267. // CHECK:STDOUT: }
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: fn @__global_init() {
  271. // CHECK:STDOUT: !entry:
  272. // CHECK:STDOUT: %v.ref: ref %Outer.614 = name_ref v, file.%v
  273. // CHECK:STDOUT: %.loc19: %Inner.277 = converted %v.ref, <error> [template = <error>]
  274. // CHECK:STDOUT: assign file.%w.var, <error>
  275. // CHECK:STDOUT: return
  276. // CHECK:STDOUT: }
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: specific @Outer(constants.%T) {
  279. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  280. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: specific @Inner(constants.%T, constants.%U) {
  284. // CHECK:STDOUT: %U.loc5_15.2 => constants.%U
  285. // CHECK:STDOUT: %U.patt.loc5_15.2 => constants.%U
  286. // CHECK:STDOUT: }
  287. // CHECK:STDOUT:
  288. // CHECK:STDOUT: specific @Outer(%T.loc4_13.2) {}
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: specific @Outer(constants.%ptr.c28) {
  291. // CHECK:STDOUT: %T.loc4_13.2 => constants.%ptr.c28
  292. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%ptr.c28
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: !definition:
  295. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.5d2
  296. // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.8e6
  297. // CHECK:STDOUT: }
  298. // CHECK:STDOUT:
  299. // CHECK:STDOUT: specific @Inner(constants.%ptr.c28, constants.%ptr.1bb) {
  300. // CHECK:STDOUT: %U.loc5_15.2 => constants.%ptr.1bb
  301. // CHECK:STDOUT: %U.patt.loc5_15.2 => constants.%ptr.1bb
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: !definition:
  304. // CHECK:STDOUT: }
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: --- fail_int_value.carbon
  307. // CHECK:STDOUT:
  308. // CHECK:STDOUT: constants {
  309. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  310. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  311. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  312. // CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic]
  313. // CHECK:STDOUT: %N.patt.8e2: %i32 = symbolic_binding_pattern N, 0 [symbolic]
  314. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  315. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  316. // CHECK:STDOUT: %C.506: type = class_type @C, @C(%N.51e) [symbolic]
  317. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  318. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  319. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [template]
  320. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  321. // CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
  322. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  323. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
  324. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_123.fff, %Convert.956 [template]
  325. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
  326. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [template]
  327. // CHECK:STDOUT: %C.4c3: type = class_type @C, @C(%int_123.f7f) [template]
  328. // CHECK:STDOUT: }
  329. // CHECK:STDOUT:
  330. // CHECK:STDOUT: imports {
  331. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  332. // CHECK:STDOUT: .Int = %Core.Int
  333. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  334. // CHECK:STDOUT: import Core//prelude
  335. // CHECK:STDOUT: import Core//prelude/...
  336. // CHECK:STDOUT: }
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: file {
  340. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  341. // CHECK:STDOUT: .Core = imports.%Core
  342. // CHECK:STDOUT: .C = %C.decl
  343. // CHECK:STDOUT: .v = %v
  344. // CHECK:STDOUT: }
  345. // CHECK:STDOUT: %Core.import = import Core
  346. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  347. // CHECK:STDOUT: %N.patt.loc4_9.1: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.8e2)]
  348. // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_9.1, runtime_param<invalid> [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.8e2)]
  349. // CHECK:STDOUT: } {
  350. // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param<invalid>
  351. // CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] {
  352. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  353. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  354. // CHECK:STDOUT: }
  355. // CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_9.2 (constants.%N.51e)]
  356. // CHECK:STDOUT: }
  357. // CHECK:STDOUT: name_binding_decl {
  358. // CHECK:STDOUT: %v.patt: %C.4c3 = binding_pattern v
  359. // CHECK:STDOUT: %.loc13_1: %C.4c3 = var_pattern %v.patt
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT: %v.var: ref %C.4c3 = var v
  362. // CHECK:STDOUT: %.loc13_13.1: type = splice_block %C [template = constants.%C.4c3] {
  363. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [template = constants.%C.generic]
  364. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [template = constants.%int_123.fff]
  365. // CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  366. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_123, %impl.elem0 [template = constants.%Convert.bound]
  367. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
  368. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_123) [template = constants.%int_123.f7f]
  369. // CHECK:STDOUT: %.loc13_13.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_123.f7f]
  370. // CHECK:STDOUT: %.loc13_13.3: %i32 = converted %int_123, %.loc13_13.2 [template = constants.%int_123.f7f]
  371. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_123.f7f) [template = constants.%C.4c3]
  372. // CHECK:STDOUT: }
  373. // CHECK:STDOUT: %v: ref %C.4c3 = bind_name v, %v.var
  374. // CHECK:STDOUT: }
  375. // CHECK:STDOUT:
  376. // CHECK:STDOUT: generic class @C(%N.loc4_9.1: %i32) {
  377. // CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.51e)]
  378. // CHECK:STDOUT: %N.patt.loc4_9.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_9.2 (constants.%N.patt.8e2)]
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: !definition:
  381. // CHECK:STDOUT:
  382. // CHECK:STDOUT: class {
  383. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  384. // CHECK:STDOUT: complete_type_witness = %complete_type
  385. // CHECK:STDOUT:
  386. // CHECK:STDOUT: !members:
  387. // CHECK:STDOUT: .Self = constants.%C.506
  388. // CHECK:STDOUT: }
  389. // CHECK:STDOUT: }
  390. // CHECK:STDOUT:
  391. // CHECK:STDOUT: fn @__global_init() {
  392. // CHECK:STDOUT: !entry:
  393. // CHECK:STDOUT: %.loc13_18: %empty_tuple.type = tuple_literal ()
  394. // CHECK:STDOUT: %.loc13_1: %C.4c3 = converted %.loc13_18, <error> [template = <error>]
  395. // CHECK:STDOUT: assign file.%v.var, <error>
  396. // CHECK:STDOUT: return
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT:
  399. // CHECK:STDOUT: specific @C(constants.%N.51e) {
  400. // CHECK:STDOUT: %N.loc4_9.2 => constants.%N.51e
  401. // CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%N.51e
  402. // CHECK:STDOUT: }
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: specific @C(constants.%int_123.f7f) {
  405. // CHECK:STDOUT: %N.loc4_9.2 => constants.%int_123.f7f
  406. // CHECK:STDOUT: %N.patt.loc4_9.2 => constants.%int_123.f7f
  407. // CHECK:STDOUT:
  408. // CHECK:STDOUT: !definition:
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT:
  411. // CHECK:STDOUT: --- fail_class_param.carbon
  412. // CHECK:STDOUT:
  413. // CHECK:STDOUT: constants {
  414. // CHECK:STDOUT: %D: type = class_type @D [template]
  415. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  416. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  417. // CHECK:STDOUT: %D.elem: type = unbound_element_type %D, %i32 [template]
  418. // CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [template]
  419. // CHECK:STDOUT: %complete_type.705: <witness> = complete_type_witness %struct_type.a.b.501 [template]
  420. // CHECK:STDOUT: %F: %D = bind_symbolic_name F, 0 [symbolic]
  421. // CHECK:STDOUT: %F.patt: %D = symbolic_binding_pattern F, 0 [symbolic]
  422. // CHECK:STDOUT: %E.type: type = generic_class_type @E [template]
  423. // CHECK:STDOUT: %E.generic: %E.type = struct_value () [template]
  424. // CHECK:STDOUT: %E: type = class_type @E, @E(%F) [symbolic]
  425. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  426. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  427. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
  428. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
  429. // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template]
  430. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  431. // CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
  432. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  433. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
  434. // CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [template]
  435. // CHECK:STDOUT: %Convert.specific_fn.70c: <specific function> = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template]
  436. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
  437. // CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
  438. // CHECK:STDOUT: %Convert.specific_fn.787: <specific function> = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [template]
  439. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
  440. // CHECK:STDOUT: %D.val.413: %D = struct_value (%int_1.5d2, %int_2.ef8) [template]
  441. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
  442. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template]
  443. // CHECK:STDOUT: %Convert.bound.b30: <bound method> = bound_method %int_3.1ba, %Convert.956 [template]
  444. // CHECK:STDOUT: %Convert.specific_fn.b42: <specific function> = specific_function %Convert.bound.b30, @Convert.2(%int_32) [template]
  445. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [template]
  446. // CHECK:STDOUT: %Convert.bound.ac3: <bound method> = bound_method %int_4.0c1, %Convert.956 [template]
  447. // CHECK:STDOUT: %Convert.specific_fn.450: <specific function> = specific_function %Convert.bound.ac3, @Convert.2(%int_32) [template]
  448. // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [template]
  449. // CHECK:STDOUT: %D.val.835: %D = struct_value (%int_3.822, %int_4.940) [template]
  450. // CHECK:STDOUT: }
  451. // CHECK:STDOUT:
  452. // CHECK:STDOUT: imports {
  453. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  454. // CHECK:STDOUT: .Int = %Core.Int
  455. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  456. // CHECK:STDOUT: import Core//prelude
  457. // CHECK:STDOUT: import Core//prelude/...
  458. // CHECK:STDOUT: }
  459. // CHECK:STDOUT: }
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: file {
  462. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  463. // CHECK:STDOUT: .Core = imports.%Core
  464. // CHECK:STDOUT: .D = %D.decl
  465. // CHECK:STDOUT: .E = %E.decl
  466. // CHECK:STDOUT: .g = %g
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT: %Core.import = import Core
  469. // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {}
  470. // CHECK:STDOUT: %E.decl: %E.type = class_decl @E [template = constants.%E.generic] {
  471. // CHECK:STDOUT: %F.patt.loc9_9.1: %D = symbolic_binding_pattern F, 0 [symbolic = %F.patt.loc9_9.2 (constants.%F.patt)]
  472. // CHECK:STDOUT: %F.param_patt: %D = value_param_pattern %F.patt.loc9_9.1, runtime_param<invalid> [symbolic = %F.patt.loc9_9.2 (constants.%F.patt)]
  473. // CHECK:STDOUT: } {
  474. // CHECK:STDOUT: %F.param: %D = value_param runtime_param<invalid>
  475. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D]
  476. // CHECK:STDOUT: %F.loc9_9.1: %D = bind_symbolic_name F, 0, %F.param [symbolic = %F.loc9_9.2 (constants.%F)]
  477. // CHECK:STDOUT: }
  478. // CHECK:STDOUT: name_binding_decl {
  479. // CHECK:STDOUT: %g.patt: <error> = binding_pattern g
  480. // CHECK:STDOUT: %.loc25_1: <error> = var_pattern %g.patt
  481. // CHECK:STDOUT: }
  482. // CHECK:STDOUT: %g.var: ref <error> = var g
  483. // CHECK:STDOUT: %.1: <error> = splice_block <error> [template = <error>] {
  484. // CHECK:STDOUT: %E.ref: %E.type = name_ref E, %E.decl [template = constants.%E.generic]
  485. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  486. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  487. // CHECK:STDOUT: %.loc25_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2)
  488. // CHECK:STDOUT: %impl.elem0.loc25_25.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  489. // CHECK:STDOUT: %Convert.bound.loc25_25.1: <bound method> = bound_method %int_1, %impl.elem0.loc25_25.1 [template = constants.%Convert.bound.ab5]
  490. // CHECK:STDOUT: %Convert.specific_fn.loc25_25.1: <specific function> = specific_function %Convert.bound.loc25_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
  491. // CHECK:STDOUT: %int.convert_checked.loc25_25.1: init %i32 = call %Convert.specific_fn.loc25_25.1(%int_1) [template = constants.%int_1.5d2]
  492. // CHECK:STDOUT: %.loc25_25.2: init %i32 = converted %int_1, %int.convert_checked.loc25_25.1 [template = constants.%int_1.5d2]
  493. // CHECK:STDOUT: %.loc25_25.3: ref %D = temporary_storage
  494. // CHECK:STDOUT: %.loc25_25.4: ref %i32 = class_element_access %.loc25_25.3, element0
  495. // CHECK:STDOUT: %.loc25_25.5: init %i32 = initialize_from %.loc25_25.2 to %.loc25_25.4 [template = constants.%int_1.5d2]
  496. // CHECK:STDOUT: %impl.elem0.loc25_25.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  497. // CHECK:STDOUT: %Convert.bound.loc25_25.2: <bound method> = bound_method %int_2, %impl.elem0.loc25_25.2 [template = constants.%Convert.bound.ef9]
  498. // CHECK:STDOUT: %Convert.specific_fn.loc25_25.2: <specific function> = specific_function %Convert.bound.loc25_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
  499. // CHECK:STDOUT: %int.convert_checked.loc25_25.2: init %i32 = call %Convert.specific_fn.loc25_25.2(%int_2) [template = constants.%int_2.ef8]
  500. // CHECK:STDOUT: %.loc25_25.6: init %i32 = converted %int_2, %int.convert_checked.loc25_25.2 [template = constants.%int_2.ef8]
  501. // CHECK:STDOUT: %.loc25_25.7: ref %i32 = class_element_access %.loc25_25.3, element1
  502. // CHECK:STDOUT: %.loc25_25.8: init %i32 = initialize_from %.loc25_25.6 to %.loc25_25.7 [template = constants.%int_2.ef8]
  503. // CHECK:STDOUT: %.loc25_25.9: init %D = class_init (%.loc25_25.5, %.loc25_25.8), %.loc25_25.3 [template = constants.%D.val.413]
  504. // CHECK:STDOUT: %.loc25_25.10: ref %D = temporary %.loc25_25.3, %.loc25_25.9
  505. // CHECK:STDOUT: %.loc25_26.1: ref %D = converted %.loc25_25.1, %.loc25_25.10
  506. // CHECK:STDOUT: %.loc25_26.2: %D = bind_value %.loc25_26.1
  507. // CHECK:STDOUT: }
  508. // CHECK:STDOUT: %g: <error> = bind_name g, <error>
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT:
  511. // CHECK:STDOUT: class @D {
  512. // CHECK:STDOUT: %.loc5_8: %D.elem = field_decl a, element0 [template]
  513. // CHECK:STDOUT: name_binding_decl {
  514. // CHECK:STDOUT: %.loc5_3: %D.elem = var_pattern %.loc5_8
  515. // CHECK:STDOUT: }
  516. // CHECK:STDOUT: %.var.loc5: ref %D.elem = var <invalid>
  517. // CHECK:STDOUT: %.loc6_8: %D.elem = field_decl b, element1 [template]
  518. // CHECK:STDOUT: name_binding_decl {
  519. // CHECK:STDOUT: %.loc6_3: %D.elem = var_pattern %.loc6_8
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT: %.var.loc6: ref %D.elem = var <invalid>
  522. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a.b.501 [template = constants.%complete_type.705]
  523. // CHECK:STDOUT: complete_type_witness = %complete_type
  524. // CHECK:STDOUT:
  525. // CHECK:STDOUT: !members:
  526. // CHECK:STDOUT: .Self = constants.%D
  527. // CHECK:STDOUT: .a = %.loc5_8
  528. // CHECK:STDOUT: .b = %.loc6_8
  529. // CHECK:STDOUT: }
  530. // CHECK:STDOUT:
  531. // CHECK:STDOUT: generic class @E(%F.loc9_9.1: %D) {
  532. // CHECK:STDOUT: %F.loc9_9.2: %D = bind_symbolic_name F, 0 [symbolic = %F.loc9_9.2 (constants.%F)]
  533. // CHECK:STDOUT: %F.patt.loc9_9.2: %D = symbolic_binding_pattern F, 0 [symbolic = %F.patt.loc9_9.2 (constants.%F.patt)]
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: !definition:
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: class {
  538. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  539. // CHECK:STDOUT: complete_type_witness = %complete_type
  540. // CHECK:STDOUT:
  541. // CHECK:STDOUT: !members:
  542. // CHECK:STDOUT: .Self = constants.%E
  543. // CHECK:STDOUT: }
  544. // CHECK:STDOUT: }
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: fn @__global_init() {
  547. // CHECK:STDOUT: !entry:
  548. // CHECK:STDOUT: %.loc25_31: %empty_struct_type = struct_literal ()
  549. // CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%E.decl [template = constants.%E.generic]
  550. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
  551. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1]
  552. // CHECK:STDOUT: %.loc25_53.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4)
  553. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D]
  554. // CHECK:STDOUT: %impl.elem0.loc25_53.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  555. // CHECK:STDOUT: %Convert.bound.loc25_53.1: <bound method> = bound_method %int_3, %impl.elem0.loc25_53.1 [template = constants.%Convert.bound.b30]
  556. // CHECK:STDOUT: %Convert.specific_fn.loc25_53.1: <specific function> = specific_function %Convert.bound.loc25_53.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42]
  557. // CHECK:STDOUT: %int.convert_checked.loc25_53.1: init %i32 = call %Convert.specific_fn.loc25_53.1(%int_3) [template = constants.%int_3.822]
  558. // CHECK:STDOUT: %.loc25_53.2: init %i32 = converted %int_3, %int.convert_checked.loc25_53.1 [template = constants.%int_3.822]
  559. // CHECK:STDOUT: %.loc25_53.3: ref %D = temporary_storage
  560. // CHECK:STDOUT: %.loc25_53.4: ref %i32 = class_element_access %.loc25_53.3, element0
  561. // CHECK:STDOUT: %.loc25_53.5: init %i32 = initialize_from %.loc25_53.2 to %.loc25_53.4 [template = constants.%int_3.822]
  562. // CHECK:STDOUT: %impl.elem0.loc25_53.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  563. // CHECK:STDOUT: %Convert.bound.loc25_53.2: <bound method> = bound_method %int_4, %impl.elem0.loc25_53.2 [template = constants.%Convert.bound.ac3]
  564. // CHECK:STDOUT: %Convert.specific_fn.loc25_53.2: <specific function> = specific_function %Convert.bound.loc25_53.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450]
  565. // CHECK:STDOUT: %int.convert_checked.loc25_53.2: init %i32 = call %Convert.specific_fn.loc25_53.2(%int_4) [template = constants.%int_4.940]
  566. // CHECK:STDOUT: %.loc25_53.6: init %i32 = converted %int_4, %int.convert_checked.loc25_53.2 [template = constants.%int_4.940]
  567. // CHECK:STDOUT: %.loc25_53.7: ref %i32 = class_element_access %.loc25_53.3, element1
  568. // CHECK:STDOUT: %.loc25_53.8: init %i32 = initialize_from %.loc25_53.6 to %.loc25_53.7 [template = constants.%int_4.940]
  569. // CHECK:STDOUT: %.loc25_53.9: init %D = class_init (%.loc25_53.5, %.loc25_53.8), %.loc25_53.3 [template = constants.%D.val.835]
  570. // CHECK:STDOUT: %.loc25_53.10: ref %D = temporary %.loc25_53.3, %.loc25_53.9
  571. // CHECK:STDOUT: %.loc25_55.1: ref %D = converted %.loc25_53.1, %.loc25_53.10
  572. // CHECK:STDOUT: %.loc25_55.2: %D = bind_value %.loc25_55.1
  573. // CHECK:STDOUT: assign file.%g.var, <error>
  574. // CHECK:STDOUT: return
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: specific @E(constants.%F) {
  578. // CHECK:STDOUT: %F.loc9_9.2 => constants.%F
  579. // CHECK:STDOUT: %F.patt.loc9_9.2 => constants.%F
  580. // CHECK:STDOUT: }
  581. // CHECK:STDOUT: