member_out_of_line.carbon 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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/convert.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/generic/member_out_of_line.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/member_out_of_line.carbon
  12. // --- basic.carbon
  13. library "[[@TEST_NAME]]";
  14. //@dump-sem-ir-begin
  15. class Class(T:! Core.Copy) {
  16. fn F(n: T) -> T;
  17. fn G[self: Self]() -> T;
  18. var n: T;
  19. }
  20. fn Class(T:! Core.Copy).F(n: T) -> T {
  21. return n;
  22. }
  23. fn Class(T:! Core.Copy).G[self: Self]() -> T {
  24. return self.n;
  25. }
  26. //@dump-sem-ir-end
  27. // --- nested.carbon
  28. library "[[@TEST_NAME]]";
  29. //@dump-sem-ir-begin
  30. class A(T:! type) {
  31. class B(N:! T) {
  32. fn F[self: Self](a: T);
  33. }
  34. }
  35. fn A(T:! type).B(N:! T).F[self: Self](a: T) {}
  36. //@dump-sem-ir-end
  37. // --- fail_mismatched_not_generic_vs_generic.carbon
  38. library "[[@TEST_NAME]]";
  39. class NotGeneric {
  40. fn F();
  41. }
  42. // CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter list [RedeclParamListDiffers]
  43. // CHECK:STDERR: fn NotGeneric(T:! type).F() {}
  44. // CHECK:STDERR: ^~~~~~~~~~
  45. // CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE-7]]:1: note: previously declared without parameter list [RedeclParamListPrevious]
  46. // CHECK:STDERR: class NotGeneric {
  47. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
  48. // CHECK:STDERR:
  49. fn NotGeneric(T:! type).F() {}
  50. // --- fail_mismatched_too_few_args.carbon
  51. library "[[@TEST_NAME]]";
  52. class Generic(T:! type) {
  53. fn TooFew();
  54. }
  55. // CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter count of 0 [RedeclParamCountDiffers]
  56. // CHECK:STDERR: fn Generic().TooFew() {}
  57. // CHECK:STDERR: ^~~~~~~
  58. // CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE-7]]:1: note: previously declared with parameter count of 1 [RedeclParamCountPrevious]
  59. // CHECK:STDERR: class Generic(T:! type) {
  60. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
  61. // CHECK:STDERR:
  62. fn Generic().TooFew() {}
  63. // --- fail_mismatched_too_many_args.carbon
  64. library "[[@TEST_NAME]]";
  65. class Generic(T:! type) {
  66. fn TooMany();
  67. }
  68. // CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter count of 2 [RedeclParamCountDiffers]
  69. // CHECK:STDERR: fn Generic(T:! type, U:! type).TooMany() {}
  70. // CHECK:STDERR: ^~~~~~~
  71. // CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE-7]]:1: note: previously declared with parameter count of 1 [RedeclParamCountPrevious]
  72. // CHECK:STDERR: class Generic(T:! type) {
  73. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
  74. // CHECK:STDERR:
  75. fn Generic(T:! type, U:! type).TooMany() {}
  76. // --- fail_mismatched_wrong_arg_type.carbon
  77. library "[[@TEST_NAME]]";
  78. class Generic(T:! type) {
  79. fn WrongType();
  80. }
  81. // CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+7]]:12: error: type `<pattern for ()>` of parameter 1 in redeclaration differs from previous parameter type `<pattern for type>` [RedeclParamDiffersType]
  82. // CHECK:STDERR: fn Generic(T:! ()).WrongType() {}
  83. // CHECK:STDERR: ^
  84. // CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
  85. // CHECK:STDERR: class Generic(T:! type) {
  86. // CHECK:STDERR: ^
  87. // CHECK:STDERR:
  88. fn Generic(T:! ()).WrongType() {}
  89. // CHECK:STDOUT: --- basic.carbon
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: constants {
  92. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  93. // CHECK:STDOUT: %T.035: %Copy.type = symbolic_binding T, 0 [symbolic]
  94. // CHECK:STDOUT: %pattern_type.ce2: type = pattern_type %Copy.type [concrete]
  95. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete]
  96. // CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete]
  97. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.035) [symbolic]
  98. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.035 [symbolic]
  99. // CHECK:STDOUT: %pattern_type.9b9f0c.1: type = pattern_type %T.binding.as_type [symbolic]
  100. // CHECK:STDOUT: %Class.F.type: type = fn_type @Class.F, @Class(%T.035) [symbolic]
  101. // CHECK:STDOUT: %Class.F: %Class.F.type = struct_value () [symbolic]
  102. // CHECK:STDOUT: %pattern_type.893: type = pattern_type %Class [symbolic]
  103. // CHECK:STDOUT: %Class.G.type: type = fn_type @Class.G, @Class(%T.035) [symbolic]
  104. // CHECK:STDOUT: %Class.G: %Class.G.type = struct_value () [symbolic]
  105. // CHECK:STDOUT: %require_complete.67c: <witness> = require_complete_type %T.binding.as_type [symbolic]
  106. // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.binding.as_type [symbolic]
  107. // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %T.binding.as_type} [symbolic]
  108. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.n [symbolic]
  109. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  110. // CHECK:STDOUT: %Copy.lookup_impl_witness.58d: <witness> = lookup_impl_witness %T.035, @Copy [symbolic]
  111. // CHECK:STDOUT: %.72e: type = fn_type_with_self_type %Copy.Op.type, %T.035 [symbolic]
  112. // CHECK:STDOUT: %impl.elem0.07b: %.72e = impl_witness_access %Copy.lookup_impl_witness.58d, element0 [symbolic]
  113. // CHECK:STDOUT: %specific_impl_fn.2c9: <specific function> = specific_impl_function %impl.elem0.07b, @Copy.Op(%T.035) [symbolic]
  114. // CHECK:STDOUT: %require_complete.904: <witness> = require_complete_type %Class [symbolic]
  115. // CHECK:STDOUT: }
  116. // CHECK:STDOUT:
  117. // CHECK:STDOUT: imports {
  118. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  119. // CHECK:STDOUT: .Copy = %Core.Copy
  120. // CHECK:STDOUT: import Core//prelude
  121. // CHECK:STDOUT: import Core//prelude/...
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  124. // CHECK:STDOUT: }
  125. // CHECK:STDOUT:
  126. // CHECK:STDOUT: file {
  127. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [concrete = constants.%Class.generic] {
  128. // CHECK:STDOUT: %T.patt: %pattern_type.ce2 = symbolic_binding_pattern T, 0 [concrete]
  129. // CHECK:STDOUT: } {
  130. // CHECK:STDOUT: %.loc5: type = splice_block %Copy.ref [concrete = constants.%Copy.type] {
  131. // CHECK:STDOUT: <elided>
  132. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  133. // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type]
  134. // CHECK:STDOUT: }
  135. // CHECK:STDOUT: %T.loc5_13.2: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc5_13.1 (constants.%T.035)]
  136. // CHECK:STDOUT: }
  137. // CHECK:STDOUT: %Class.F.decl: %Class.F.type = fn_decl @Class.F [symbolic = constants.%Class.F] {
  138. // CHECK:STDOUT: %n.patt: @Class.F.%pattern_type (%pattern_type.9b9f0c.1) = value_binding_pattern n [concrete]
  139. // CHECK:STDOUT: %n.param_patt: @Class.F.%pattern_type (%pattern_type.9b9f0c.1) = value_param_pattern %n.patt, call_param0 [concrete]
  140. // CHECK:STDOUT: %return.patt: @Class.F.%pattern_type (%pattern_type.9b9f0c.1) = return_slot_pattern [concrete]
  141. // CHECK:STDOUT: %return.param_patt: @Class.F.%pattern_type (%pattern_type.9b9f0c.1) = out_param_pattern %return.patt, call_param1 [concrete]
  142. // CHECK:STDOUT: } {
  143. // CHECK:STDOUT: %.loc11_18: type = splice_block %Copy.ref [concrete = constants.%Copy.type] {
  144. // CHECK:STDOUT: <elided>
  145. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  146. // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type]
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT: %T.loc11: %Copy.type = symbolic_binding T, 0 [symbolic = @Class.%T.loc5_13.1 (constants.%T.035)]
  149. // CHECK:STDOUT: %T.ref.loc11_36: %Copy.type = name_ref T, %T.loc11 [symbolic = %T.loc6 (constants.%T.035)]
  150. // CHECK:STDOUT: %T.as_type.loc11_36: type = facet_access_type %T.ref.loc11_36 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  151. // CHECK:STDOUT: %.loc11_36: type = converted %T.ref.loc11_36, %T.as_type.loc11_36 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  152. // CHECK:STDOUT: %n.param.loc11: @Class.F.%T.binding.as_type (%T.binding.as_type) = value_param call_param0
  153. // CHECK:STDOUT: %.loc11_30.1: type = splice_block %.loc11_30.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
  154. // CHECK:STDOUT: %T.ref.loc11_30: %Copy.type = name_ref T, %T.loc11 [symbolic = %T.loc6 (constants.%T.035)]
  155. // CHECK:STDOUT: %T.as_type.loc11_30: type = facet_access_type %T.ref.loc11_30 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  156. // CHECK:STDOUT: %.loc11_30.2: type = converted %T.ref.loc11_30, %T.as_type.loc11_30 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT: %n.loc11: @Class.F.%T.binding.as_type (%T.binding.as_type) = value_binding n, %n.param.loc11
  159. // CHECK:STDOUT: %return.param.loc11: ref @Class.F.%T.binding.as_type (%T.binding.as_type) = out_param call_param1
  160. // CHECK:STDOUT: %return.loc11: ref @Class.F.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param.loc11
  161. // CHECK:STDOUT: }
  162. // CHECK:STDOUT: %Class.G.decl: %Class.G.type = fn_decl @Class.G [symbolic = constants.%Class.G] {
  163. // CHECK:STDOUT: %self.patt: @Class.G.%pattern_type.loc7_8 (%pattern_type.893) = value_binding_pattern self [concrete]
  164. // CHECK:STDOUT: %self.param_patt: @Class.G.%pattern_type.loc7_8 (%pattern_type.893) = value_param_pattern %self.patt, call_param0 [concrete]
  165. // CHECK:STDOUT: %return.patt: @Class.G.%pattern_type.loc7_22 (%pattern_type.9b9f0c.1) = return_slot_pattern [concrete]
  166. // CHECK:STDOUT: %return.param_patt: @Class.G.%pattern_type.loc7_22 (%pattern_type.9b9f0c.1) = out_param_pattern %return.patt, call_param1 [concrete]
  167. // CHECK:STDOUT: } {
  168. // CHECK:STDOUT: %.loc15_18: type = splice_block %Copy.ref [concrete = constants.%Copy.type] {
  169. // CHECK:STDOUT: <elided>
  170. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  171. // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type]
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT: %T.loc15: %Copy.type = symbolic_binding T, 0 [symbolic = @Class.%T.loc5_13.1 (constants.%T.035)]
  174. // CHECK:STDOUT: %T.ref.loc15: %Copy.type = name_ref T, %T.loc15 [symbolic = %T.loc7 (constants.%T.035)]
  175. // CHECK:STDOUT: %T.as_type.loc15: type = facet_access_type %T.ref.loc15 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  176. // CHECK:STDOUT: %.loc15_44: type = converted %T.ref.loc15, %T.as_type.loc15 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  177. // CHECK:STDOUT: %self.param.loc15: @Class.G.%Class (%Class) = value_param call_param0
  178. // CHECK:STDOUT: %.loc15_33.1: type = splice_block %Self.ref.loc15 [symbolic = %Class (constants.%Class)] {
  179. // CHECK:STDOUT: %.loc15_33.2: type = specific_constant constants.%Class, @Class(constants.%T.035) [symbolic = %Class (constants.%Class)]
  180. // CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, %.loc15_33.2 [symbolic = %Class (constants.%Class)]
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT: %self.loc15: @Class.G.%Class (%Class) = value_binding self, %self.param.loc15
  183. // CHECK:STDOUT: %return.param.loc15: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = out_param call_param1
  184. // CHECK:STDOUT: %return.loc15: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param.loc15
  185. // CHECK:STDOUT: }
  186. // CHECK:STDOUT: }
  187. // CHECK:STDOUT:
  188. // CHECK:STDOUT: generic class @Class(%T.loc5_13.2: %Copy.type) {
  189. // CHECK:STDOUT: %T.loc5_13.1: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc5_13.1 (constants.%T.035)]
  190. // CHECK:STDOUT:
  191. // CHECK:STDOUT: !definition:
  192. // CHECK:STDOUT: %Class.F.type: type = fn_type @Class.F, @Class(%T.loc5_13.1) [symbolic = %Class.F.type (constants.%Class.F.type)]
  193. // CHECK:STDOUT: %Class.F: @Class.%Class.F.type (%Class.F.type) = struct_value () [symbolic = %Class.F (constants.%Class.F)]
  194. // CHECK:STDOUT: %Class.G.type: type = fn_type @Class.G, @Class(%T.loc5_13.1) [symbolic = %Class.G.type (constants.%Class.G.type)]
  195. // CHECK:STDOUT: %Class.G: @Class.%Class.G.type (%Class.G.type) = struct_value () [symbolic = %Class.G (constants.%Class.G)]
  196. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc5_13.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  197. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.67c)]
  198. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc5_13.1) [symbolic = %Class (constants.%Class)]
  199. // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem)]
  200. // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Class.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n)]
  201. // CHECK:STDOUT: %complete_type.loc9_1.2: <witness> = complete_type_witness %struct_type.n [symbolic = %complete_type.loc9_1.2 (constants.%complete_type)]
  202. // CHECK:STDOUT:
  203. // CHECK:STDOUT: class {
  204. // CHECK:STDOUT: %Class.F.decl: @Class.%Class.F.type (%Class.F.type) = fn_decl @Class.F [symbolic = @Class.%Class.F (constants.%Class.F)] {
  205. // CHECK:STDOUT: %n.patt: @Class.F.%pattern_type (%pattern_type.9b9f0c.1) = value_binding_pattern n [concrete]
  206. // CHECK:STDOUT: %n.param_patt: @Class.F.%pattern_type (%pattern_type.9b9f0c.1) = value_param_pattern %n.patt, call_param0 [concrete]
  207. // CHECK:STDOUT: %return.patt: @Class.F.%pattern_type (%pattern_type.9b9f0c.1) = return_slot_pattern [concrete]
  208. // CHECK:STDOUT: %return.param_patt: @Class.F.%pattern_type (%pattern_type.9b9f0c.1) = out_param_pattern %return.patt, call_param1 [concrete]
  209. // CHECK:STDOUT: } {
  210. // CHECK:STDOUT: %T.ref.loc6_17: %Copy.type = name_ref T, @Class.%T.loc5_13.2 [symbolic = %T.loc6 (constants.%T.035)]
  211. // CHECK:STDOUT: %T.as_type.loc6_17: type = facet_access_type %T.ref.loc6_17 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  212. // CHECK:STDOUT: %.loc6_17: type = converted %T.ref.loc6_17, %T.as_type.loc6_17 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  213. // CHECK:STDOUT: %n.param.loc6: @Class.F.%T.binding.as_type (%T.binding.as_type) = value_param call_param0
  214. // CHECK:STDOUT: %.loc6_11.1: type = splice_block %.loc6_11.2 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
  215. // CHECK:STDOUT: %T.ref.loc6_11: %Copy.type = name_ref T, @Class.%T.loc5_13.2 [symbolic = %T.loc6 (constants.%T.035)]
  216. // CHECK:STDOUT: %T.as_type.loc6_11: type = facet_access_type %T.ref.loc6_11 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  217. // CHECK:STDOUT: %.loc6_11.2: type = converted %T.ref.loc6_11, %T.as_type.loc6_11 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT: %n.loc6: @Class.F.%T.binding.as_type (%T.binding.as_type) = value_binding n, %n.param.loc6
  220. // CHECK:STDOUT: %return.param.loc6: ref @Class.F.%T.binding.as_type (%T.binding.as_type) = out_param call_param1
  221. // CHECK:STDOUT: %return.loc6: ref @Class.F.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param.loc6
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT: %Class.G.decl: @Class.%Class.G.type (%Class.G.type) = fn_decl @Class.G [symbolic = @Class.%Class.G (constants.%Class.G)] {
  224. // CHECK:STDOUT: %self.patt: @Class.G.%pattern_type.loc7_8 (%pattern_type.893) = value_binding_pattern self [concrete]
  225. // CHECK:STDOUT: %self.param_patt: @Class.G.%pattern_type.loc7_8 (%pattern_type.893) = value_param_pattern %self.patt, call_param0 [concrete]
  226. // CHECK:STDOUT: %return.patt: @Class.G.%pattern_type.loc7_22 (%pattern_type.9b9f0c.1) = return_slot_pattern [concrete]
  227. // CHECK:STDOUT: %return.param_patt: @Class.G.%pattern_type.loc7_22 (%pattern_type.9b9f0c.1) = out_param_pattern %return.patt, call_param1 [concrete]
  228. // CHECK:STDOUT: } {
  229. // CHECK:STDOUT: %T.ref.loc7: %Copy.type = name_ref T, @Class.%T.loc5_13.2 [symbolic = %T.loc7 (constants.%T.035)]
  230. // CHECK:STDOUT: %T.as_type.loc7: type = facet_access_type %T.ref.loc7 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  231. // CHECK:STDOUT: %.loc7_25: type = converted %T.ref.loc7, %T.as_type.loc7 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  232. // CHECK:STDOUT: %self.param.loc7: @Class.G.%Class (%Class) = value_param call_param0
  233. // CHECK:STDOUT: %.loc7_14.1: type = splice_block %Self.ref.loc7 [symbolic = %Class (constants.%Class)] {
  234. // CHECK:STDOUT: %.loc7_14.2: type = specific_constant constants.%Class, @Class(constants.%T.035) [symbolic = %Class (constants.%Class)]
  235. // CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, %.loc7_14.2 [symbolic = %Class (constants.%Class)]
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT: %self.loc7: @Class.G.%Class (%Class) = value_binding self, %self.param.loc7
  238. // CHECK:STDOUT: %return.param.loc7: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = out_param call_param1
  239. // CHECK:STDOUT: %return.loc7: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = return_slot %return.param.loc7
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, %T.loc5_13.2 [symbolic = %T.loc5_13.1 (constants.%T.035)]
  242. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  243. // CHECK:STDOUT: %.loc8_10: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  244. // CHECK:STDOUT: %.loc8_8: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [concrete]
  245. // CHECK:STDOUT: %complete_type.loc9_1.1: <witness> = complete_type_witness constants.%struct_type.n [symbolic = %complete_type.loc9_1.2 (constants.%complete_type)]
  246. // CHECK:STDOUT: complete_type_witness = %complete_type.loc9_1.1
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: !members:
  249. // CHECK:STDOUT: .Self = constants.%Class
  250. // CHECK:STDOUT: .T = <poisoned>
  251. // CHECK:STDOUT: .F = %Class.F.decl
  252. // CHECK:STDOUT: .G = %Class.G.decl
  253. // CHECK:STDOUT: .n = %.loc8_8
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: generic fn @Class.F(@Class.%T.loc5_13.2: %Copy.type) {
  258. // CHECK:STDOUT: %T.loc6: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc6 (constants.%T.035)]
  259. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc6 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  260. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.9b9f0c.1)]
  261. // CHECK:STDOUT:
  262. // CHECK:STDOUT: !definition:
  263. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.67c)]
  264. // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc6, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.58d)]
  265. // CHECK:STDOUT: %.loc12: type = fn_type_with_self_type constants.%Copy.Op.type, %T.loc6 [symbolic = %.loc12 (constants.%.72e)]
  266. // CHECK:STDOUT: %impl.elem0.loc12_10.2: @Class.F.%.loc12 (%.72e) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_10.2 (constants.%impl.elem0.07b)]
  267. // CHECK:STDOUT: %specific_impl_fn.loc12_10.2: <specific function> = specific_impl_function %impl.elem0.loc12_10.2, @Copy.Op(%T.loc6) [symbolic = %specific_impl_fn.loc12_10.2 (constants.%specific_impl_fn.2c9)]
  268. // CHECK:STDOUT:
  269. // CHECK:STDOUT: fn(%n.param.loc11: @Class.F.%T.binding.as_type (%T.binding.as_type)) -> %return.param.loc11: @Class.F.%T.binding.as_type (%T.binding.as_type) {
  270. // CHECK:STDOUT: !entry:
  271. // CHECK:STDOUT: %n.ref: @Class.F.%T.binding.as_type (%T.binding.as_type) = name_ref n, %n.loc11
  272. // CHECK:STDOUT: %impl.elem0.loc12_10.1: @Class.F.%.loc12 (%.72e) = impl_witness_access constants.%Copy.lookup_impl_witness.58d, element0 [symbolic = %impl.elem0.loc12_10.2 (constants.%impl.elem0.07b)]
  273. // CHECK:STDOUT: %bound_method.loc12_10.1: <bound method> = bound_method %n.ref, %impl.elem0.loc12_10.1
  274. // CHECK:STDOUT: %specific_impl_fn.loc12_10.1: <specific function> = specific_impl_function %impl.elem0.loc12_10.1, @Copy.Op(constants.%T.035) [symbolic = %specific_impl_fn.loc12_10.2 (constants.%specific_impl_fn.2c9)]
  275. // CHECK:STDOUT: %bound_method.loc12_10.2: <bound method> = bound_method %n.ref, %specific_impl_fn.loc12_10.1
  276. // CHECK:STDOUT: %.loc11_33: ref @Class.F.%T.binding.as_type (%T.binding.as_type) = splice_block %return.loc11 {}
  277. // CHECK:STDOUT: %Copy.Op.call: init @Class.F.%T.binding.as_type (%T.binding.as_type) = call %bound_method.loc12_10.2(%n.ref) to %.loc11_33
  278. // CHECK:STDOUT: return %Copy.Op.call to %return.loc11
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: generic fn @Class.G(@Class.%T.loc5_13.2: %Copy.type) {
  283. // CHECK:STDOUT: %T.loc7: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc7 (constants.%T.035)]
  284. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc7) [symbolic = %Class (constants.%Class)]
  285. // CHECK:STDOUT: %pattern_type.loc7_8: type = pattern_type %Class [symbolic = %pattern_type.loc7_8 (constants.%pattern_type.893)]
  286. // CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc7 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
  287. // CHECK:STDOUT: %pattern_type.loc7_22: type = pattern_type %T.binding.as_type [symbolic = %pattern_type.loc7_22 (constants.%pattern_type.9b9f0c.1)]
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: !definition:
  290. // CHECK:STDOUT: %require_complete.loc15: <witness> = require_complete_type %Class [symbolic = %require_complete.loc15 (constants.%require_complete.904)]
  291. // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.binding.as_type [symbolic = %Class.elem (constants.%Class.elem)]
  292. // CHECK:STDOUT: %require_complete.loc16: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc16 (constants.%require_complete.67c)]
  293. // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc7, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.58d)]
  294. // CHECK:STDOUT: %.loc16_14.3: type = fn_type_with_self_type constants.%Copy.Op.type, %T.loc7 [symbolic = %.loc16_14.3 (constants.%.72e)]
  295. // CHECK:STDOUT: %impl.elem0.loc16_14.2: @Class.G.%.loc16_14.3 (%.72e) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_14.2 (constants.%impl.elem0.07b)]
  296. // CHECK:STDOUT: %specific_impl_fn.loc16_14.2: <specific function> = specific_impl_function %impl.elem0.loc16_14.2, @Copy.Op(%T.loc7) [symbolic = %specific_impl_fn.loc16_14.2 (constants.%specific_impl_fn.2c9)]
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: fn(%self.param.loc15: @Class.G.%Class (%Class)) -> %return.param.loc15: @Class.G.%T.binding.as_type (%T.binding.as_type) {
  299. // CHECK:STDOUT: !entry:
  300. // CHECK:STDOUT: %self.ref: @Class.G.%Class (%Class) = name_ref self, %self.loc15
  301. // CHECK:STDOUT: %n.ref: @Class.G.%Class.elem (%Class.elem) = name_ref n, @Class.%.loc8_8 [concrete = @Class.%.loc8_8]
  302. // CHECK:STDOUT: %.loc16_14.1: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = class_element_access %self.ref, element0
  303. // CHECK:STDOUT: %.loc16_14.2: @Class.G.%T.binding.as_type (%T.binding.as_type) = acquire_value %.loc16_14.1
  304. // CHECK:STDOUT: %impl.elem0.loc16_14.1: @Class.G.%.loc16_14.3 (%.72e) = impl_witness_access constants.%Copy.lookup_impl_witness.58d, element0 [symbolic = %impl.elem0.loc16_14.2 (constants.%impl.elem0.07b)]
  305. // CHECK:STDOUT: %bound_method.loc16_14.1: <bound method> = bound_method %.loc16_14.2, %impl.elem0.loc16_14.1
  306. // CHECK:STDOUT: %specific_impl_fn.loc16_14.1: <specific function> = specific_impl_function %impl.elem0.loc16_14.1, @Copy.Op(constants.%T.035) [symbolic = %specific_impl_fn.loc16_14.2 (constants.%specific_impl_fn.2c9)]
  307. // CHECK:STDOUT: %bound_method.loc16_14.2: <bound method> = bound_method %.loc16_14.2, %specific_impl_fn.loc16_14.1
  308. // CHECK:STDOUT: %.loc15_41: ref @Class.G.%T.binding.as_type (%T.binding.as_type) = splice_block %return.loc15 {}
  309. // CHECK:STDOUT: %Copy.Op.call: init @Class.G.%T.binding.as_type (%T.binding.as_type) = call %bound_method.loc16_14.2(%.loc16_14.2) to %.loc15_41
  310. // CHECK:STDOUT: return %Copy.Op.call to %return.loc15
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT: }
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: specific @Class(constants.%T.035) {
  315. // CHECK:STDOUT: %T.loc5_13.1 => constants.%T.035
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: !definition:
  318. // CHECK:STDOUT: %Class.F.type => constants.%Class.F.type
  319. // CHECK:STDOUT: %Class.F => constants.%Class.F
  320. // CHECK:STDOUT: %Class.G.type => constants.%Class.G.type
  321. // CHECK:STDOUT: %Class.G => constants.%Class.G
  322. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  323. // CHECK:STDOUT: %require_complete => constants.%require_complete.67c
  324. // CHECK:STDOUT: %Class => constants.%Class
  325. // CHECK:STDOUT: %Class.elem => constants.%Class.elem
  326. // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n
  327. // CHECK:STDOUT: %complete_type.loc9_1.2 => constants.%complete_type
  328. // CHECK:STDOUT: }
  329. // CHECK:STDOUT:
  330. // CHECK:STDOUT: specific @Class.F(constants.%T.035) {
  331. // CHECK:STDOUT: %T.loc6 => constants.%T.035
  332. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  333. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9b9f0c.1
  334. // CHECK:STDOUT: }
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: specific @Class.G(constants.%T.035) {
  337. // CHECK:STDOUT: %T.loc7 => constants.%T.035
  338. // CHECK:STDOUT: %Class => constants.%Class
  339. // CHECK:STDOUT: %pattern_type.loc7_8 => constants.%pattern_type.893
  340. // CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
  341. // CHECK:STDOUT: %pattern_type.loc7_22 => constants.%pattern_type.9b9f0c.1
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: --- nested.carbon
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: constants {
  347. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  348. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  349. // CHECK:STDOUT: %A.type: type = generic_class_type @A [concrete]
  350. // CHECK:STDOUT: %A.generic: %A.type = struct_value () [concrete]
  351. // CHECK:STDOUT: %A: type = class_type @A, @A(%T) [symbolic]
  352. // CHECK:STDOUT: %N: %T = symbolic_binding N, 1 [symbolic]
  353. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
  354. // CHECK:STDOUT: %B.type: type = generic_class_type @B, @A(%T) [symbolic]
  355. // CHECK:STDOUT: %B.generic: %B.type = struct_value () [symbolic]
  356. // CHECK:STDOUT: %B: type = class_type @B, @B(%T, %N) [symbolic]
  357. // CHECK:STDOUT: %pattern_type.830: type = pattern_type %B [symbolic]
  358. // CHECK:STDOUT: %B.F.type: type = fn_type @B.F, @B(%T, %N) [symbolic]
  359. // CHECK:STDOUT: %B.F: %B.F.type = struct_value () [symbolic]
  360. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  361. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  362. // CHECK:STDOUT: %require_complete.7cc: <witness> = require_complete_type %B [symbolic]
  363. // CHECK:STDOUT: %require_complete.944: <witness> = require_complete_type %T [symbolic]
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: imports {
  367. // CHECK:STDOUT: }
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: file {
  370. // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [concrete = constants.%A.generic] {
  371. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  372. // CHECK:STDOUT: } {
  373. // CHECK:STDOUT: <elided>
  374. // CHECK:STDOUT: %T.loc5_9.2: type = symbolic_binding T, 0 [symbolic = %T.loc5_9.1 (constants.%T)]
  375. // CHECK:STDOUT: }
  376. // CHECK:STDOUT: %B.F.decl: %B.F.type = fn_decl @B.F [symbolic = constants.%B.F] {
  377. // CHECK:STDOUT: %self.patt: @B.F.%pattern_type.loc7_10 (%pattern_type.830) = value_binding_pattern self [concrete]
  378. // CHECK:STDOUT: %self.param_patt: @B.F.%pattern_type.loc7_10 (%pattern_type.830) = value_param_pattern %self.patt, call_param0 [concrete]
  379. // CHECK:STDOUT: %a.patt: @B.F.%pattern_type.loc7_22 (%pattern_type.51d) = value_binding_pattern a [concrete]
  380. // CHECK:STDOUT: %a.param_patt: @B.F.%pattern_type.loc7_22 (%pattern_type.51d) = value_param_pattern %a.patt, call_param1 [concrete]
  381. // CHECK:STDOUT: } {
  382. // CHECK:STDOUT: <elided>
  383. // CHECK:STDOUT: %T.loc11: type = symbolic_binding T, 0 [symbolic = @A.%T.loc5_9.1 (constants.%T)]
  384. // CHECK:STDOUT: %.loc11_22: type = splice_block %T.ref.loc11_22 [symbolic = @B.%T (constants.%T)] {
  385. // CHECK:STDOUT: <elided>
  386. // CHECK:STDOUT: %T.ref.loc11_22: type = name_ref T, %T.loc11 [symbolic = @B.%T (constants.%T)]
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT: %N.loc11: @B.%T (%T) = symbolic_binding N, 1 [symbolic = @B.%N.loc6_11.1 (constants.%N)]
  389. // CHECK:STDOUT: %self.param.loc11: @B.F.%B (%B) = value_param call_param0
  390. // CHECK:STDOUT: %.loc11_33.1: type = splice_block %Self.ref.loc11 [symbolic = %B (constants.%B)] {
  391. // CHECK:STDOUT: %.loc11_33.2: type = specific_constant constants.%B, @B(constants.%T, constants.%N) [symbolic = %B (constants.%B)]
  392. // CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, %.loc11_33.2 [symbolic = %B (constants.%B)]
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT: %self.loc11: @B.F.%B (%B) = value_binding self, %self.param.loc11
  395. // CHECK:STDOUT: %a.param.loc11: @B.F.%T.loc7 (%T) = value_param call_param1
  396. // CHECK:STDOUT: %T.ref.loc11_42: type = name_ref T, %T.loc11 [symbolic = %T.loc7 (constants.%T)]
  397. // CHECK:STDOUT: %a.loc11: @B.F.%T.loc7 (%T) = value_binding a, %a.param.loc11
  398. // CHECK:STDOUT: }
  399. // CHECK:STDOUT: }
  400. // CHECK:STDOUT:
  401. // CHECK:STDOUT: generic class @A(%T.loc5_9.2: type) {
  402. // CHECK:STDOUT: %T.loc5_9.1: type = symbolic_binding T, 0 [symbolic = %T.loc5_9.1 (constants.%T)]
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: !definition:
  405. // CHECK:STDOUT: %B.type: type = generic_class_type @B, @A(%T.loc5_9.1) [symbolic = %B.type (constants.%B.type)]
  406. // CHECK:STDOUT: %B.generic: @A.%B.type (%B.type) = struct_value () [symbolic = %B.generic (constants.%B.generic)]
  407. // CHECK:STDOUT:
  408. // CHECK:STDOUT: class {
  409. // CHECK:STDOUT: %B.decl: @A.%B.type (%B.type) = class_decl @B [symbolic = @A.%B.generic (constants.%B.generic)] {
  410. // CHECK:STDOUT: %N.patt: @B.%pattern_type (%pattern_type.51d) = symbolic_binding_pattern N, 1 [concrete]
  411. // CHECK:STDOUT: } {
  412. // CHECK:STDOUT: %.loc6: type = splice_block %T.ref [symbolic = %T (constants.%T)] {
  413. // CHECK:STDOUT: <elided>
  414. // CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_9.2 [symbolic = %T (constants.%T)]
  415. // CHECK:STDOUT: }
  416. // CHECK:STDOUT: %N.loc6_11.2: @B.%T (%T) = symbolic_binding N, 1 [symbolic = %N.loc6_11.1 (constants.%N)]
  417. // CHECK:STDOUT: }
  418. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  419. // CHECK:STDOUT: complete_type_witness = %complete_type
  420. // CHECK:STDOUT:
  421. // CHECK:STDOUT: !members:
  422. // CHECK:STDOUT: .Self = constants.%A
  423. // CHECK:STDOUT: .T = <poisoned>
  424. // CHECK:STDOUT: .B = %B.decl
  425. // CHECK:STDOUT: }
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: generic class @B(@A.%T.loc5_9.2: type, %N.loc6_11.2: @B.%T (%T)) {
  429. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
  430. // CHECK:STDOUT: %N.loc6_11.1: @B.%T (%T) = symbolic_binding N, 1 [symbolic = %N.loc6_11.1 (constants.%N)]
  431. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.51d)]
  432. // CHECK:STDOUT:
  433. // CHECK:STDOUT: !definition:
  434. // CHECK:STDOUT: %B.F.type: type = fn_type @B.F, @B(%T, %N.loc6_11.1) [symbolic = %B.F.type (constants.%B.F.type)]
  435. // CHECK:STDOUT: %B.F: @B.%B.F.type (%B.F.type) = struct_value () [symbolic = %B.F (constants.%B.F)]
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: class {
  438. // CHECK:STDOUT: %B.F.decl: @B.%B.F.type (%B.F.type) = fn_decl @B.F [symbolic = @B.%B.F (constants.%B.F)] {
  439. // CHECK:STDOUT: %self.patt: @B.F.%pattern_type.loc7_10 (%pattern_type.830) = value_binding_pattern self [concrete]
  440. // CHECK:STDOUT: %self.param_patt: @B.F.%pattern_type.loc7_10 (%pattern_type.830) = value_param_pattern %self.patt, call_param0 [concrete]
  441. // CHECK:STDOUT: %a.patt: @B.F.%pattern_type.loc7_22 (%pattern_type.51d) = value_binding_pattern a [concrete]
  442. // CHECK:STDOUT: %a.param_patt: @B.F.%pattern_type.loc7_22 (%pattern_type.51d) = value_param_pattern %a.patt, call_param1 [concrete]
  443. // CHECK:STDOUT: } {
  444. // CHECK:STDOUT: %self.param.loc7: @B.F.%B (%B) = value_param call_param0
  445. // CHECK:STDOUT: %.loc7_16.1: type = splice_block %Self.ref.loc7 [symbolic = %B (constants.%B)] {
  446. // CHECK:STDOUT: %.loc7_16.2: type = specific_constant constants.%B, @B(constants.%T, constants.%N) [symbolic = %B (constants.%B)]
  447. // CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, %.loc7_16.2 [symbolic = %B (constants.%B)]
  448. // CHECK:STDOUT: }
  449. // CHECK:STDOUT: %self.loc7: @B.F.%B (%B) = value_binding self, %self.param.loc7
  450. // CHECK:STDOUT: %a.param.loc7: @B.F.%T.loc7 (%T) = value_param call_param1
  451. // CHECK:STDOUT: %T.ref.loc7: type = name_ref T, @A.%T.loc5_9.2 [symbolic = %T.loc7 (constants.%T)]
  452. // CHECK:STDOUT: %a.loc7: @B.F.%T.loc7 (%T) = value_binding a, %a.param.loc7
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  455. // CHECK:STDOUT: complete_type_witness = %complete_type
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: !members:
  458. // CHECK:STDOUT: .Self = constants.%B
  459. // CHECK:STDOUT: .T = <poisoned>
  460. // CHECK:STDOUT: .F = %B.F.decl
  461. // CHECK:STDOUT: }
  462. // CHECK:STDOUT: }
  463. // CHECK:STDOUT:
  464. // CHECK:STDOUT: generic fn @B.F(@A.%T.loc5_9.2: type, @B.%N.loc6_11.2: @B.%T (%T)) {
  465. // CHECK:STDOUT: %T.loc7: type = symbolic_binding T, 0 [symbolic = %T.loc7 (constants.%T)]
  466. // CHECK:STDOUT: %N.loc7: @B.F.%T.loc7 (%T) = symbolic_binding N, 1 [symbolic = %N.loc7 (constants.%N)]
  467. // CHECK:STDOUT: %B: type = class_type @B, @B(%T.loc7, %N.loc7) [symbolic = %B (constants.%B)]
  468. // CHECK:STDOUT: %pattern_type.loc7_10: type = pattern_type %B [symbolic = %pattern_type.loc7_10 (constants.%pattern_type.830)]
  469. // CHECK:STDOUT: %pattern_type.loc7_22: type = pattern_type %T.loc7 [symbolic = %pattern_type.loc7_22 (constants.%pattern_type.51d)]
  470. // CHECK:STDOUT:
  471. // CHECK:STDOUT: !definition:
  472. // CHECK:STDOUT: %require_complete.loc11_31: <witness> = require_complete_type %B [symbolic = %require_complete.loc11_31 (constants.%require_complete.7cc)]
  473. // CHECK:STDOUT: %require_complete.loc11_40: <witness> = require_complete_type %T.loc7 [symbolic = %require_complete.loc11_40 (constants.%require_complete.944)]
  474. // CHECK:STDOUT:
  475. // CHECK:STDOUT: fn(%self.param.loc11: @B.F.%B (%B), %a.param.loc11: @B.F.%T.loc7 (%T)) {
  476. // CHECK:STDOUT: !entry:
  477. // CHECK:STDOUT: return
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT: }
  480. // CHECK:STDOUT:
  481. // CHECK:STDOUT: specific @A(constants.%T) {
  482. // CHECK:STDOUT: %T.loc5_9.1 => constants.%T
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: !definition:
  485. // CHECK:STDOUT: %B.type => constants.%B.type
  486. // CHECK:STDOUT: %B.generic => constants.%B.generic
  487. // CHECK:STDOUT: }
  488. // CHECK:STDOUT:
  489. // CHECK:STDOUT: specific @B(constants.%T, constants.%N) {
  490. // CHECK:STDOUT: %T => constants.%T
  491. // CHECK:STDOUT: %N.loc6_11.1 => constants.%N
  492. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d
  493. // CHECK:STDOUT:
  494. // CHECK:STDOUT: !definition:
  495. // CHECK:STDOUT: %B.F.type => constants.%B.F.type
  496. // CHECK:STDOUT: %B.F => constants.%B.F
  497. // CHECK:STDOUT: }
  498. // CHECK:STDOUT:
  499. // CHECK:STDOUT: specific @B.F(constants.%T, constants.%N) {
  500. // CHECK:STDOUT: %T.loc7 => constants.%T
  501. // CHECK:STDOUT: %N.loc7 => constants.%N
  502. // CHECK:STDOUT: %B => constants.%B
  503. // CHECK:STDOUT: %pattern_type.loc7_10 => constants.%pattern_type.830
  504. // CHECK:STDOUT: %pattern_type.loc7_22 => constants.%pattern_type.51d
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT: