generic.carbon 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285
  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/generic.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/generic.carbon
  10. // --- deduced_type.carbon
  11. library "[[@TEST_NAME]]";
  12. interface HasF {
  13. fn F();
  14. }
  15. impl forall [T:! type] T as HasF {
  16. fn F() {}
  17. }
  18. fn G(x: {}) {
  19. x.(HasF.F)();
  20. }
  21. // --- deduced_type_subst.carbon
  22. library "[[@TEST_NAME]]";
  23. interface HasF {
  24. fn F[self: Self]() -> Self;
  25. }
  26. impl forall [T:! type] T as HasF {
  27. fn F[self: Self]() -> T { return self; }
  28. }
  29. fn G(x: {}) -> {} {
  30. return x.(HasF.F)();
  31. }
  32. // --- deduced_type_argument.carbon
  33. library "[[@TEST_NAME]]";
  34. interface HasF {
  35. fn F();
  36. }
  37. class C(T:! type) {}
  38. impl forall [T:! type] C(T) as HasF {
  39. fn F() {}
  40. }
  41. fn G(x: C({})) {
  42. x.(HasF.F)();
  43. }
  44. // --- deduced_interface_argument.carbon
  45. library "[[@TEST_NAME]]";
  46. interface HasF(T:! type) {
  47. fn F();
  48. }
  49. impl forall [T:! type] {} as HasF(T) {
  50. fn F() {}
  51. }
  52. fn G(x: {}) {
  53. x.(HasF({}).F)();
  54. }
  55. // --- fail_incomplete_deduction.carbon
  56. library "[[@TEST_NAME]]";
  57. interface HasF {
  58. fn F();
  59. }
  60. // TODO: Reject this declaration because U cannot be deduced.
  61. impl forall [T:! type, U:! type] T as HasF {
  62. fn F() {}
  63. }
  64. fn G(x: {}) {
  65. // TODO: It'd be nice to include a note here saying that deduction failed because
  66. // we couldn't deduce a value for 'U'.
  67. // CHECK:STDERR: fail_incomplete_deduction.carbon:[[@LINE+4]]:3: error: cannot access member of interface `HasF` in type `{}` that does not implement that interface
  68. // CHECK:STDERR: x.(HasF.F)();
  69. // CHECK:STDERR: ^~~~~~~~~~
  70. // CHECK:STDERR:
  71. x.(HasF.F)();
  72. }
  73. // --- fail_inconsistent_deduction.carbon
  74. library "[[@TEST_NAME]]";
  75. interface HasF(T:! type) {
  76. fn F();
  77. }
  78. impl forall [T:! type] T as HasF(T) {
  79. fn F() {}
  80. }
  81. class A {}
  82. class B {}
  83. fn G(x: A) {
  84. // TODO: It'd be nice to include a note here saying that deduction failed because
  85. // we deduced two different values for `T`.
  86. // CHECK:STDERR: fail_inconsistent_deduction.carbon:[[@LINE+3]]:3: error: cannot access member of interface `HasF` in type `A` that does not implement that interface
  87. // CHECK:STDERR: x.(HasF(B).F)();
  88. // CHECK:STDERR: ^~~~~~~~~~~~~
  89. x.(HasF(B).F)();
  90. }
  91. // CHECK:STDOUT: --- deduced_type.carbon
  92. // CHECK:STDOUT:
  93. // CHECK:STDOUT: constants {
  94. // CHECK:STDOUT: %HasF.type: type = interface_type @HasF [template]
  95. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  96. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
  97. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  98. // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
  99. // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type, %F.type.1 [template]
  100. // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [template]
  101. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  102. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  103. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic]
  104. // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic]
  105. // CHECK:STDOUT: %.4: <witness> = interface_witness (%F.2) [symbolic]
  106. // CHECK:STDOUT: %.5: type = struct_type {} [template]
  107. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  108. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  109. // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%.5) [template]
  110. // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template]
  111. // CHECK:STDOUT: %.6: <witness> = interface_witness (%F.3) [template]
  112. // CHECK:STDOUT: %.7: <specific function> = specific_function %F.3, @F.2(%.5) [template]
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT:
  115. // CHECK:STDOUT: imports {
  116. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  117. // CHECK:STDOUT: import Core//prelude
  118. // CHECK:STDOUT: import Core//prelude/operators
  119. // CHECK:STDOUT: import Core//prelude/types
  120. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  121. // CHECK:STDOUT: import Core//prelude/operators/as
  122. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  123. // CHECK:STDOUT: import Core//prelude/operators/comparison
  124. // CHECK:STDOUT: import Core//prelude/types/bool
  125. // CHECK:STDOUT: }
  126. // CHECK:STDOUT: }
  127. // CHECK:STDOUT:
  128. // CHECK:STDOUT: file {
  129. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  130. // CHECK:STDOUT: .Core = imports.%Core
  131. // CHECK:STDOUT: .HasF = %HasF.decl
  132. // CHECK:STDOUT: .G = %G.decl
  133. // CHECK:STDOUT: }
  134. // CHECK:STDOUT: %Core.import = import Core
  135. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%HasF.type] {} {}
  136. // CHECK:STDOUT: impl_decl @impl [template] {
  137. // CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  138. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_14.1, runtime_param<invalid> [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  139. // CHECK:STDOUT: } {
  140. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)]
  141. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
  142. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  143. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_14.2 (constants.%T)]
  144. // CHECK:STDOUT: }
  145. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  146. // CHECK:STDOUT: %x.patt: %.5 = binding_pattern x
  147. // CHECK:STDOUT: %x.param_patt: %.5 = param_pattern %x.patt, runtime_param0
  148. // CHECK:STDOUT: } {
  149. // CHECK:STDOUT: %.loc12_10.1: %.5 = struct_literal ()
  150. // CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%.5 [template = constants.%.5]
  151. // CHECK:STDOUT: %param: %.5 = param runtime_param0
  152. // CHECK:STDOUT: %x: %.5 = bind_name x, %param
  153. // CHECK:STDOUT: }
  154. // CHECK:STDOUT: }
  155. // CHECK:STDOUT:
  156. // CHECK:STDOUT: interface @HasF {
  157. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  158. // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {}
  159. // CHECK:STDOUT: %.loc5: %.2 = assoc_entity element0, %F.decl [template = constants.%.3]
  160. // CHECK:STDOUT:
  161. // CHECK:STDOUT: !members:
  162. // CHECK:STDOUT: .Self = %Self
  163. // CHECK:STDOUT: .F = %.loc5
  164. // CHECK:STDOUT: witness = (%F.decl)
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) {
  168. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  169. // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: !definition:
  172. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)]
  173. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)]
  174. // CHECK:STDOUT: %.loc8_34.2: <witness> = interface_witness (%F) [symbolic = %.loc8_34.2 (constants.%.4)]
  175. // CHECK:STDOUT:
  176. // CHECK:STDOUT: impl: %T.ref as %HasF.ref {
  177. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {}
  178. // CHECK:STDOUT: %.loc8_34.1: <witness> = interface_witness (%F.decl) [symbolic = %.loc8_34.2 (constants.%.4)]
  179. // CHECK:STDOUT:
  180. // CHECK:STDOUT: !members:
  181. // CHECK:STDOUT: .F = %F.decl
  182. // CHECK:STDOUT: witness = %.loc8_34.1
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT: }
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %HasF.type) {
  187. // CHECK:STDOUT:
  188. // CHECK:STDOUT: fn();
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT:
  191. // CHECK:STDOUT: generic fn @F.2(@impl.%T.loc8_14.1: type) {
  192. // CHECK:STDOUT: !definition:
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: fn() {
  195. // CHECK:STDOUT: !entry:
  196. // CHECK:STDOUT: return
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT: }
  199. // CHECK:STDOUT:
  200. // CHECK:STDOUT: fn @G(%x.param_patt: %.5) {
  201. // CHECK:STDOUT: !entry:
  202. // CHECK:STDOUT: %x.ref: %.5 = name_ref x, %x
  203. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
  204. // CHECK:STDOUT: %F.ref: %.2 = name_ref F, @HasF.%.loc5 [template = constants.%.3]
  205. // CHECK:STDOUT: %.loc13_4.1: %F.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%F.3]
  206. // CHECK:STDOUT: %.loc13_4.2: <specific function> = specific_function %.loc13_4.1, @F.2(constants.%.5) [template = constants.%.7]
  207. // CHECK:STDOUT: %F.call: init %.1 = call %.loc13_4.2()
  208. // CHECK:STDOUT: return
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: specific @F.1(constants.%Self) {}
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: specific @impl(constants.%T) {
  214. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  215. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T
  216. // CHECK:STDOUT:
  217. // CHECK:STDOUT: !definition:
  218. // CHECK:STDOUT: %F.type => constants.%F.type.2
  219. // CHECK:STDOUT: %F => constants.%F.2
  220. // CHECK:STDOUT: %.loc8_34.2 => constants.%.4
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: specific @F.2(constants.%T) {}
  224. // CHECK:STDOUT:
  225. // CHECK:STDOUT: specific @F.1(constants.%T) {}
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: specific @impl(@impl.%T.loc8_14.2) {
  228. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  229. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T
  230. // CHECK:STDOUT: }
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: specific @impl(constants.%.5) {
  233. // CHECK:STDOUT: %T.loc8_14.2 => constants.%.5
  234. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%.5
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: !definition:
  237. // CHECK:STDOUT: %F.type => constants.%F.type.3
  238. // CHECK:STDOUT: %F => constants.%F.3
  239. // CHECK:STDOUT: %.loc8_34.2 => constants.%.6
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT:
  242. // CHECK:STDOUT: specific @F.2(constants.%.5) {
  243. // CHECK:STDOUT: !definition:
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: --- deduced_type_subst.carbon
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: constants {
  249. // CHECK:STDOUT: %HasF.type: type = interface_type @HasF [template]
  250. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  251. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
  252. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  253. // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
  254. // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type, %F.type.1 [template]
  255. // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [template]
  256. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  257. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  258. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic]
  259. // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic]
  260. // CHECK:STDOUT: %.4: <witness> = interface_witness (%F.2) [symbolic]
  261. // CHECK:STDOUT: %.5: type = struct_type {} [template]
  262. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  263. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  264. // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%.5) [template]
  265. // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template]
  266. // CHECK:STDOUT: %.6: <witness> = interface_witness (%F.3) [template]
  267. // CHECK:STDOUT: %struct: %.5 = struct_value () [template]
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: imports {
  271. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  272. // CHECK:STDOUT: import Core//prelude
  273. // CHECK:STDOUT: import Core//prelude/operators
  274. // CHECK:STDOUT: import Core//prelude/types
  275. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  276. // CHECK:STDOUT: import Core//prelude/operators/as
  277. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  278. // CHECK:STDOUT: import Core//prelude/operators/comparison
  279. // CHECK:STDOUT: import Core//prelude/types/bool
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: file {
  284. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  285. // CHECK:STDOUT: .Core = imports.%Core
  286. // CHECK:STDOUT: .HasF = %HasF.decl
  287. // CHECK:STDOUT: .G = %G.decl
  288. // CHECK:STDOUT: }
  289. // CHECK:STDOUT: %Core.import = import Core
  290. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%HasF.type] {} {}
  291. // CHECK:STDOUT: impl_decl @impl [template] {
  292. // CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  293. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_14.1, runtime_param<invalid> [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  294. // CHECK:STDOUT: } {
  295. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)]
  296. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
  297. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  298. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_14.2 (constants.%T)]
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  301. // CHECK:STDOUT: %x.patt: %.5 = binding_pattern x
  302. // CHECK:STDOUT: %x.param_patt: %.5 = param_pattern %x.patt, runtime_param0
  303. // CHECK:STDOUT: } {
  304. // CHECK:STDOUT: %.loc12_10.1: %.5 = struct_literal ()
  305. // CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%.5 [template = constants.%.5]
  306. // CHECK:STDOUT: %.loc12_17.1: %.5 = struct_literal ()
  307. // CHECK:STDOUT: %.loc12_17.2: type = converted %.loc12_17.1, constants.%.5 [template = constants.%.5]
  308. // CHECK:STDOUT: %return: ref %.5 = var <return slot>
  309. // CHECK:STDOUT: %param: %.5 = param runtime_param0
  310. // CHECK:STDOUT: %x: %.5 = bind_name x, %param
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT: }
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: interface @HasF {
  315. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  316. // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {
  317. // CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self
  318. // CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self) = param_pattern %self.patt, runtime_param0
  319. // CHECK:STDOUT: } {
  320. // CHECK:STDOUT: %Self.ref.loc5_14: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)]
  321. // CHECK:STDOUT: %.loc5_14.1: type = facet_type_access %Self.ref.loc5_14 [symbolic = %Self (constants.%Self)]
  322. // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref.loc5_14, %.loc5_14.1 [symbolic = %Self (constants.%Self)]
  323. // CHECK:STDOUT: %Self.ref.loc5_25: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)]
  324. // CHECK:STDOUT: %.loc5_25.1: type = facet_type_access %Self.ref.loc5_25 [symbolic = %Self (constants.%Self)]
  325. // CHECK:STDOUT: %.loc5_25.2: type = converted %Self.ref.loc5_25, %.loc5_25.1 [symbolic = %Self (constants.%Self)]
  326. // CHECK:STDOUT: %return: ref @F.1.%Self (%Self) = var <return slot>
  327. // CHECK:STDOUT: %param: @F.1.%Self (%Self) = param runtime_param0
  328. // CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %param
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT: %.loc5: %.2 = assoc_entity element0, %F.decl [template = constants.%.3]
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: !members:
  333. // CHECK:STDOUT: .Self = %Self
  334. // CHECK:STDOUT: .F = %.loc5
  335. // CHECK:STDOUT: witness = (%F.decl)
  336. // CHECK:STDOUT: }
  337. // CHECK:STDOUT:
  338. // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) {
  339. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  340. // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  341. // CHECK:STDOUT:
  342. // CHECK:STDOUT: !definition:
  343. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)]
  344. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)]
  345. // CHECK:STDOUT: %.loc8_34.2: <witness> = interface_witness (%F) [symbolic = %.loc8_34.2 (constants.%.4)]
  346. // CHECK:STDOUT:
  347. // CHECK:STDOUT: impl: %T.ref as %HasF.ref {
  348. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {
  349. // CHECK:STDOUT: %self.patt: @F.2.%T (%T) = binding_pattern self
  350. // CHECK:STDOUT: %self.param_patt: @F.2.%T (%T) = param_pattern %self.patt, runtime_param0
  351. // CHECK:STDOUT: } {
  352. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)]
  353. // CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T.loc8_14.1 [symbolic = %T (constants.%T)]
  354. // CHECK:STDOUT: %return: ref @F.2.%T (%T) = var <return slot>
  355. // CHECK:STDOUT: %param: @F.2.%T (%T) = param runtime_param0
  356. // CHECK:STDOUT: %self: @F.2.%T (%T) = bind_name self, %param
  357. // CHECK:STDOUT: }
  358. // CHECK:STDOUT: %.loc8_34.1: <witness> = interface_witness (%F.decl) [symbolic = %.loc8_34.2 (constants.%.4)]
  359. // CHECK:STDOUT:
  360. // CHECK:STDOUT: !members:
  361. // CHECK:STDOUT: .F = %F.decl
  362. // CHECK:STDOUT: witness = %.loc8_34.1
  363. // CHECK:STDOUT: }
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %HasF.type) {
  367. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)]() -> @F.1.%Self (%Self);
  370. // CHECK:STDOUT: }
  371. // CHECK:STDOUT:
  372. // CHECK:STDOUT: generic fn @F.2(@impl.%T.loc8_14.1: type) {
  373. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: !definition:
  376. // CHECK:STDOUT:
  377. // CHECK:STDOUT: fn[%self.param_patt: @F.2.%T (%T)]() -> @F.2.%T (%T) {
  378. // CHECK:STDOUT: !entry:
  379. // CHECK:STDOUT: %self.ref: @F.2.%T (%T) = name_ref self, %self
  380. // CHECK:STDOUT: return %self.ref
  381. // CHECK:STDOUT: }
  382. // CHECK:STDOUT: }
  383. // CHECK:STDOUT:
  384. // CHECK:STDOUT: fn @G(%x.param_patt: %.5) -> %.5 {
  385. // CHECK:STDOUT: !entry:
  386. // CHECK:STDOUT: %x.ref: %.5 = name_ref x, %x
  387. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
  388. // CHECK:STDOUT: %F.ref: %.2 = name_ref F, @HasF.%.loc5 [template = constants.%.3]
  389. // CHECK:STDOUT: %.loc13_11.1: %F.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%F.3]
  390. // CHECK:STDOUT: %.loc13_11.2: <bound method> = bound_method %x.ref, %.loc13_11.1
  391. // CHECK:STDOUT: %.loc13_11.3: <specific function> = specific_function %.loc13_11.2, @F.2(constants.%.5)
  392. // CHECK:STDOUT: %F.call: init %.5 = call %.loc13_11.3(%x.ref)
  393. // CHECK:STDOUT: %.loc13_20.1: ref %.5 = temporary_storage
  394. // CHECK:STDOUT: %.loc13_20.2: ref %.5 = temporary %.loc13_20.1, %F.call
  395. // CHECK:STDOUT: %struct: %.5 = struct_value () [template = constants.%struct]
  396. // CHECK:STDOUT: %.loc13_22: %.5 = converted %F.call, %struct [template = constants.%struct]
  397. // CHECK:STDOUT: return %.loc13_22
  398. // CHECK:STDOUT: }
  399. // CHECK:STDOUT:
  400. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  401. // CHECK:STDOUT: %Self => constants.%Self
  402. // CHECK:STDOUT: }
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: specific @impl(constants.%T) {
  405. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  406. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T
  407. // CHECK:STDOUT:
  408. // CHECK:STDOUT: !definition:
  409. // CHECK:STDOUT: %F.type => constants.%F.type.2
  410. // CHECK:STDOUT: %F => constants.%F.2
  411. // CHECK:STDOUT: %.loc8_34.2 => constants.%.4
  412. // CHECK:STDOUT: }
  413. // CHECK:STDOUT:
  414. // CHECK:STDOUT: specific @F.2(constants.%T) {
  415. // CHECK:STDOUT: %T => constants.%T
  416. // CHECK:STDOUT: }
  417. // CHECK:STDOUT:
  418. // CHECK:STDOUT: specific @F.1(constants.%T) {
  419. // CHECK:STDOUT: %Self => constants.%T
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: specific @impl(@impl.%T.loc8_14.2) {
  423. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  424. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T
  425. // CHECK:STDOUT: }
  426. // CHECK:STDOUT:
  427. // CHECK:STDOUT: specific @impl(constants.%.5) {
  428. // CHECK:STDOUT: %T.loc8_14.2 => constants.%.5
  429. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%.5
  430. // CHECK:STDOUT:
  431. // CHECK:STDOUT: !definition:
  432. // CHECK:STDOUT: %F.type => constants.%F.type.3
  433. // CHECK:STDOUT: %F => constants.%F.3
  434. // CHECK:STDOUT: %.loc8_34.2 => constants.%.6
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: specific @F.2(constants.%.5) {
  438. // CHECK:STDOUT: %T => constants.%.5
  439. // CHECK:STDOUT:
  440. // CHECK:STDOUT: !definition:
  441. // CHECK:STDOUT: }
  442. // CHECK:STDOUT:
  443. // CHECK:STDOUT: --- deduced_type_argument.carbon
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: constants {
  446. // CHECK:STDOUT: %HasF.type: type = interface_type @HasF [template]
  447. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  448. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
  449. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  450. // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
  451. // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type, %F.type.1 [template]
  452. // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [template]
  453. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  454. // CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic]
  455. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  456. // CHECK:STDOUT: %C.1: %C.type = struct_value () [template]
  457. // CHECK:STDOUT: %C.2: type = class_type @C, @C(%T) [symbolic]
  458. // CHECK:STDOUT: %.4: type = struct_type {} [template]
  459. // CHECK:STDOUT: %.5: <witness> = complete_type_witness %.4 [template]
  460. // CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic]
  461. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic]
  462. // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic]
  463. // CHECK:STDOUT: %.6: <witness> = interface_witness (%F.2) [symbolic]
  464. // CHECK:STDOUT: %C.3: type = class_type @C, @C(%.4) [template]
  465. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  466. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  467. // CHECK:STDOUT: %.7: type = ptr_type %.4 [template]
  468. // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%.4) [template]
  469. // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template]
  470. // CHECK:STDOUT: %.8: <witness> = interface_witness (%F.3) [template]
  471. // CHECK:STDOUT: %.9: <specific function> = specific_function %F.3, @F.2(%.4) [template]
  472. // CHECK:STDOUT: }
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: imports {
  475. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  476. // CHECK:STDOUT: import Core//prelude
  477. // CHECK:STDOUT: import Core//prelude/operators
  478. // CHECK:STDOUT: import Core//prelude/types
  479. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  480. // CHECK:STDOUT: import Core//prelude/operators/as
  481. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  482. // CHECK:STDOUT: import Core//prelude/operators/comparison
  483. // CHECK:STDOUT: import Core//prelude/types/bool
  484. // CHECK:STDOUT: }
  485. // CHECK:STDOUT: }
  486. // CHECK:STDOUT:
  487. // CHECK:STDOUT: file {
  488. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  489. // CHECK:STDOUT: .Core = imports.%Core
  490. // CHECK:STDOUT: .HasF = %HasF.decl
  491. // CHECK:STDOUT: .C = %C.decl
  492. // CHECK:STDOUT: .G = %G.decl
  493. // CHECK:STDOUT: }
  494. // CHECK:STDOUT: %Core.import = import Core
  495. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%HasF.type] {} {}
  496. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] {
  497. // CHECK:STDOUT: %T.patt.loc8_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.1)]
  498. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_9.1, runtime_param<invalid> [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.1)]
  499. // CHECK:STDOUT: } {
  500. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  501. // CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_9.2 (constants.%T)]
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT: impl_decl @impl [template] {
  504. // CHECK:STDOUT: %T.patt.loc10_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_14.2 (constants.%T.patt.2)]
  505. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc10_14.1, runtime_param<invalid> [symbolic = %T.patt.loc10_14.2 (constants.%T.patt.2)]
  506. // CHECK:STDOUT: } {
  507. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1]
  508. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc10_14.1 [symbolic = %T.loc10_14.2 (constants.%T)]
  509. // CHECK:STDOUT: %C.loc10_25.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc10_25.2 (constants.%C.2)]
  510. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
  511. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  512. // CHECK:STDOUT: %T.loc10_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc10_14.2 (constants.%T)]
  513. // CHECK:STDOUT: }
  514. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  515. // CHECK:STDOUT: %x.patt: %C.3 = binding_pattern x
  516. // CHECK:STDOUT: %x.param_patt: %C.3 = param_pattern %x.patt, runtime_param0
  517. // CHECK:STDOUT: } {
  518. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1]
  519. // CHECK:STDOUT: %.loc14_12: %.4 = struct_literal ()
  520. // CHECK:STDOUT: %.loc14_10: type = converted %.loc14_12, constants.%.4 [template = constants.%.4]
  521. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%.4) [template = constants.%C.3]
  522. // CHECK:STDOUT: %param: %C.3 = param runtime_param0
  523. // CHECK:STDOUT: %x: %C.3 = bind_name x, %param
  524. // CHECK:STDOUT: }
  525. // CHECK:STDOUT: }
  526. // CHECK:STDOUT:
  527. // CHECK:STDOUT: interface @HasF {
  528. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  529. // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {}
  530. // CHECK:STDOUT: %.loc5: %.2 = assoc_entity element0, %F.decl [template = constants.%.3]
  531. // CHECK:STDOUT:
  532. // CHECK:STDOUT: !members:
  533. // CHECK:STDOUT: .Self = %Self
  534. // CHECK:STDOUT: .F = %.loc5
  535. // CHECK:STDOUT: witness = (%F.decl)
  536. // CHECK:STDOUT: }
  537. // CHECK:STDOUT:
  538. // CHECK:STDOUT: generic impl @impl(%T.loc10_14.1: type) {
  539. // CHECK:STDOUT: %T.loc10_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.2 (constants.%T)]
  540. // CHECK:STDOUT: %T.patt.loc10_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_14.2 (constants.%T.patt.2)]
  541. // CHECK:STDOUT: %C.loc10_25.2: type = class_type @C, @C(%T.loc10_14.2) [symbolic = %C.loc10_25.2 (constants.%C.2)]
  542. // CHECK:STDOUT:
  543. // CHECK:STDOUT: !definition:
  544. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc10_14.2) [symbolic = %F.type (constants.%F.type.2)]
  545. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)]
  546. // CHECK:STDOUT: %.loc10_37.2: <witness> = interface_witness (%F) [symbolic = %.loc10_37.2 (constants.%.6)]
  547. // CHECK:STDOUT:
  548. // CHECK:STDOUT: impl: %C.loc10_25.1 as %HasF.ref {
  549. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {}
  550. // CHECK:STDOUT: %.loc10_37.1: <witness> = interface_witness (%F.decl) [symbolic = %.loc10_37.2 (constants.%.6)]
  551. // CHECK:STDOUT:
  552. // CHECK:STDOUT: !members:
  553. // CHECK:STDOUT: .F = %F.decl
  554. // CHECK:STDOUT: witness = %.loc10_37.1
  555. // CHECK:STDOUT: }
  556. // CHECK:STDOUT: }
  557. // CHECK:STDOUT:
  558. // CHECK:STDOUT: generic class @C(%T.loc8_9.1: type) {
  559. // CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.2 (constants.%T)]
  560. // CHECK:STDOUT: %T.patt.loc8_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.1)]
  561. // CHECK:STDOUT:
  562. // CHECK:STDOUT: !definition:
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: class {
  565. // CHECK:STDOUT: %.loc8: <witness> = complete_type_witness %.4 [template = constants.%.5]
  566. // CHECK:STDOUT:
  567. // CHECK:STDOUT: !members:
  568. // CHECK:STDOUT: .Self = constants.%C.2
  569. // CHECK:STDOUT: }
  570. // CHECK:STDOUT: }
  571. // CHECK:STDOUT:
  572. // CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %HasF.type) {
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: fn();
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: generic fn @F.2(@impl.%T.loc10_14.1: type) {
  578. // CHECK:STDOUT: !definition:
  579. // CHECK:STDOUT:
  580. // CHECK:STDOUT: fn() {
  581. // CHECK:STDOUT: !entry:
  582. // CHECK:STDOUT: return
  583. // CHECK:STDOUT: }
  584. // CHECK:STDOUT: }
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: fn @G(%x.param_patt: %C.3) {
  587. // CHECK:STDOUT: !entry:
  588. // CHECK:STDOUT: %x.ref: %C.3 = name_ref x, %x
  589. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
  590. // CHECK:STDOUT: %F.ref: %.2 = name_ref F, @HasF.%.loc5 [template = constants.%.3]
  591. // CHECK:STDOUT: %.loc15_4.1: %F.type.1 = interface_witness_access constants.%.8, element0 [template = constants.%F.3]
  592. // CHECK:STDOUT: %.loc15_4.2: <specific function> = specific_function %.loc15_4.1, @F.2(constants.%.4) [template = constants.%.9]
  593. // CHECK:STDOUT: %F.call: init %.1 = call %.loc15_4.2()
  594. // CHECK:STDOUT: return
  595. // CHECK:STDOUT: }
  596. // CHECK:STDOUT:
  597. // CHECK:STDOUT: specific @F.1(constants.%Self) {}
  598. // CHECK:STDOUT:
  599. // CHECK:STDOUT: specific @C(constants.%T) {
  600. // CHECK:STDOUT: %T.loc8_9.2 => constants.%T
  601. // CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT:
  604. // CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) {
  605. // CHECK:STDOUT: %T.loc8_9.2 => constants.%T
  606. // CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T
  607. // CHECK:STDOUT: }
  608. // CHECK:STDOUT:
  609. // CHECK:STDOUT: specific @impl(constants.%T) {
  610. // CHECK:STDOUT: %T.loc10_14.2 => constants.%T
  611. // CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T
  612. // CHECK:STDOUT: %C.loc10_25.2 => constants.%C.2
  613. // CHECK:STDOUT:
  614. // CHECK:STDOUT: !definition:
  615. // CHECK:STDOUT: %F.type => constants.%F.type.2
  616. // CHECK:STDOUT: %F => constants.%F.2
  617. // CHECK:STDOUT: %.loc10_37.2 => constants.%.6
  618. // CHECK:STDOUT: }
  619. // CHECK:STDOUT:
  620. // CHECK:STDOUT: specific @F.2(constants.%T) {}
  621. // CHECK:STDOUT:
  622. // CHECK:STDOUT: specific @F.1(constants.%C.2) {}
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: specific @impl(@impl.%T.loc10_14.2) {
  625. // CHECK:STDOUT: %T.loc10_14.2 => constants.%T
  626. // CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T
  627. // CHECK:STDOUT: %C.loc10_25.2 => constants.%C.2
  628. // CHECK:STDOUT: }
  629. // CHECK:STDOUT:
  630. // CHECK:STDOUT: specific @C(constants.%.4) {
  631. // CHECK:STDOUT: %T.loc8_9.2 => constants.%.4
  632. // CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%.4
  633. // CHECK:STDOUT:
  634. // CHECK:STDOUT: !definition:
  635. // CHECK:STDOUT: }
  636. // CHECK:STDOUT:
  637. // CHECK:STDOUT: specific @impl(constants.%.4) {
  638. // CHECK:STDOUT: %T.loc10_14.2 => constants.%.4
  639. // CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%.4
  640. // CHECK:STDOUT: %C.loc10_25.2 => constants.%C.3
  641. // CHECK:STDOUT:
  642. // CHECK:STDOUT: !definition:
  643. // CHECK:STDOUT: %F.type => constants.%F.type.3
  644. // CHECK:STDOUT: %F => constants.%F.3
  645. // CHECK:STDOUT: %.loc10_37.2 => constants.%.8
  646. // CHECK:STDOUT: }
  647. // CHECK:STDOUT:
  648. // CHECK:STDOUT: specific @F.2(constants.%.4) {
  649. // CHECK:STDOUT: !definition:
  650. // CHECK:STDOUT: }
  651. // CHECK:STDOUT:
  652. // CHECK:STDOUT: --- deduced_interface_argument.carbon
  653. // CHECK:STDOUT:
  654. // CHECK:STDOUT: constants {
  655. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  656. // CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic]
  657. // CHECK:STDOUT: %HasF.type.1: type = generic_interface_type @HasF [template]
  658. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  659. // CHECK:STDOUT: %HasF: %HasF.type.1 = struct_value () [template]
  660. // CHECK:STDOUT: %HasF.type.2: type = interface_type @HasF, @HasF(%T) [symbolic]
  661. // CHECK:STDOUT: %Self: %HasF.type.2 = bind_symbolic_name Self, 1 [symbolic]
  662. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @HasF(%T) [symbolic]
  663. // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic]
  664. // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type.2, %F.type.1 [symbolic]
  665. // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [symbolic]
  666. // CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic]
  667. // CHECK:STDOUT: %.4: type = struct_type {} [template]
  668. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic]
  669. // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic]
  670. // CHECK:STDOUT: %.5: <witness> = interface_witness (%F.2) [symbolic]
  671. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  672. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  673. // CHECK:STDOUT: %HasF.type.3: type = interface_type @HasF, @HasF(%.4) [template]
  674. // CHECK:STDOUT: %F.type.3: type = fn_type @F.1, @HasF(%.4) [template]
  675. // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template]
  676. // CHECK:STDOUT: %.6: type = assoc_entity_type %HasF.type.3, %F.type.3 [template]
  677. // CHECK:STDOUT: %.7: %.6 = assoc_entity element0, @HasF.%F.decl [template]
  678. // CHECK:STDOUT: %F.type.4: type = fn_type @F.2, @impl(%.4) [template]
  679. // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template]
  680. // CHECK:STDOUT: %.8: <witness> = interface_witness (%F.4) [template]
  681. // CHECK:STDOUT: %.9: <specific function> = specific_function %F.4, @F.2(%.4) [template]
  682. // CHECK:STDOUT: }
  683. // CHECK:STDOUT:
  684. // CHECK:STDOUT: imports {
  685. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  686. // CHECK:STDOUT: import Core//prelude
  687. // CHECK:STDOUT: import Core//prelude/operators
  688. // CHECK:STDOUT: import Core//prelude/types
  689. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  690. // CHECK:STDOUT: import Core//prelude/operators/as
  691. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  692. // CHECK:STDOUT: import Core//prelude/operators/comparison
  693. // CHECK:STDOUT: import Core//prelude/types/bool
  694. // CHECK:STDOUT: }
  695. // CHECK:STDOUT: }
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: file {
  698. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  699. // CHECK:STDOUT: .Core = imports.%Core
  700. // CHECK:STDOUT: .HasF = %HasF.decl
  701. // CHECK:STDOUT: .G = %G.decl
  702. // CHECK:STDOUT: }
  703. // CHECK:STDOUT: %Core.import = import Core
  704. // CHECK:STDOUT: %HasF.decl: %HasF.type.1 = interface_decl @HasF [template = constants.%HasF] {
  705. // CHECK:STDOUT: %T.patt.loc4_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)]
  706. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_16.1, runtime_param<invalid> [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)]
  707. // CHECK:STDOUT: } {
  708. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  709. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_16.2 (constants.%T)]
  710. // CHECK:STDOUT: }
  711. // CHECK:STDOUT: impl_decl @impl [template] {
  712. // CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)]
  713. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_14.1, runtime_param<invalid> [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)]
  714. // CHECK:STDOUT: } {
  715. // CHECK:STDOUT: %.loc8_25.1: %.4 = struct_literal ()
  716. // CHECK:STDOUT: %.loc8_25.2: type = converted %.loc8_25.1, constants.%.4 [template = constants.%.4]
  717. // CHECK:STDOUT: %HasF.ref: %HasF.type.1 = name_ref HasF, file.%HasF.decl [template = constants.%HasF]
  718. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)]
  719. // CHECK:STDOUT: %HasF.type.loc8_34.1: type = interface_type @HasF, @HasF(constants.%T) [symbolic = %HasF.type.loc8_34.2 (constants.%HasF.type.2)]
  720. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  721. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_14.2 (constants.%T)]
  722. // CHECK:STDOUT: }
  723. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  724. // CHECK:STDOUT: %x.patt: %.4 = binding_pattern x
  725. // CHECK:STDOUT: %x.param_patt: %.4 = param_pattern %x.patt, runtime_param0
  726. // CHECK:STDOUT: } {
  727. // CHECK:STDOUT: %.loc12_10.1: %.4 = struct_literal ()
  728. // CHECK:STDOUT: %.loc12_10.2: type = converted %.loc12_10.1, constants.%.4 [template = constants.%.4]
  729. // CHECK:STDOUT: %param: %.4 = param runtime_param0
  730. // CHECK:STDOUT: %x: %.4 = bind_name x, %param
  731. // CHECK:STDOUT: }
  732. // CHECK:STDOUT: }
  733. // CHECK:STDOUT:
  734. // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.1: type) {
  735. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)]
  736. // CHECK:STDOUT: %T.patt.loc4_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)]
  737. // CHECK:STDOUT:
  738. // CHECK:STDOUT: !definition:
  739. // CHECK:STDOUT: %HasF.type: type = interface_type @HasF, @HasF(%T.loc4_16.2) [symbolic = %HasF.type (constants.%HasF.type.2)]
  740. // CHECK:STDOUT: %Self.2: %HasF.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  741. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @HasF(%T.loc4_16.2) [symbolic = %F.type (constants.%F.type.1)]
  742. // CHECK:STDOUT: %F: @HasF.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)]
  743. // CHECK:STDOUT: %.loc5_9.2: type = assoc_entity_type @HasF.%HasF.type (%HasF.type.2), @HasF.%F.type (%F.type.1) [symbolic = %.loc5_9.2 (constants.%.2)]
  744. // CHECK:STDOUT: %.loc5_9.3: @HasF.%.loc5_9.2 (%.2) = assoc_entity element0, %F.decl [symbolic = %.loc5_9.3 (constants.%.3)]
  745. // CHECK:STDOUT:
  746. // CHECK:STDOUT: interface {
  747. // CHECK:STDOUT: %Self.1: @HasF.%HasF.type (%HasF.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  748. // CHECK:STDOUT: %F.decl: @HasF.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = @HasF.%F (constants.%F.1)] {} {}
  749. // CHECK:STDOUT: %.loc5_9.1: @HasF.%.loc5_9.2 (%.2) = assoc_entity element0, %F.decl [symbolic = %.loc5_9.3 (constants.%.3)]
  750. // CHECK:STDOUT:
  751. // CHECK:STDOUT: !members:
  752. // CHECK:STDOUT: .Self = %Self.1
  753. // CHECK:STDOUT: .F = %.loc5_9.1
  754. // CHECK:STDOUT: witness = (%F.decl)
  755. // CHECK:STDOUT: }
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) {
  759. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  760. // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)]
  761. // CHECK:STDOUT: %HasF.type.loc8_34.2: type = interface_type @HasF, @HasF(%T.loc8_14.2) [symbolic = %HasF.type.loc8_34.2 (constants.%HasF.type.2)]
  762. // CHECK:STDOUT:
  763. // CHECK:STDOUT: !definition:
  764. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)]
  765. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)]
  766. // CHECK:STDOUT: %.loc8_38.2: <witness> = interface_witness (%F) [symbolic = %.loc8_38.2 (constants.%.5)]
  767. // CHECK:STDOUT:
  768. // CHECK:STDOUT: impl: %.loc8_25.2 as %HasF.type.loc8_34.1 {
  769. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {}
  770. // CHECK:STDOUT: %.loc8_38.1: <witness> = interface_witness (%F.decl) [symbolic = %.loc8_38.2 (constants.%.5)]
  771. // CHECK:STDOUT:
  772. // CHECK:STDOUT: !members:
  773. // CHECK:STDOUT: .F = %F.decl
  774. // CHECK:STDOUT: witness = %.loc8_38.1
  775. // CHECK:STDOUT: }
  776. // CHECK:STDOUT: }
  777. // CHECK:STDOUT:
  778. // CHECK:STDOUT: generic fn @F.1(@HasF.%T.loc4_16.1: type, @HasF.%Self.1: @HasF.%HasF.type (%HasF.type.2)) {
  779. // CHECK:STDOUT:
  780. // CHECK:STDOUT: fn();
  781. // CHECK:STDOUT: }
  782. // CHECK:STDOUT:
  783. // CHECK:STDOUT: generic fn @F.2(@impl.%T.loc8_14.1: type) {
  784. // CHECK:STDOUT: !definition:
  785. // CHECK:STDOUT:
  786. // CHECK:STDOUT: fn() {
  787. // CHECK:STDOUT: !entry:
  788. // CHECK:STDOUT: return
  789. // CHECK:STDOUT: }
  790. // CHECK:STDOUT: }
  791. // CHECK:STDOUT:
  792. // CHECK:STDOUT: fn @G(%x.param_patt: %.4) {
  793. // CHECK:STDOUT: !entry:
  794. // CHECK:STDOUT: %x.ref: %.4 = name_ref x, %x
  795. // CHECK:STDOUT: %HasF.ref: %HasF.type.1 = name_ref HasF, file.%HasF.decl [template = constants.%HasF]
  796. // CHECK:STDOUT: %.loc13_12: %.4 = struct_literal ()
  797. // CHECK:STDOUT: %.loc13_10: type = converted %.loc13_12, constants.%.4 [template = constants.%.4]
  798. // CHECK:STDOUT: %HasF.type: type = interface_type @HasF, @HasF(constants.%.4) [template = constants.%HasF.type.3]
  799. // CHECK:STDOUT: %.loc13_14: %.6 = specific_constant @HasF.%.loc5_9.1, @HasF(constants.%.4) [template = constants.%.7]
  800. // CHECK:STDOUT: %F.ref: %.6 = name_ref F, %.loc13_14 [template = constants.%.7]
  801. // CHECK:STDOUT: %.loc13_4.1: %F.type.3 = interface_witness_access constants.%.8, element0 [template = constants.%F.4]
  802. // CHECK:STDOUT: %.loc13_4.2: <specific function> = specific_function %.loc13_4.1, @F.2(constants.%.4) [template = constants.%.9]
  803. // CHECK:STDOUT: %F.call: init %.1 = call %.loc13_4.2()
  804. // CHECK:STDOUT: return
  805. // CHECK:STDOUT: }
  806. // CHECK:STDOUT:
  807. // CHECK:STDOUT: specific @HasF(constants.%T) {
  808. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T
  809. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T
  810. // CHECK:STDOUT:
  811. // CHECK:STDOUT: !definition:
  812. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.2
  813. // CHECK:STDOUT: %Self.2 => constants.%Self
  814. // CHECK:STDOUT: %F.type => constants.%F.type.1
  815. // CHECK:STDOUT: %F => constants.%F.1
  816. // CHECK:STDOUT: %.loc5_9.2 => constants.%.2
  817. // CHECK:STDOUT: %.loc5_9.3 => constants.%.3
  818. // CHECK:STDOUT: }
  819. // CHECK:STDOUT:
  820. // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {}
  821. // CHECK:STDOUT:
  822. // CHECK:STDOUT: specific @HasF(@HasF.%T.loc4_16.2) {
  823. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T
  824. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T
  825. // CHECK:STDOUT: }
  826. // CHECK:STDOUT:
  827. // CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) {
  828. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T
  829. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T
  830. // CHECK:STDOUT: }
  831. // CHECK:STDOUT:
  832. // CHECK:STDOUT: specific @impl(constants.%T) {
  833. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  834. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T
  835. // CHECK:STDOUT: %HasF.type.loc8_34.2 => constants.%HasF.type.2
  836. // CHECK:STDOUT:
  837. // CHECK:STDOUT: !definition:
  838. // CHECK:STDOUT: %F.type => constants.%F.type.2
  839. // CHECK:STDOUT: %F => constants.%F.2
  840. // CHECK:STDOUT: %.loc8_38.2 => constants.%.5
  841. // CHECK:STDOUT: }
  842. // CHECK:STDOUT:
  843. // CHECK:STDOUT: specific @F.2(constants.%T) {}
  844. // CHECK:STDOUT:
  845. // CHECK:STDOUT: specific @F.1(constants.%T, constants.%.4) {}
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: specific @impl(@impl.%T.loc8_14.2) {
  848. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  849. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T
  850. // CHECK:STDOUT: %HasF.type.loc8_34.2 => constants.%HasF.type.2
  851. // CHECK:STDOUT: }
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: specific @HasF(constants.%.4) {
  854. // CHECK:STDOUT: %T.loc4_16.2 => constants.%.4
  855. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%.4
  856. // CHECK:STDOUT:
  857. // CHECK:STDOUT: !definition:
  858. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.3
  859. // CHECK:STDOUT: %Self.2 => constants.%Self
  860. // CHECK:STDOUT: %F.type => constants.%F.type.3
  861. // CHECK:STDOUT: %F => constants.%F.3
  862. // CHECK:STDOUT: %.loc5_9.2 => constants.%.6
  863. // CHECK:STDOUT: %.loc5_9.3 => constants.%.7
  864. // CHECK:STDOUT: }
  865. // CHECK:STDOUT:
  866. // CHECK:STDOUT: specific @impl(constants.%.4) {
  867. // CHECK:STDOUT: %T.loc8_14.2 => constants.%.4
  868. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%.4
  869. // CHECK:STDOUT: %HasF.type.loc8_34.2 => constants.%HasF.type.3
  870. // CHECK:STDOUT:
  871. // CHECK:STDOUT: !definition:
  872. // CHECK:STDOUT: %F.type => constants.%F.type.4
  873. // CHECK:STDOUT: %F => constants.%F.4
  874. // CHECK:STDOUT: %.loc8_38.2 => constants.%.8
  875. // CHECK:STDOUT: }
  876. // CHECK:STDOUT:
  877. // CHECK:STDOUT: specific @F.2(constants.%.4) {
  878. // CHECK:STDOUT: !definition:
  879. // CHECK:STDOUT: }
  880. // CHECK:STDOUT:
  881. // CHECK:STDOUT: --- fail_incomplete_deduction.carbon
  882. // CHECK:STDOUT:
  883. // CHECK:STDOUT: constants {
  884. // CHECK:STDOUT: %HasF.type: type = interface_type @HasF [template]
  885. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic]
  886. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
  887. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  888. // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
  889. // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type, %F.type.1 [template]
  890. // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [template]
  891. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  892. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  893. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic]
  894. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic]
  895. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T, %U) [symbolic]
  896. // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic]
  897. // CHECK:STDOUT: %.4: <witness> = interface_witness (%F.2) [symbolic]
  898. // CHECK:STDOUT: %.5: type = struct_type {} [template]
  899. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  900. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  901. // CHECK:STDOUT: }
  902. // CHECK:STDOUT:
  903. // CHECK:STDOUT: imports {
  904. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  905. // CHECK:STDOUT: import Core//prelude
  906. // CHECK:STDOUT: import Core//prelude/operators
  907. // CHECK:STDOUT: import Core//prelude/types
  908. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  909. // CHECK:STDOUT: import Core//prelude/operators/as
  910. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  911. // CHECK:STDOUT: import Core//prelude/operators/comparison
  912. // CHECK:STDOUT: import Core//prelude/types/bool
  913. // CHECK:STDOUT: }
  914. // CHECK:STDOUT: }
  915. // CHECK:STDOUT:
  916. // CHECK:STDOUT: file {
  917. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  918. // CHECK:STDOUT: .Core = imports.%Core
  919. // CHECK:STDOUT: .HasF = %HasF.decl
  920. // CHECK:STDOUT: .G = %G.decl
  921. // CHECK:STDOUT: }
  922. // CHECK:STDOUT: %Core.import = import Core
  923. // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%HasF.type] {} {}
  924. // CHECK:STDOUT: impl_decl @impl [template] {
  925. // CHECK:STDOUT: %T.patt.loc9_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_14.2 (constants.%T.patt)]
  926. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc9_14.1, runtime_param<invalid> [symbolic = %T.patt.loc9_14.2 (constants.%T.patt)]
  927. // CHECK:STDOUT: %U.patt.loc9_24.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc9_24.2 (constants.%U.patt)]
  928. // CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc9_24.1, runtime_param<invalid> [symbolic = %U.patt.loc9_24.2 (constants.%U.patt)]
  929. // CHECK:STDOUT: } {
  930. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc9_14.1 [symbolic = %T.loc9_14.2 (constants.%T)]
  931. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
  932. // CHECK:STDOUT: %param.loc9_14: type = param runtime_param<invalid>
  933. // CHECK:STDOUT: %T.loc9_14.1: type = bind_symbolic_name T, 0, %param.loc9_14 [symbolic = %T.loc9_14.2 (constants.%T)]
  934. // CHECK:STDOUT: %param.loc9_24: type = param runtime_param<invalid>
  935. // CHECK:STDOUT: %U.loc9_24.1: type = bind_symbolic_name U, 1, %param.loc9_24 [symbolic = %U.loc9_24.2 (constants.%U)]
  936. // CHECK:STDOUT: }
  937. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  938. // CHECK:STDOUT: %x.patt: %.5 = binding_pattern x
  939. // CHECK:STDOUT: %x.param_patt: %.5 = param_pattern %x.patt, runtime_param0
  940. // CHECK:STDOUT: } {
  941. // CHECK:STDOUT: %.loc13_10.1: %.5 = struct_literal ()
  942. // CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%.5 [template = constants.%.5]
  943. // CHECK:STDOUT: %param: %.5 = param runtime_param0
  944. // CHECK:STDOUT: %x: %.5 = bind_name x, %param
  945. // CHECK:STDOUT: }
  946. // CHECK:STDOUT: }
  947. // CHECK:STDOUT:
  948. // CHECK:STDOUT: interface @HasF {
  949. // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  950. // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {}
  951. // CHECK:STDOUT: %.loc5: %.2 = assoc_entity element0, %F.decl [template = constants.%.3]
  952. // CHECK:STDOUT:
  953. // CHECK:STDOUT: !members:
  954. // CHECK:STDOUT: .Self = %Self
  955. // CHECK:STDOUT: .F = %.loc5
  956. // CHECK:STDOUT: witness = (%F.decl)
  957. // CHECK:STDOUT: }
  958. // CHECK:STDOUT:
  959. // CHECK:STDOUT: generic impl @impl(%T.loc9_14.1: type, %U.loc9_24.1: type) {
  960. // CHECK:STDOUT: %T.loc9_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc9_14.2 (constants.%T)]
  961. // CHECK:STDOUT: %T.patt.loc9_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_14.2 (constants.%T.patt)]
  962. // CHECK:STDOUT: %U.loc9_24.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc9_24.2 (constants.%U)]
  963. // CHECK:STDOUT: %U.patt.loc9_24.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc9_24.2 (constants.%U.patt)]
  964. // CHECK:STDOUT:
  965. // CHECK:STDOUT: !definition:
  966. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc9_14.2, %U.loc9_24.2) [symbolic = %F.type (constants.%F.type.2)]
  967. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)]
  968. // CHECK:STDOUT: %.loc9_44.2: <witness> = interface_witness (%F) [symbolic = %.loc9_44.2 (constants.%.4)]
  969. // CHECK:STDOUT:
  970. // CHECK:STDOUT: impl: %T.ref as %HasF.ref {
  971. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {}
  972. // CHECK:STDOUT: %.loc9_44.1: <witness> = interface_witness (%F.decl) [symbolic = %.loc9_44.2 (constants.%.4)]
  973. // CHECK:STDOUT:
  974. // CHECK:STDOUT: !members:
  975. // CHECK:STDOUT: .F = %F.decl
  976. // CHECK:STDOUT: witness = %.loc9_44.1
  977. // CHECK:STDOUT: }
  978. // CHECK:STDOUT: }
  979. // CHECK:STDOUT:
  980. // CHECK:STDOUT: generic fn @F.1(@HasF.%Self: %HasF.type) {
  981. // CHECK:STDOUT:
  982. // CHECK:STDOUT: fn();
  983. // CHECK:STDOUT: }
  984. // CHECK:STDOUT:
  985. // CHECK:STDOUT: generic fn @F.2(@impl.%T.loc9_14.1: type, @impl.%U.loc9_24.1: type) {
  986. // CHECK:STDOUT: !definition:
  987. // CHECK:STDOUT:
  988. // CHECK:STDOUT: fn() {
  989. // CHECK:STDOUT: !entry:
  990. // CHECK:STDOUT: return
  991. // CHECK:STDOUT: }
  992. // CHECK:STDOUT: }
  993. // CHECK:STDOUT:
  994. // CHECK:STDOUT: fn @G(%x.param_patt: %.5) {
  995. // CHECK:STDOUT: !entry:
  996. // CHECK:STDOUT: %x.ref: %.5 = name_ref x, %x
  997. // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%HasF.type]
  998. // CHECK:STDOUT: %F.ref: %.2 = name_ref F, @HasF.%.loc5 [template = constants.%.3]
  999. // CHECK:STDOUT: return
  1000. // CHECK:STDOUT: }
  1001. // CHECK:STDOUT:
  1002. // CHECK:STDOUT: specific @F.1(constants.%Self) {}
  1003. // CHECK:STDOUT:
  1004. // CHECK:STDOUT: specific @impl(constants.%T, constants.%U) {
  1005. // CHECK:STDOUT: %T.loc9_14.2 => constants.%T
  1006. // CHECK:STDOUT: %T.patt.loc9_14.2 => constants.%T
  1007. // CHECK:STDOUT: %U.loc9_24.2 => constants.%U
  1008. // CHECK:STDOUT: %U.patt.loc9_24.2 => constants.%U
  1009. // CHECK:STDOUT:
  1010. // CHECK:STDOUT: !definition:
  1011. // CHECK:STDOUT: %F.type => constants.%F.type.2
  1012. // CHECK:STDOUT: %F => constants.%F.2
  1013. // CHECK:STDOUT: %.loc9_44.2 => constants.%.4
  1014. // CHECK:STDOUT: }
  1015. // CHECK:STDOUT:
  1016. // CHECK:STDOUT: specific @F.2(constants.%T, constants.%U) {}
  1017. // CHECK:STDOUT:
  1018. // CHECK:STDOUT: specific @F.1(constants.%T) {}
  1019. // CHECK:STDOUT:
  1020. // CHECK:STDOUT: specific @impl(@impl.%T.loc9_14.2, @impl.%U.loc9_24.2) {
  1021. // CHECK:STDOUT: %T.loc9_14.2 => constants.%T
  1022. // CHECK:STDOUT: %T.patt.loc9_14.2 => constants.%T
  1023. // CHECK:STDOUT: %U.loc9_24.2 => constants.%U
  1024. // CHECK:STDOUT: %U.patt.loc9_24.2 => constants.%U
  1025. // CHECK:STDOUT: }
  1026. // CHECK:STDOUT:
  1027. // CHECK:STDOUT: --- fail_inconsistent_deduction.carbon
  1028. // CHECK:STDOUT:
  1029. // CHECK:STDOUT: constants {
  1030. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1031. // CHECK:STDOUT: %T.patt.1: type = symbolic_binding_pattern T, 0 [symbolic]
  1032. // CHECK:STDOUT: %HasF.type.1: type = generic_interface_type @HasF [template]
  1033. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  1034. // CHECK:STDOUT: %HasF: %HasF.type.1 = struct_value () [template]
  1035. // CHECK:STDOUT: %HasF.type.2: type = interface_type @HasF, @HasF(%T) [symbolic]
  1036. // CHECK:STDOUT: %Self: %HasF.type.2 = bind_symbolic_name Self, 1 [symbolic]
  1037. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @HasF(%T) [symbolic]
  1038. // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic]
  1039. // CHECK:STDOUT: %.2: type = assoc_entity_type %HasF.type.2, %F.type.1 [symbolic]
  1040. // CHECK:STDOUT: %.3: %.2 = assoc_entity element0, @HasF.%F.decl [symbolic]
  1041. // CHECK:STDOUT: %T.patt.2: type = symbolic_binding_pattern T, 0 [symbolic]
  1042. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic]
  1043. // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic]
  1044. // CHECK:STDOUT: %.4: <witness> = interface_witness (%F.2) [symbolic]
  1045. // CHECK:STDOUT: %A: type = class_type @A [template]
  1046. // CHECK:STDOUT: %.5: type = struct_type {} [template]
  1047. // CHECK:STDOUT: %.6: <witness> = complete_type_witness %.5 [template]
  1048. // CHECK:STDOUT: %B: type = class_type @B [template]
  1049. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  1050. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  1051. // CHECK:STDOUT: %.7: type = ptr_type %.5 [template]
  1052. // CHECK:STDOUT: %HasF.type.3: type = interface_type @HasF, @HasF(%B) [template]
  1053. // CHECK:STDOUT: %F.type.3: type = fn_type @F.1, @HasF(%B) [template]
  1054. // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template]
  1055. // CHECK:STDOUT: %.8: type = assoc_entity_type %HasF.type.3, %F.type.3 [template]
  1056. // CHECK:STDOUT: %.9: %.8 = assoc_entity element0, @HasF.%F.decl [template]
  1057. // CHECK:STDOUT: }
  1058. // CHECK:STDOUT:
  1059. // CHECK:STDOUT: imports {
  1060. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1061. // CHECK:STDOUT: import Core//prelude
  1062. // CHECK:STDOUT: import Core//prelude/operators
  1063. // CHECK:STDOUT: import Core//prelude/types
  1064. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  1065. // CHECK:STDOUT: import Core//prelude/operators/as
  1066. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  1067. // CHECK:STDOUT: import Core//prelude/operators/comparison
  1068. // CHECK:STDOUT: import Core//prelude/types/bool
  1069. // CHECK:STDOUT: }
  1070. // CHECK:STDOUT: }
  1071. // CHECK:STDOUT:
  1072. // CHECK:STDOUT: file {
  1073. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1074. // CHECK:STDOUT: .Core = imports.%Core
  1075. // CHECK:STDOUT: .HasF = %HasF.decl
  1076. // CHECK:STDOUT: .A = %A.decl
  1077. // CHECK:STDOUT: .B = %B.decl
  1078. // CHECK:STDOUT: .G = %G.decl
  1079. // CHECK:STDOUT: }
  1080. // CHECK:STDOUT: %Core.import = import Core
  1081. // CHECK:STDOUT: %HasF.decl: %HasF.type.1 = interface_decl @HasF [template = constants.%HasF] {
  1082. // CHECK:STDOUT: %T.patt.loc4_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)]
  1083. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_16.1, runtime_param<invalid> [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)]
  1084. // CHECK:STDOUT: } {
  1085. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  1086. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc4_16.2 (constants.%T)]
  1087. // CHECK:STDOUT: }
  1088. // CHECK:STDOUT: impl_decl @impl [template] {
  1089. // CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)]
  1090. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc8_14.1, runtime_param<invalid> [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)]
  1091. // CHECK:STDOUT: } {
  1092. // CHECK:STDOUT: %T.ref.loc8_24: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)]
  1093. // CHECK:STDOUT: %HasF.ref: %HasF.type.1 = name_ref HasF, file.%HasF.decl [template = constants.%HasF]
  1094. // CHECK:STDOUT: %T.ref.loc8_34: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)]
  1095. // CHECK:STDOUT: %HasF.type.loc8_33.1: type = interface_type @HasF, @HasF(constants.%T) [symbolic = %HasF.type.loc8_33.2 (constants.%HasF.type.2)]
  1096. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  1097. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc8_14.2 (constants.%T)]
  1098. // CHECK:STDOUT: }
  1099. // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {}
  1100. // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} {}
  1101. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  1102. // CHECK:STDOUT: %x.patt: %A = binding_pattern x
  1103. // CHECK:STDOUT: %x.param_patt: %A = param_pattern %x.patt, runtime_param0
  1104. // CHECK:STDOUT: } {
  1105. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A]
  1106. // CHECK:STDOUT: %param: %A = param runtime_param0
  1107. // CHECK:STDOUT: %x: %A = bind_name x, %param
  1108. // CHECK:STDOUT: }
  1109. // CHECK:STDOUT: }
  1110. // CHECK:STDOUT:
  1111. // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.1: type) {
  1112. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)]
  1113. // CHECK:STDOUT: %T.patt.loc4_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt.1)]
  1114. // CHECK:STDOUT:
  1115. // CHECK:STDOUT: !definition:
  1116. // CHECK:STDOUT: %HasF.type: type = interface_type @HasF, @HasF(%T.loc4_16.2) [symbolic = %HasF.type (constants.%HasF.type.2)]
  1117. // CHECK:STDOUT: %Self.2: %HasF.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  1118. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @HasF(%T.loc4_16.2) [symbolic = %F.type (constants.%F.type.1)]
  1119. // CHECK:STDOUT: %F: @HasF.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)]
  1120. // CHECK:STDOUT: %.loc5_9.2: type = assoc_entity_type @HasF.%HasF.type (%HasF.type.2), @HasF.%F.type (%F.type.1) [symbolic = %.loc5_9.2 (constants.%.2)]
  1121. // CHECK:STDOUT: %.loc5_9.3: @HasF.%.loc5_9.2 (%.2) = assoc_entity element0, %F.decl [symbolic = %.loc5_9.3 (constants.%.3)]
  1122. // CHECK:STDOUT:
  1123. // CHECK:STDOUT: interface {
  1124. // CHECK:STDOUT: %Self.1: @HasF.%HasF.type (%HasF.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  1125. // CHECK:STDOUT: %F.decl: @HasF.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = @HasF.%F (constants.%F.1)] {} {}
  1126. // CHECK:STDOUT: %.loc5_9.1: @HasF.%.loc5_9.2 (%.2) = assoc_entity element0, %F.decl [symbolic = %.loc5_9.3 (constants.%.3)]
  1127. // CHECK:STDOUT:
  1128. // CHECK:STDOUT: !members:
  1129. // CHECK:STDOUT: .Self = %Self.1
  1130. // CHECK:STDOUT: .F = %.loc5_9.1
  1131. // CHECK:STDOUT: witness = (%F.decl)
  1132. // CHECK:STDOUT: }
  1133. // CHECK:STDOUT: }
  1134. // CHECK:STDOUT:
  1135. // CHECK:STDOUT: generic impl @impl(%T.loc8_14.1: type) {
  1136. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  1137. // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt.2)]
  1138. // CHECK:STDOUT: %HasF.type.loc8_33.2: type = interface_type @HasF, @HasF(%T.loc8_14.2) [symbolic = %HasF.type.loc8_33.2 (constants.%HasF.type.2)]
  1139. // CHECK:STDOUT:
  1140. // CHECK:STDOUT: !definition:
  1141. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc8_14.2) [symbolic = %F.type (constants.%F.type.2)]
  1142. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)]
  1143. // CHECK:STDOUT: %.loc8_37.2: <witness> = interface_witness (%F) [symbolic = %.loc8_37.2 (constants.%.4)]
  1144. // CHECK:STDOUT:
  1145. // CHECK:STDOUT: impl: %T.ref.loc8_24 as %HasF.type.loc8_33.1 {
  1146. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {}
  1147. // CHECK:STDOUT: %.loc8_37.1: <witness> = interface_witness (%F.decl) [symbolic = %.loc8_37.2 (constants.%.4)]
  1148. // CHECK:STDOUT:
  1149. // CHECK:STDOUT: !members:
  1150. // CHECK:STDOUT: .F = %F.decl
  1151. // CHECK:STDOUT: witness = %.loc8_37.1
  1152. // CHECK:STDOUT: }
  1153. // CHECK:STDOUT: }
  1154. // CHECK:STDOUT:
  1155. // CHECK:STDOUT: class @A {
  1156. // CHECK:STDOUT: %.loc12: <witness> = complete_type_witness %.5 [template = constants.%.6]
  1157. // CHECK:STDOUT:
  1158. // CHECK:STDOUT: !members:
  1159. // CHECK:STDOUT: .Self = constants.%A
  1160. // CHECK:STDOUT: }
  1161. // CHECK:STDOUT:
  1162. // CHECK:STDOUT: class @B {
  1163. // CHECK:STDOUT: %.loc13: <witness> = complete_type_witness %.5 [template = constants.%.6]
  1164. // CHECK:STDOUT:
  1165. // CHECK:STDOUT: !members:
  1166. // CHECK:STDOUT: .Self = constants.%B
  1167. // CHECK:STDOUT: }
  1168. // CHECK:STDOUT:
  1169. // CHECK:STDOUT: generic fn @F.1(@HasF.%T.loc4_16.1: type, @HasF.%Self.1: @HasF.%HasF.type (%HasF.type.2)) {
  1170. // CHECK:STDOUT:
  1171. // CHECK:STDOUT: fn();
  1172. // CHECK:STDOUT: }
  1173. // CHECK:STDOUT:
  1174. // CHECK:STDOUT: generic fn @F.2(@impl.%T.loc8_14.1: type) {
  1175. // CHECK:STDOUT: !definition:
  1176. // CHECK:STDOUT:
  1177. // CHECK:STDOUT: fn() {
  1178. // CHECK:STDOUT: !entry:
  1179. // CHECK:STDOUT: return
  1180. // CHECK:STDOUT: }
  1181. // CHECK:STDOUT: }
  1182. // CHECK:STDOUT:
  1183. // CHECK:STDOUT: fn @G(%x.param_patt: %A) {
  1184. // CHECK:STDOUT: !entry:
  1185. // CHECK:STDOUT: %x.ref: %A = name_ref x, %x
  1186. // CHECK:STDOUT: %HasF.ref: %HasF.type.1 = name_ref HasF, file.%HasF.decl [template = constants.%HasF]
  1187. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
  1188. // CHECK:STDOUT: %HasF.type: type = interface_type @HasF, @HasF(constants.%B) [template = constants.%HasF.type.3]
  1189. // CHECK:STDOUT: %.loc21: %.8 = specific_constant @HasF.%.loc5_9.1, @HasF(constants.%B) [template = constants.%.9]
  1190. // CHECK:STDOUT: %F.ref: %.8 = name_ref F, %.loc21 [template = constants.%.9]
  1191. // CHECK:STDOUT: return
  1192. // CHECK:STDOUT: }
  1193. // CHECK:STDOUT:
  1194. // CHECK:STDOUT: specific @HasF(constants.%T) {
  1195. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T
  1196. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T
  1197. // CHECK:STDOUT:
  1198. // CHECK:STDOUT: !definition:
  1199. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.2
  1200. // CHECK:STDOUT: %Self.2 => constants.%Self
  1201. // CHECK:STDOUT: %F.type => constants.%F.type.1
  1202. // CHECK:STDOUT: %F => constants.%F.1
  1203. // CHECK:STDOUT: %.loc5_9.2 => constants.%.2
  1204. // CHECK:STDOUT: %.loc5_9.3 => constants.%.3
  1205. // CHECK:STDOUT: }
  1206. // CHECK:STDOUT:
  1207. // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {}
  1208. // CHECK:STDOUT:
  1209. // CHECK:STDOUT: specific @HasF(@HasF.%T.loc4_16.2) {
  1210. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T
  1211. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T
  1212. // CHECK:STDOUT: }
  1213. // CHECK:STDOUT:
  1214. // CHECK:STDOUT: specific @HasF(@impl.%T.loc8_14.2) {
  1215. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T
  1216. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T
  1217. // CHECK:STDOUT: }
  1218. // CHECK:STDOUT:
  1219. // CHECK:STDOUT: specific @impl(constants.%T) {
  1220. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  1221. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T
  1222. // CHECK:STDOUT: %HasF.type.loc8_33.2 => constants.%HasF.type.2
  1223. // CHECK:STDOUT:
  1224. // CHECK:STDOUT: !definition:
  1225. // CHECK:STDOUT: %F.type => constants.%F.type.2
  1226. // CHECK:STDOUT: %F => constants.%F.2
  1227. // CHECK:STDOUT: %.loc8_37.2 => constants.%.4
  1228. // CHECK:STDOUT: }
  1229. // CHECK:STDOUT:
  1230. // CHECK:STDOUT: specific @F.2(constants.%T) {}
  1231. // CHECK:STDOUT:
  1232. // CHECK:STDOUT: specific @F.1(constants.%T, constants.%T) {}
  1233. // CHECK:STDOUT:
  1234. // CHECK:STDOUT: specific @impl(@impl.%T.loc8_14.2) {
  1235. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  1236. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T
  1237. // CHECK:STDOUT: %HasF.type.loc8_33.2 => constants.%HasF.type.2
  1238. // CHECK:STDOUT: }
  1239. // CHECK:STDOUT:
  1240. // CHECK:STDOUT: specific @HasF(constants.%B) {
  1241. // CHECK:STDOUT: %T.loc4_16.2 => constants.%B
  1242. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%B
  1243. // CHECK:STDOUT:
  1244. // CHECK:STDOUT: !definition:
  1245. // CHECK:STDOUT: %HasF.type => constants.%HasF.type.3
  1246. // CHECK:STDOUT: %Self.2 => constants.%Self
  1247. // CHECK:STDOUT: %F.type => constants.%F.type.3
  1248. // CHECK:STDOUT: %F => constants.%F.3
  1249. // CHECK:STDOUT: %.loc5_9.2 => constants.%.8
  1250. // CHECK:STDOUT: %.loc5_9.3 => constants.%.9
  1251. // CHECK:STDOUT: }
  1252. // CHECK:STDOUT: