generic.carbon 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  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: %empty_struct: %empty_struct_type = struct_value () [concrete]
  101. // CHECK:STDOUT: %X.val: %X = struct_value () [concrete]
  102. // CHECK:STDOUT: %N: %T.d9f = symbolic_binding N, 1 [symbolic]
  103. // CHECK:STDOUT: %pattern_type.e68: type = pattern_type %T.d9f [symbolic]
  104. // CHECK:STDOUT: %WithImplicitArgs.type: type = generic_interface_type @WithImplicitArgs [concrete]
  105. // CHECK:STDOUT: %WithImplicitArgs.generic: %WithImplicitArgs.type = struct_value () [concrete]
  106. // CHECK:STDOUT: %T.7b8: %Simple.type.ebf = symbolic_binding T, 0 [symbolic]
  107. // CHECK:STDOUT: %pattern_type.eee: type = pattern_type %Simple.type.ebf [concrete]
  108. // CHECK:STDOUT: %Receive.type: type = fn_type @Receive [concrete]
  109. // CHECK:STDOUT: %Receive: %Receive.type = struct_value () [concrete]
  110. // CHECK:STDOUT: %Pass.type: type = fn_type @Pass [concrete]
  111. // CHECK:STDOUT: %Pass: %Pass.type = struct_value () [concrete]
  112. // CHECK:STDOUT: %Receive.specific_fn: <specific function> = specific_function %Receive, @Receive(%T.7b8) [symbolic]
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT:
  115. // CHECK:STDOUT: file {
  116. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  117. // CHECK:STDOUT: .Simple = %Simple.decl
  118. // CHECK:STDOUT: .X = %X.decl
  119. // CHECK:STDOUT: .WithAssocFn = %WithAssocFn.decl
  120. // CHECK:STDOUT: .C = %C.decl
  121. // CHECK:STDOUT: .WithImplicitArgs = %WithImplicitArgs.decl
  122. // CHECK:STDOUT: .Receive = %Receive.decl
  123. // CHECK:STDOUT: .Pass = %Pass.decl
  124. // CHECK:STDOUT: }
  125. // CHECK:STDOUT: %Simple.decl: %Simple.type.3b3 = interface_decl @Simple [concrete = constants.%Simple.generic] {
  126. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  127. // CHECK:STDOUT: } {
  128. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  129. // CHECK:STDOUT: %T.loc4_18.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_18.1 (constants.%T.d9f)]
  130. // CHECK:STDOUT: }
  131. // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
  132. // CHECK:STDOUT: %WithAssocFn.decl: %WithAssocFn.type.509 = interface_decl @WithAssocFn [concrete = constants.%WithAssocFn.generic] {
  133. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  134. // CHECK:STDOUT: } {
  135. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  136. // CHECK:STDOUT: %T.loc8_23.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_23.1 (constants.%T.d9f)]
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  139. // CHECK:STDOUT: %WithImplicitArgs.decl: %WithImplicitArgs.type = interface_decl @WithImplicitArgs [concrete = constants.%WithImplicitArgs.generic] {
  140. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  141. // CHECK:STDOUT: %N.patt: @WithImplicitArgs.%pattern_type (%pattern_type.e68) = symbolic_binding_pattern N, 1 [concrete]
  142. // CHECK:STDOUT: } {
  143. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  144. // CHECK:STDOUT: %T.loc22_28.2: type = symbolic_binding T, 0 [symbolic = %T.loc22_28.1 (constants.%T.d9f)]
  145. // CHECK:STDOUT: %.loc22: type = splice_block %T.ref [symbolic = %T.loc22_28.1 (constants.%T.d9f)] {
  146. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  147. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc22_28.2 [symbolic = %T.loc22_28.1 (constants.%T.d9f)]
  148. // CHECK:STDOUT: }
  149. // CHECK:STDOUT: %N.loc22_38.2: @WithImplicitArgs.%T.loc22_28.1 (%T.d9f) = symbolic_binding N, 1 [symbolic = %N.loc22_38.1 (constants.%N)]
  150. // CHECK:STDOUT: }
  151. // CHECK:STDOUT: %Receive.decl: %Receive.type = fn_decl @Receive [concrete = constants.%Receive] {
  152. // CHECK:STDOUT: %T.patt: %pattern_type.eee = symbolic_binding_pattern T, 0 [concrete]
  153. // CHECK:STDOUT: } {
  154. // CHECK:STDOUT: %.loc24: type = splice_block %Simple.type [concrete = constants.%Simple.type.ebf] {
  155. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  156. // CHECK:STDOUT: %Simple.ref: %Simple.type.3b3 = name_ref Simple, file.%Simple.decl [concrete = constants.%Simple.generic]
  157. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  158. // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [concrete = constants.%Simple.type.ebf]
  159. // CHECK:STDOUT: }
  160. // CHECK:STDOUT: %T.loc24_12.2: %Simple.type.ebf = symbolic_binding T, 0 [symbolic = %T.loc24_12.1 (constants.%T.7b8)]
  161. // CHECK:STDOUT: }
  162. // CHECK:STDOUT: %Pass.decl: %Pass.type = fn_decl @Pass [concrete = constants.%Pass] {
  163. // CHECK:STDOUT: %T.patt: %pattern_type.eee = symbolic_binding_pattern T, 0 [concrete]
  164. // CHECK:STDOUT: } {
  165. // CHECK:STDOUT: %.loc25: type = splice_block %Simple.type [concrete = constants.%Simple.type.ebf] {
  166. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  167. // CHECK:STDOUT: %Simple.ref: %Simple.type.3b3 = name_ref Simple, file.%Simple.decl [concrete = constants.%Simple.generic]
  168. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  169. // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [concrete = constants.%Simple.type.ebf]
  170. // CHECK:STDOUT: }
  171. // CHECK:STDOUT: %T.loc25_9.2: %Simple.type.ebf = symbolic_binding T, 0 [symbolic = %T.loc25_9.1 (constants.%T.7b8)]
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT: }
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: generic interface @Simple(%T.loc4_18.2: type) {
  176. // CHECK:STDOUT: %T.loc4_18.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_18.1 (constants.%T.d9f)]
  177. // CHECK:STDOUT:
  178. // CHECK:STDOUT: !definition:
  179. // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(%T.loc4_18.1)> [symbolic = %Simple.type (constants.%Simple.type.85b)]
  180. // CHECK:STDOUT: %Self.loc4_28.2: @Simple.%Simple.type (%Simple.type.85b) = symbolic_binding Self, 1 [symbolic = %Self.loc4_28.2 (constants.%Self.355)]
  181. // CHECK:STDOUT:
  182. // CHECK:STDOUT: interface {
  183. // CHECK:STDOUT: %Self.loc4_28.1: @Simple.%Simple.type (%Simple.type.85b) = symbolic_binding Self, 1 [symbolic = %Self.loc4_28.2 (constants.%Self.355)]
  184. // CHECK:STDOUT:
  185. // CHECK:STDOUT: !members:
  186. // CHECK:STDOUT: .Self = %Self.loc4_28.1
  187. // CHECK:STDOUT: witness = ()
  188. // CHECK:STDOUT:
  189. // CHECK:STDOUT: !requires:
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT:
  193. // CHECK:STDOUT: generic interface @WithAssocFn(%T.loc8_23.2: type) {
  194. // CHECK:STDOUT: %T.loc8_23.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_23.1 (constants.%T.d9f)]
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: !definition:
  197. // CHECK:STDOUT: %WithAssocFn.type: type = facet_type <@WithAssocFn, @WithAssocFn(%T.loc8_23.1)> [symbolic = %WithAssocFn.type (constants.%WithAssocFn.type.507)]
  198. // CHECK:STDOUT: %Self.loc8_33.2: @WithAssocFn.%WithAssocFn.type (%WithAssocFn.type.507) = symbolic_binding Self, 1 [symbolic = %Self.loc8_33.2 (constants.%Self.33c)]
  199. // CHECK:STDOUT: %WithAssocFn.F.type: type = fn_type @WithAssocFn.F, @WithAssocFn(%T.loc8_23.1) [symbolic = %WithAssocFn.F.type (constants.%WithAssocFn.F.type.c9b)]
  200. // CHECK:STDOUT: %WithAssocFn.F: @WithAssocFn.%WithAssocFn.F.type (%WithAssocFn.F.type.c9b) = struct_value () [symbolic = %WithAssocFn.F (constants.%WithAssocFn.F.deb)]
  201. // CHECK:STDOUT: %WithAssocFn.assoc_type: type = assoc_entity_type @WithAssocFn, @WithAssocFn(%T.loc8_23.1) [symbolic = %WithAssocFn.assoc_type (constants.%WithAssocFn.assoc_type.7e6)]
  202. // 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)]
  203. // CHECK:STDOUT:
  204. // CHECK:STDOUT: interface {
  205. // CHECK:STDOUT: %Self.loc8_33.1: @WithAssocFn.%WithAssocFn.type (%WithAssocFn.type.507) = symbolic_binding Self, 1 [symbolic = %Self.loc8_33.2 (constants.%Self.33c)]
  206. // 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)] {
  207. // CHECK:STDOUT: %return.patt: %pattern_type.019 = return_slot_pattern [concrete]
  208. // CHECK:STDOUT: %return.param_patt: %pattern_type.019 = out_param_pattern %return.patt, call_param0 [concrete]
  209. // CHECK:STDOUT: } {
  210. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  211. // CHECK:STDOUT: %return.param: ref %X = out_param call_param0
  212. // CHECK:STDOUT: %return: ref %X = return_slot %return.param
  213. // CHECK:STDOUT: }
  214. // 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)]
  215. // CHECK:STDOUT:
  216. // CHECK:STDOUT: !members:
  217. // CHECK:STDOUT: .Self = %Self.loc8_33.1
  218. // CHECK:STDOUT: .X = <poisoned>
  219. // CHECK:STDOUT: .F = %assoc0.loc10_14.1
  220. // CHECK:STDOUT: witness = (%WithAssocFn.F.decl)
  221. // CHECK:STDOUT:
  222. // CHECK:STDOUT: !requires:
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT:
  226. // CHECK:STDOUT: generic interface @WithImplicitArgs(%T.loc22_28.2: type, %N.loc22_38.2: @WithImplicitArgs.%T.loc22_28.1 (%T.d9f)) {
  227. // CHECK:STDOUT: %T.loc22_28.1: type = symbolic_binding T, 0 [symbolic = %T.loc22_28.1 (constants.%T.d9f)]
  228. // CHECK:STDOUT: %N.loc22_38.1: @WithImplicitArgs.%T.loc22_28.1 (%T.d9f) = symbolic_binding N, 1 [symbolic = %N.loc22_38.1 (constants.%N)]
  229. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc22_28.1 [symbolic = %pattern_type (constants.%pattern_type.e68)]
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: interface;
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: impl @C.as.Simple.impl: %Self.ref as %Simple.type {
  235. // CHECK:STDOUT: !members:
  236. // CHECK:STDOUT: witness = @C.%Simple.impl_witness
  237. // CHECK:STDOUT: }
  238. // CHECK:STDOUT:
  239. // CHECK:STDOUT: impl @C.as.WithAssocFn.impl: %Self.ref as %WithAssocFn.type {
  240. // 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] {
  241. // CHECK:STDOUT: %return.patt: %pattern_type.019 = return_slot_pattern [concrete]
  242. // CHECK:STDOUT: %return.param_patt: %pattern_type.019 = out_param_pattern %return.patt, call_param0 [concrete]
  243. // CHECK:STDOUT: } {
  244. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  245. // CHECK:STDOUT: %return.param: ref %X = out_param call_param0
  246. // CHECK:STDOUT: %return: ref %X = return_slot %return.param
  247. // CHECK:STDOUT: }
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: !members:
  250. // CHECK:STDOUT: .X = <poisoned>
  251. // CHECK:STDOUT: .F = %C.as.WithAssocFn.impl.F.decl
  252. // CHECK:STDOUT: witness = @C.%WithAssocFn.impl_witness
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: class @X {
  256. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  257. // CHECK:STDOUT: complete_type_witness = %complete_type
  258. // CHECK:STDOUT:
  259. // CHECK:STDOUT: !members:
  260. // CHECK:STDOUT: .Self = constants.%X
  261. // CHECK:STDOUT: }
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: class @C {
  264. // CHECK:STDOUT: impl_decl @C.as.Simple.impl [concrete] {} {
  265. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  266. // CHECK:STDOUT: %Simple.ref: %Simple.type.3b3 = name_ref Simple, file.%Simple.decl [concrete = constants.%Simple.generic]
  267. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  268. // CHECK:STDOUT: %Simple.type: type = facet_type <@Simple, @Simple(constants.%C)> [concrete = constants.%Simple.type.ebf]
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (), @C.as.Simple.impl [concrete]
  271. // CHECK:STDOUT: %Simple.impl_witness: <witness> = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness]
  272. // CHECK:STDOUT: impl_decl @C.as.WithAssocFn.impl [concrete] {} {
  273. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  274. // CHECK:STDOUT: %WithAssocFn.ref: %WithAssocFn.type.509 = name_ref WithAssocFn, file.%WithAssocFn.decl [concrete = constants.%WithAssocFn.generic]
  275. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  276. // CHECK:STDOUT: %WithAssocFn.type: type = facet_type <@WithAssocFn, @WithAssocFn(constants.%C)> [concrete = constants.%WithAssocFn.type.fc9]
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT: %WithAssocFn.impl_witness_table = impl_witness_table (@C.as.WithAssocFn.impl.%C.as.WithAssocFn.impl.F.decl), @C.as.WithAssocFn.impl [concrete]
  279. // CHECK:STDOUT: %WithAssocFn.impl_witness: <witness> = impl_witness %WithAssocFn.impl_witness_table [concrete = constants.%WithAssocFn.impl_witness]
  280. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  281. // CHECK:STDOUT: complete_type_witness = %complete_type
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: !members:
  284. // CHECK:STDOUT: .Self = constants.%C
  285. // CHECK:STDOUT: .Simple = <poisoned>
  286. // CHECK:STDOUT: .C = <poisoned>
  287. // CHECK:STDOUT: .WithAssocFn = <poisoned>
  288. // CHECK:STDOUT: .X = <poisoned>
  289. // CHECK:STDOUT: }
  290. // CHECK:STDOUT:
  291. // CHECK:STDOUT: generic fn @WithAssocFn.F(@WithAssocFn.%T.loc8_23.2: type, @WithAssocFn.%Self.loc8_33.1: @WithAssocFn.%WithAssocFn.type (%WithAssocFn.type.507)) {
  292. // CHECK:STDOUT: fn() -> %return.param: %X;
  293. // CHECK:STDOUT: }
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: fn @C.as.WithAssocFn.impl.F() -> %return.param: %X {
  296. // CHECK:STDOUT: !entry:
  297. // CHECK:STDOUT: %.loc17_15.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  298. // CHECK:STDOUT: %.loc17_15.2: init %X = class_init (), %return [concrete = constants.%X.val]
  299. // CHECK:STDOUT: %.loc17_16: init %X = converted %.loc17_15.1, %.loc17_15.2 [concrete = constants.%X.val]
  300. // CHECK:STDOUT: return %.loc17_16 to %return
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: generic fn @Receive(%T.loc24_12.2: %Simple.type.ebf) {
  304. // CHECK:STDOUT: %T.loc24_12.1: %Simple.type.ebf = symbolic_binding T, 0 [symbolic = %T.loc24_12.1 (constants.%T.7b8)]
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: !definition:
  307. // CHECK:STDOUT:
  308. // CHECK:STDOUT: fn() {
  309. // CHECK:STDOUT: !entry:
  310. // CHECK:STDOUT: return
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT: }
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: generic fn @Pass(%T.loc25_9.2: %Simple.type.ebf) {
  315. // CHECK:STDOUT: %T.loc25_9.1: %Simple.type.ebf = symbolic_binding T, 0 [symbolic = %T.loc25_9.1 (constants.%T.7b8)]
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: !definition:
  318. // 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)]
  319. // CHECK:STDOUT:
  320. // CHECK:STDOUT: fn() {
  321. // CHECK:STDOUT: !entry:
  322. // CHECK:STDOUT: %Receive.ref: %Receive.type = name_ref Receive, file.%Receive.decl [concrete = constants.%Receive]
  323. // CHECK:STDOUT: %T.ref: %Simple.type.ebf = name_ref T, %T.loc25_9.2 [symbolic = %T.loc25_9.1 (constants.%T.7b8)]
  324. // 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)]
  325. // CHECK:STDOUT: %Receive.call: init %empty_tuple.type = call %Receive.specific_fn.loc26_3.1()
  326. // CHECK:STDOUT: return
  327. // CHECK:STDOUT: }
  328. // CHECK:STDOUT: }
  329. // CHECK:STDOUT:
  330. // CHECK:STDOUT: specific @Simple(constants.%T.d9f) {
  331. // CHECK:STDOUT: %T.loc4_18.1 => constants.%T.d9f
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT:
  334. // CHECK:STDOUT: specific @WithAssocFn(constants.%T.d9f) {
  335. // CHECK:STDOUT: %T.loc8_23.1 => constants.%T.d9f
  336. // CHECK:STDOUT: }
  337. // CHECK:STDOUT:
  338. // CHECK:STDOUT: specific @WithAssocFn.F(constants.%T.d9f, constants.%Self.33c) {}
  339. // CHECK:STDOUT:
  340. // CHECK:STDOUT: specific @Simple(constants.%C) {
  341. // CHECK:STDOUT: %T.loc4_18.1 => constants.%C
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: !definition:
  344. // CHECK:STDOUT: %Simple.type => constants.%Simple.type.ebf
  345. // CHECK:STDOUT: %Self.loc4_28.2 => constants.%Self.671
  346. // CHECK:STDOUT: }
  347. // CHECK:STDOUT:
  348. // CHECK:STDOUT: specific @WithAssocFn(constants.%C) {
  349. // CHECK:STDOUT: %T.loc8_23.1 => constants.%C
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: !definition:
  352. // CHECK:STDOUT: %WithAssocFn.type => constants.%WithAssocFn.type.fc9
  353. // CHECK:STDOUT: %Self.loc8_33.2 => constants.%Self.669
  354. // CHECK:STDOUT: %WithAssocFn.F.type => constants.%WithAssocFn.F.type.18c
  355. // CHECK:STDOUT: %WithAssocFn.F => constants.%WithAssocFn.F.e46
  356. // CHECK:STDOUT: %WithAssocFn.assoc_type => constants.%WithAssocFn.assoc_type.9ea
  357. // CHECK:STDOUT: %assoc0.loc10_14.2 => constants.%assoc0.3cc
  358. // CHECK:STDOUT: }
  359. // CHECK:STDOUT:
  360. // CHECK:STDOUT: specific @WithAssocFn.F(constants.%C, constants.%WithAssocFn.facet) {}
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: specific @WithImplicitArgs(constants.%T.d9f, constants.%N) {
  363. // CHECK:STDOUT: %T.loc22_28.1 => constants.%T.d9f
  364. // CHECK:STDOUT: %N.loc22_38.1 => constants.%N
  365. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e68
  366. // CHECK:STDOUT: }
  367. // CHECK:STDOUT:
  368. // CHECK:STDOUT: specific @Receive(constants.%T.7b8) {
  369. // CHECK:STDOUT: %T.loc24_12.1 => constants.%T.7b8
  370. // CHECK:STDOUT:
  371. // CHECK:STDOUT: !definition:
  372. // CHECK:STDOUT: }
  373. // CHECK:STDOUT:
  374. // CHECK:STDOUT: specific @Pass(constants.%T.7b8) {
  375. // CHECK:STDOUT: %T.loc25_9.1 => constants.%T.7b8
  376. // CHECK:STDOUT: }
  377. // CHECK:STDOUT:
  378. // CHECK:STDOUT: --- fail_mismatched_args.carbon
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: constants {
  381. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  382. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  383. // CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic]
  384. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  385. // CHECK:STDOUT: %Generic.type.c21: type = generic_interface_type @Generic [concrete]
  386. // CHECK:STDOUT: %Generic.generic: %Generic.type.c21 = struct_value () [concrete]
  387. // CHECK:STDOUT: %Generic.type.68b: type = facet_type <@Generic, @Generic(%T.d9f)> [symbolic]
  388. // CHECK:STDOUT: %Self.fc1: %Generic.type.68b = symbolic_binding Self, 1 [symbolic]
  389. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  390. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  391. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  392. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  393. // CHECK:STDOUT: %Generic.type.185: type = facet_type <@Generic, @Generic(%A)> [concrete]
  394. // CHECK:STDOUT: %T.db7: %Generic.type.185 = symbolic_binding T, 0 [symbolic]
  395. // CHECK:STDOUT: %pattern_type.99a: type = pattern_type %Generic.type.185 [concrete]
  396. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  397. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  398. // CHECK:STDOUT: %Generic.type.227: type = facet_type <@Generic, @Generic(%B)> [concrete]
  399. // CHECK:STDOUT: %T.7ca: %Generic.type.227 = symbolic_binding T, 0 [symbolic]
  400. // CHECK:STDOUT: %pattern_type.b43: type = pattern_type %Generic.type.227 [concrete]
  401. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  402. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  403. // CHECK:STDOUT: %Self.fc0: %Generic.type.227 = symbolic_binding Self, 1 [symbolic]
  404. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.7ca [symbolic]
  405. // CHECK:STDOUT: }
  406. // CHECK:STDOUT:
  407. // CHECK:STDOUT: file {
  408. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  409. // CHECK:STDOUT: .Generic = %Generic.decl
  410. // CHECK:STDOUT: .A = %A.decl
  411. // CHECK:STDOUT: .B = %B.decl
  412. // CHECK:STDOUT: .F = %F.decl
  413. // CHECK:STDOUT: .G = %G.decl
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT: %Generic.decl: %Generic.type.c21 = interface_decl @Generic [concrete = constants.%Generic.generic] {
  416. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  417. // CHECK:STDOUT: } {
  418. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  419. // CHECK:STDOUT: %T.loc4_19.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_19.1 (constants.%T.d9f)]
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  422. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  423. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  424. // CHECK:STDOUT: %T.patt: %pattern_type.99a = symbolic_binding_pattern T, 0 [concrete]
  425. // CHECK:STDOUT: } {
  426. // CHECK:STDOUT: %.loc9: type = splice_block %Generic.type [concrete = constants.%Generic.type.185] {
  427. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  428. // CHECK:STDOUT: %Generic.ref: %Generic.type.c21 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic]
  429. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  430. // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%A)> [concrete = constants.%Generic.type.185]
  431. // CHECK:STDOUT: }
  432. // CHECK:STDOUT: %T.loc9_6.2: %Generic.type.185 = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.db7)]
  433. // CHECK:STDOUT: }
  434. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  435. // CHECK:STDOUT: %T.patt: %pattern_type.b43 = symbolic_binding_pattern T, 0 [concrete]
  436. // CHECK:STDOUT: } {
  437. // CHECK:STDOUT: %.loc10: type = splice_block %Generic.type [concrete = constants.%Generic.type.227] {
  438. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  439. // CHECK:STDOUT: %Generic.ref: %Generic.type.c21 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic]
  440. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  441. // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(constants.%B)> [concrete = constants.%Generic.type.227]
  442. // CHECK:STDOUT: }
  443. // CHECK:STDOUT: %T.loc10_6.2: %Generic.type.227 = symbolic_binding T, 0 [symbolic = %T.loc10_6.1 (constants.%T.7ca)]
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT: }
  446. // CHECK:STDOUT:
  447. // CHECK:STDOUT: generic interface @Generic(%T.loc4_19.2: type) {
  448. // CHECK:STDOUT: %T.loc4_19.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_19.1 (constants.%T.d9f)]
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: !definition:
  451. // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(%T.loc4_19.1)> [symbolic = %Generic.type (constants.%Generic.type.68b)]
  452. // CHECK:STDOUT: %Self.loc4_29.2: @Generic.%Generic.type (%Generic.type.68b) = symbolic_binding Self, 1 [symbolic = %Self.loc4_29.2 (constants.%Self.fc1)]
  453. // CHECK:STDOUT:
  454. // CHECK:STDOUT: interface {
  455. // CHECK:STDOUT: %Self.loc4_29.1: @Generic.%Generic.type (%Generic.type.68b) = symbolic_binding Self, 1 [symbolic = %Self.loc4_29.2 (constants.%Self.fc1)]
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: !members:
  458. // CHECK:STDOUT: .Self = %Self.loc4_29.1
  459. // CHECK:STDOUT: witness = ()
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: !requires:
  462. // CHECK:STDOUT: }
  463. // CHECK:STDOUT: }
  464. // CHECK:STDOUT:
  465. // CHECK:STDOUT: class @A {
  466. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  467. // CHECK:STDOUT: complete_type_witness = %complete_type
  468. // CHECK:STDOUT:
  469. // CHECK:STDOUT: !members:
  470. // CHECK:STDOUT: .Self = constants.%A
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT:
  473. // CHECK:STDOUT: class @B {
  474. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  475. // CHECK:STDOUT: complete_type_witness = %complete_type
  476. // CHECK:STDOUT:
  477. // CHECK:STDOUT: !members:
  478. // CHECK:STDOUT: .Self = constants.%B
  479. // CHECK:STDOUT: }
  480. // CHECK:STDOUT:
  481. // CHECK:STDOUT: generic fn @F(%T.loc9_6.2: %Generic.type.185) {
  482. // CHECK:STDOUT: %T.loc9_6.1: %Generic.type.185 = symbolic_binding T, 0 [symbolic = %T.loc9_6.1 (constants.%T.db7)]
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: fn();
  485. // CHECK:STDOUT: }
  486. // CHECK:STDOUT:
  487. // CHECK:STDOUT: generic fn @G(%T.loc10_6.2: %Generic.type.227) {
  488. // CHECK:STDOUT: %T.loc10_6.1: %Generic.type.227 = symbolic_binding T, 0 [symbolic = %T.loc10_6.1 (constants.%T.7ca)]
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: !definition:
  491. // 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)]
  492. // CHECK:STDOUT:
  493. // CHECK:STDOUT: fn() {
  494. // CHECK:STDOUT: !entry:
  495. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  496. // CHECK:STDOUT: %T.ref: %Generic.type.227 = name_ref T, %T.loc10_6.2 [symbolic = %T.loc10_6.1 (constants.%T.7ca)]
  497. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  498. // CHECK:STDOUT: return
  499. // CHECK:STDOUT: }
  500. // CHECK:STDOUT: }
  501. // CHECK:STDOUT:
  502. // CHECK:STDOUT: specific @Generic(constants.%T.d9f) {
  503. // CHECK:STDOUT: %T.loc4_19.1 => constants.%T.d9f
  504. // CHECK:STDOUT: }
  505. // CHECK:STDOUT:
  506. // CHECK:STDOUT: specific @Generic(constants.%A) {
  507. // CHECK:STDOUT: %T.loc4_19.1 => constants.%A
  508. // CHECK:STDOUT: }
  509. // CHECK:STDOUT:
  510. // CHECK:STDOUT: specific @F(constants.%T.db7) {
  511. // CHECK:STDOUT: %T.loc9_6.1 => constants.%T.db7
  512. // CHECK:STDOUT: }
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: specific @Generic(constants.%B) {
  515. // CHECK:STDOUT: %T.loc4_19.1 => constants.%B
  516. // CHECK:STDOUT:
  517. // CHECK:STDOUT: !definition:
  518. // CHECK:STDOUT: %Generic.type => constants.%Generic.type.227
  519. // CHECK:STDOUT: %Self.loc4_29.2 => constants.%Self.fc0
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT:
  522. // CHECK:STDOUT: specific @G(constants.%T.7ca) {
  523. // CHECK:STDOUT: %T.loc10_6.1 => constants.%T.7ca
  524. // CHECK:STDOUT: }
  525. // CHECK:STDOUT:
  526. // CHECK:STDOUT: --- fail_args_count_mismatch.carbon
  527. // CHECK:STDOUT:
  528. // CHECK:STDOUT: constants {
  529. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  530. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  531. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  532. // CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete]
  533. // CHECK:STDOUT: %Generic.type.c21: type = generic_interface_type @Generic [concrete]
  534. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  535. // CHECK:STDOUT: %Generic.generic: %Generic.type.c21 = struct_value () [concrete]
  536. // CHECK:STDOUT: %Generic.type.68b: type = facet_type <@Generic, @Generic(%T)> [symbolic]
  537. // CHECK:STDOUT: %Self: %Generic.type.68b = symbolic_binding Self, 1 [symbolic]
  538. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  539. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  540. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  541. // CHECK:STDOUT: }
  542. // CHECK:STDOUT:
  543. // CHECK:STDOUT: file {
  544. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  545. // CHECK:STDOUT: .Generic = %Generic.decl
  546. // CHECK:STDOUT: .F = %F.decl
  547. // CHECK:STDOUT: }
  548. // CHECK:STDOUT: %Generic.decl: %Generic.type.c21 = interface_decl @Generic [concrete = constants.%Generic.generic] {
  549. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  550. // CHECK:STDOUT: } {
  551. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  552. // CHECK:STDOUT: %T.loc3_19.2: type = symbolic_binding T, 0 [symbolic = %T.loc3_19.1 (constants.%T)]
  553. // CHECK:STDOUT: }
  554. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  555. // CHECK:STDOUT: %T.patt: <error> = symbolic_binding_pattern T, 0 [concrete]
  556. // CHECK:STDOUT: } {
  557. // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
  558. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  559. // CHECK:STDOUT: %Generic.ref: %Generic.type.c21 = name_ref Generic, file.%Generic.decl [concrete = constants.%Generic.generic]
  560. // CHECK:STDOUT: %.loc12_19: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  561. // CHECK:STDOUT: %.loc12_23: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT: %T: <error> = symbolic_binding T, 0 [concrete = <error>]
  564. // CHECK:STDOUT: }
  565. // CHECK:STDOUT: }
  566. // CHECK:STDOUT:
  567. // CHECK:STDOUT: generic interface @Generic(%T.loc3_19.2: type) {
  568. // CHECK:STDOUT: %T.loc3_19.1: type = symbolic_binding T, 0 [symbolic = %T.loc3_19.1 (constants.%T)]
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: !definition:
  571. // CHECK:STDOUT: %Generic.type: type = facet_type <@Generic, @Generic(%T.loc3_19.1)> [symbolic = %Generic.type (constants.%Generic.type.68b)]
  572. // CHECK:STDOUT: %Self.loc3_29.2: @Generic.%Generic.type (%Generic.type.68b) = symbolic_binding Self, 1 [symbolic = %Self.loc3_29.2 (constants.%Self)]
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: interface {
  575. // CHECK:STDOUT: %Self.loc3_29.1: @Generic.%Generic.type (%Generic.type.68b) = symbolic_binding Self, 1 [symbolic = %Self.loc3_29.2 (constants.%Self)]
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: !members:
  578. // CHECK:STDOUT: .Self = %Self.loc3_29.1
  579. // CHECK:STDOUT: witness = ()
  580. // CHECK:STDOUT:
  581. // CHECK:STDOUT: !requires:
  582. // CHECK:STDOUT: }
  583. // CHECK:STDOUT: }
  584. // CHECK:STDOUT:
  585. // CHECK:STDOUT: generic fn @F(%T: <error>) {
  586. // CHECK:STDOUT: !definition:
  587. // CHECK:STDOUT:
  588. // CHECK:STDOUT: fn() {
  589. // CHECK:STDOUT: !entry:
  590. // CHECK:STDOUT: return
  591. // CHECK:STDOUT: }
  592. // CHECK:STDOUT: }
  593. // CHECK:STDOUT:
  594. // CHECK:STDOUT: specific @Generic(constants.%T) {
  595. // CHECK:STDOUT: %T.loc3_19.1 => constants.%T
  596. // CHECK:STDOUT: }
  597. // CHECK:STDOUT:
  598. // CHECK:STDOUT: specific @F(<error>) {}
  599. // CHECK:STDOUT: