generic_vs_params.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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/no_prelude/generic_vs_params.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon
  10. // --- params.carbon
  11. library "[[@TEST_NAME]]";
  12. class NotGenericNoParams {}
  13. class NotGenericButParams() {}
  14. class GenericAndParams(T:! type) {}
  15. class C(T:! type) {
  16. class GenericNoParams {}
  17. class GenericAndParams(U:! type) {}
  18. }
  19. class X {}
  20. var a: NotGenericNoParams = {};
  21. var b: NotGenericButParams() = {};
  22. var c: GenericAndParams(X) = {};
  23. var d: C(X).GenericNoParams = {};
  24. var e: C(X).GenericAndParams(X) = {};
  25. // --- fail_non_generic_implicit_params.carbon
  26. library "[[@TEST_NAME]]";
  27. // CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:9: ERROR: Parameters of generic types must be constant.
  28. // CHECK:STDERR: class A[T: type]() {}
  29. // CHECK:STDERR: ^
  30. // CHECK:STDERR:
  31. class A[T: type]() {}
  32. // --- fail_non_generic_params.carbon
  33. library "[[@TEST_NAME]]";
  34. // CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:9: ERROR: Parameters of generic types must be constant.
  35. // CHECK:STDERR: class A(T: type) {}
  36. // CHECK:STDERR: ^
  37. class A(T: type) {}
  38. // This is testing a use of the invalid type.
  39. fn F(T:! type) {
  40. A(T);
  41. }
  42. // CHECK:STDOUT: --- params.carbon
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: constants {
  45. // CHECK:STDOUT: %NotGenericNoParams: type = class_type @NotGenericNoParams [template]
  46. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  47. // CHECK:STDOUT: %NotGenericButParams.type: type = generic_class_type @NotGenericButParams [template]
  48. // CHECK:STDOUT: %.2: type = tuple_type () [template]
  49. // CHECK:STDOUT: %NotGenericButParams.1: %NotGenericButParams.type = struct_value () [template]
  50. // CHECK:STDOUT: %NotGenericButParams.2: type = class_type @NotGenericButParams [template]
  51. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic]
  52. // CHECK:STDOUT: %GenericAndParams.type.1: type = generic_class_type @GenericAndParams.1 [template]
  53. // CHECK:STDOUT: %GenericAndParams.1: %GenericAndParams.type.1 = struct_value () [template]
  54. // CHECK:STDOUT: %GenericAndParams.2: type = class_type @GenericAndParams.1, @GenericAndParams.1(%T) [symbolic]
  55. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  56. // CHECK:STDOUT: %C.1: %C.type = struct_value () [template]
  57. // CHECK:STDOUT: %C.2: type = class_type @C, @C(%T) [symbolic]
  58. // CHECK:STDOUT: %GenericNoParams.1: type = class_type @GenericNoParams [template]
  59. // CHECK:STDOUT: %GenericNoParams.2: type = class_type @GenericNoParams, @GenericNoParams(%T) [symbolic]
  60. // CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic]
  61. // CHECK:STDOUT: %GenericAndParams.type.2: type = generic_class_type @GenericAndParams.2 [template]
  62. // CHECK:STDOUT: %GenericAndParams.3: %GenericAndParams.type.2 = struct_value () [template]
  63. // CHECK:STDOUT: %GenericAndParams.4: type = class_type @GenericAndParams.2, @GenericAndParams.2(%T, %U) [symbolic]
  64. // CHECK:STDOUT: %X: type = class_type @X [template]
  65. // CHECK:STDOUT: %.3: type = ptr_type %.1 [template]
  66. // CHECK:STDOUT: %struct.1: %NotGenericNoParams = struct_value () [template]
  67. // CHECK:STDOUT: %struct.2: %NotGenericButParams.2 = struct_value () [template]
  68. // CHECK:STDOUT: %GenericAndParams.5: type = class_type @GenericAndParams.1, @GenericAndParams.1(%X) [template]
  69. // CHECK:STDOUT: %struct.3: %GenericAndParams.5 = struct_value () [template]
  70. // CHECK:STDOUT: %C.3: type = class_type @C, @C(%X) [template]
  71. // CHECK:STDOUT: %struct.4: %GenericNoParams.1 = struct_value () [template]
  72. // CHECK:STDOUT: %GenericAndParams.6: type = class_type @GenericAndParams.2, @GenericAndParams.2(%X) [template]
  73. // CHECK:STDOUT: %struct.5: %GenericAndParams.6 = struct_value () [template]
  74. // CHECK:STDOUT: }
  75. // CHECK:STDOUT:
  76. // CHECK:STDOUT: file {
  77. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  78. // CHECK:STDOUT: .NotGenericNoParams = %NotGenericNoParams.decl
  79. // CHECK:STDOUT: .NotGenericButParams = %NotGenericButParams.decl
  80. // CHECK:STDOUT: .GenericAndParams = %GenericAndParams.decl
  81. // CHECK:STDOUT: .C = %C.decl
  82. // CHECK:STDOUT: .X = %X.decl
  83. // CHECK:STDOUT: .a = %a
  84. // CHECK:STDOUT: .b = %b
  85. // CHECK:STDOUT: .c = %c
  86. // CHECK:STDOUT: .d = %d
  87. // CHECK:STDOUT: .e = %e
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT: %NotGenericNoParams.decl: type = class_decl @NotGenericNoParams [template = constants.%NotGenericNoParams] {}
  90. // CHECK:STDOUT: %NotGenericButParams.decl: %NotGenericButParams.type = class_decl @NotGenericButParams [template = constants.%NotGenericButParams.1] {}
  91. // CHECK:STDOUT: %GenericAndParams.decl: %GenericAndParams.type.1 = class_decl @GenericAndParams.1 [template = constants.%GenericAndParams.1] {
  92. // CHECK:STDOUT: %T.loc6_24.1: type = param T
  93. // CHECK:STDOUT: %T.loc6_24.2: type = bind_symbolic_name T 0, %T.loc6_24.1 [symbolic = @GenericAndParams.1.%T (constants.%T)]
  94. // CHECK:STDOUT: }
  95. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] {
  96. // CHECK:STDOUT: %T.loc8_9.1: type = param T
  97. // CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T 0, %T.loc8_9.1 [symbolic = @C.%T (constants.%T)]
  98. // CHECK:STDOUT: }
  99. // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {}
  100. // CHECK:STDOUT: %NotGenericNoParams.ref: type = name_ref NotGenericNoParams, %NotGenericNoParams.decl [template = constants.%NotGenericNoParams]
  101. // CHECK:STDOUT: %a.var: ref %NotGenericNoParams = var a
  102. // CHECK:STDOUT: %a: ref %NotGenericNoParams = bind_name a, %a.var
  103. // CHECK:STDOUT: %NotGenericButParams.ref: %NotGenericButParams.type = name_ref NotGenericButParams, %NotGenericButParams.decl [template = constants.%NotGenericButParams.1]
  104. // CHECK:STDOUT: %.loc16_27: init type = call %NotGenericButParams.ref() [template = constants.%NotGenericButParams.2]
  105. // CHECK:STDOUT: %.loc16_28.1: type = value_of_initializer %.loc16_27 [template = constants.%NotGenericButParams.2]
  106. // CHECK:STDOUT: %.loc16_28.2: type = converted %.loc16_27, %.loc16_28.1 [template = constants.%NotGenericButParams.2]
  107. // CHECK:STDOUT: %b.var: ref %NotGenericButParams.2 = var b
  108. // CHECK:STDOUT: %b: ref %NotGenericButParams.2 = bind_name b, %b.var
  109. // CHECK:STDOUT: %GenericAndParams.ref.loc17: %GenericAndParams.type.1 = name_ref GenericAndParams, %GenericAndParams.decl [template = constants.%GenericAndParams.1]
  110. // CHECK:STDOUT: %X.ref.loc17: type = name_ref X, %X.decl [template = constants.%X]
  111. // CHECK:STDOUT: %.loc17_24: init type = call %GenericAndParams.ref.loc17(%X.ref.loc17) [template = constants.%GenericAndParams.5]
  112. // CHECK:STDOUT: %.loc17_26.1: type = value_of_initializer %.loc17_24 [template = constants.%GenericAndParams.5]
  113. // CHECK:STDOUT: %.loc17_26.2: type = converted %.loc17_24, %.loc17_26.1 [template = constants.%GenericAndParams.5]
  114. // CHECK:STDOUT: %c.var: ref %GenericAndParams.5 = var c
  115. // CHECK:STDOUT: %c: ref %GenericAndParams.5 = bind_name c, %c.var
  116. // CHECK:STDOUT: %C.ref.loc18: %C.type = name_ref C, %C.decl [template = constants.%C.1]
  117. // CHECK:STDOUT: %X.ref.loc18: type = name_ref X, %X.decl [template = constants.%X]
  118. // CHECK:STDOUT: %.loc18: init type = call %C.ref.loc18(%X.ref.loc18) [template = constants.%C.3]
  119. // CHECK:STDOUT: %GenericNoParams.ref: type = name_ref GenericNoParams, @C.%GenericNoParams.decl [template = constants.%GenericNoParams.1]
  120. // CHECK:STDOUT: %d.var: ref %GenericNoParams.1 = var d
  121. // CHECK:STDOUT: %d: ref %GenericNoParams.1 = bind_name d, %d.var
  122. // CHECK:STDOUT: %C.ref.loc19: %C.type = name_ref C, %C.decl [template = constants.%C.1]
  123. // CHECK:STDOUT: %X.ref.loc19_10: type = name_ref X, %X.decl [template = constants.%X]
  124. // CHECK:STDOUT: %.loc19_9: init type = call %C.ref.loc19(%X.ref.loc19_10) [template = constants.%C.3]
  125. // CHECK:STDOUT: %GenericAndParams.ref.loc19: %GenericAndParams.type.2 = name_ref GenericAndParams, @C.%GenericAndParams.decl [template = constants.%GenericAndParams.3]
  126. // CHECK:STDOUT: %X.ref.loc19_30: type = name_ref X, %X.decl [template = constants.%X]
  127. // CHECK:STDOUT: %.loc19_29: init type = call %GenericAndParams.ref.loc19(%X.ref.loc19_30) [template = constants.%GenericAndParams.6]
  128. // CHECK:STDOUT: %.loc19_31.1: type = value_of_initializer %.loc19_29 [template = constants.%GenericAndParams.6]
  129. // CHECK:STDOUT: %.loc19_31.2: type = converted %.loc19_29, %.loc19_31.1 [template = constants.%GenericAndParams.6]
  130. // CHECK:STDOUT: %e.var: ref %GenericAndParams.6 = var e
  131. // CHECK:STDOUT: %e: ref %GenericAndParams.6 = bind_name e, %e.var
  132. // CHECK:STDOUT: }
  133. // CHECK:STDOUT:
  134. // CHECK:STDOUT: class @NotGenericNoParams {
  135. // CHECK:STDOUT: !members:
  136. // CHECK:STDOUT: .Self = constants.%NotGenericNoParams
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT:
  139. // CHECK:STDOUT: class @NotGenericButParams {
  140. // CHECK:STDOUT: !members:
  141. // CHECK:STDOUT: .Self = constants.%NotGenericButParams.2
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: generic class @GenericAndParams.1(file.%T.loc6_24.2: type) {
  145. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
  146. // CHECK:STDOUT:
  147. // CHECK:STDOUT: !definition:
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: class {
  150. // CHECK:STDOUT: !members:
  151. // CHECK:STDOUT: .Self = constants.%GenericAndParams.2
  152. // CHECK:STDOUT: }
  153. // CHECK:STDOUT: }
  154. // CHECK:STDOUT:
  155. // CHECK:STDOUT: generic class @C(file.%T.loc8_9.2: type) {
  156. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: !definition:
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: class {
  161. // CHECK:STDOUT: %GenericNoParams.decl: type = class_decl @GenericNoParams [template = constants.%GenericNoParams.1] {}
  162. // CHECK:STDOUT: %GenericAndParams.decl: %GenericAndParams.type.2 = class_decl @GenericAndParams.2 [template = constants.%GenericAndParams.3] {
  163. // CHECK:STDOUT: %U.loc10_26.1: type = param U
  164. // CHECK:STDOUT: %U.loc10_26.2: type = bind_symbolic_name U 1, %U.loc10_26.1 [symbolic = @GenericAndParams.2.%U (constants.%U)]
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: !members:
  168. // CHECK:STDOUT: .Self = constants.%C.2
  169. // CHECK:STDOUT: .GenericNoParams = %GenericNoParams.decl
  170. // CHECK:STDOUT: .GenericAndParams = %GenericAndParams.decl
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT:
  174. // CHECK:STDOUT: generic class @GenericNoParams(file.%T.loc8_9.2: type) {
  175. // CHECK:STDOUT: !definition:
  176. // CHECK:STDOUT:
  177. // CHECK:STDOUT: class {
  178. // CHECK:STDOUT: !members:
  179. // CHECK:STDOUT: .Self = constants.%GenericNoParams.2
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: generic class @GenericAndParams.2(file.%T.loc8_9.2: type, @C.%U.loc10_26.2: type) {
  184. // CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic = %U (constants.%U)]
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: !definition:
  187. // CHECK:STDOUT:
  188. // CHECK:STDOUT: class {
  189. // CHECK:STDOUT: !members:
  190. // CHECK:STDOUT: .Self = constants.%GenericAndParams.4
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT: }
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: class @X {
  195. // CHECK:STDOUT: !members:
  196. // CHECK:STDOUT: .Self = constants.%X
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: fn @__global_init() {
  200. // CHECK:STDOUT: !entry:
  201. // CHECK:STDOUT: %.loc15_30.1: %.1 = struct_literal ()
  202. // CHECK:STDOUT: %.loc15_30.2: init %NotGenericNoParams = class_init (), file.%a.var [template = constants.%struct.1]
  203. // CHECK:STDOUT: %.loc15_31: init %NotGenericNoParams = converted %.loc15_30.1, %.loc15_30.2 [template = constants.%struct.1]
  204. // CHECK:STDOUT: assign file.%a.var, %.loc15_31
  205. // CHECK:STDOUT: %.loc16_33.1: %.1 = struct_literal ()
  206. // CHECK:STDOUT: %.loc16_33.2: init %NotGenericButParams.2 = class_init (), file.%b.var [template = constants.%struct.2]
  207. // CHECK:STDOUT: %.loc16_34: init %NotGenericButParams.2 = converted %.loc16_33.1, %.loc16_33.2 [template = constants.%struct.2]
  208. // CHECK:STDOUT: assign file.%b.var, %.loc16_34
  209. // CHECK:STDOUT: %.loc17_31.1: %.1 = struct_literal ()
  210. // CHECK:STDOUT: %.loc17_31.2: init %GenericAndParams.5 = class_init (), file.%c.var [template = constants.%struct.3]
  211. // CHECK:STDOUT: %.loc17_32: init %GenericAndParams.5 = converted %.loc17_31.1, %.loc17_31.2 [template = constants.%struct.3]
  212. // CHECK:STDOUT: assign file.%c.var, %.loc17_32
  213. // CHECK:STDOUT: %.loc18_32.1: %.1 = struct_literal ()
  214. // CHECK:STDOUT: %.loc18_32.2: init %GenericNoParams.1 = class_init (), file.%d.var [template = constants.%struct.4]
  215. // CHECK:STDOUT: %.loc18_33: init %GenericNoParams.1 = converted %.loc18_32.1, %.loc18_32.2 [template = constants.%struct.4]
  216. // CHECK:STDOUT: assign file.%d.var, %.loc18_33
  217. // CHECK:STDOUT: %.loc19_36.1: %.1 = struct_literal ()
  218. // CHECK:STDOUT: %.loc19_36.2: init %GenericAndParams.6 = class_init (), file.%e.var [template = constants.%struct.5]
  219. // CHECK:STDOUT: %.loc19_37: init %GenericAndParams.6 = converted %.loc19_36.1, %.loc19_36.2 [template = constants.%struct.5]
  220. // CHECK:STDOUT: assign file.%e.var, %.loc19_37
  221. // CHECK:STDOUT: return
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: specific @GenericAndParams.1(constants.%T) {
  225. // CHECK:STDOUT: %T => constants.%T
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: specific @C(constants.%T) {
  229. // CHECK:STDOUT: %T => constants.%T
  230. // CHECK:STDOUT: }
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: specific @GenericNoParams(constants.%T) {}
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: specific @GenericAndParams.2(constants.%T, constants.%U) {
  235. // CHECK:STDOUT: %U => constants.%U
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: specific @GenericAndParams.1(constants.%X) {
  239. // CHECK:STDOUT: %T => constants.%X
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: !definition:
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: specific @C(constants.%X) {
  245. // CHECK:STDOUT: %T => constants.%X
  246. // CHECK:STDOUT:
  247. // CHECK:STDOUT: !definition:
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: specific @GenericAndParams.2(constants.%X) {
  251. // CHECK:STDOUT: %U => constants.%U
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: !definition:
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: --- fail_non_generic_implicit_params.carbon
  257. // CHECK:STDOUT:
  258. // CHECK:STDOUT: constants {
  259. // CHECK:STDOUT: %A.type: type = generic_class_type @A [template]
  260. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  261. // CHECK:STDOUT: %A.1: %A.type = struct_value () [template]
  262. // CHECK:STDOUT: %A.2: type = class_type @A [template]
  263. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  264. // CHECK:STDOUT: }
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: file {
  267. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  268. // CHECK:STDOUT: .A = %A.decl
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.1] {
  271. // CHECK:STDOUT: %T.loc8_9.1: type = param T
  272. // CHECK:STDOUT: %T.loc8_9.2: type = bind_name T, %T.loc8_9.1
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: class @A {
  277. // CHECK:STDOUT: !members:
  278. // CHECK:STDOUT: .Self = constants.%A.2
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: --- fail_non_generic_params.carbon
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: constants {
  284. // CHECK:STDOUT: %A.type: type = generic_class_type @A [template]
  285. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  286. // CHECK:STDOUT: %A.1: %A.type = struct_value () [template]
  287. // CHECK:STDOUT: %A.2: type = class_type @A [template]
  288. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  289. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic]
  290. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  291. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  292. // CHECK:STDOUT: }
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: file {
  295. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  296. // CHECK:STDOUT: .A = %A.decl
  297. // CHECK:STDOUT: .F = %F.decl
  298. // CHECK:STDOUT: }
  299. // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.1] {
  300. // CHECK:STDOUT: %T.loc7_9.1: type = param T
  301. // CHECK:STDOUT: %T.loc7_9.2: type = bind_name T, %T.loc7_9.1
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  304. // CHECK:STDOUT: %T.loc10_6.1: type = param T
  305. // CHECK:STDOUT: @F.%T.loc10: type = bind_symbolic_name T 0, %T.loc10_6.1 [symbolic = @F.%T.1 (constants.%T)]
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: class @A {
  310. // CHECK:STDOUT: !members:
  311. // CHECK:STDOUT: .Self = constants.%A.2
  312. // CHECK:STDOUT: }
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: generic fn @F(%T.loc10: type) {
  315. // CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)]
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: !definition:
  318. // CHECK:STDOUT:
  319. // CHECK:STDOUT: fn(%T.loc10: type) {
  320. // CHECK:STDOUT: !entry:
  321. // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.1]
  322. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc10 [symbolic = %T.1 (constants.%T)]
  323. // CHECK:STDOUT: %.loc11: init type = call %A.ref(<invalid>) [template = <error>]
  324. // CHECK:STDOUT: return
  325. // CHECK:STDOUT: }
  326. // CHECK:STDOUT: }
  327. // CHECK:STDOUT:
  328. // CHECK:STDOUT: specific @F(constants.%T) {
  329. // CHECK:STDOUT: %T.1 => constants.%T
  330. // CHECK:STDOUT: }
  331. // CHECK:STDOUT: