transitive.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/transitive.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/transitive.carbon
  10. // --- i.carbon
  11. library "[[@TEST_NAME]]";
  12. interface I { fn F[self: Self](); }
  13. // --- c.carbon
  14. library "[[@TEST_NAME]]";
  15. import library "i";
  16. class C {}
  17. impl C as I { fn F[self: Self]() {} }
  18. // --- get.carbon
  19. library "[[@TEST_NAME]]";
  20. import library "c";
  21. fn Get() -> C;
  22. // --- call.carbon
  23. library "[[@TEST_NAME]]";
  24. import library "get";
  25. import library "i";
  26. fn Call() {
  27. // We find C in "get", but should look in "c" instead.
  28. Get().(I.F)();
  29. }
  30. // CHECK:STDOUT: --- i.carbon
  31. // CHECK:STDOUT:
  32. // CHECK:STDOUT: constants {
  33. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  34. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  35. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  36. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  37. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  38. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [concrete]
  39. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%F.decl [concrete]
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT:
  42. // CHECK:STDOUT: imports {
  43. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  44. // CHECK:STDOUT: import Core//prelude
  45. // CHECK:STDOUT: import Core//prelude/...
  46. // CHECK:STDOUT: }
  47. // CHECK:STDOUT: }
  48. // CHECK:STDOUT:
  49. // CHECK:STDOUT: file {
  50. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  51. // CHECK:STDOUT: .Core = imports.%Core
  52. // CHECK:STDOUT: .I = %I.decl
  53. // CHECK:STDOUT: }
  54. // CHECK:STDOUT: %Core.import = import Core
  55. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  56. // CHECK:STDOUT: }
  57. // CHECK:STDOUT:
  58. // CHECK:STDOUT: interface @I {
  59. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  60. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  61. // CHECK:STDOUT: %self.patt: @F.%Self.as_type.loc4_26.1 (%Self.as_type) = binding_pattern self
  62. // CHECK:STDOUT: %self.param_patt: @F.%Self.as_type.loc4_26.1 (%Self.as_type) = value_param_pattern %self.patt, call_param0
  63. // CHECK:STDOUT: } {
  64. // CHECK:STDOUT: %self.param: @F.%Self.as_type.loc4_26.1 (%Self.as_type) = value_param call_param0
  65. // CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.2 [symbolic = %Self.as_type.loc4_26.1 (constants.%Self.as_type)] {
  66. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
  67. // CHECK:STDOUT: %Self.as_type.loc4_26.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_26.1 (constants.%Self.as_type)]
  68. // CHECK:STDOUT: %.loc4_26.2: type = converted %Self.ref, %Self.as_type.loc4_26.2 [symbolic = %Self.as_type.loc4_26.1 (constants.%Self.as_type)]
  69. // CHECK:STDOUT: }
  70. // CHECK:STDOUT: %self: @F.%Self.as_type.loc4_26.1 (%Self.as_type) = bind_name self, %self.param
  71. // CHECK:STDOUT: }
  72. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  73. // CHECK:STDOUT:
  74. // CHECK:STDOUT: !members:
  75. // CHECK:STDOUT: .Self = %Self
  76. // CHECK:STDOUT: .F = %assoc0
  77. // CHECK:STDOUT: witness = (%F.decl)
  78. // CHECK:STDOUT: }
  79. // CHECK:STDOUT:
  80. // CHECK:STDOUT: generic fn @F(@I.%Self: %I.type) {
  81. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  82. // CHECK:STDOUT: %Self.as_type.loc4_26.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_26.1 (constants.%Self.as_type)]
  83. // CHECK:STDOUT:
  84. // CHECK:STDOUT: fn[%self.param_patt: @F.%Self.as_type.loc4_26.1 (%Self.as_type)]();
  85. // CHECK:STDOUT: }
  86. // CHECK:STDOUT:
  87. // CHECK:STDOUT: specific @F(constants.%Self) {
  88. // CHECK:STDOUT: %Self => constants.%Self
  89. // CHECK:STDOUT: %Self.as_type.loc4_26.1 => constants.%Self.as_type
  90. // CHECK:STDOUT: }
  91. // CHECK:STDOUT:
  92. // CHECK:STDOUT: --- c.carbon
  93. // CHECK:STDOUT:
  94. // CHECK:STDOUT: constants {
  95. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  96. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  97. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  98. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  99. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  100. // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
  101. // CHECK:STDOUT: %F.bc6: %F.type.cf0 = struct_value () [concrete]
  102. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  103. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [concrete]
  104. // CHECK:STDOUT: %F.type.5d6: type = fn_type @F.2 [concrete]
  105. // CHECK:STDOUT: %F.a2e: %F.type.5d6 = struct_value () [concrete]
  106. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [concrete]
  107. // CHECK:STDOUT: }
  108. // CHECK:STDOUT:
  109. // CHECK:STDOUT: imports {
  110. // CHECK:STDOUT: %Main.I: type = import_ref Main//i, I, loaded [concrete = constants.%I.type]
  111. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  112. // CHECK:STDOUT: import Core//prelude
  113. // CHECK:STDOUT: import Core//prelude/...
  114. // CHECK:STDOUT: }
  115. // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//i, inst17 [no loc], unloaded
  116. // CHECK:STDOUT: %Main.import_ref.1e0 = import_ref Main//i, loc4_33, unloaded
  117. // CHECK:STDOUT: %Main.F: %F.type.cf0 = import_ref Main//i, F, loaded [concrete = constants.%F.bc6]
  118. // CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//i, inst17 [no loc], loaded [symbolic = constants.%Self]
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT:
  121. // CHECK:STDOUT: file {
  122. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  123. // CHECK:STDOUT: .I = imports.%Main.I
  124. // CHECK:STDOUT: .Core = imports.%Core
  125. // CHECK:STDOUT: .C = %C.decl
  126. // CHECK:STDOUT: }
  127. // CHECK:STDOUT: %Core.import = import Core
  128. // CHECK:STDOUT: %default.import = import <none>
  129. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  130. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  131. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  132. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  133. // CHECK:STDOUT: }
  134. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [concrete = constants.%impl_witness]
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: interface @I [from "i.carbon"] {
  138. // CHECK:STDOUT: !members:
  139. // CHECK:STDOUT: .Self = imports.%Main.import_ref.e5d
  140. // CHECK:STDOUT: .F = imports.%Main.import_ref.1e0
  141. // CHECK:STDOUT: witness = (imports.%Main.F)
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: impl @impl: %C.ref as %I.ref {
  145. // CHECK:STDOUT: %F.decl: %F.type.5d6 = fn_decl @F.2 [concrete = constants.%F.a2e] {
  146. // CHECK:STDOUT: %self.patt: %C = binding_pattern self
  147. // CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
  148. // CHECK:STDOUT: } {
  149. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  150. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [concrete = constants.%C]
  151. // CHECK:STDOUT: %self: %C = bind_name self, %self.param
  152. // CHECK:STDOUT: }
  153. // CHECK:STDOUT:
  154. // CHECK:STDOUT: !members:
  155. // CHECK:STDOUT: .F = %F.decl
  156. // CHECK:STDOUT: witness = file.%impl_witness
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: class @C {
  160. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  161. // CHECK:STDOUT: complete_type_witness = %complete_type
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: !members:
  164. // CHECK:STDOUT: .Self = constants.%C
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.5dd: %I.type) [from "i.carbon"] {
  168. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  169. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self.as_type (%Self.as_type)]();
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT:
  174. // CHECK:STDOUT: fn @F.2[%self.param_patt: %C]() {
  175. // CHECK:STDOUT: !entry:
  176. // CHECK:STDOUT: return
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT:
  179. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  180. // CHECK:STDOUT: %Self => constants.%Self
  181. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT:
  184. // CHECK:STDOUT: specific @F.1(constants.%I.facet) {
  185. // CHECK:STDOUT: %Self => constants.%I.facet
  186. // CHECK:STDOUT: %Self.as_type => constants.%C
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT:
  189. // CHECK:STDOUT: --- get.carbon
  190. // CHECK:STDOUT:
  191. // CHECK:STDOUT: constants {
  192. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  193. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  194. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  195. // CHECK:STDOUT: %Get.type: type = fn_type @Get [concrete]
  196. // CHECK:STDOUT: %Get: %Get.type = struct_value () [concrete]
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: imports {
  200. // CHECK:STDOUT: %Main.C: type = import_ref Main//c, C, loaded [concrete = constants.%C]
  201. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  202. // CHECK:STDOUT: import Core//prelude
  203. // CHECK:STDOUT: import Core//prelude/...
  204. // CHECK:STDOUT: }
  205. // CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//c, loc6_10, loaded [concrete = constants.%complete_type]
  206. // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//c, inst18 [no loc], unloaded
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: file {
  210. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  211. // CHECK:STDOUT: .C = imports.%Main.C
  212. // CHECK:STDOUT: .Core = imports.%Core
  213. // CHECK:STDOUT: .Get = %Get.decl
  214. // CHECK:STDOUT: }
  215. // CHECK:STDOUT: %Core.import = import Core
  216. // CHECK:STDOUT: %default.import = import <none>
  217. // CHECK:STDOUT: %Get.decl: %Get.type = fn_decl @Get [concrete = constants.%Get] {
  218. // CHECK:STDOUT: %return.patt: %C = return_slot_pattern
  219. // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, call_param0
  220. // CHECK:STDOUT: } {
  221. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
  222. // CHECK:STDOUT: %return.param: ref %C = out_param call_param0
  223. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: class @C [from "c.carbon"] {
  228. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: !members:
  231. // CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: fn @Get() -> %C;
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: --- call.carbon
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: constants {
  239. // CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete]
  240. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  241. // CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete]
  242. // CHECK:STDOUT: %Get.type: type = fn_type @Get [concrete]
  243. // CHECK:STDOUT: %Get: %Get.type = struct_value () [concrete]
  244. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  245. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  246. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  247. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  248. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  249. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [concrete]
  250. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.e03 [concrete]
  251. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.742) [concrete]
  252. // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
  253. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  254. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [concrete]
  255. // CHECK:STDOUT: %.076: type = fn_type_with_self_type %F.type.cf0, %I.facet [concrete]
  256. // CHECK:STDOUT: %F.type.5d6: type = fn_type @F.2 [concrete]
  257. // CHECK:STDOUT: %F.a2e: %F.type.5d6 = struct_value () [concrete]
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: imports {
  261. // CHECK:STDOUT: %Main.Get: %Get.type = import_ref Main//get, Get, loaded [concrete = constants.%Get]
  262. // CHECK:STDOUT: %Main.I: type = import_ref Main//i, I, loaded [concrete = constants.%I.type]
  263. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  264. // CHECK:STDOUT: import Core//prelude
  265. // CHECK:STDOUT: import Core//prelude/...
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT: %Main.import_ref.8db: <witness> = import_ref Main//get, inst21 [indirect], loaded [concrete = constants.%complete_type]
  268. // CHECK:STDOUT: %Main.import_ref.6a9 = import_ref Main//get, inst22 [indirect], unloaded
  269. // CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//i, inst17 [no loc], unloaded
  270. // CHECK:STDOUT: %Main.import_ref.bcb: %I.assoc_type = import_ref Main//i, loc4_33, loaded [concrete = constants.%assoc0]
  271. // CHECK:STDOUT: %Main.F = import_ref Main//i, F, unloaded
  272. // CHECK:STDOUT: %Main.import_ref.e53: <witness> = import_ref Main//c, loc7_13, loaded [concrete = constants.%impl_witness]
  273. // CHECK:STDOUT: %Main.import_ref.29a: type = import_ref Main//c, loc7_6, loaded [concrete = constants.%C]
  274. // CHECK:STDOUT: %Main.import_ref.f50: type = import_ref Main//c, loc7_11, loaded [concrete = constants.%I.type]
  275. // CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//i, inst17 [no loc], loaded [symbolic = constants.%Self]
  276. // CHECK:STDOUT: }
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: file {
  279. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  280. // CHECK:STDOUT: .Get = imports.%Main.Get
  281. // CHECK:STDOUT: .I = imports.%Main.I
  282. // CHECK:STDOUT: .Core = imports.%Core
  283. // CHECK:STDOUT: .Call = %Call.decl
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT: %Core.import = import Core
  286. // CHECK:STDOUT: %default.import = import <none>
  287. // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {}
  288. // CHECK:STDOUT: }
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: interface @I [from "i.carbon"] {
  291. // CHECK:STDOUT: !members:
  292. // CHECK:STDOUT: .Self = imports.%Main.import_ref.e5d
  293. // CHECK:STDOUT: .F = imports.%Main.import_ref.bcb
  294. // CHECK:STDOUT: witness = (imports.%Main.F)
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT:
  297. // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.29a as imports.%Main.import_ref.f50 [from "c.carbon"] {
  298. // CHECK:STDOUT: !members:
  299. // CHECK:STDOUT: witness = imports.%Main.import_ref.e53
  300. // CHECK:STDOUT: }
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: class @C [from "get.carbon"] {
  303. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8db
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: !members:
  306. // CHECK:STDOUT: .Self = imports.%Main.import_ref.6a9
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: fn @Call() {
  310. // CHECK:STDOUT: !entry:
  311. // CHECK:STDOUT: %Get.ref: %Get.type = name_ref Get, imports.%Main.Get [concrete = constants.%Get]
  312. // CHECK:STDOUT: %.loc9_7.1: ref %C = temporary_storage
  313. // CHECK:STDOUT: %Get.call: init %C = call %Get.ref() to %.loc9_7.1
  314. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
  315. // CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, imports.%Main.import_ref.bcb [concrete = constants.%assoc0]
  316. // CHECK:STDOUT: %impl.elem0: %.076 = impl_witness_access constants.%impl_witness, element0 [concrete = constants.%F.a2e]
  317. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %Get.call, %impl.elem0
  318. // CHECK:STDOUT: %.loc9_7.2: ref %C = temporary %.loc9_7.1, %Get.call
  319. // CHECK:STDOUT: %.loc9_7.3: %C = bind_value %.loc9_7.2
  320. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %bound_method(%.loc9_7.3)
  321. // CHECK:STDOUT: return
  322. // CHECK:STDOUT: }
  323. // CHECK:STDOUT:
  324. // CHECK:STDOUT: fn @Get() -> %C [from "get.carbon"];
  325. // CHECK:STDOUT:
  326. // CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.5dd: %I.type) [from "i.carbon"] {
  327. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  328. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  329. // CHECK:STDOUT:
  330. // CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self.as_type (%Self.as_type)]();
  331. // CHECK:STDOUT: }
  332. // CHECK:STDOUT:
  333. // CHECK:STDOUT: fn @F.2[%self.param_patt: %C]() [from "c.carbon"];
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  336. // CHECK:STDOUT: %Self => constants.%Self
  337. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  338. // CHECK:STDOUT: }
  339. // CHECK:STDOUT: