extend_impl_generic.carbon 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/extend_impl_generic.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/extend_impl_generic.carbon
  13. // --- extend_impl_generic_interface.carbon
  14. library "[[@TEST_NAME]]";
  15. interface HasF(T:! type) {
  16. fn F() -> T;
  17. }
  18. class Param {
  19. var x: i32;
  20. }
  21. class C {
  22. extend impl as HasF(Param) {
  23. fn F() -> Param {
  24. return {.x = 2};
  25. }
  26. }
  27. }
  28. fn G(c: C) {
  29. let a: i32 = C.F().x;
  30. var b: i32 = c.F().x;
  31. }
  32. // --- extend_impl_generic_class.carbon
  33. library "[[@TEST_NAME]]";
  34. interface I(T:! type) {
  35. fn F[self: Self](t: T);
  36. }
  37. class X(U:! type) {
  38. extend impl as I(U) {
  39. fn F[self: Self](t: U) { }
  40. }
  41. }
  42. // CHECK:STDOUT: --- extend_impl_generic_interface.carbon
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: constants {
  45. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  46. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  47. // CHECK:STDOUT: %HasF.type.fe3: type = generic_interface_type @HasF [concrete]
  48. // CHECK:STDOUT: %HasF.generic: %HasF.type.fe3 = struct_value () [concrete]
  49. // CHECK:STDOUT: %HasF.type.901: type = facet_type <@HasF, @HasF(%T)> [symbolic]
  50. // CHECK:STDOUT: %Self.322: %HasF.type.901 = bind_symbolic_name Self, 1 [symbolic]
  51. // CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T [symbolic]
  52. // CHECK:STDOUT: %F.type.46c: type = fn_type @F.1, @HasF(%T) [symbolic]
  53. // CHECK:STDOUT: %F.823: %F.type.46c = struct_value () [symbolic]
  54. // CHECK:STDOUT: %HasF.assoc_type.dd8: type = assoc_entity_type @HasF, @HasF(%T) [symbolic]
  55. // CHECK:STDOUT: %assoc0.d31: %HasF.assoc_type.dd8 = assoc_entity element0, @HasF.%F.decl [symbolic]
  56. // CHECK:STDOUT: %Param: type = class_type @Param [concrete]
  57. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  58. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  59. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  60. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  61. // CHECK:STDOUT: %Param.elem: type = unbound_element_type %Param, %i32 [concrete]
  62. // CHECK:STDOUT: %struct_type.x.ed6: type = struct_type {.x: %i32} [concrete]
  63. // CHECK:STDOUT: %complete_type.1ec: <witness> = complete_type_witness %struct_type.x.ed6 [concrete]
  64. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  65. // CHECK:STDOUT: %HasF.type.b18: type = facet_type <@HasF, @HasF(%Param)> [concrete]
  66. // CHECK:STDOUT: %Self.a41: %HasF.type.b18 = bind_symbolic_name Self, 1 [symbolic]
  67. // CHECK:STDOUT: %F.type.7f1: type = fn_type @F.1, @HasF(%Param) [concrete]
  68. // CHECK:STDOUT: %F.eff: %F.type.7f1 = struct_value () [concrete]
  69. // CHECK:STDOUT: %HasF.assoc_type.257: type = assoc_entity_type @HasF, @HasF(%Param) [concrete]
  70. // CHECK:STDOUT: %assoc0.afb: %HasF.assoc_type.257 = assoc_entity element0, @HasF.%F.decl [concrete]
  71. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness @C.%HasF.impl_witness_table [concrete]
  72. // CHECK:STDOUT: %pattern_type.b01: type = pattern_type %Param [concrete]
  73. // CHECK:STDOUT: %F.type.94c: type = fn_type @F.2 [concrete]
  74. // CHECK:STDOUT: %F.901: %F.type.94c = struct_value () [concrete]
  75. // CHECK:STDOUT: %HasF.facet: %HasF.type.b18 = facet_value %C, (%HasF.impl_witness) [concrete]
  76. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  77. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  78. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  79. // CHECK:STDOUT: %struct_type.x.c96: type = struct_type {.x: Core.IntLiteral} [concrete]
  80. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  81. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  82. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  83. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  84. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  85. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
  86. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  87. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  88. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
  89. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  90. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  91. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
  92. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
  93. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  94. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
  95. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
  96. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  97. // CHECK:STDOUT: %Param.val: %Param = struct_value (%int_2.ef8) [concrete]
  98. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  99. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  100. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  101. // CHECK:STDOUT: %.22c: type = fn_type_with_self_type %F.type.7f1, %HasF.facet [concrete]
  102. // CHECK:STDOUT: }
  103. // CHECK:STDOUT:
  104. // CHECK:STDOUT: imports {
  105. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  106. // CHECK:STDOUT: .Int = %Core.Int
  107. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  108. // CHECK:STDOUT: import Core//prelude
  109. // CHECK:STDOUT: import Core//prelude/...
  110. // CHECK:STDOUT: }
  111. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  112. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  113. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  114. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  115. // CHECK:STDOUT: }
  116. // CHECK:STDOUT:
  117. // CHECK:STDOUT: file {
  118. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  119. // CHECK:STDOUT: .Core = imports.%Core
  120. // CHECK:STDOUT: .HasF = %HasF.decl
  121. // CHECK:STDOUT: .Param = %Param.decl
  122. // CHECK:STDOUT: .C = %C.decl
  123. // CHECK:STDOUT: .G = %G.decl
  124. // CHECK:STDOUT: }
  125. // CHECK:STDOUT: %Core.import = import Core
  126. // CHECK:STDOUT: %HasF.decl: %HasF.type.fe3 = interface_decl @HasF [concrete = constants.%HasF.generic] {
  127. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  128. // CHECK:STDOUT: } {
  129. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)]
  130. // CHECK:STDOUT: }
  131. // CHECK:STDOUT: %Param.decl: type = class_decl @Param [concrete = constants.%Param] {} {}
  132. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  133. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  134. // CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete]
  135. // CHECK:STDOUT: %c.param_patt: %pattern_type.c48 = value_param_pattern %c.patt, call_param0 [concrete]
  136. // CHECK:STDOUT: } {
  137. // CHECK:STDOUT: %c.param: %C = value_param call_param0
  138. // CHECK:STDOUT: %C.ref.loc20: type = name_ref C, file.%C.decl [concrete = constants.%C]
  139. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  140. // CHECK:STDOUT: }
  141. // CHECK:STDOUT: }
  142. // CHECK:STDOUT:
  143. // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.1: type) {
  144. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)]
  145. // CHECK:STDOUT:
  146. // CHECK:STDOUT: !definition:
  147. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T.loc4_16.2)> [symbolic = %HasF.type (constants.%HasF.type.901)]
  148. // CHECK:STDOUT: %Self.2: @HasF.%HasF.type (%HasF.type.901) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.322)]
  149. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @HasF(%T.loc4_16.2) [symbolic = %F.type (constants.%F.type.46c)]
  150. // CHECK:STDOUT: %F: @HasF.%F.type (%F.type.46c) = struct_value () [symbolic = %F (constants.%F.823)]
  151. // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF, @HasF(%T.loc4_16.2) [symbolic = %HasF.assoc_type (constants.%HasF.assoc_type.dd8)]
  152. // CHECK:STDOUT: %assoc0.loc5_14.2: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc5_14.2 (constants.%assoc0.d31)]
  153. // CHECK:STDOUT:
  154. // CHECK:STDOUT: interface {
  155. // CHECK:STDOUT: %Self.1: @HasF.%HasF.type (%HasF.type.901) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.322)]
  156. // CHECK:STDOUT: %F.decl: @HasF.%F.type (%F.type.46c) = fn_decl @F.1 [symbolic = @HasF.%F (constants.%F.823)] {
  157. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.7dcd0a.1) = return_slot_pattern [concrete]
  158. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.7dcd0a.1) = out_param_pattern %return.patt, call_param0 [concrete]
  159. // CHECK:STDOUT: } {
  160. // CHECK:STDOUT: %T.ref: type = name_ref T, @HasF.%T.loc4_16.1 [symbolic = %T (constants.%T)]
  161. // CHECK:STDOUT: %return.param: ref @F.1.%T (%T) = out_param call_param0
  162. // CHECK:STDOUT: %return: ref @F.1.%T (%T) = return_slot %return.param
  163. // CHECK:STDOUT: }
  164. // CHECK:STDOUT: %assoc0.loc5_14.1: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc5_14.2 (constants.%assoc0.d31)]
  165. // CHECK:STDOUT:
  166. // CHECK:STDOUT: !members:
  167. // CHECK:STDOUT: .Self = %Self.1
  168. // CHECK:STDOUT: .T = <poisoned>
  169. // CHECK:STDOUT: .F = %assoc0.loc5_14.1
  170. // CHECK:STDOUT: .Param = <poisoned>
  171. // CHECK:STDOUT: witness = (%F.decl)
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT: }
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: impl @impl.3b1: %Self.ref as %HasF.type {
  176. // CHECK:STDOUT: %F.decl: %F.type.94c = fn_decl @F.2 [concrete = constants.%F.901] {
  177. // CHECK:STDOUT: %return.patt: %pattern_type.b01 = return_slot_pattern [concrete]
  178. // CHECK:STDOUT: %return.param_patt: %pattern_type.b01 = out_param_pattern %return.patt, call_param0 [concrete]
  179. // CHECK:STDOUT: } {
  180. // CHECK:STDOUT: %Param.ref: type = name_ref Param, file.%Param.decl [concrete = constants.%Param]
  181. // CHECK:STDOUT: %return.param: ref %Param = out_param call_param0
  182. // CHECK:STDOUT: %return: ref %Param = return_slot %return.param
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT:
  185. // CHECK:STDOUT: !members:
  186. // CHECK:STDOUT: .Param = <poisoned>
  187. // CHECK:STDOUT: .F = %F.decl
  188. // CHECK:STDOUT: witness = @C.%HasF.impl_witness
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT:
  191. // CHECK:STDOUT: class @Param {
  192. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  193. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  194. // CHECK:STDOUT: %.loc9: %Param.elem = field_decl x, element0 [concrete]
  195. // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %i32} [concrete = constants.%struct_type.x.ed6]
  196. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete = constants.%complete_type.1ec]
  197. // CHECK:STDOUT: complete_type_witness = %complete_type
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: !members:
  200. // CHECK:STDOUT: .Self = constants.%Param
  201. // CHECK:STDOUT: .x = %.loc9
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT:
  204. // CHECK:STDOUT: class @C {
  205. // CHECK:STDOUT: impl_decl @impl.3b1 [concrete] {} {
  206. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  207. // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic]
  208. // CHECK:STDOUT: %Param.ref: type = name_ref Param, file.%Param.decl [concrete = constants.%Param]
  209. // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%Param)> [concrete = constants.%HasF.type.b18]
  210. // CHECK:STDOUT: }
  211. // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@impl.3b1.%F.decl), @impl.3b1 [concrete]
  212. // CHECK:STDOUT: %HasF.impl_witness: <witness> = impl_witness %HasF.impl_witness_table [concrete = constants.%HasF.impl_witness]
  213. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  214. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  215. // CHECK:STDOUT: complete_type_witness = %complete_type
  216. // CHECK:STDOUT:
  217. // CHECK:STDOUT: !members:
  218. // CHECK:STDOUT: .Self = constants.%C
  219. // CHECK:STDOUT: .HasF = <poisoned>
  220. // CHECK:STDOUT: .Param = <poisoned>
  221. // CHECK:STDOUT: .F = <poisoned>
  222. // CHECK:STDOUT: extend @impl.3b1.%HasF.type
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT:
  225. // CHECK:STDOUT: generic fn @F.1(@HasF.%T.loc4_16.1: type, @HasF.%Self.1: @HasF.%HasF.type (%HasF.type.901)) {
  226. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  227. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dcd0a.1)]
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: fn() -> @F.1.%T (%T);
  230. // CHECK:STDOUT: }
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: fn @F.2() -> %return.param: %Param {
  233. // CHECK:STDOUT: !entry:
  234. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  235. // CHECK:STDOUT: %.loc15_21.1: %struct_type.x.c96 = struct_literal (%int_2)
  236. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  237. // CHECK:STDOUT: %bound_method.loc15_21.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound]
  238. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  239. // CHECK:STDOUT: %bound_method.loc15_21.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
  240. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_21.2(%int_2) [concrete = constants.%int_2.ef8]
  241. // CHECK:STDOUT: %.loc15_21.2: init %i32 = converted %int_2, %int.convert_checked [concrete = constants.%int_2.ef8]
  242. // CHECK:STDOUT: %.loc15_21.3: ref %i32 = class_element_access %return, element0
  243. // CHECK:STDOUT: %.loc15_21.4: init %i32 = initialize_from %.loc15_21.2 to %.loc15_21.3 [concrete = constants.%int_2.ef8]
  244. // CHECK:STDOUT: %.loc15_21.5: init %Param = class_init (%.loc15_21.4), %return [concrete = constants.%Param.val]
  245. // CHECK:STDOUT: %.loc15_22: init %Param = converted %.loc15_21.1, %.loc15_21.5 [concrete = constants.%Param.val]
  246. // CHECK:STDOUT: return %.loc15_22 to %return
  247. // CHECK:STDOUT: }
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: fn @G(%c.param: %C) {
  250. // CHECK:STDOUT: !entry:
  251. // CHECK:STDOUT: name_binding_decl {
  252. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [concrete = constants.%C]
  255. // CHECK:STDOUT: %.loc21_17: %HasF.assoc_type.257 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [concrete = constants.%assoc0.afb]
  256. // CHECK:STDOUT: %F.ref.loc21: %HasF.assoc_type.257 = name_ref F, %.loc21_17 [concrete = constants.%assoc0.afb]
  257. // CHECK:STDOUT: %impl.elem0.loc21: %.22c = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%F.901]
  258. // CHECK:STDOUT: %.loc21_20.1: ref %Param = temporary_storage
  259. // CHECK:STDOUT: %F.call.loc21: init %Param = call %impl.elem0.loc21() to %.loc21_20.1
  260. // CHECK:STDOUT: %.loc21_20.2: ref %Param = temporary %.loc21_20.1, %F.call.loc21
  261. // CHECK:STDOUT: %x.ref.loc21: %Param.elem = name_ref x, @Param.%.loc9 [concrete = @Param.%.loc9]
  262. // CHECK:STDOUT: %.loc21_21: ref %i32 = class_element_access %.loc21_20.2, element0
  263. // CHECK:STDOUT: %.loc21_10: type = splice_block %i32.loc21 [concrete = constants.%i32] {
  264. // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  265. // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT: %a: ref %i32 = bind_name a, %.loc21_21
  268. // CHECK:STDOUT: name_binding_decl {
  269. // CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete]
  270. // CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete]
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt
  273. // CHECK:STDOUT: %c.ref: %C = name_ref c, %c
  274. // CHECK:STDOUT: %.loc22_17: %HasF.assoc_type.257 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param) [concrete = constants.%assoc0.afb]
  275. // CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type.257 = name_ref F, %.loc22_17 [concrete = constants.%assoc0.afb]
  276. // CHECK:STDOUT: %impl.elem0.loc22: %.22c = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%F.901]
  277. // CHECK:STDOUT: %.loc22_20.1: ref %Param = temporary_storage
  278. // CHECK:STDOUT: %F.call.loc22: init %Param = call %impl.elem0.loc22() to %.loc22_20.1
  279. // CHECK:STDOUT: %.loc22_20.2: ref %Param = temporary %.loc22_20.1, %F.call.loc22
  280. // CHECK:STDOUT: %x.ref.loc22: %Param.elem = name_ref x, @Param.%.loc9 [concrete = @Param.%.loc9]
  281. // CHECK:STDOUT: %.loc22_21.1: ref %i32 = class_element_access %.loc22_20.2, element0
  282. // CHECK:STDOUT: %.loc22_21.2: %i32 = bind_value %.loc22_21.1
  283. // CHECK:STDOUT: assign %b.var, %.loc22_21.2
  284. // CHECK:STDOUT: %.loc22_10: type = splice_block %i32.loc22 [concrete = constants.%i32] {
  285. // CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  286. // CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
  289. // CHECK:STDOUT: return
  290. // CHECK:STDOUT: }
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: specific @HasF(constants.%T) {
  293. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T
  294. // CHECK:STDOUT: }
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self.322) {
  297. // CHECK:STDOUT: %T => constants.%T
  298. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dcd0a.1
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: specific @HasF(constants.%Param) {
  302. // CHECK:STDOUT: %T.loc4_16.2 => constants.%Param
  303. // CHECK:STDOUT:
  304. // CHECK:STDOUT: !definition:
  305. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.b18
  306. // CHECK:STDOUT: %Self.2 => constants.%Self.a41
  307. // CHECK:STDOUT: %F.type => constants.%F.type.7f1
  308. // CHECK:STDOUT: %F => constants.%F.eff
  309. // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.257
  310. // CHECK:STDOUT: %assoc0.loc5_14.2 => constants.%assoc0.afb
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT:
  313. // CHECK:STDOUT: specific @F.1(constants.%Param, constants.%HasF.facet) {
  314. // CHECK:STDOUT: %T => constants.%Param
  315. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b01
  316. // CHECK:STDOUT: }
  317. // CHECK:STDOUT:
  318. // CHECK:STDOUT: --- extend_impl_generic_class.carbon
  319. // CHECK:STDOUT:
  320. // CHECK:STDOUT: constants {
  321. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  322. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  323. // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [concrete]
  324. // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [concrete]
  325. // CHECK:STDOUT: %I.type.325e65.1: type = facet_type <@I, @I(%T)> [symbolic]
  326. // CHECK:STDOUT: %Self.209206.1: %I.type.325e65.1 = bind_symbolic_name Self, 1 [symbolic]
  327. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.209206.1 [symbolic]
  328. // CHECK:STDOUT: %pattern_type.4be: type = pattern_type %Self.as_type [symbolic]
  329. // CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T [symbolic]
  330. // CHECK:STDOUT: %F.type.2aef59.1: type = fn_type @F.1, @I(%T) [symbolic]
  331. // CHECK:STDOUT: %F.bb2dd4.1: %F.type.2aef59.1 = struct_value () [symbolic]
  332. // CHECK:STDOUT: %I.assoc_type.1e5078.1: type = assoc_entity_type @I, @I(%T) [symbolic]
  333. // CHECK:STDOUT: %assoc0.8f0422.1: %I.assoc_type.1e5078.1 = assoc_entity element0, @I.%F.decl [symbolic]
  334. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  335. // CHECK:STDOUT: %X.type: type = generic_class_type @X [concrete]
  336. // CHECK:STDOUT: %X.generic: %X.type = struct_value () [concrete]
  337. // CHECK:STDOUT: %X: type = class_type @X, @X(%U) [symbolic]
  338. // CHECK:STDOUT: %I.type.325e65.2: type = facet_type <@I, @I(%U)> [symbolic]
  339. // CHECK:STDOUT: %Self.209206.2: %I.type.325e65.2 = bind_symbolic_name Self, 1 [symbolic]
  340. // CHECK:STDOUT: %F.type.2aef59.2: type = fn_type @F.1, @I(%U) [symbolic]
  341. // CHECK:STDOUT: %F.bb2dd4.2: %F.type.2aef59.2 = struct_value () [symbolic]
  342. // CHECK:STDOUT: %I.assoc_type.1e5078.2: type = assoc_entity_type @I, @I(%U) [symbolic]
  343. // CHECK:STDOUT: %assoc0.8f0422.2: %I.assoc_type.1e5078.2 = assoc_entity element0, @I.%F.decl [symbolic]
  344. // CHECK:STDOUT: %require_complete.cfe: <witness> = require_complete_type %I.type.325e65.2 [symbolic]
  345. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @X.%I.impl_witness_table, @impl(%U) [symbolic]
  346. // CHECK:STDOUT: %pattern_type.830: type = pattern_type %X [symbolic]
  347. // CHECK:STDOUT: %pattern_type.7dcd0a.2: type = pattern_type %U [symbolic]
  348. // CHECK:STDOUT: %F.type.e88: type = fn_type @F.2, @impl(%U) [symbolic]
  349. // CHECK:STDOUT: %F.b02: %F.type.e88 = struct_value () [symbolic]
  350. // CHECK:STDOUT: %I.facet: %I.type.325e65.2 = facet_value %X, (%I.impl_witness) [symbolic]
  351. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  352. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  353. // CHECK:STDOUT: %require_complete.441: <witness> = require_complete_type %X [symbolic]
  354. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %U [symbolic]
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: imports {
  358. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  359. // CHECK:STDOUT: import Core//prelude
  360. // CHECK:STDOUT: import Core//prelude/...
  361. // CHECK:STDOUT: }
  362. // CHECK:STDOUT: }
  363. // CHECK:STDOUT:
  364. // CHECK:STDOUT: file {
  365. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  366. // CHECK:STDOUT: .Core = imports.%Core
  367. // CHECK:STDOUT: .I = %I.decl
  368. // CHECK:STDOUT: .X = %X.decl
  369. // CHECK:STDOUT: }
  370. // CHECK:STDOUT: %Core.import = import Core
  371. // CHECK:STDOUT: %I.decl: %I.type.dac = interface_decl @I [concrete = constants.%I.generic] {
  372. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  373. // CHECK:STDOUT: } {
  374. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  375. // CHECK:STDOUT: }
  376. // CHECK:STDOUT: %X.decl: %X.type = class_decl @X [concrete = constants.%X.generic] {
  377. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  378. // CHECK:STDOUT: } {
  379. // CHECK:STDOUT: %U.loc8_9.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc8_9.2 (constants.%U)]
  380. // CHECK:STDOUT: }
  381. // CHECK:STDOUT: }
  382. // CHECK:STDOUT:
  383. // CHECK:STDOUT: generic interface @I(%T.loc4_13.1: type) {
  384. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  385. // CHECK:STDOUT:
  386. // CHECK:STDOUT: !definition:
  387. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T.loc4_13.2)> [symbolic = %I.type (constants.%I.type.325e65.1)]
  388. // CHECK:STDOUT: %Self.2: @I.%I.type (%I.type.325e65.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209206.1)]
  389. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @I(%T.loc4_13.2) [symbolic = %F.type (constants.%F.type.2aef59.1)]
  390. // CHECK:STDOUT: %F: @I.%F.type (%F.type.2aef59.1) = struct_value () [symbolic = %F (constants.%F.bb2dd4.1)]
  391. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%T.loc4_13.2) [symbolic = %I.assoc_type (constants.%I.assoc_type.1e5078.1)]
  392. // CHECK:STDOUT: %assoc0.loc5_25.2: @I.%I.assoc_type (%I.assoc_type.1e5078.1) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc5_25.2 (constants.%assoc0.8f0422.1)]
  393. // CHECK:STDOUT:
  394. // CHECK:STDOUT: interface {
  395. // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.325e65.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209206.1)]
  396. // CHECK:STDOUT: %F.decl: @I.%F.type (%F.type.2aef59.1) = fn_decl @F.1 [symbolic = @I.%F (constants.%F.bb2dd4.1)] {
  397. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type.loc5_8 (%pattern_type.4be) = binding_pattern self [concrete]
  398. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type.loc5_8 (%pattern_type.4be) = value_param_pattern %self.patt, call_param0 [concrete]
  399. // CHECK:STDOUT: %t.patt: @F.1.%pattern_type.loc5_20 (%pattern_type.7dcd0a.1) = binding_pattern t [concrete]
  400. // CHECK:STDOUT: %t.param_patt: @F.1.%pattern_type.loc5_20 (%pattern_type.7dcd0a.1) = value_param_pattern %t.patt, call_param1 [concrete]
  401. // CHECK:STDOUT: } {
  402. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0
  403. // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.3 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] {
  404. // CHECK:STDOUT: %.loc5_14.2: @F.1.%I.type (%I.type.325e65.1) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self.209206.1)]
  405. // CHECK:STDOUT: %Self.ref: @F.1.%I.type (%I.type.325e65.1) = name_ref Self, %.loc5_14.2 [symbolic = %Self (constants.%Self.209206.1)]
  406. // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  407. // CHECK:STDOUT: %.loc5_14.3: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  408. // CHECK:STDOUT: }
  409. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param
  410. // CHECK:STDOUT: %t.param: @F.1.%T (%T) = value_param call_param1
  411. // CHECK:STDOUT: %T.ref: type = name_ref T, @I.%T.loc4_13.1 [symbolic = %T (constants.%T)]
  412. // CHECK:STDOUT: %t: @F.1.%T (%T) = bind_name t, %t.param
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT: %assoc0.loc5_25.1: @I.%I.assoc_type (%I.assoc_type.1e5078.1) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc5_25.2 (constants.%assoc0.8f0422.1)]
  415. // CHECK:STDOUT:
  416. // CHECK:STDOUT: !members:
  417. // CHECK:STDOUT: .Self = %Self.1
  418. // CHECK:STDOUT: .T = <poisoned>
  419. // CHECK:STDOUT: .F = %assoc0.loc5_25.1
  420. // CHECK:STDOUT: .U = <poisoned>
  421. // CHECK:STDOUT: witness = (%F.decl)
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT: }
  424. // CHECK:STDOUT:
  425. // CHECK:STDOUT: generic impl @impl(@X.%U.loc8_9.1: type) {
  426. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  427. // CHECK:STDOUT: %X: type = class_type @X, @X(%U) [symbolic = %X (constants.%X)]
  428. // CHECK:STDOUT: %I.type.loc9_21.2: type = facet_type <@I, @I(%U)> [symbolic = %I.type.loc9_21.2 (constants.%I.type.325e65.2)]
  429. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %I.type.loc9_21.2 [symbolic = %require_complete (constants.%require_complete.cfe)]
  430. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @X.%I.impl_witness_table, @impl(%U) [symbolic = %I.impl_witness (constants.%I.impl_witness)]
  431. // CHECK:STDOUT:
  432. // CHECK:STDOUT: !definition:
  433. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%U) [symbolic = %F.type (constants.%F.type.e88)]
  434. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.e88) = struct_value () [symbolic = %F (constants.%F.b02)]
  435. // CHECK:STDOUT:
  436. // CHECK:STDOUT: impl: %Self.ref as %I.type.loc9_21.1 {
  437. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.e88) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.b02)] {
  438. // CHECK:STDOUT: %self.patt: @F.2.%pattern_type.loc10_10 (%pattern_type.830) = binding_pattern self [concrete]
  439. // CHECK:STDOUT: %self.param_patt: @F.2.%pattern_type.loc10_10 (%pattern_type.830) = value_param_pattern %self.patt, call_param0 [concrete]
  440. // CHECK:STDOUT: %t.patt: @F.2.%pattern_type.loc10_22 (%pattern_type.7dcd0a.2) = binding_pattern t [concrete]
  441. // CHECK:STDOUT: %t.param_patt: @F.2.%pattern_type.loc10_22 (%pattern_type.7dcd0a.2) = value_param_pattern %t.patt, call_param1 [concrete]
  442. // CHECK:STDOUT: } {
  443. // CHECK:STDOUT: %self.param: @F.2.%X (%X) = value_param call_param0
  444. // CHECK:STDOUT: %.loc10_16.1: type = splice_block %Self.ref [symbolic = %X (constants.%X)] {
  445. // CHECK:STDOUT: %.loc10_16.2: type = specific_constant constants.%X, @X(constants.%U) [symbolic = %X (constants.%X)]
  446. // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_16.2 [symbolic = %X (constants.%X)]
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT: %self: @F.2.%X (%X) = bind_name self, %self.param
  449. // CHECK:STDOUT: %t.param: @F.2.%U (%U) = value_param call_param1
  450. // CHECK:STDOUT: %U.ref: type = name_ref U, @X.%U.loc8_9.1 [symbolic = %U (constants.%U)]
  451. // CHECK:STDOUT: %t: @F.2.%U (%U) = bind_name t, %t.param
  452. // CHECK:STDOUT: }
  453. // CHECK:STDOUT:
  454. // CHECK:STDOUT: !members:
  455. // CHECK:STDOUT: .U = <poisoned>
  456. // CHECK:STDOUT: .F = %F.decl
  457. // CHECK:STDOUT: witness = @X.%I.impl_witness
  458. // CHECK:STDOUT: }
  459. // CHECK:STDOUT: }
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: generic class @X(%U.loc8_9.1: type) {
  462. // CHECK:STDOUT: %U.loc8_9.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc8_9.2 (constants.%U)]
  463. // CHECK:STDOUT:
  464. // CHECK:STDOUT: !definition:
  465. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U.loc8_9.2)> [symbolic = %I.type (constants.%I.type.325e65.2)]
  466. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %I.type [symbolic = %require_complete (constants.%require_complete.cfe)]
  467. // CHECK:STDOUT:
  468. // CHECK:STDOUT: class {
  469. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  470. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%X [symbolic = %X (constants.%X)]
  471. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  472. // CHECK:STDOUT: %U.ref: type = name_ref U, @X.%U.loc8_9.1 [symbolic = %U (constants.%U)]
  473. // CHECK:STDOUT: %I.type.loc9_21.1: type = facet_type <@I, @I(constants.%U)> [symbolic = %I.type.loc9_21.2 (constants.%I.type.325e65.2)]
  474. // CHECK:STDOUT: }
  475. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.%F.decl), @impl [concrete]
  476. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table, @impl(constants.%U) [symbolic = @impl.%I.impl_witness (constants.%I.impl_witness)]
  477. // CHECK:STDOUT: %.loc9: type = specific_constant @impl.%I.type.loc9_21.1, @impl(constants.%U) [symbolic = %I.type (constants.%I.type.325e65.2)]
  478. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  479. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  480. // CHECK:STDOUT: complete_type_witness = %complete_type
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: !members:
  483. // CHECK:STDOUT: .Self = constants.%X
  484. // CHECK:STDOUT: .I = <poisoned>
  485. // CHECK:STDOUT: .U = <poisoned>
  486. // CHECK:STDOUT: extend %.loc9
  487. // CHECK:STDOUT: }
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: generic fn @F.1(@I.%T.loc4_13.1: type, @I.%Self.1: @I.%I.type (%I.type.325e65.1)) {
  491. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  492. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.325e65.1)]
  493. // CHECK:STDOUT: %Self: @F.1.%I.type (%I.type.325e65.1) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.209206.1)]
  494. // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)]
  495. // CHECK:STDOUT: %pattern_type.loc5_8: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type.loc5_8 (constants.%pattern_type.4be)]
  496. // CHECK:STDOUT: %pattern_type.loc5_20: type = pattern_type %T [symbolic = %pattern_type.loc5_20 (constants.%pattern_type.7dcd0a.1)]
  497. // CHECK:STDOUT:
  498. // CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc5_14.1 (%Self.as_type), %t.param: @F.1.%T (%T));
  499. // CHECK:STDOUT: }
  500. // CHECK:STDOUT:
  501. // CHECK:STDOUT: generic fn @F.2(@X.%U.loc8_9.1: type) {
  502. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  503. // CHECK:STDOUT: %X: type = class_type @X, @X(%U) [symbolic = %X (constants.%X)]
  504. // CHECK:STDOUT: %pattern_type.loc10_10: type = pattern_type %X [symbolic = %pattern_type.loc10_10 (constants.%pattern_type.830)]
  505. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U)> [symbolic = %I.type (constants.%I.type.325e65.2)]
  506. // CHECK:STDOUT: %require_complete.loc10_25: <witness> = require_complete_type %I.type [symbolic = %require_complete.loc10_25 (constants.%require_complete.cfe)]
  507. // CHECK:STDOUT: %pattern_type.loc10_22: type = pattern_type %U [symbolic = %pattern_type.loc10_22 (constants.%pattern_type.7dcd0a.2)]
  508. // CHECK:STDOUT:
  509. // CHECK:STDOUT: !definition:
  510. // CHECK:STDOUT: %require_complete.loc10_14: <witness> = require_complete_type %X [symbolic = %require_complete.loc10_14 (constants.%require_complete.441)]
  511. // CHECK:STDOUT: %require_complete.loc10_23: <witness> = require_complete_type %U [symbolic = %require_complete.loc10_23 (constants.%require_complete.4ae)]
  512. // CHECK:STDOUT:
  513. // CHECK:STDOUT: fn(%self.param: @F.2.%X (%X), %t.param: @F.2.%U (%U)) {
  514. // CHECK:STDOUT: !entry:
  515. // CHECK:STDOUT: return
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: specific @I(constants.%T) {
  520. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  521. // CHECK:STDOUT: }
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self.209206.1) {
  524. // CHECK:STDOUT: %T => constants.%T
  525. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.1
  526. // CHECK:STDOUT: %Self => constants.%Self.209206.1
  527. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type
  528. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.4be
  529. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.7dcd0a.1
  530. // CHECK:STDOUT: }
  531. // CHECK:STDOUT:
  532. // CHECK:STDOUT: specific @X(constants.%U) {
  533. // CHECK:STDOUT: %U.loc8_9.2 => constants.%U
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: !definition:
  536. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.2
  537. // CHECK:STDOUT: %require_complete => constants.%require_complete.cfe
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT:
  540. // CHECK:STDOUT: specific @I(constants.%U) {
  541. // CHECK:STDOUT: %T.loc4_13.2 => constants.%U
  542. // CHECK:STDOUT:
  543. // CHECK:STDOUT: !definition:
  544. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.2
  545. // CHECK:STDOUT: %Self.2 => constants.%Self.209206.2
  546. // CHECK:STDOUT: %F.type => constants.%F.type.2aef59.2
  547. // CHECK:STDOUT: %F => constants.%F.bb2dd4.2
  548. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.1e5078.2
  549. // CHECK:STDOUT: %assoc0.loc5_25.2 => constants.%assoc0.8f0422.2
  550. // CHECK:STDOUT: }
  551. // CHECK:STDOUT:
  552. // CHECK:STDOUT: specific @impl(constants.%U) {
  553. // CHECK:STDOUT: %U => constants.%U
  554. // CHECK:STDOUT: %X => constants.%X
  555. // CHECK:STDOUT: %I.type.loc9_21.2 => constants.%I.type.325e65.2
  556. // CHECK:STDOUT: %require_complete => constants.%require_complete.cfe
  557. // CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness
  558. // CHECK:STDOUT:
  559. // CHECK:STDOUT: !definition:
  560. // CHECK:STDOUT: %F.type => constants.%F.type.e88
  561. // CHECK:STDOUT: %F => constants.%F.b02
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: specific @F.2(constants.%U) {
  565. // CHECK:STDOUT: %U => constants.%U
  566. // CHECK:STDOUT: %X => constants.%X
  567. // CHECK:STDOUT: %pattern_type.loc10_10 => constants.%pattern_type.830
  568. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.2
  569. // CHECK:STDOUT: %require_complete.loc10_25 => constants.%require_complete.cfe
  570. // CHECK:STDOUT: %pattern_type.loc10_22 => constants.%pattern_type.7dcd0a.2
  571. // CHECK:STDOUT: }
  572. // CHECK:STDOUT:
  573. // CHECK:STDOUT: specific @F.1(constants.%U, constants.%I.facet) {
  574. // CHECK:STDOUT: %T => constants.%U
  575. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.2
  576. // CHECK:STDOUT: %Self => constants.%I.facet
  577. // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%X
  578. // CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.830
  579. // CHECK:STDOUT: %pattern_type.loc5_20 => constants.%pattern_type.7dcd0a.2
  580. // CHECK:STDOUT: }
  581. // CHECK:STDOUT: