generic.carbon 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/generic.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/generic.carbon
  14. // --- generic.carbon
  15. library "[[@TEST_NAME]]";
  16. interface Simple(T:! type) {}
  17. class X {}
  18. interface WithAssocFn(T:! type) {
  19. // TODO: Take `Self`, return `T`, once that works.
  20. fn F() -> X;
  21. }
  22. class C {
  23. impl as Simple(C) {}
  24. impl as WithAssocFn(C) {
  25. fn F() -> X {
  26. return {};
  27. }
  28. }
  29. }
  30. interface WithImplicitArgs[T:! type](N:! T);
  31. fn Receive(T:! Simple(C)) {}
  32. fn Pass(T:! Simple(C)) {
  33. Receive(T);
  34. }
  35. // --- fail_mismatched_args.carbon
  36. library "[[@TEST_NAME]]";
  37. interface Generic(T:! type) {}
  38. class A {}
  39. class B {}
  40. fn F(T:! Generic(A));
  41. fn G(T:! Generic(B)) {
  42. // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `Generic(B)` into type implementing `Generic(A)` [ConversionFailureFacetToFacet]
  43. // CHECK:STDERR: F(T);
  44. // CHECK:STDERR: ^~~~
  45. // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE-5]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam]
  46. // CHECK:STDERR: fn F(T:! Generic(A));
  47. // CHECK:STDERR: ^
  48. // CHECK:STDERR:
  49. F(T);
  50. }
  51. // --- fail_args_count_mismatch.carbon
  52. library "[[@TEST_NAME]]";
  53. interface Generic(T:! type) {}
  54. // CHECK:STDERR: fail_args_count_mismatch.carbon:[[@LINE+7]]:10: error: 2 arguments passed to generic interface expecting 1 argument [CallArgCountMismatch]
  55. // CHECK:STDERR: fn F(T:! Generic((), ())) {}
  56. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  57. // CHECK:STDERR: fail_args_count_mismatch.carbon:[[@LINE-5]]:1: note: calling generic interface declared here [InCallToEntity]
  58. // CHECK:STDERR: interface Generic(T:! type) {}
  59. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  60. // CHECK:STDERR:
  61. fn F(T:! Generic((), ())) {}
  62. // CHECK:STDOUT: --- generic.carbon
  63. // CHECK:STDOUT:
  64. // CHECK:STDOUT: constants {
  65. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  66. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  67. // CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic]
  68. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  69. // CHECK:STDOUT: %Simple.type.3b3: type = generic_interface_type @Simple [concrete]
  70. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  71. // CHECK:STDOUT: %Simple.generic: %Simple.type.3b3 = struct_value () [concrete]
  72. // CHECK:STDOUT: %Simple.type.85b: type = facet_type <@Simple, @Simple(%T.d9f)> [symbolic]
  73. // CHECK:STDOUT: %Self.355: %Simple.type.85b = symbolic_binding Self, 1 [symbolic]
  74. // CHECK:STDOUT: %X: type = class_type @X [concrete]
  75. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  76. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  77. // CHECK:STDOUT: %WithAssocFn.type.509: type = generic_interface_type @WithAssocFn [concrete]
  78. // CHECK:STDOUT: %WithAssocFn.generic: %WithAssocFn.type.509 = struct_value () [concrete]
  79. // CHECK:STDOUT: %WithAssocFn.type.507: type = facet_type <@WithAssocFn, @WithAssocFn(%T.d9f)> [symbolic]
  80. // CHECK:STDOUT: %Self.33c: %WithAssocFn.type.507 = symbolic_binding Self, 1 [symbolic]
  81. // CHECK:STDOUT: %pattern_type.019: type = pattern_type %X [concrete]
  82. // CHECK:STDOUT: %WithAssocFn.F.type.c9b: type = fn_type @WithAssocFn.F, @WithAssocFn(%T.d9f) [symbolic]
  83. // CHECK:STDOUT: %WithAssocFn.F.deb: %WithAssocFn.F.type.c9b = struct_value () [symbolic]
  84. // CHECK:STDOUT: %WithAssocFn.assoc_type.7e6: type = assoc_entity_type @WithAssocFn, @WithAssocFn(%T.d9f) [symbolic]
  85. // CHECK:STDOUT: %assoc0.141: %WithAssocFn.assoc_type.7e6 = assoc_entity element0, @WithAssocFn.%WithAssocFn.F.decl [symbolic]
  86. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  87. // CHECK:STDOUT: %Simple.type.ebf: type = facet_type <@Simple, @Simple(%C)> [concrete]
  88. // CHECK:STDOUT: %Self.671: %Simple.type.ebf = symbolic_binding Self, 1 [symbolic]
  89. // CHECK:STDOUT: %Simple.impl_witness: <witness> = impl_witness @C.%Simple.impl_witness_table [concrete]
  90. // CHECK:STDOUT: %WithAssocFn.type.fc9: type = facet_type <@WithAssocFn, @WithAssocFn(%C)> [concrete]
  91. // CHECK:STDOUT: %Self.669: %WithAssocFn.type.fc9 = symbolic_binding Self, 1 [symbolic]
  92. // CHECK:STDOUT: %WithAssocFn.F.type.18c: type = fn_type @WithAssocFn.F, @WithAssocFn(%C) [concrete]
  93. // CHECK:STDOUT: %WithAssocFn.F.e46: %WithAssocFn.F.type.18c = struct_value () [concrete]
  94. // CHECK:STDOUT: %WithAssocFn.assoc_type.9ea: type = assoc_entity_type @WithAssocFn, @WithAssocFn(%C) [concrete]
  95. // CHECK:STDOUT: %assoc0.3cc: %WithAssocFn.assoc_type.9ea = assoc_entity element0, @WithAssocFn.%WithAssocFn.F.decl [concrete]
  96. // CHECK:STDOUT: %WithAssocFn.impl_witness: <witness> = impl_witness @C.%WithAssocFn.impl_witness_table [concrete]
  97. // CHECK:STDOUT: %C.as.WithAssocFn.impl.F.type: type = fn_type @C.as.WithAssocFn.impl.F [concrete]
  98. // CHECK:STDOUT: %C.as.WithAssocFn.impl.F: %C.as.WithAssocFn.impl.F.type = struct_value () [concrete]
  99. // CHECK:STDOUT: %WithAssocFn.facet: %WithAssocFn.type.fc9 = facet_value %C, (%WithAssocFn.impl_witness) [concrete]
  100. // CHECK:STDOUT: %X.val: %X = struct_value () [concrete]
  101. // CHECK:STDOUT: %N: %T.d9f = symbolic_binding N, 1 [symbolic]
  102. // CHECK:STDOUT: %pattern_type.e68: type = pattern_type %T.d9f [symbolic]
  103. // CHECK:STDOUT: %WithImplicitArgs.type: type = generic_interface_type @WithImplicitArgs [concrete]
  104. // CHECK:STDOUT: %WithImplicitArgs.generic: %WithImplicitArgs.type = struct_value () [concrete]
  105. // CHECK:STDOUT: %T.7b8: %Simple.type.ebf = symbolic_binding T, 0 [symbolic]
  106. // CHECK:STDOUT: %pattern_type.eee: type = pattern_type %Simple.type.ebf [concrete]
  107. // CHECK:STDOUT: %Receive.type: type = fn_type @Receive [concrete]
  108. // CHECK:STDOUT: %Receive: %Receive.type = struct_value () [concrete]
  109. // CHECK:STDOUT: %Pass.type: type = fn_type @Pass [concrete]
  110. // CHECK:STDOUT: %Pass: %Pass.type = struct_value () [concrete]
  111. // CHECK:STDOUT: %Receive.specific_fn: <specific function> = specific_function %Receive, @Receive(%T.7b8) [symbolic]
  112. // CHECK:STDOUT: }
  113. // CHECK:STDOUT:
  114. // CHECK:STDOUT: file {
  115. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  116. // CHECK:STDOUT: .Simple = %Simple.decl
  117. // CHECK:STDOUT: .X = %X.decl
  118. // CHECK:STDOUT: .WithAssocFn = %WithAssocFn.decl
  119. // CHECK:STDOUT: .C = %C.decl
  120. // CHECK:STDOUT: .WithImplicitArgs = %WithImplicitArgs.decl
  121. // CHECK:STDOUT: .Receive = %Receive.decl
  122. // CHECK:STDOUT: .Pass = %Pass.decl
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: %Simple.decl: %Simple.type.3b3 = interface_decl @Simple [concrete = constants.%Simple.generic] {
  125. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  126. // CHECK:STDOUT: } {
  127. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  128. // CHECK:STDOUT: %T.loc4_18.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_18.1 (constants.%T.d9f)]
  129. // CHECK:STDOUT: }
  130. // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
  131. // CHECK:STDOUT: %WithAssocFn.decl: %WithAssocFn.type.509 = interface_decl @WithAssocFn [concrete = constants.%WithAssocFn.generic] {
  132. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  133. // CHECK:STDOUT: } {
  134. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  135. // CHECK:STDOUT: %T.loc8_23.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_23.1 (constants.%T.d9f)]
  136. // CHECK:STDOUT: }
  137. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  138. // CHECK:STDOUT: %WithImplicitArgs.decl: %WithImplicitArgs.type = interface_decl @WithImplicitArgs [concrete = constants.%WithImplicitArgs.generic] {
  139. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  140. // CHECK:STDOUT: %N.patt: @WithImplicitArgs.%pattern_type (%pattern_type.e68) = symbolic_binding_pattern N, 1 [concrete]
  141. // CHECK:STDOUT: } {
  142. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  143. // CHECK:STDOUT: %T.loc22_28.2: type = symbolic_binding T, 0 [symbolic = %T.loc22_28.1 (constants.%T.d9f)]
  144. // CHECK:STDOUT: %.loc22: type = splice_block %T.ref [symbolic = %T.loc22_28.1 (constants.%T.d9f)] {
  145. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  146. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc22_28.2 [symbolic = %T.loc22_28.1 (constants.%T.d9f)]
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT: %N.loc22_38.2: @WithImplicitArgs.%T.loc22_28.1 (%T.d9f) = symbolic_binding N, 1 [symbolic = %N.loc22_38.1 (constants.%N)]
  149. // CHECK:STDOUT: }
  150. // CHECK:STDOUT: %Receive.decl: %Receive.type = fn_decl @Receive [concrete = constants.%Receive] {
  151. // CHECK:STDOUT: %T.patt: %pattern_type.eee = symbolic_binding_pattern T, 0 [concrete]
  152. // CHECK:STDOUT: } {
  153. // CHECK:STDOUT: %.loc24: type = splice_block %Simple.type [concrete = constants.%Simple.type.ebf] {
  154. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  155. // CHECK:STDOUT: %Simple.ref: %Simple.type.3b3 = name_ref Simple, file.%Simple.decl [concrete = constants.%Simple.generic]
  156. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  157. // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [concrete = constants.%Simple.type.ebf]
  158. // CHECK:STDOUT: }
  159. // CHECK:STDOUT: %T.loc24_12.2: %Simple.type.ebf = symbolic_binding T, 0 [symbolic = %T.loc24_12.1 (constants.%T.7b8)]
  160. // CHECK:STDOUT: }
  161. // CHECK:STDOUT: %Pass.decl: %Pass.type = fn_decl @Pass [concrete = constants.%Pass] {
  162. // CHECK:STDOUT: %T.patt: %pattern_type.eee = symbolic_binding_pattern T, 0 [concrete]
  163. // CHECK:STDOUT: } {
  164. // CHECK:STDOUT: %.loc25: type = splice_block %Simple.type [concrete = constants.%Simple.type.ebf] {
  165. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  166. // CHECK:STDOUT: %Simple.ref: %Simple.type.3b3 = name_ref Simple, file.%Simple.decl [concrete = constants.%Simple.generic]
  167. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  168. // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [concrete = constants.%Simple.type.ebf]
  169. // CHECK:STDOUT: }
  170. // CHECK:STDOUT: %T.loc25_9.2: %Simple.type.ebf = symbolic_binding T, 0 [symbolic = %T.loc25_9.1 (constants.%T.7b8)]
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT:
  174. // CHECK:STDOUT: generic interface @Simple(%T.loc4_18.2: type) {
  175. // CHECK:STDOUT: %T.loc4_18.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_18.1 (constants.%T.d9f)]
  176. // CHECK:STDOUT:
  177. // CHECK:STDOUT: !definition:
  178. // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(%T.loc4_18.1)> [symbolic = %Simple.type (constants.%Simple.type.85b)]
  179. // CHECK:STDOUT: %Self.2: @Simple.%Simple.type (%Simple.type.85b) = symbolic_binding Self, 1 [symbolic = %Self.2 (constants.%Self.355)]
  180. // CHECK:STDOUT:
  181. // CHECK:STDOUT: interface {
  182. // CHECK:STDOUT: %Self.1: @Simple.%Simple.type (%Simple.type.85b) = symbolic_binding Self, 1 [symbolic = %Self.2 (constants.%Self.355)]
  183. // CHECK:STDOUT:
  184. // CHECK:STDOUT: !members:
  185. // CHECK:STDOUT: .Self = %Self.1
  186. // CHECK:STDOUT: witness = ()
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT: }
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: generic interface @WithAssocFn(%T.loc8_23.2: type) {
  191. // CHECK:STDOUT: %T.loc8_23.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_23.1 (constants.%T.d9f)]
  192. // CHECK:STDOUT:
  193. // CHECK:STDOUT: !definition:
  194. // CHECK:STDOUT: %WithAssocFn.type: type = facet_type <@WithAssocFn, @WithAssocFn(%T.loc8_23.1)> [symbolic = %WithAssocFn.type (constants.%WithAssocFn.type.507)]
  195. // CHECK:STDOUT: %Self.2: @WithAssocFn.%WithAssocFn.type (%WithAssocFn.type.507) = symbolic_binding Self, 1 [symbolic = %Self.2 (constants.%Self.33c)]
  196. // CHECK:STDOUT: %WithAssocFn.F.type: type = fn_type @WithAssocFn.F, @WithAssocFn(%T.loc8_23.1) [symbolic = %WithAssocFn.F.type (constants.%WithAssocFn.F.type.c9b)]
  197. // CHECK:STDOUT: %WithAssocFn.F: @WithAssocFn.%WithAssocFn.F.type (%WithAssocFn.F.type.c9b) = struct_value () [symbolic = %WithAssocFn.F (constants.%WithAssocFn.F.deb)]
  198. // CHECK:STDOUT: %WithAssocFn.assoc_type: type = assoc_entity_type @WithAssocFn, @WithAssocFn(%T.loc8_23.1) [symbolic = %WithAssocFn.assoc_type (constants.%WithAssocFn.assoc_type.7e6)]
  199. // CHECK:STDOUT: %assoc0.loc10_14.2: @WithAssocFn.%WithAssocFn.assoc_type (%WithAssocFn.assoc_type.7e6) = assoc_entity element0, %WithAssocFn.F.decl [symbolic = %assoc0.loc10_14.2 (constants.%assoc0.141)]
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: interface {
  202. // CHECK:STDOUT: %Self.1: @WithAssocFn.%WithAssocFn.type (%WithAssocFn.type.507) = symbolic_binding Self, 1 [symbolic = %Self.2 (constants.%Self.33c)]
  203. // CHECK:STDOUT: %WithAssocFn.F.decl: @WithAssocFn.%WithAssocFn.F.type (%WithAssocFn.F.type.c9b) = fn_decl @WithAssocFn.F [symbolic = @WithAssocFn.%WithAssocFn.F (constants.%WithAssocFn.F.deb)] {
  204. // CHECK:STDOUT: %return.patt: %pattern_type.019 = return_slot_pattern [concrete]
  205. // CHECK:STDOUT: %return.param_patt: %pattern_type.019 = out_param_pattern %return.patt, call_param0 [concrete]
  206. // CHECK:STDOUT: } {
  207. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  208. // CHECK:STDOUT: %return.param: ref %X = out_param call_param0
  209. // CHECK:STDOUT: %return: ref %X = return_slot %return.param
  210. // CHECK:STDOUT: }
  211. // CHECK:STDOUT: %assoc0.loc10_14.1: @WithAssocFn.%WithAssocFn.assoc_type (%WithAssocFn.assoc_type.7e6) = assoc_entity element0, %WithAssocFn.F.decl [symbolic = %assoc0.loc10_14.2 (constants.%assoc0.141)]
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: !members:
  214. // CHECK:STDOUT: .Self = %Self.1
  215. // CHECK:STDOUT: .X = <poisoned>
  216. // CHECK:STDOUT: .F = %assoc0.loc10_14.1
  217. // CHECK:STDOUT: witness = (%WithAssocFn.F.decl)
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: generic interface @WithImplicitArgs(%T.loc22_28.2: type, %N.loc22_38.2: @WithImplicitArgs.%T.loc22_28.1 (%T.d9f)) {
  222. // CHECK:STDOUT: %T.loc22_28.1: type = symbolic_binding T, 0 [symbolic = %T.loc22_28.1 (constants.%T.d9f)]
  223. // CHECK:STDOUT: %N.loc22_38.1: @WithImplicitArgs.%T.loc22_28.1 (%T.d9f) = symbolic_binding N, 1 [symbolic = %N.loc22_38.1 (constants.%N)]
  224. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc22_28.1 [symbolic = %pattern_type (constants.%pattern_type.e68)]
  225. // CHECK:STDOUT:
  226. // CHECK:STDOUT: interface;
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: impl @C.as.Simple.impl: %Self.ref as %Simple.type {
  230. // CHECK:STDOUT: !members:
  231. // CHECK:STDOUT: witness = @C.%Simple.impl_witness
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: impl @C.as.WithAssocFn.impl: %Self.ref as %WithAssocFn.type {
  235. // CHECK:STDOUT: %C.as.WithAssocFn.impl.F.decl: %C.as.WithAssocFn.impl.F.type = fn_decl @C.as.WithAssocFn.impl.F [concrete = constants.%C.as.WithAssocFn.impl.F] {
  236. // CHECK:STDOUT: %return.patt: %pattern_type.019 = return_slot_pattern [concrete]
  237. // CHECK:STDOUT: %return.param_patt: %pattern_type.019 = out_param_pattern %return.patt, call_param0 [concrete]
  238. // CHECK:STDOUT: } {
  239. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  240. // CHECK:STDOUT: %return.param: ref %X = out_param call_param0
  241. // CHECK:STDOUT: %return: ref %X = return_slot %return.param
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: !members:
  245. // CHECK:STDOUT: .X = <poisoned>
  246. // CHECK:STDOUT: .F = %C.as.WithAssocFn.impl.F.decl
  247. // CHECK:STDOUT: witness = @C.%WithAssocFn.impl_witness
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: class @X {
  251. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  252. // CHECK:STDOUT: complete_type_witness = %complete_type
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: !members:
  255. // CHECK:STDOUT: .Self = constants.%X
  256. // CHECK:STDOUT: }
  257. // CHECK:STDOUT:
  258. // CHECK:STDOUT: class @C {
  259. // CHECK:STDOUT: impl_decl @C.as.Simple.impl [concrete] {} {
  260. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  261. // CHECK:STDOUT: %Simple.ref: %Simple.type.3b3 = name_ref Simple, file.%Simple.decl [concrete = constants.%Simple.generic]
  262. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  263. // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [concrete = constants.%Simple.type.ebf]
  264. // CHECK:STDOUT: }
  265. // CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (), @C.as.Simple.impl [concrete]
  266. // CHECK:STDOUT: %Simple.impl_witness: <witness> = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness]
  267. // CHECK:STDOUT: impl_decl @C.as.WithAssocFn.impl [concrete] {} {
  268. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  269. // CHECK:STDOUT: %WithAssocFn.ref: %WithAssocFn.type.509 = name_ref WithAssocFn, file.%WithAssocFn.decl [concrete = constants.%WithAssocFn.generic]
  270. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  271. // CHECK:STDOUT: %WithAssocFn.type: type = facet_type <@WithAssocFn, @WithAssocFn(constants.%C)> [concrete = constants.%WithAssocFn.type.fc9]
  272. // CHECK:STDOUT: }
  273. // CHECK:STDOUT: %WithAssocFn.impl_witness_table = impl_witness_table (@C.as.WithAssocFn.impl.%C.as.WithAssocFn.impl.F.decl), @C.as.WithAssocFn.impl [concrete]
  274. // CHECK:STDOUT: %WithAssocFn.impl_witness: <witness> = impl_witness %WithAssocFn.impl_witness_table [concrete = constants.%WithAssocFn.impl_witness]
  275. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  276. // CHECK:STDOUT: complete_type_witness = %complete_type
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: !members:
  279. // CHECK:STDOUT: .Self = constants.%C
  280. // CHECK:STDOUT: .Simple = <poisoned>
  281. // CHECK:STDOUT: .C = <poisoned>
  282. // CHECK:STDOUT: .WithAssocFn = <poisoned>
  283. // CHECK:STDOUT: .X = <poisoned>
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT:
  286. // CHECK:STDOUT: generic fn @WithAssocFn.F(@WithAssocFn.%T.loc8_23.2: type, @WithAssocFn.%Self.1: @WithAssocFn.%WithAssocFn.type (%WithAssocFn.type.507)) {
  287. // CHECK:STDOUT: fn() -> %return.param: %X;
  288. // CHECK:STDOUT: }
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: fn @C.as.WithAssocFn.impl.F() -> %return.param: %X {
  291. // CHECK:STDOUT: !entry:
  292. // CHECK:STDOUT: %.loc17_15.1: %empty_struct_type = struct_literal ()
  293. // CHECK:STDOUT: %.loc17_15.2: init %X = class_init (), %return [concrete = constants.%X.val]
  294. // CHECK:STDOUT: %.loc17_16: init %X = converted %.loc17_15.1, %.loc17_15.2 [concrete = constants.%X.val]
  295. // CHECK:STDOUT: return %.loc17_16 to %return
  296. // CHECK:STDOUT: }
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: generic fn @Receive(%T.loc24_12.2: %Simple.type.ebf) {
  299. // CHECK:STDOUT: %T.loc24_12.1: %Simple.type.ebf = symbolic_binding T, 0 [symbolic = %T.loc24_12.1 (constants.%T.7b8)]
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: !definition:
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: fn() {
  304. // CHECK:STDOUT: !entry:
  305. // CHECK:STDOUT: return
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: generic fn @Pass(%T.loc25_9.2: %Simple.type.ebf) {
  310. // CHECK:STDOUT: %T.loc25_9.1: %Simple.type.ebf = symbolic_binding T, 0 [symbolic = %T.loc25_9.1 (constants.%T.7b8)]
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: !definition:
  313. // CHECK:STDOUT: %Receive.specific_fn.loc26_3.2: <specific function> = specific_function constants.%Receive, @Receive(%T.loc25_9.1) [symbolic = %Receive.specific_fn.loc26_3.2 (constants.%Receive.specific_fn)]
  314. // CHECK:STDOUT:
  315. // CHECK:STDOUT: fn() {
  316. // CHECK:STDOUT: !entry:
  317. // CHECK:STDOUT: %Receive.ref: %Receive.type = name_ref Receive, file.%Receive.decl [concrete = constants.%Receive]
  318. // CHECK:STDOUT: %T.ref: %Simple.type.ebf = name_ref T, %T.loc25_9.2 [symbolic = %T.loc25_9.1 (constants.%T.7b8)]
  319. // CHECK:STDOUT: %Receive.specific_fn.loc26_3.1: <specific function> = specific_function %Receive.ref, @Receive(constants.%T.7b8) [symbolic = %Receive.specific_fn.loc26_3.2 (constants.%Receive.specific_fn)]
  320. // CHECK:STDOUT: %Receive.call: init %empty_tuple.type = call %Receive.specific_fn.loc26_3.1()
  321. // CHECK:STDOUT: return
  322. // CHECK:STDOUT: }
  323. // CHECK:STDOUT: }
  324. // CHECK:STDOUT:
  325. // CHECK:STDOUT: specific @Simple(constants.%T.d9f) {
  326. // CHECK:STDOUT: %T.loc4_18.1 => constants.%T.d9f
  327. // CHECK:STDOUT: }
  328. // CHECK:STDOUT:
  329. // CHECK:STDOUT: specific @WithAssocFn(constants.%T.d9f) {
  330. // CHECK:STDOUT: %T.loc8_23.1 => constants.%T.d9f
  331. // CHECK:STDOUT: }
  332. // CHECK:STDOUT:
  333. // CHECK:STDOUT: specific @WithAssocFn.F(constants.%T.d9f, constants.%Self.33c) {}
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: specific @Simple(constants.%C) {
  336. // CHECK:STDOUT: %T.loc4_18.1 => constants.%C
  337. // CHECK:STDOUT:
  338. // CHECK:STDOUT: !definition:
  339. // CHECK:STDOUT: %Simple.type => constants.%Simple.type.ebf
  340. // CHECK:STDOUT: %Self.2 => constants.%Self.671
  341. // CHECK:STDOUT: }
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: specific @WithAssocFn(constants.%C) {
  344. // CHECK:STDOUT: %T.loc8_23.1 => constants.%C
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: !definition:
  347. // CHECK:STDOUT: %WithAssocFn.type => constants.%WithAssocFn.type.fc9
  348. // CHECK:STDOUT: %Self.2 => constants.%Self.669
  349. // CHECK:STDOUT: %WithAssocFn.F.type => constants.%WithAssocFn.F.type.18c
  350. // CHECK:STDOUT: %WithAssocFn.F => constants.%WithAssocFn.F.e46
  351. // CHECK:STDOUT: %WithAssocFn.assoc_type => constants.%WithAssocFn.assoc_type.9ea
  352. // CHECK:STDOUT: %assoc0.loc10_14.2 => constants.%assoc0.3cc
  353. // CHECK:STDOUT: }
  354. // CHECK:STDOUT:
  355. // CHECK:STDOUT: specific @WithAssocFn.F(constants.%C, constants.%WithAssocFn.facet) {}
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: specific @WithImplicitArgs(constants.%T.d9f, constants.%N) {
  358. // CHECK:STDOUT: %T.loc22_28.1 => constants.%T.d9f
  359. // CHECK:STDOUT: %N.loc22_38.1 => constants.%N
  360. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e68
  361. // CHECK:STDOUT: }
  362. // CHECK:STDOUT:
  363. // CHECK:STDOUT: specific @Receive(constants.%T.7b8) {
  364. // CHECK:STDOUT: %T.loc24_12.1 => constants.%T.7b8
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: !definition:
  367. // CHECK:STDOUT: }
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: specific @Pass(constants.%T.7b8) {
  370. // CHECK:STDOUT: %T.loc25_9.1 => constants.%T.7b8
  371. // CHECK:STDOUT: }
  372. // CHECK:STDOUT:
  373. // CHECK:STDOUT: --- fail_mismatched_args.carbon
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: constants {
  376. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  377. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  378. // CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic]
  379. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  380. // CHECK:STDOUT: %Generic.type.c21: type = generic_interface_type @Generic [concrete]
  381. // CHECK:STDOUT: %Generic.generic: %Generic.type.c21 = struct_value () [concrete]
  382. // CHECK:STDOUT: %Generic.type.68b: type = facet_type <@Generic, @Generic(%T.d9f)> [symbolic]
  383. // CHECK:STDOUT: %Self.fc1: %Generic.type.68b = symbolic_binding Self, 1 [symbolic]
  384. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  385. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  386. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  387. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  388. // CHECK:STDOUT: %Generic.type.185: type = facet_type <@Generic, @Generic(%A)> [concrete]
  389. // CHECK:STDOUT: %T.db7: %Generic.type.185 = symbolic_binding T, 0 [symbolic]
  390. // CHECK:STDOUT: %pattern_type.99a: type = pattern_type %Generic.type.185 [concrete]
  391. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  392. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  393. // CHECK:STDOUT: %Generic.type.227: type = facet_type <@Generic, @Generic(%B)> [concrete]
  394. // CHECK:STDOUT: %T.7ca: %Generic.type.227 = symbolic_binding T, 0 [symbolic]
  395. // CHECK:STDOUT: %pattern_type.b43: type = pattern_type %Generic.type.227 [concrete]
  396. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  397. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  398. // CHECK:STDOUT: %Self.fc0: %Generic.type.227 = symbolic_binding Self, 1 [symbolic]
  399. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.7ca [symbolic]
  400. // CHECK:STDOUT: }
  401. // CHECK:STDOUT:
  402. // CHECK:STDOUT: file {
  403. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  404. // CHECK:STDOUT: .Generic = %Generic.decl
  405. // CHECK:STDOUT: .A = %A.decl
  406. // CHECK:STDOUT: .B = %B.decl
  407. // CHECK:STDOUT: .F = %F.decl
  408. // CHECK:STDOUT: .G = %G.decl
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT: %Generic.decl: %Generic.type.c21 = interface_decl @Generic [concrete = constants.%Generic.generic] {
  411. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  412. // CHECK:STDOUT: } {
  413. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  414. // CHECK:STDOUT: %T.loc4_19.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_19.1 (constants.%T.d9f)]
  415. // CHECK:STDOUT: }
  416. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  417. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  418. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  419. // CHECK:STDOUT: %T.patt: %pattern_type.99a = symbolic_binding_pattern T, 0 [concrete]
  420. // CHECK:STDOUT: } {
  421. // CHECK:STDOUT: %.loc9: type = splice_block %Generic.type [concrete = constants.%Generic.type.185] {
  422. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  423. // CHECK:STDOUT: %Generic.ref: %Generic.type.c21 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic]
  424. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  425. // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%A)> [concrete = constants.%Generic.type.185]
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT: %T.loc9_6.2: %Generic.type.185 = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.db7)]
  428. // CHECK:STDOUT: }
  429. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  430. // CHECK:STDOUT: %T.patt: %pattern_type.b43 = symbolic_binding_pattern T, 0 [concrete]
  431. // CHECK:STDOUT: } {
  432. // CHECK:STDOUT: %.loc10: type = splice_block %Generic.type [concrete = constants.%Generic.type.227] {
  433. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  434. // CHECK:STDOUT: %Generic.ref: %Generic.type.c21 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic]
  435. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  436. // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%B)> [concrete = constants.%Generic.type.227]
  437. // CHECK:STDOUT: }
  438. // CHECK:STDOUT: %T.loc10_6.2: %Generic.type.227 = symbolic_binding T, 0 [symbolic = %T.loc10_6.1 (constants.%T.7ca)]
  439. // CHECK:STDOUT: }
  440. // CHECK:STDOUT: }
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: generic interface @Generic(%T.loc4_19.2: type) {
  443. // CHECK:STDOUT: %T.loc4_19.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_19.1 (constants.%T.d9f)]
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: !definition:
  446. // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(%T.loc4_19.1)> [symbolic = %Generic.type (constants.%Generic.type.68b)]
  447. // CHECK:STDOUT: %Self.2: @Generic.%Generic.type (%Generic.type.68b) = symbolic_binding Self, 1 [symbolic = %Self.2 (constants.%Self.fc1)]
  448. // CHECK:STDOUT:
  449. // CHECK:STDOUT: interface {
  450. // CHECK:STDOUT: %Self.1: @Generic.%Generic.type (%Generic.type.68b) = symbolic_binding Self, 1 [symbolic = %Self.2 (constants.%Self.fc1)]
  451. // CHECK:STDOUT:
  452. // CHECK:STDOUT: !members:
  453. // CHECK:STDOUT: .Self = %Self.1
  454. // CHECK:STDOUT: witness = ()
  455. // CHECK:STDOUT: }
  456. // CHECK:STDOUT: }
  457. // CHECK:STDOUT:
  458. // CHECK:STDOUT: class @A {
  459. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  460. // CHECK:STDOUT: complete_type_witness = %complete_type
  461. // CHECK:STDOUT:
  462. // CHECK:STDOUT: !members:
  463. // CHECK:STDOUT: .Self = constants.%A
  464. // CHECK:STDOUT: }
  465. // CHECK:STDOUT:
  466. // CHECK:STDOUT: class @B {
  467. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  468. // CHECK:STDOUT: complete_type_witness = %complete_type
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: !members:
  471. // CHECK:STDOUT: .Self = constants.%B
  472. // CHECK:STDOUT: }
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: generic fn @F(%T.loc9_6.2: %Generic.type.185) {
  475. // CHECK:STDOUT: %T.loc9_6.1: %Generic.type.185 = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.db7)]
  476. // CHECK:STDOUT:
  477. // CHECK:STDOUT: fn();
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT:
  480. // CHECK:STDOUT: generic fn @G(%T.loc10_6.2: %Generic.type.227) {
  481. // CHECK:STDOUT: %T.loc10_6.1: %Generic.type.227 = symbolic_binding T, 0 [symbolic = %T.loc10_6.1 (constants.%T.7ca)]
  482. // CHECK:STDOUT:
  483. // CHECK:STDOUT: !definition:
  484. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc10_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  485. // CHECK:STDOUT:
  486. // CHECK:STDOUT: fn() {
  487. // CHECK:STDOUT: !entry:
  488. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  489. // CHECK:STDOUT: %T.ref: %Generic.type.227 = name_ref T, %T.loc10_6.2 [symbolic = %T.loc10_6.1 (constants.%T.7ca)]
  490. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  491. // CHECK:STDOUT: return
  492. // CHECK:STDOUT: }
  493. // CHECK:STDOUT: }
  494. // CHECK:STDOUT:
  495. // CHECK:STDOUT: specific @Generic(constants.%T.d9f) {
  496. // CHECK:STDOUT: %T.loc4_19.1 => constants.%T.d9f
  497. // CHECK:STDOUT: }
  498. // CHECK:STDOUT:
  499. // CHECK:STDOUT: specific @Generic(constants.%A) {
  500. // CHECK:STDOUT: %T.loc4_19.1 => constants.%A
  501. // CHECK:STDOUT: }
  502. // CHECK:STDOUT:
  503. // CHECK:STDOUT: specific @F(constants.%T.db7) {
  504. // CHECK:STDOUT: %T.loc9_6.1 => constants.%T.db7
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT:
  507. // CHECK:STDOUT: specific @Generic(constants.%B) {
  508. // CHECK:STDOUT: %T.loc4_19.1 => constants.%B
  509. // CHECK:STDOUT:
  510. // CHECK:STDOUT: !definition:
  511. // CHECK:STDOUT: %Generic.type => constants.%Generic.type.227
  512. // CHECK:STDOUT: %Self.2 => constants.%Self.fc0
  513. // CHECK:STDOUT: }
  514. // CHECK:STDOUT:
  515. // CHECK:STDOUT: specific @G(constants.%T.7ca) {
  516. // CHECK:STDOUT: %T.loc10_6.1 => constants.%T.7ca
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: --- fail_args_count_mismatch.carbon
  520. // CHECK:STDOUT:
  521. // CHECK:STDOUT: constants {
  522. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  523. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  524. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  525. // CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete]
  526. // CHECK:STDOUT: %Generic.type.c21: type = generic_interface_type @Generic [concrete]
  527. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  528. // CHECK:STDOUT: %Generic.generic: %Generic.type.c21 = struct_value () [concrete]
  529. // CHECK:STDOUT: %Generic.type.68b: type = facet_type <@Generic, @Generic(%T)> [symbolic]
  530. // CHECK:STDOUT: %Self: %Generic.type.68b = symbolic_binding Self, 1 [symbolic]
  531. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  532. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  533. // CHECK:STDOUT: }
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: file {
  536. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  537. // CHECK:STDOUT: .Generic = %Generic.decl
  538. // CHECK:STDOUT: .F = %F.decl
  539. // CHECK:STDOUT: }
  540. // CHECK:STDOUT: %Generic.decl: %Generic.type.c21 = interface_decl @Generic [concrete = constants.%Generic.generic] {
  541. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  542. // CHECK:STDOUT: } {
  543. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  544. // CHECK:STDOUT: %T.loc3_19.2: type = symbolic_binding T, 0 [symbolic = %T.loc3_19.1 (constants.%T)]
  545. // CHECK:STDOUT: }
  546. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  547. // CHECK:STDOUT: %T.patt: <error> = symbolic_binding_pattern T, 0 [concrete]
  548. // CHECK:STDOUT: } {
  549. // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
  550. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  551. // CHECK:STDOUT: %Generic.ref: %Generic.type.c21 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic]
  552. // CHECK:STDOUT: %.loc12_19: %empty_tuple.type = tuple_literal ()
  553. // CHECK:STDOUT: %.loc12_23: %empty_tuple.type = tuple_literal ()
  554. // CHECK:STDOUT: }
  555. // CHECK:STDOUT: %T: <error> = symbolic_binding T, 0 [concrete = <error>]
  556. // CHECK:STDOUT: }
  557. // CHECK:STDOUT: }
  558. // CHECK:STDOUT:
  559. // CHECK:STDOUT: generic interface @Generic(%T.loc3_19.2: type) {
  560. // CHECK:STDOUT: %T.loc3_19.1: type = symbolic_binding T, 0 [symbolic = %T.loc3_19.1 (constants.%T)]
  561. // CHECK:STDOUT:
  562. // CHECK:STDOUT: !definition:
  563. // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(%T.loc3_19.1)> [symbolic = %Generic.type (constants.%Generic.type.68b)]
  564. // CHECK:STDOUT: %Self.2: @Generic.%Generic.type (%Generic.type.68b) = symbolic_binding Self, 1 [symbolic = %Self.2 (constants.%Self)]
  565. // CHECK:STDOUT:
  566. // CHECK:STDOUT: interface {
  567. // CHECK:STDOUT: %Self.1: @Generic.%Generic.type (%Generic.type.68b) = symbolic_binding Self, 1 [symbolic = %Self.2 (constants.%Self)]
  568. // CHECK:STDOUT:
  569. // CHECK:STDOUT: !members:
  570. // CHECK:STDOUT: .Self = %Self.1
  571. // CHECK:STDOUT: witness = ()
  572. // CHECK:STDOUT: }
  573. // CHECK:STDOUT: }
  574. // CHECK:STDOUT:
  575. // CHECK:STDOUT: generic fn @F(%T: <error>) {
  576. // CHECK:STDOUT: !definition:
  577. // CHECK:STDOUT:
  578. // CHECK:STDOUT: fn() {
  579. // CHECK:STDOUT: !entry:
  580. // CHECK:STDOUT: return
  581. // CHECK:STDOUT: }
  582. // CHECK:STDOUT: }
  583. // CHECK:STDOUT:
  584. // CHECK:STDOUT: specific @Generic(constants.%T) {
  585. // CHECK:STDOUT: %T.loc3_19.1 => constants.%T
  586. // CHECK:STDOUT: }
  587. // CHECK:STDOUT:
  588. // CHECK:STDOUT: specific @F(<error>) {}
  589. // CHECK:STDOUT: