generic.carbon 61 KB

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