call.carbon 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  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/call.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/call.carbon
  10. // --- call.carbon
  11. library "[[@TEST_NAME]]";
  12. class Class(T:! type, N:! i32) {}
  13. var a: Class(i32*, 5);
  14. // Requires an implicit conversion to type `type`.
  15. var b: Class((), 0);
  16. // --- fail_too_few.carbon
  17. library "[[@TEST_NAME]]";
  18. class Class(T:! type, N:! i32) {}
  19. // CHECK:STDERR: fail_too_few.carbon:[[@LINE+7]]:8: error: 1 argument passed to generic class expecting 2 arguments [CallArgCountMismatch]
  20. // CHECK:STDERR: var a: Class(i32*);
  21. // CHECK:STDERR: ^~~~~~~~~~~
  22. // CHECK:STDERR: fail_too_few.carbon:[[@LINE-5]]:1: note: calling generic class declared here [InCallToEntity]
  23. // CHECK:STDERR: class Class(T:! type, N:! i32) {}
  24. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. // CHECK:STDERR:
  26. var a: Class(i32*);
  27. // --- fail_too_many.carbon
  28. library "[[@TEST_NAME]]";
  29. class Class(T:! type, N:! i32) {}
  30. // CHECK:STDERR: fail_too_many.carbon:[[@LINE+7]]:8: error: 3 arguments passed to generic class expecting 2 arguments [CallArgCountMismatch]
  31. // CHECK:STDERR: var a: Class(i32*, 1, 2);
  32. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  33. // CHECK:STDERR: fail_too_many.carbon:[[@LINE-5]]:1: note: calling generic class declared here [InCallToEntity]
  34. // CHECK:STDERR: class Class(T:! type, N:! i32) {}
  35. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. // CHECK:STDERR:
  37. var a: Class(i32*, 1, 2);
  38. // --- fail_no_conversion.carbon
  39. library "[[@TEST_NAME]]";
  40. class Class(T:! type, N:! i32) {}
  41. // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure]
  42. // CHECK:STDERR: var a: Class(5, i32*);
  43. // CHECK:STDERR: ^~~~~~~~~~~~~~
  44. // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
  45. // CHECK:STDERR: var a: Class(5, i32*);
  46. // CHECK:STDERR: ^~~~~~~~~~~~~~
  47. // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  48. // CHECK:STDERR: class Class(T:! type, N:! i32) {}
  49. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  50. var a: Class(5, i32*);
  51. // --- call_in_nested_return_type.carbon
  52. class Outer(T:! type) {
  53. class Inner(U:! type) {
  54. fn A() -> Outer(T) {
  55. return {};
  56. }
  57. fn B() -> Outer(U) {
  58. return {};
  59. }
  60. fn C() -> Inner(T) {
  61. return {};
  62. }
  63. fn D() -> Inner(U) {
  64. return {};
  65. }
  66. }
  67. }
  68. // CHECK:STDOUT: --- call.carbon
  69. // CHECK:STDOUT:
  70. // CHECK:STDOUT: constants {
  71. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  72. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  73. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  74. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  75. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  76. // CHECK:STDOUT: %N.356: %i32 = bind_symbolic_name N, 1 [symbolic]
  77. // CHECK:STDOUT: %N.patt.8cf: %i32 = symbolic_binding_pattern N, 1 [symbolic]
  78. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  79. // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template]
  80. // CHECK:STDOUT: %Class.ab2: type = class_type @Class, @Class(%T, %N.356) [symbolic]
  81. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  82. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  83. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template]
  84. // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [template]
  85. // CHECK:STDOUT: %Class.f29: type = class_type @Class, @Class(%ptr.235, %int_5.0f6) [template]
  86. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template]
  87. // CHECK:STDOUT: %Class.dd4: type = class_type @Class, @Class(%empty_tuple.type, %int_0.6a9) [template]
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT:
  90. // CHECK:STDOUT: imports {
  91. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  92. // CHECK:STDOUT: .Int = %import_ref.485
  93. // CHECK:STDOUT: .ImplicitAs = %import_ref.d44
  94. // CHECK:STDOUT: import Core//prelude
  95. // CHECK:STDOUT: import Core//prelude/...
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT:
  99. // CHECK:STDOUT: file {
  100. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  101. // CHECK:STDOUT: .Core = imports.%Core
  102. // CHECK:STDOUT: .Class = %Class.decl
  103. // CHECK:STDOUT: .a = %a
  104. // CHECK:STDOUT: .b = %b
  105. // CHECK:STDOUT: }
  106. // CHECK:STDOUT: %Core.import = import Core
  107. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.generic] {
  108. // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  109. // 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)]
  110. // CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  111. // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param<invalid> [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  112. // CHECK:STDOUT: } {
  113. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  114. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)]
  115. // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param<invalid>
  116. // CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] {
  117. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  118. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.356)]
  121. // CHECK:STDOUT: }
  122. // CHECK:STDOUT: %a.var: ref %Class.f29 = var a
  123. // CHECK:STDOUT: %a: ref %Class.f29 = bind_name a, %a.var
  124. // CHECK:STDOUT: %b.var: ref %Class.dd4 = var b
  125. // CHECK:STDOUT: %b: ref %Class.dd4 = bind_name b, %b.var
  126. // CHECK:STDOUT: }
  127. // CHECK:STDOUT:
  128. // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) {
  129. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  130. // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  131. // CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.356)]
  132. // CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  133. // CHECK:STDOUT:
  134. // CHECK:STDOUT: !definition:
  135. // CHECK:STDOUT:
  136. // CHECK:STDOUT: class {
  137. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  138. // CHECK:STDOUT: complete_type_witness = %complete_type
  139. // CHECK:STDOUT:
  140. // CHECK:STDOUT: !members:
  141. // CHECK:STDOUT: .Self = constants.%Class.ab2
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT:
  145. // CHECK:STDOUT: specific @Class(constants.%T, constants.%N.356) {
  146. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  147. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
  148. // CHECK:STDOUT: %N.loc4_23.2 => constants.%N.356
  149. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.356
  150. // CHECK:STDOUT: }
  151. // CHECK:STDOUT:
  152. // CHECK:STDOUT: specific @Class(constants.%ptr.235, constants.%int_5.0f6) {
  153. // CHECK:STDOUT: %T.loc4_13.2 => constants.%ptr.235
  154. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%ptr.235
  155. // CHECK:STDOUT: %N.loc4_23.2 => constants.%int_5.0f6
  156. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%int_5.0f6
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: !definition:
  159. // CHECK:STDOUT: }
  160. // CHECK:STDOUT:
  161. // CHECK:STDOUT: specific @Class(constants.%empty_tuple.type, constants.%int_0.6a9) {
  162. // CHECK:STDOUT: %T.loc4_13.2 => constants.%empty_tuple.type
  163. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%empty_tuple.type
  164. // CHECK:STDOUT: %N.loc4_23.2 => constants.%int_0.6a9
  165. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%int_0.6a9
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: !definition:
  168. // CHECK:STDOUT: }
  169. // CHECK:STDOUT:
  170. // CHECK:STDOUT: --- fail_too_few.carbon
  171. // CHECK:STDOUT:
  172. // CHECK:STDOUT: constants {
  173. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  174. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  175. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  176. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  177. // CHECK:STDOUT: %N.356: %i32 = bind_symbolic_name N, 1 [symbolic]
  178. // CHECK:STDOUT: %N.patt.8cf: %i32 = symbolic_binding_pattern N, 1 [symbolic]
  179. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  180. // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template]
  181. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.356) [symbolic]
  182. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  183. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  184. // CHECK:STDOUT: }
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: imports {
  187. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  188. // CHECK:STDOUT: .Int = %import_ref.485
  189. // CHECK:STDOUT: import Core//prelude
  190. // CHECK:STDOUT: import Core//prelude/...
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT: }
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: file {
  195. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  196. // CHECK:STDOUT: .Core = imports.%Core
  197. // CHECK:STDOUT: .Class = %Class.decl
  198. // CHECK:STDOUT: .a = %a
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT: %Core.import = import Core
  201. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.generic] {
  202. // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  203. // 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)]
  204. // CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  205. // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param<invalid> [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  206. // CHECK:STDOUT: } {
  207. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  208. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)]
  209. // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param<invalid>
  210. // CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] {
  211. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  212. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.356)]
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT: %a.var: ref <error> = var a
  217. // CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT:
  220. // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) {
  221. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  222. // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  223. // CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.356)]
  224. // CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  225. // CHECK:STDOUT:
  226. // CHECK:STDOUT: !definition:
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: class {
  229. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  230. // CHECK:STDOUT: complete_type_witness = %complete_type
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: !members:
  233. // CHECK:STDOUT: .Self = constants.%Class
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: specific @Class(constants.%T, constants.%N.356) {
  238. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  239. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
  240. // CHECK:STDOUT: %N.loc4_23.2 => constants.%N.356
  241. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.356
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: --- fail_too_many.carbon
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: constants {
  247. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  248. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  249. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  250. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  251. // CHECK:STDOUT: %N.356: %i32 = bind_symbolic_name N, 1 [symbolic]
  252. // CHECK:STDOUT: %N.patt.8cf: %i32 = symbolic_binding_pattern N, 1 [symbolic]
  253. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  254. // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template]
  255. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.356) [symbolic]
  256. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  257. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: imports {
  261. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  262. // CHECK:STDOUT: .Int = %import_ref.485
  263. // CHECK:STDOUT: import Core//prelude
  264. // CHECK:STDOUT: import Core//prelude/...
  265. // CHECK:STDOUT: }
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: file {
  269. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  270. // CHECK:STDOUT: .Core = imports.%Core
  271. // CHECK:STDOUT: .Class = %Class.decl
  272. // CHECK:STDOUT: .a = %a
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT: %Core.import = import Core
  275. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.generic] {
  276. // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  277. // 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)]
  278. // CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  279. // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param<invalid> [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  280. // CHECK:STDOUT: } {
  281. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  282. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)]
  283. // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param<invalid>
  284. // CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] {
  285. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  286. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.356)]
  289. // CHECK:STDOUT: }
  290. // CHECK:STDOUT: %a.var: ref <error> = var a
  291. // CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
  292. // CHECK:STDOUT: }
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) {
  295. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  296. // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  297. // CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.356)]
  298. // CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: !definition:
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: class {
  303. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  304. // CHECK:STDOUT: complete_type_witness = %complete_type
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: !members:
  307. // CHECK:STDOUT: .Self = constants.%Class
  308. // CHECK:STDOUT: }
  309. // CHECK:STDOUT: }
  310. // CHECK:STDOUT:
  311. // CHECK:STDOUT: specific @Class(constants.%T, constants.%N.356) {
  312. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  313. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
  314. // CHECK:STDOUT: %N.loc4_23.2 => constants.%N.356
  315. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.356
  316. // CHECK:STDOUT: }
  317. // CHECK:STDOUT:
  318. // CHECK:STDOUT: --- fail_no_conversion.carbon
  319. // CHECK:STDOUT:
  320. // CHECK:STDOUT: constants {
  321. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  322. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  323. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  324. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  325. // CHECK:STDOUT: %N.356: %i32 = bind_symbolic_name N, 1 [symbolic]
  326. // CHECK:STDOUT: %N.patt.8cf: %i32 = symbolic_binding_pattern N, 1 [symbolic]
  327. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  328. // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [template]
  329. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T, %N.356) [symbolic]
  330. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  331. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT:
  334. // CHECK:STDOUT: imports {
  335. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  336. // CHECK:STDOUT: .Int = %import_ref.485
  337. // CHECK:STDOUT: .ImplicitAs = %import_ref.d44
  338. // CHECK:STDOUT: import Core//prelude
  339. // CHECK:STDOUT: import Core//prelude/...
  340. // CHECK:STDOUT: }
  341. // CHECK:STDOUT: }
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: file {
  344. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  345. // CHECK:STDOUT: .Core = imports.%Core
  346. // CHECK:STDOUT: .Class = %Class.decl
  347. // CHECK:STDOUT: .a = %a
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT: %Core.import = import Core
  350. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.generic] {
  351. // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  352. // 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)]
  353. // CHECK:STDOUT: %N.patt.loc4_23.1: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  354. // CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_23.1, runtime_param<invalid> [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  355. // CHECK:STDOUT: } {
  356. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  357. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)]
  358. // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param<invalid>
  359. // CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] {
  360. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  361. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  362. // CHECK:STDOUT: }
  363. // CHECK:STDOUT: %N.loc4_23.1: %i32 = bind_symbolic_name N, 1, %N.param [symbolic = %N.loc4_23.2 (constants.%N.356)]
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT: %a.var: ref <error> = var a
  366. // CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
  367. // CHECK:STDOUT: }
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: %i32) {
  370. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  371. // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  372. // CHECK:STDOUT: %N.loc4_23.2: %i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N.356)]
  373. // CHECK:STDOUT: %N.patt.loc4_23.2: %i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt.8cf)]
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: !definition:
  376. // CHECK:STDOUT:
  377. // CHECK:STDOUT: class {
  378. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  379. // CHECK:STDOUT: complete_type_witness = %complete_type
  380. // CHECK:STDOUT:
  381. // CHECK:STDOUT: !members:
  382. // CHECK:STDOUT: .Self = constants.%Class
  383. // CHECK:STDOUT: }
  384. // CHECK:STDOUT: }
  385. // CHECK:STDOUT:
  386. // CHECK:STDOUT: specific @Class(constants.%T, constants.%N.356) {
  387. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  388. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
  389. // CHECK:STDOUT: %N.loc4_23.2 => constants.%N.356
  390. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N.356
  391. // CHECK:STDOUT: }
  392. // CHECK:STDOUT:
  393. // CHECK:STDOUT: --- call_in_nested_return_type.carbon
  394. // CHECK:STDOUT:
  395. // CHECK:STDOUT: constants {
  396. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  397. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  398. // CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [template]
  399. // CHECK:STDOUT: %Outer.generic: %Outer.type = struct_value () [template]
  400. // CHECK:STDOUT: %Outer.9d6: type = class_type @Outer, @Outer(%T) [symbolic]
  401. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic]
  402. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic]
  403. // CHECK:STDOUT: %Inner.type.eae: type = generic_class_type @Inner, @Outer(%T) [symbolic]
  404. // CHECK:STDOUT: %Inner.generic.137: %Inner.type.eae = struct_value () [symbolic]
  405. // CHECK:STDOUT: %Inner.c71: type = class_type @Inner, @Inner(%T, %U) [symbolic]
  406. // CHECK:STDOUT: %A.type.8d7: type = fn_type @A, @Inner(%T, %U) [symbolic]
  407. // CHECK:STDOUT: %A.d0e: %A.type.8d7 = struct_value () [symbolic]
  408. // CHECK:STDOUT: %Outer.99f: type = class_type @Outer, @Outer(%U) [symbolic]
  409. // CHECK:STDOUT: %B.type.880: type = fn_type @B, @Inner(%T, %U) [symbolic]
  410. // CHECK:STDOUT: %B.c7b: %B.type.880 = struct_value () [symbolic]
  411. // CHECK:STDOUT: %Inner.13a: type = class_type @Inner, @Inner(%T, %T) [symbolic]
  412. // CHECK:STDOUT: %C.type.714: type = fn_type @C, @Inner(%T, %U) [symbolic]
  413. // CHECK:STDOUT: %C.e62: %C.type.714 = struct_value () [symbolic]
  414. // CHECK:STDOUT: %D.type.102: type = fn_type @D, @Inner(%T, %U) [symbolic]
  415. // CHECK:STDOUT: %D.d85: %D.type.102 = struct_value () [symbolic]
  416. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  417. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  418. // CHECK:STDOUT: %require_complete.127: <witness> = require_complete_type %Outer.9d6 [symbolic]
  419. // CHECK:STDOUT: %Outer.val.234: %Outer.9d6 = struct_value () [symbolic]
  420. // CHECK:STDOUT: %Inner.type.a71: type = generic_class_type @Inner, @Outer(%U) [symbolic]
  421. // CHECK:STDOUT: %Inner.generic.e3b: %Inner.type.a71 = struct_value () [symbolic]
  422. // CHECK:STDOUT: %require_complete.964: <witness> = require_complete_type %Outer.99f [symbolic]
  423. // CHECK:STDOUT: %Outer.val.a2f: %Outer.99f = struct_value () [symbolic]
  424. // CHECK:STDOUT: %A.type.5c8: type = fn_type @A, @Inner(%T, %T) [symbolic]
  425. // CHECK:STDOUT: %A.7e2: %A.type.5c8 = struct_value () [symbolic]
  426. // CHECK:STDOUT: %B.type.ec0: type = fn_type @B, @Inner(%T, %T) [symbolic]
  427. // CHECK:STDOUT: %B.051: %B.type.ec0 = struct_value () [symbolic]
  428. // CHECK:STDOUT: %C.type.1cf: type = fn_type @C, @Inner(%T, %T) [symbolic]
  429. // CHECK:STDOUT: %C.cf5: %C.type.1cf = struct_value () [symbolic]
  430. // CHECK:STDOUT: %D.type.7bc: type = fn_type @D, @Inner(%T, %T) [symbolic]
  431. // CHECK:STDOUT: %D.aa3: %D.type.7bc = struct_value () [symbolic]
  432. // CHECK:STDOUT: %require_complete.7b1: <witness> = require_complete_type %Inner.13a [symbolic]
  433. // CHECK:STDOUT: %Inner.val.69d: %Inner.13a = struct_value () [symbolic]
  434. // CHECK:STDOUT: %require_complete.e7e: <witness> = require_complete_type %Inner.c71 [symbolic]
  435. // CHECK:STDOUT: %Inner.val.dfa: %Inner.c71 = struct_value () [symbolic]
  436. // CHECK:STDOUT: }
  437. // CHECK:STDOUT:
  438. // CHECK:STDOUT: imports {
  439. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  440. // CHECK:STDOUT: import Core//prelude
  441. // CHECK:STDOUT: import Core//prelude/...
  442. // CHECK:STDOUT: }
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: file {
  446. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  447. // CHECK:STDOUT: .Core = imports.%Core
  448. // CHECK:STDOUT: .Outer = %Outer.decl
  449. // CHECK:STDOUT: }
  450. // CHECK:STDOUT: %Core.import = import Core
  451. // CHECK:STDOUT: %Outer.decl: %Outer.type = class_decl @Outer [template = constants.%Outer.generic] {
  452. // CHECK:STDOUT: %T.patt.loc2_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)]
  453. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc2_13.1, runtime_param<invalid> [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)]
  454. // CHECK:STDOUT: } {
  455. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  456. // CHECK:STDOUT: %T.loc2_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc2_13.2 (constants.%T)]
  457. // CHECK:STDOUT: }
  458. // CHECK:STDOUT: }
  459. // CHECK:STDOUT:
  460. // CHECK:STDOUT: generic class @Outer(%T.loc2_13.1: type) {
  461. // CHECK:STDOUT: %T.loc2_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc2_13.2 (constants.%T)]
  462. // CHECK:STDOUT: %T.patt.loc2_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)]
  463. // CHECK:STDOUT:
  464. // CHECK:STDOUT: !definition:
  465. // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T.loc2_13.2) [symbolic = %Inner.type (constants.%Inner.type.eae)]
  466. // CHECK:STDOUT: %Inner.generic: @Outer.%Inner.type (%Inner.type.eae) = struct_value () [symbolic = %Inner.generic (constants.%Inner.generic.137)]
  467. // CHECK:STDOUT:
  468. // CHECK:STDOUT: class {
  469. // CHECK:STDOUT: %Inner.decl: @Outer.%Inner.type (%Inner.type.eae) = class_decl @Inner [symbolic = @Outer.%Inner.generic (constants.%Inner.generic.137)] {
  470. // CHECK:STDOUT: %U.patt.loc3_15.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc3_15.2 (constants.%U.patt)]
  471. // CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc3_15.1, runtime_param<invalid> [symbolic = %U.patt.loc3_15.2 (constants.%U.patt)]
  472. // CHECK:STDOUT: } {
  473. // CHECK:STDOUT: %U.param: type = value_param runtime_param<invalid>
  474. // CHECK:STDOUT: %U.loc3_15.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc3_15.2 (constants.%U)]
  475. // CHECK:STDOUT: }
  476. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  477. // CHECK:STDOUT: complete_type_witness = %complete_type
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: !members:
  480. // CHECK:STDOUT: .Self = constants.%Outer.9d6
  481. // CHECK:STDOUT: .Inner = %Inner.decl
  482. // CHECK:STDOUT: }
  483. // CHECK:STDOUT: }
  484. // CHECK:STDOUT:
  485. // CHECK:STDOUT: generic class @Inner(@Outer.%T.loc2_13.1: type, %U.loc3_15.1: type) {
  486. // CHECK:STDOUT: %U.loc3_15.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc3_15.2 (constants.%U)]
  487. // CHECK:STDOUT: %U.patt.loc3_15.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc3_15.2 (constants.%U.patt)]
  488. // CHECK:STDOUT:
  489. // CHECK:STDOUT: !definition:
  490. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  491. // CHECK:STDOUT: %A.type: type = fn_type @A, @Inner(%T, %U.loc3_15.2) [symbolic = %A.type (constants.%A.type.8d7)]
  492. // CHECK:STDOUT: %A: @Inner.%A.type (%A.type.8d7) = struct_value () [symbolic = %A (constants.%A.d0e)]
  493. // CHECK:STDOUT: %B.type: type = fn_type @B, @Inner(%T, %U.loc3_15.2) [symbolic = %B.type (constants.%B.type.880)]
  494. // CHECK:STDOUT: %B: @Inner.%B.type (%B.type.880) = struct_value () [symbolic = %B (constants.%B.c7b)]
  495. // CHECK:STDOUT: %C.type: type = fn_type @C, @Inner(%T, %U.loc3_15.2) [symbolic = %C.type (constants.%C.type.714)]
  496. // CHECK:STDOUT: %C: @Inner.%C.type (%C.type.714) = struct_value () [symbolic = %C (constants.%C.e62)]
  497. // CHECK:STDOUT: %D.type: type = fn_type @D, @Inner(%T, %U.loc3_15.2) [symbolic = %D.type (constants.%D.type.102)]
  498. // CHECK:STDOUT: %D: @Inner.%D.type (%D.type.102) = struct_value () [symbolic = %D (constants.%D.d85)]
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: class {
  501. // CHECK:STDOUT: %A.decl: @Inner.%A.type (%A.type.8d7) = fn_decl @A [symbolic = @Inner.%A (constants.%A.d0e)] {
  502. // CHECK:STDOUT: %return.patt: @A.%Outer.loc4_22.1 (%Outer.9d6) = return_slot_pattern
  503. // CHECK:STDOUT: %return.param_patt: @A.%Outer.loc4_22.1 (%Outer.9d6) = out_param_pattern %return.patt, runtime_param0
  504. // CHECK:STDOUT: } {
  505. // CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.generic]
  506. // CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc2_13.1 [symbolic = %T (constants.%T)]
  507. // CHECK:STDOUT: %Outer.loc4_22.2: type = class_type @Outer, @Outer(constants.%T) [symbolic = %Outer.loc4_22.1 (constants.%Outer.9d6)]
  508. // CHECK:STDOUT: %return.param: ref @A.%Outer.loc4_22.1 (%Outer.9d6) = out_param runtime_param0
  509. // CHECK:STDOUT: %return: ref @A.%Outer.loc4_22.1 (%Outer.9d6) = return_slot %return.param
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT: %B.decl: @Inner.%B.type (%B.type.880) = fn_decl @B [symbolic = @Inner.%B (constants.%B.c7b)] {
  512. // CHECK:STDOUT: %return.patt: @B.%Outer.loc7_22.1 (%Outer.99f) = return_slot_pattern
  513. // CHECK:STDOUT: %return.param_patt: @B.%Outer.loc7_22.1 (%Outer.99f) = out_param_pattern %return.patt, runtime_param0
  514. // CHECK:STDOUT: } {
  515. // CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.generic]
  516. // CHECK:STDOUT: %U.ref: type = name_ref U, @Inner.%U.loc3_15.1 [symbolic = %U (constants.%U)]
  517. // CHECK:STDOUT: %Outer.loc7_22.2: type = class_type @Outer, @Outer(constants.%U) [symbolic = %Outer.loc7_22.1 (constants.%Outer.99f)]
  518. // CHECK:STDOUT: %return.param: ref @B.%Outer.loc7_22.1 (%Outer.99f) = out_param runtime_param0
  519. // CHECK:STDOUT: %return: ref @B.%Outer.loc7_22.1 (%Outer.99f) = return_slot %return.param
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT: %C.decl: @Inner.%C.type (%C.type.714) = fn_decl @C [symbolic = @Inner.%C (constants.%C.e62)] {
  522. // CHECK:STDOUT: %return.patt: @C.%Inner.loc10_22.1 (%Inner.13a) = return_slot_pattern
  523. // CHECK:STDOUT: %return.param_patt: @C.%Inner.loc10_22.1 (%Inner.13a) = out_param_pattern %return.patt, runtime_param0
  524. // CHECK:STDOUT: } {
  525. // CHECK:STDOUT: %.loc10: @C.%Inner.type (%Inner.type.eae) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.generic (constants.%Inner.generic.137)]
  526. // CHECK:STDOUT: %Inner.ref: @C.%Inner.type (%Inner.type.eae) = name_ref Inner, %.loc10 [symbolic = %Inner.generic (constants.%Inner.generic.137)]
  527. // CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc2_13.1 [symbolic = %T (constants.%T)]
  528. // CHECK:STDOUT: %Inner.loc10_22.2: type = class_type @Inner, @Inner(constants.%T, constants.%T) [symbolic = %Inner.loc10_22.1 (constants.%Inner.13a)]
  529. // CHECK:STDOUT: %return.param: ref @C.%Inner.loc10_22.1 (%Inner.13a) = out_param runtime_param0
  530. // CHECK:STDOUT: %return: ref @C.%Inner.loc10_22.1 (%Inner.13a) = return_slot %return.param
  531. // CHECK:STDOUT: }
  532. // CHECK:STDOUT: %D.decl: @Inner.%D.type (%D.type.102) = fn_decl @D [symbolic = @Inner.%D (constants.%D.d85)] {
  533. // CHECK:STDOUT: %return.patt: @D.%Inner.loc13_22.1 (%Inner.c71) = return_slot_pattern
  534. // CHECK:STDOUT: %return.param_patt: @D.%Inner.loc13_22.1 (%Inner.c71) = out_param_pattern %return.patt, runtime_param0
  535. // CHECK:STDOUT: } {
  536. // CHECK:STDOUT: %.loc13: @D.%Inner.type (%Inner.type.eae) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.generic (constants.%Inner.generic.137)]
  537. // CHECK:STDOUT: %Inner.ref: @D.%Inner.type (%Inner.type.eae) = name_ref Inner, %.loc13 [symbolic = %Inner.generic (constants.%Inner.generic.137)]
  538. // CHECK:STDOUT: %U.ref: type = name_ref U, @Inner.%U.loc3_15.1 [symbolic = %U (constants.%U)]
  539. // CHECK:STDOUT: %Inner.loc13_22.2: type = class_type @Inner, @Inner(constants.%T, constants.%U) [symbolic = %Inner.loc13_22.1 (constants.%Inner.c71)]
  540. // CHECK:STDOUT: %return.param: ref @D.%Inner.loc13_22.1 (%Inner.c71) = out_param runtime_param0
  541. // CHECK:STDOUT: %return: ref @D.%Inner.loc13_22.1 (%Inner.c71) = return_slot %return.param
  542. // CHECK:STDOUT: }
  543. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  544. // CHECK:STDOUT: complete_type_witness = %complete_type
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: !members:
  547. // CHECK:STDOUT: .Self = constants.%Inner.c71
  548. // CHECK:STDOUT: .A = %A.decl
  549. // CHECK:STDOUT: .B = %B.decl
  550. // CHECK:STDOUT: .C = %C.decl
  551. // CHECK:STDOUT: .D = %D.decl
  552. // CHECK:STDOUT: }
  553. // CHECK:STDOUT: }
  554. // CHECK:STDOUT:
  555. // CHECK:STDOUT: generic fn @A(@Outer.%T.loc2_13.1: type, @Inner.%U.loc3_15.1: type) {
  556. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  557. // CHECK:STDOUT: %Outer.loc4_22.1: type = class_type @Outer, @Outer(%T) [symbolic = %Outer.loc4_22.1 (constants.%Outer.9d6)]
  558. // CHECK:STDOUT:
  559. // CHECK:STDOUT: !definition:
  560. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @A.%Outer.loc4_22.1 (%Outer.9d6) [symbolic = %require_complete (constants.%require_complete.127)]
  561. // CHECK:STDOUT: %Outer.val: @A.%Outer.loc4_22.1 (%Outer.9d6) = struct_value () [symbolic = %Outer.val (constants.%Outer.val.234)]
  562. // CHECK:STDOUT:
  563. // CHECK:STDOUT: fn() -> %return.param_patt: @A.%Outer.loc4_22.1 (%Outer.9d6) {
  564. // CHECK:STDOUT: !entry:
  565. // CHECK:STDOUT: %.loc5_15.1: %empty_struct_type = struct_literal ()
  566. // CHECK:STDOUT: %.loc5_15.2: init @A.%Outer.loc4_22.1 (%Outer.9d6) = class_init (), %return [symbolic = %Outer.val (constants.%Outer.val.234)]
  567. // CHECK:STDOUT: %.loc5_16: init @A.%Outer.loc4_22.1 (%Outer.9d6) = converted %.loc5_15.1, %.loc5_15.2 [symbolic = %Outer.val (constants.%Outer.val.234)]
  568. // CHECK:STDOUT: return %.loc5_16 to %return
  569. // CHECK:STDOUT: }
  570. // CHECK:STDOUT: }
  571. // CHECK:STDOUT:
  572. // CHECK:STDOUT: generic fn @B(@Outer.%T.loc2_13.1: type, @Inner.%U.loc3_15.1: type) {
  573. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic = %U (constants.%U)]
  574. // CHECK:STDOUT: %Outer.loc7_22.1: type = class_type @Outer, @Outer(%U) [symbolic = %Outer.loc7_22.1 (constants.%Outer.99f)]
  575. // CHECK:STDOUT:
  576. // CHECK:STDOUT: !definition:
  577. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @B.%Outer.loc7_22.1 (%Outer.99f) [symbolic = %require_complete (constants.%require_complete.964)]
  578. // CHECK:STDOUT: %Outer.val: @B.%Outer.loc7_22.1 (%Outer.99f) = struct_value () [symbolic = %Outer.val (constants.%Outer.val.a2f)]
  579. // CHECK:STDOUT:
  580. // CHECK:STDOUT: fn() -> %return.param_patt: @B.%Outer.loc7_22.1 (%Outer.99f) {
  581. // CHECK:STDOUT: !entry:
  582. // CHECK:STDOUT: %.loc8_15.1: %empty_struct_type = struct_literal ()
  583. // CHECK:STDOUT: %.loc8_15.2: init @B.%Outer.loc7_22.1 (%Outer.99f) = class_init (), %return [symbolic = %Outer.val (constants.%Outer.val.a2f)]
  584. // CHECK:STDOUT: %.loc8_16: init @B.%Outer.loc7_22.1 (%Outer.99f) = converted %.loc8_15.1, %.loc8_15.2 [symbolic = %Outer.val (constants.%Outer.val.a2f)]
  585. // CHECK:STDOUT: return %.loc8_16 to %return
  586. // CHECK:STDOUT: }
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT:
  589. // CHECK:STDOUT: generic fn @C(@Outer.%T.loc2_13.1: type, @Inner.%U.loc3_15.1: type) {
  590. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  591. // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T) [symbolic = %Inner.type (constants.%Inner.type.eae)]
  592. // CHECK:STDOUT: %Inner.generic: @C.%Inner.type (%Inner.type.eae) = struct_value () [symbolic = %Inner.generic (constants.%Inner.generic.137)]
  593. // CHECK:STDOUT: %Inner.loc10_22.1: type = class_type @Inner, @Inner(%T, %T) [symbolic = %Inner.loc10_22.1 (constants.%Inner.13a)]
  594. // CHECK:STDOUT:
  595. // CHECK:STDOUT: !definition:
  596. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @C.%Inner.loc10_22.1 (%Inner.13a) [symbolic = %require_complete (constants.%require_complete.7b1)]
  597. // CHECK:STDOUT: %Inner.val: @C.%Inner.loc10_22.1 (%Inner.13a) = struct_value () [symbolic = %Inner.val (constants.%Inner.val.69d)]
  598. // CHECK:STDOUT:
  599. // CHECK:STDOUT: fn() -> %return.param_patt: @C.%Inner.loc10_22.1 (%Inner.13a) {
  600. // CHECK:STDOUT: !entry:
  601. // CHECK:STDOUT: %.loc11_15.1: %empty_struct_type = struct_literal ()
  602. // CHECK:STDOUT: %.loc11_15.2: init @C.%Inner.loc10_22.1 (%Inner.13a) = class_init (), %return [symbolic = %Inner.val (constants.%Inner.val.69d)]
  603. // CHECK:STDOUT: %.loc11_16: init @C.%Inner.loc10_22.1 (%Inner.13a) = converted %.loc11_15.1, %.loc11_15.2 [symbolic = %Inner.val (constants.%Inner.val.69d)]
  604. // CHECK:STDOUT: return %.loc11_16 to %return
  605. // CHECK:STDOUT: }
  606. // CHECK:STDOUT: }
  607. // CHECK:STDOUT:
  608. // CHECK:STDOUT: generic fn @D(@Outer.%T.loc2_13.1: type, @Inner.%U.loc3_15.1: type) {
  609. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  610. // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T) [symbolic = %Inner.type (constants.%Inner.type.eae)]
  611. // CHECK:STDOUT: %Inner.generic: @D.%Inner.type (%Inner.type.eae) = struct_value () [symbolic = %Inner.generic (constants.%Inner.generic.137)]
  612. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic = %U (constants.%U)]
  613. // CHECK:STDOUT: %Inner.loc13_22.1: type = class_type @Inner, @Inner(%T, %U) [symbolic = %Inner.loc13_22.1 (constants.%Inner.c71)]
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: !definition:
  616. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @D.%Inner.loc13_22.1 (%Inner.c71) [symbolic = %require_complete (constants.%require_complete.e7e)]
  617. // CHECK:STDOUT: %Inner.val: @D.%Inner.loc13_22.1 (%Inner.c71) = struct_value () [symbolic = %Inner.val (constants.%Inner.val.dfa)]
  618. // CHECK:STDOUT:
  619. // CHECK:STDOUT: fn() -> %return.param_patt: @D.%Inner.loc13_22.1 (%Inner.c71) {
  620. // CHECK:STDOUT: !entry:
  621. // CHECK:STDOUT: %.loc14_15.1: %empty_struct_type = struct_literal ()
  622. // CHECK:STDOUT: %.loc14_15.2: init @D.%Inner.loc13_22.1 (%Inner.c71) = class_init (), %return [symbolic = %Inner.val (constants.%Inner.val.dfa)]
  623. // CHECK:STDOUT: %.loc14_16: init @D.%Inner.loc13_22.1 (%Inner.c71) = converted %.loc14_15.1, %.loc14_15.2 [symbolic = %Inner.val (constants.%Inner.val.dfa)]
  624. // CHECK:STDOUT: return %.loc14_16 to %return
  625. // CHECK:STDOUT: }
  626. // CHECK:STDOUT: }
  627. // CHECK:STDOUT:
  628. // CHECK:STDOUT: specific @Outer(constants.%T) {
  629. // CHECK:STDOUT: %T.loc2_13.2 => constants.%T
  630. // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T
  631. // CHECK:STDOUT:
  632. // CHECK:STDOUT: !definition:
  633. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.eae
  634. // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.137
  635. // CHECK:STDOUT: }
  636. // CHECK:STDOUT:
  637. // CHECK:STDOUT: specific @Inner(constants.%T, constants.%U) {
  638. // CHECK:STDOUT: %U.loc3_15.2 => constants.%U
  639. // CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%U
  640. // CHECK:STDOUT:
  641. // CHECK:STDOUT: !definition:
  642. // CHECK:STDOUT: %T => constants.%T
  643. // CHECK:STDOUT: %A.type => constants.%A.type.8d7
  644. // CHECK:STDOUT: %A => constants.%A.d0e
  645. // CHECK:STDOUT: %B.type => constants.%B.type.880
  646. // CHECK:STDOUT: %B => constants.%B.c7b
  647. // CHECK:STDOUT: %C.type => constants.%C.type.714
  648. // CHECK:STDOUT: %C => constants.%C.e62
  649. // CHECK:STDOUT: %D.type => constants.%D.type.102
  650. // CHECK:STDOUT: %D => constants.%D.d85
  651. // CHECK:STDOUT: }
  652. // CHECK:STDOUT:
  653. // CHECK:STDOUT: specific @A(constants.%T, constants.%U) {
  654. // CHECK:STDOUT: %T => constants.%T
  655. // CHECK:STDOUT: %Outer.loc4_22.1 => constants.%Outer.9d6
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT:
  658. // CHECK:STDOUT: specific @Outer(@A.%T) {}
  659. // CHECK:STDOUT:
  660. // CHECK:STDOUT: specific @Outer(constants.%U) {
  661. // CHECK:STDOUT: %T.loc2_13.2 => constants.%U
  662. // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%U
  663. // CHECK:STDOUT:
  664. // CHECK:STDOUT: !definition:
  665. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.a71
  666. // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.e3b
  667. // CHECK:STDOUT: }
  668. // CHECK:STDOUT:
  669. // CHECK:STDOUT: specific @B(constants.%T, constants.%U) {
  670. // CHECK:STDOUT: %U => constants.%U
  671. // CHECK:STDOUT: %Outer.loc7_22.1 => constants.%Outer.99f
  672. // CHECK:STDOUT: }
  673. // CHECK:STDOUT:
  674. // CHECK:STDOUT: specific @Outer(@B.%U) {}
  675. // CHECK:STDOUT:
  676. // CHECK:STDOUT: specific @Inner(constants.%T, constants.%T) {
  677. // CHECK:STDOUT: %U.loc3_15.2 => constants.%T
  678. // CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%T
  679. // CHECK:STDOUT:
  680. // CHECK:STDOUT: !definition:
  681. // CHECK:STDOUT: %T => constants.%T
  682. // CHECK:STDOUT: %A.type => constants.%A.type.5c8
  683. // CHECK:STDOUT: %A => constants.%A.7e2
  684. // CHECK:STDOUT: %B.type => constants.%B.type.ec0
  685. // CHECK:STDOUT: %B => constants.%B.051
  686. // CHECK:STDOUT: %C.type => constants.%C.type.1cf
  687. // CHECK:STDOUT: %C => constants.%C.cf5
  688. // CHECK:STDOUT: %D.type => constants.%D.type.7bc
  689. // CHECK:STDOUT: %D => constants.%D.aa3
  690. // CHECK:STDOUT: }
  691. // CHECK:STDOUT:
  692. // CHECK:STDOUT: specific @C(constants.%T, constants.%U) {
  693. // CHECK:STDOUT: %T => constants.%T
  694. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.eae
  695. // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.137
  696. // CHECK:STDOUT: %Inner.loc10_22.1 => constants.%Inner.13a
  697. // CHECK:STDOUT: }
  698. // CHECK:STDOUT:
  699. // CHECK:STDOUT: specific @Outer(@C.%T) {}
  700. // CHECK:STDOUT:
  701. // CHECK:STDOUT: specific @Inner(@C.%T, @C.%T) {}
  702. // CHECK:STDOUT:
  703. // CHECK:STDOUT: specific @D(constants.%T, constants.%U) {
  704. // CHECK:STDOUT: %T => constants.%T
  705. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.eae
  706. // CHECK:STDOUT: %Inner.generic => constants.%Inner.generic.137
  707. // CHECK:STDOUT: %U => constants.%U
  708. // CHECK:STDOUT: %Inner.loc13_22.1 => constants.%Inner.c71
  709. // CHECK:STDOUT: }
  710. // CHECK:STDOUT:
  711. // CHECK:STDOUT: specific @Outer(@D.%T) {}
  712. // CHECK:STDOUT:
  713. // CHECK:STDOUT: specific @Inner(@D.%T, @D.%U) {}
  714. // CHECK:STDOUT:
  715. // CHECK:STDOUT: specific @Inner(%T, %U.loc3_15.2) {}
  716. // CHECK:STDOUT:
  717. // CHECK:STDOUT: specific @Outer(%T.loc2_13.2) {}
  718. // CHECK:STDOUT: