fail_impl_bad_assoc_fn.carbon 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100
  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/fail_impl_bad_assoc_fn.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon
  10. interface I { fn F(); }
  11. class NoF {
  12. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:3: error: missing implementation of F in impl of interface I [ImplMissingFunction]
  13. // CHECK:STDERR: impl as I {}
  14. // CHECK:STDERR: ^~~~~~~~~~~
  15. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: note: associated function F declared here [ImplAssociatedFunctionHere]
  16. // CHECK:STDERR: interface I { fn F(); }
  17. // CHECK:STDERR: ^~~~~~~
  18. // CHECK:STDERR:
  19. impl as I {}
  20. }
  21. class FNotFunction {
  22. impl as I {
  23. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: associated function F implemented by non-function [ImplFunctionWithNonFunction]
  24. // CHECK:STDERR: class F;
  25. // CHECK:STDERR: ^~~~~~~~
  26. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: note: associated function F declared here [ImplAssociatedFunctionHere]
  27. // CHECK:STDERR: interface I { fn F(); }
  28. // CHECK:STDERR: ^~~~~~~
  29. // CHECK:STDERR:
  30. class F;
  31. }
  32. }
  33. fn PossiblyF();
  34. // TODO: Should this be permitted?
  35. class FAlias {
  36. impl as I {
  37. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:11: error: associated function F implemented by non-function [ImplFunctionWithNonFunction]
  38. // CHECK:STDERR: alias F = PossiblyF;
  39. // CHECK:STDERR: ^
  40. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: note: associated function F declared here [ImplAssociatedFunctionHere]
  41. // CHECK:STDERR: interface I { fn F(); }
  42. // CHECK:STDERR: ^~~~~~~
  43. // CHECK:STDERR:
  44. alias F = PossiblyF;
  45. }
  46. }
  47. class FExtraParam {
  48. impl as I {
  49. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 1 [RedeclParamCountDiffers]
  50. // CHECK:STDERR: fn F(b: bool);
  51. // CHECK:STDERR: ^~~~~~~~~~~~~~
  52. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: note: previously declared with parameter count of 0 [RedeclParamCountPrevious]
  53. // CHECK:STDERR: interface I { fn F(); }
  54. // CHECK:STDERR: ^~~~~~~
  55. // CHECK:STDERR:
  56. fn F(b: bool);
  57. }
  58. }
  59. class FExtraImplicitParam {
  60. impl as I {
  61. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of implicit parameter list [RedeclParamListDiffers]
  62. // CHECK:STDERR: fn F[self: Self]();
  63. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
  64. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: note: previously declared without implicit parameter list [RedeclParamListPrevious]
  65. // CHECK:STDERR: interface I { fn F(); }
  66. // CHECK:STDERR: ^~~~~~~
  67. // CHECK:STDERR:
  68. fn F[self: Self]();
  69. }
  70. }
  71. // TODO: Should this be permitted?
  72. class FExtraReturnType {
  73. impl as I {
  74. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `bool` [FunctionRedeclReturnTypeDiffers]
  75. // CHECK:STDERR: fn F() -> bool;
  76. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  77. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: note: previously declared with no return type [FunctionRedeclReturnTypePreviousNoReturn]
  78. // CHECK:STDERR: interface I { fn F(); }
  79. // CHECK:STDERR: ^~~~~~~
  80. // CHECK:STDERR:
  81. fn F() -> bool;
  82. }
  83. }
  84. interface J { fn F[self: bool](b: bool) -> bool; }
  85. class FMissingParam {
  86. impl as J {
  87. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 0 [RedeclParamCountDiffers]
  88. // CHECK:STDERR: fn F[self: bool]() -> bool;
  89. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  90. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: note: previously declared with parameter count of 1 [RedeclParamCountPrevious]
  91. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  92. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  93. // CHECK:STDERR:
  94. fn F[self: bool]() -> bool;
  95. }
  96. }
  97. class FMissingImplicitParam {
  98. impl as J {
  99. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of missing implicit parameter list [RedeclParamListDiffers]
  100. // CHECK:STDERR: fn F(b: bool) -> bool;
  101. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
  102. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: note: previously declared with implicit parameter list [RedeclParamListPrevious]
  103. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  104. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105. // CHECK:STDERR:
  106. fn F(b: bool) -> bool;
  107. }
  108. }
  109. class FMissingReturnType {
  110. impl as J {
  111. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because no return type is provided [FunctionRedeclReturnTypeDiffersNoReturn]
  112. // CHECK:STDERR: fn F[self: bool](b: bool);
  113. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  114. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: note: previously declared with return type `bool` [FunctionRedeclReturnTypePrevious]
  115. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  116. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  117. // CHECK:STDERR:
  118. fn F[self: bool](b: bool);
  119. }
  120. }
  121. class FDifferentParamType {
  122. impl as J {
  123. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: type `FDifferentParamType` of parameter 1 in redeclaration differs from previous parameter type `bool` [RedeclParamDiffersType]
  124. // CHECK:STDERR: fn F[self: bool](b: Self) -> bool;
  125. // CHECK:STDERR: ^~~~~~~
  126. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
  127. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  128. // CHECK:STDERR: ^~~~~~~
  129. // CHECK:STDERR:
  130. fn F[self: bool](b: Self) -> bool;
  131. }
  132. }
  133. class FDifferentImplicitParamType {
  134. impl as J {
  135. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: type `FDifferentImplicitParamType` of implicit parameter 1 in redeclaration differs from previous parameter type `bool` [RedeclParamDiffersType]
  136. // CHECK:STDERR: fn F[self: Self](b: bool) -> bool;
  137. // CHECK:STDERR: ^~~~~~~~~~
  138. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: note: previous declaration's corresponding implicit parameter here [RedeclParamPrevious]
  139. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  140. // CHECK:STDERR: ^~~~~~~~~~
  141. // CHECK:STDERR:
  142. fn F[self: Self](b: bool) -> bool;
  143. }
  144. }
  145. class FDifferentReturnType {
  146. impl as J {
  147. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `FDifferentReturnType` [FunctionRedeclReturnTypeDiffers]
  148. // CHECK:STDERR: fn F[self: bool](b: bool) -> Self;
  149. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  150. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-72]]:15: note: previously declared with return type `bool` [FunctionRedeclReturnTypePrevious]
  151. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  152. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153. // CHECK:STDERR:
  154. fn F[self: bool](b: bool) -> Self;
  155. }
  156. }
  157. // TODO: This should probably be permitted.
  158. class FDifferentParamName {
  159. impl as J {
  160. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
  161. // CHECK:STDERR: fn F[self: bool](not_b: bool) -> bool;
  162. // CHECK:STDERR: ^~~~~~~~~~~
  163. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
  164. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  165. // CHECK:STDERR: ^~~~~~~
  166. // CHECK:STDERR:
  167. fn F[self: bool](not_b: bool) -> bool;
  168. }
  169. }
  170. interface SelfNested {
  171. fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4];
  172. }
  173. class SelfNestedBadParam {
  174. impl as SelfNested {
  175. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: type `(SelfNestedBadParam*, {.x: i32, .y: i32})` of parameter 1 in redeclaration differs from previous parameter type `(SelfNestedBadParam*, {.x: SelfNestedBadParam, .y: i32})` [RedeclParamDiffersType]
  176. // CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4];
  177. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  178. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
  179. // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4];
  180. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181. // CHECK:STDERR:
  182. fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4];
  183. }
  184. }
  185. class SelfNestedBadReturnType {
  186. impl as SelfNested {
  187. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: error: function redeclaration differs because return type is `[SelfNestedBadParam; 4]` [FunctionRedeclReturnTypeDiffers]
  188. // CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4];
  189. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  190. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: note: previously declared with return type `[SelfNestedBadReturnType; 4]` [FunctionRedeclReturnTypePrevious]
  191. // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4];
  192. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  193. fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4];
  194. }
  195. }
  196. // CHECK:STDOUT: --- fail_impl_bad_assoc_fn.carbon
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: constants {
  199. // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
  200. // CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic]
  201. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
  202. // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
  203. // CHECK:STDOUT: %F.assoc_type.1: type = assoc_entity_type %I.type, %F.type.1 [template]
  204. // CHECK:STDOUT: %assoc0.1: %F.assoc_type.1 = assoc_entity element0, @I.%F.decl [template]
  205. // CHECK:STDOUT: %NoF: type = class_type @NoF [template]
  206. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  207. // CHECK:STDOUT: %complete_type.1: <witness> = complete_type_witness %empty_struct_type [template]
  208. // CHECK:STDOUT: %FNotFunction: type = class_type @FNotFunction [template]
  209. // CHECK:STDOUT: %F.2: type = class_type @F.16 [template]
  210. // CHECK:STDOUT: %PossiblyF.type: type = fn_type @PossiblyF [template]
  211. // CHECK:STDOUT: %PossiblyF: %PossiblyF.type = struct_value () [template]
  212. // CHECK:STDOUT: %FAlias: type = class_type @FAlias [template]
  213. // CHECK:STDOUT: %FExtraParam: type = class_type @FExtraParam [template]
  214. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  215. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  216. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template]
  217. // CHECK:STDOUT: %F.3: %F.type.2 = struct_value () [template]
  218. // CHECK:STDOUT: %I.facet.1: %I.type = facet_value %FExtraParam, %FExtraParam [template]
  219. // CHECK:STDOUT: %FExtraImplicitParam: type = class_type @FExtraImplicitParam [template]
  220. // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template]
  221. // CHECK:STDOUT: %F.4: %F.type.3 = struct_value () [template]
  222. // CHECK:STDOUT: %I.facet.2: %I.type = facet_value %FExtraImplicitParam, %FExtraImplicitParam [template]
  223. // CHECK:STDOUT: %FExtraReturnType: type = class_type @FExtraReturnType [template]
  224. // CHECK:STDOUT: %F.type.4: type = fn_type @F.4 [template]
  225. // CHECK:STDOUT: %F.5: %F.type.4 = struct_value () [template]
  226. // CHECK:STDOUT: %I.facet.3: %I.type = facet_value %FExtraReturnType, %FExtraReturnType [template]
  227. // CHECK:STDOUT: %J.type: type = facet_type <@J> [template]
  228. // CHECK:STDOUT: %Self.2: %J.type = bind_symbolic_name Self, 0 [symbolic]
  229. // CHECK:STDOUT: %F.type.5: type = fn_type @F.5 [template]
  230. // CHECK:STDOUT: %F.6: %F.type.5 = struct_value () [template]
  231. // CHECK:STDOUT: %F.assoc_type.2: type = assoc_entity_type %J.type, %F.type.5 [template]
  232. // CHECK:STDOUT: %assoc0.2: %F.assoc_type.2 = assoc_entity element0, @J.%F.decl [template]
  233. // CHECK:STDOUT: %FMissingParam: type = class_type @FMissingParam [template]
  234. // CHECK:STDOUT: %F.type.6: type = fn_type @F.6 [template]
  235. // CHECK:STDOUT: %F.7: %F.type.6 = struct_value () [template]
  236. // CHECK:STDOUT: %J.facet.1: %J.type = facet_value %FMissingParam, %FMissingParam [template]
  237. // CHECK:STDOUT: %FMissingImplicitParam: type = class_type @FMissingImplicitParam [template]
  238. // CHECK:STDOUT: %F.type.7: type = fn_type @F.7 [template]
  239. // CHECK:STDOUT: %F.8: %F.type.7 = struct_value () [template]
  240. // CHECK:STDOUT: %J.facet.2: %J.type = facet_value %FMissingImplicitParam, %FMissingImplicitParam [template]
  241. // CHECK:STDOUT: %FMissingReturnType: type = class_type @FMissingReturnType [template]
  242. // CHECK:STDOUT: %F.type.8: type = fn_type @F.8 [template]
  243. // CHECK:STDOUT: %F.9: %F.type.8 = struct_value () [template]
  244. // CHECK:STDOUT: %J.facet.3: %J.type = facet_value %FMissingReturnType, %FMissingReturnType [template]
  245. // CHECK:STDOUT: %FDifferentParamType: type = class_type @FDifferentParamType [template]
  246. // CHECK:STDOUT: %F.type.9: type = fn_type @F.9 [template]
  247. // CHECK:STDOUT: %F.10: %F.type.9 = struct_value () [template]
  248. // CHECK:STDOUT: %J.facet.4: %J.type = facet_value %FDifferentParamType, %FDifferentParamType [template]
  249. // CHECK:STDOUT: %FDifferentImplicitParamType: type = class_type @FDifferentImplicitParamType [template]
  250. // CHECK:STDOUT: %F.type.10: type = fn_type @F.10 [template]
  251. // CHECK:STDOUT: %F.11: %F.type.10 = struct_value () [template]
  252. // CHECK:STDOUT: %J.facet.5: %J.type = facet_value %FDifferentImplicitParamType, %FDifferentImplicitParamType [template]
  253. // CHECK:STDOUT: %FDifferentReturnType: type = class_type @FDifferentReturnType [template]
  254. // CHECK:STDOUT: %F.type.11: type = fn_type @F.11 [template]
  255. // CHECK:STDOUT: %F.12: %F.type.11 = struct_value () [template]
  256. // CHECK:STDOUT: %J.facet.6: %J.type = facet_value %FDifferentReturnType, %FDifferentReturnType [template]
  257. // CHECK:STDOUT: %FDifferentParamName: type = class_type @FDifferentParamName [template]
  258. // CHECK:STDOUT: %F.type.12: type = fn_type @F.12 [template]
  259. // CHECK:STDOUT: %F.13: %F.type.12 = struct_value () [template]
  260. // CHECK:STDOUT: %J.facet.7: %J.type = facet_value %FDifferentParamName, %FDifferentParamName [template]
  261. // CHECK:STDOUT: %SelfNested.type: type = facet_type <@SelfNested> [template]
  262. // CHECK:STDOUT: %Self.3: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic]
  263. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.3 [symbolic]
  264. // CHECK:STDOUT: %ptr.1: type = ptr_type %Self.as_type [symbolic]
  265. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  266. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  267. // CHECK:STDOUT: %struct_type.x.y.1: type = struct_type {.x: %Self.as_type, .y: %i32} [symbolic]
  268. // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template]
  269. // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%ptr.1, %struct_type.x.y.1) [symbolic]
  270. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template]
  271. // CHECK:STDOUT: %array_type.1: type = array_type %int_4, %Self.as_type [symbolic]
  272. // CHECK:STDOUT: %F.type.13: type = fn_type @F.13 [template]
  273. // CHECK:STDOUT: %F.14: %F.type.13 = struct_value () [template]
  274. // CHECK:STDOUT: %F.assoc_type.3: type = assoc_entity_type %SelfNested.type, %F.type.13 [template]
  275. // CHECK:STDOUT: %assoc0.3: %F.assoc_type.3 = assoc_entity element0, @SelfNested.%F.decl [template]
  276. // CHECK:STDOUT: %SelfNestedBadParam: type = class_type @SelfNestedBadParam [template]
  277. // CHECK:STDOUT: %ptr.2: type = ptr_type %SelfNestedBadParam [template]
  278. // CHECK:STDOUT: %struct_type.x.y.2: type = struct_type {.x: %i32, .y: %i32} [template]
  279. // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%ptr.2, %struct_type.x.y.2) [template]
  280. // CHECK:STDOUT: %array_type.2: type = array_type %int_4, %SelfNestedBadParam [template]
  281. // CHECK:STDOUT: %F.type.14: type = fn_type @F.14 [template]
  282. // CHECK:STDOUT: %F.15: %F.type.14 = struct_value () [template]
  283. // CHECK:STDOUT: %SelfNested.facet.1: %SelfNested.type = facet_value %SelfNestedBadParam, %SelfNestedBadParam [template]
  284. // CHECK:STDOUT: %struct_type.x.y.3: type = struct_type {.x: %SelfNestedBadParam, .y: %i32} [template]
  285. // CHECK:STDOUT: %tuple.type.4: type = tuple_type (%ptr.2, %struct_type.x.y.3) [template]
  286. // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [template]
  287. // CHECK:STDOUT: %ptr.3: type = ptr_type %SelfNestedBadReturnType [template]
  288. // CHECK:STDOUT: %struct_type.x.y.4: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [template]
  289. // CHECK:STDOUT: %tuple.type.5: type = tuple_type (%ptr.3, %struct_type.x.y.4) [template]
  290. // CHECK:STDOUT: %F.type.15: type = fn_type @F.15 [template]
  291. // CHECK:STDOUT: %F.16: %F.type.15 = struct_value () [template]
  292. // CHECK:STDOUT: %SelfNested.facet.2: %SelfNested.type = facet_value %SelfNestedBadReturnType, %SelfNestedBadReturnType [template]
  293. // CHECK:STDOUT: %array_type.3: type = array_type %int_4, %SelfNestedBadReturnType [template]
  294. // CHECK:STDOUT: }
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: imports {
  297. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  298. // CHECK:STDOUT: .Bool = %import_ref.1
  299. // CHECK:STDOUT: .Int = %import_ref.2
  300. // CHECK:STDOUT: import Core//prelude
  301. // CHECK:STDOUT: import Core//prelude/...
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: file {
  306. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  307. // CHECK:STDOUT: .Core = imports.%Core
  308. // CHECK:STDOUT: .I = %I.decl
  309. // CHECK:STDOUT: .NoF = %NoF.decl
  310. // CHECK:STDOUT: .FNotFunction = %FNotFunction.decl
  311. // CHECK:STDOUT: .PossiblyF = %PossiblyF.decl
  312. // CHECK:STDOUT: .FAlias = %FAlias.decl
  313. // CHECK:STDOUT: .FExtraParam = %FExtraParam.decl
  314. // CHECK:STDOUT: .FExtraImplicitParam = %FExtraImplicitParam.decl
  315. // CHECK:STDOUT: .FExtraReturnType = %FExtraReturnType.decl
  316. // CHECK:STDOUT: .J = %J.decl
  317. // CHECK:STDOUT: .FMissingParam = %FMissingParam.decl
  318. // CHECK:STDOUT: .FMissingImplicitParam = %FMissingImplicitParam.decl
  319. // CHECK:STDOUT: .FMissingReturnType = %FMissingReturnType.decl
  320. // CHECK:STDOUT: .FDifferentParamType = %FDifferentParamType.decl
  321. // CHECK:STDOUT: .FDifferentImplicitParamType = %FDifferentImplicitParamType.decl
  322. // CHECK:STDOUT: .FDifferentReturnType = %FDifferentReturnType.decl
  323. // CHECK:STDOUT: .FDifferentParamName = %FDifferentParamName.decl
  324. // CHECK:STDOUT: .SelfNested = %SelfNested.decl
  325. // CHECK:STDOUT: .SelfNestedBadParam = %SelfNestedBadParam.decl
  326. // CHECK:STDOUT: .SelfNestedBadReturnType = %SelfNestedBadReturnType.decl
  327. // CHECK:STDOUT: }
  328. // CHECK:STDOUT: %Core.import = import Core
  329. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
  330. // CHECK:STDOUT: %NoF.decl: type = class_decl @NoF [template = constants.%NoF] {} {}
  331. // CHECK:STDOUT: %FNotFunction.decl: type = class_decl @FNotFunction [template = constants.%FNotFunction] {} {}
  332. // CHECK:STDOUT: %PossiblyF.decl: %PossiblyF.type = fn_decl @PossiblyF [template = constants.%PossiblyF] {} {}
  333. // CHECK:STDOUT: %FAlias.decl: type = class_decl @FAlias [template = constants.%FAlias] {} {}
  334. // CHECK:STDOUT: %FExtraParam.decl: type = class_decl @FExtraParam [template = constants.%FExtraParam] {} {}
  335. // CHECK:STDOUT: %FExtraImplicitParam.decl: type = class_decl @FExtraImplicitParam [template = constants.%FExtraImplicitParam] {} {}
  336. // CHECK:STDOUT: %FExtraReturnType.decl: type = class_decl @FExtraReturnType [template = constants.%FExtraReturnType] {} {}
  337. // CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%J.type] {} {}
  338. // CHECK:STDOUT: %FMissingParam.decl: type = class_decl @FMissingParam [template = constants.%FMissingParam] {} {}
  339. // CHECK:STDOUT: %FMissingImplicitParam.decl: type = class_decl @FMissingImplicitParam [template = constants.%FMissingImplicitParam] {} {}
  340. // CHECK:STDOUT: %FMissingReturnType.decl: type = class_decl @FMissingReturnType [template = constants.%FMissingReturnType] {} {}
  341. // CHECK:STDOUT: %FDifferentParamType.decl: type = class_decl @FDifferentParamType [template = constants.%FDifferentParamType] {} {}
  342. // CHECK:STDOUT: %FDifferentImplicitParamType.decl: type = class_decl @FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] {} {}
  343. // CHECK:STDOUT: %FDifferentReturnType.decl: type = class_decl @FDifferentReturnType [template = constants.%FDifferentReturnType] {} {}
  344. // CHECK:STDOUT: %FDifferentParamName.decl: type = class_decl @FDifferentParamName [template = constants.%FDifferentParamName] {} {}
  345. // CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%SelfNested.type] {} {}
  346. // CHECK:STDOUT: %SelfNestedBadParam.decl: type = class_decl @SelfNestedBadParam [template = constants.%SelfNestedBadParam] {} {}
  347. // CHECK:STDOUT: %SelfNestedBadReturnType.decl: type = class_decl @SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] {} {}
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT:
  350. // CHECK:STDOUT: interface @I {
  351. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1]
  352. // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {}
  353. // CHECK:STDOUT: %assoc0: %F.assoc_type.1 = assoc_entity element0, %F.decl [template = constants.%assoc0.1]
  354. // CHECK:STDOUT:
  355. // CHECK:STDOUT: !members:
  356. // CHECK:STDOUT: .Self = %Self
  357. // CHECK:STDOUT: .F = %assoc0
  358. // CHECK:STDOUT: witness = (%F.decl)
  359. // CHECK:STDOUT: }
  360. // CHECK:STDOUT:
  361. // CHECK:STDOUT: interface @J {
  362. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2]
  363. // CHECK:STDOUT: %F.decl: %F.type.5 = fn_decl @F.5 [template = constants.%F.6] {
  364. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  365. // CHECK:STDOUT: %self.param_patt: bool = value_param_pattern %self.patt, runtime_param0
  366. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  367. // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1
  368. // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
  369. // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2
  370. // CHECK:STDOUT: } {
  371. // CHECK:STDOUT: %bool.make_type.loc93_44: init type = call constants.%Bool() [template = bool]
  372. // CHECK:STDOUT: %.loc93_44.1: type = value_of_initializer %bool.make_type.loc93_44 [template = bool]
  373. // CHECK:STDOUT: %.loc93_44.2: type = converted %bool.make_type.loc93_44, %.loc93_44.1 [template = bool]
  374. // CHECK:STDOUT: %self.param: bool = value_param runtime_param0
  375. // CHECK:STDOUT: %.loc93_26.3: type = splice_block %.loc93_26.2 [template = bool] {
  376. // CHECK:STDOUT: %bool.make_type.loc93_26: init type = call constants.%Bool() [template = bool]
  377. // CHECK:STDOUT: %.loc93_26.1: type = value_of_initializer %bool.make_type.loc93_26 [template = bool]
  378. // CHECK:STDOUT: %.loc93_26.2: type = converted %bool.make_type.loc93_26, %.loc93_26.1 [template = bool]
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  381. // CHECK:STDOUT: %b.param: bool = value_param runtime_param1
  382. // CHECK:STDOUT: %.loc93_35.3: type = splice_block %.loc93_35.2 [template = bool] {
  383. // CHECK:STDOUT: %bool.make_type.loc93_35: init type = call constants.%Bool() [template = bool]
  384. // CHECK:STDOUT: %.loc93_35.1: type = value_of_initializer %bool.make_type.loc93_35 [template = bool]
  385. // CHECK:STDOUT: %.loc93_35.2: type = converted %bool.make_type.loc93_35, %.loc93_35.1 [template = bool]
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  388. // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2
  389. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  390. // CHECK:STDOUT: }
  391. // CHECK:STDOUT: %assoc0: %F.assoc_type.2 = assoc_entity element0, %F.decl [template = constants.%assoc0.2]
  392. // CHECK:STDOUT:
  393. // CHECK:STDOUT: !members:
  394. // CHECK:STDOUT: .Self = %Self
  395. // CHECK:STDOUT: .F = %assoc0
  396. // CHECK:STDOUT: witness = (%F.decl)
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT:
  399. // CHECK:STDOUT: interface @SelfNested {
  400. // CHECK:STDOUT: %Self: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.3]
  401. // CHECK:STDOUT: %F.decl: %F.type.13 = fn_decl @F.13 [template = constants.%F.14] {
  402. // CHECK:STDOUT: %x.patt: @F.13.%tuple.type (%tuple.type.2) = binding_pattern x
  403. // CHECK:STDOUT: %x.param_patt: @F.13.%tuple.type (%tuple.type.2) = value_param_pattern %x.patt, runtime_param0
  404. // CHECK:STDOUT: %return.patt: @F.13.%array_type.loc188_52.1 (%array_type.1) = return_slot_pattern
  405. // CHECK:STDOUT: %return.param_patt: @F.13.%array_type.loc188_52.1 (%array_type.1) = out_param_pattern %return.patt, runtime_param1
  406. // CHECK:STDOUT: } {
  407. // CHECK:STDOUT: %Self.ref.loc188_45: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)]
  408. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4]
  409. // CHECK:STDOUT: %Self.as_type.loc188_45: type = facet_access_type %Self.ref.loc188_45 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)]
  410. // CHECK:STDOUT: %.loc188_45: type = converted %Self.ref.loc188_45, %Self.as_type.loc188_45 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)]
  411. // CHECK:STDOUT: %array_type.loc188_52.2: type = array_type %int_4, %Self.as_type [symbolic = %array_type.loc188_52.1 (constants.%array_type.1)]
  412. // CHECK:STDOUT: %x.param: @F.13.%tuple.type (%tuple.type.2) = value_param runtime_param0
  413. // CHECK:STDOUT: %.loc188_38.3: type = splice_block %.loc188_38.2 [symbolic = %tuple.type (constants.%tuple.type.2)] {
  414. // CHECK:STDOUT: %Self.ref.loc188_12: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)]
  415. // CHECK:STDOUT: %Self.as_type.loc188_16.2: type = facet_access_type %Self.ref.loc188_12 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)]
  416. // CHECK:STDOUT: %.loc188_16: type = converted %Self.ref.loc188_12, %Self.as_type.loc188_16.2 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)]
  417. // CHECK:STDOUT: %ptr.loc188_16.2: type = ptr_type %Self.as_type [symbolic = %ptr.loc188_16.1 (constants.%ptr.1)]
  418. // CHECK:STDOUT: %Self.ref.loc188_24: %SelfNested.type = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)]
  419. // CHECK:STDOUT: %Self.as_type.loc188_24: type = facet_access_type %Self.ref.loc188_24 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)]
  420. // CHECK:STDOUT: %.loc188_24: type = converted %Self.ref.loc188_24, %Self.as_type.loc188_24 [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)]
  421. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  422. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  423. // CHECK:STDOUT: %struct_type.x.y.loc188_37.2: type = struct_type {.x: %Self.as_type, .y: %i32} [symbolic = %struct_type.x.y.loc188_37.1 (constants.%struct_type.x.y.1)]
  424. // CHECK:STDOUT: %.loc188_38.1: %tuple.type.1 = tuple_literal (%ptr.loc188_16.2, %struct_type.x.y.loc188_37.2)
  425. // CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%tuple.type.2 [symbolic = %tuple.type (constants.%tuple.type.2)]
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT: %x: @F.13.%tuple.type (%tuple.type.2) = bind_name x, %x.param
  428. // CHECK:STDOUT: %return.param: ref @F.13.%array_type.loc188_52.1 (%array_type.1) = out_param runtime_param1
  429. // CHECK:STDOUT: %return: ref @F.13.%array_type.loc188_52.1 (%array_type.1) = return_slot %return.param
  430. // CHECK:STDOUT: }
  431. // CHECK:STDOUT: %assoc0: %F.assoc_type.3 = assoc_entity element0, %F.decl [template = constants.%assoc0.3]
  432. // CHECK:STDOUT:
  433. // CHECK:STDOUT: !members:
  434. // CHECK:STDOUT: .Self = %Self
  435. // CHECK:STDOUT: .F = %assoc0
  436. // CHECK:STDOUT: witness = (%F.decl)
  437. // CHECK:STDOUT: }
  438. // CHECK:STDOUT:
  439. // CHECK:STDOUT: impl @impl.1: %Self.ref as %I.ref {
  440. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: !members:
  443. // CHECK:STDOUT: witness = %interface
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: impl @impl.2: %Self.ref as %I.ref {
  447. // CHECK:STDOUT: %F.decl: type = class_decl @F.16 [template = constants.%F.2] {} {}
  448. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: !members:
  451. // CHECK:STDOUT: .F = %F.decl
  452. // CHECK:STDOUT: witness = %interface
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: impl @impl.3: %Self.ref as %I.ref {
  456. // CHECK:STDOUT: %PossiblyF.ref: %PossiblyF.type = name_ref PossiblyF, file.%PossiblyF.decl [template = constants.%PossiblyF]
  457. // CHECK:STDOUT: %F: %PossiblyF.type = bind_alias F, file.%PossiblyF.decl [template = constants.%PossiblyF]
  458. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  459. // CHECK:STDOUT:
  460. // CHECK:STDOUT: !members:
  461. // CHECK:STDOUT: .F = %F
  462. // CHECK:STDOUT: witness = %interface
  463. // CHECK:STDOUT: }
  464. // CHECK:STDOUT:
  465. // CHECK:STDOUT: impl @impl.4: %Self.ref as %I.ref {
  466. // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.3] {
  467. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  468. // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0
  469. // CHECK:STDOUT: } {
  470. // CHECK:STDOUT: %b.param: bool = value_param runtime_param0
  471. // CHECK:STDOUT: %.loc62_13.3: type = splice_block %.loc62_13.2 [template = bool] {
  472. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  473. // CHECK:STDOUT: %.loc62_13.1: type = value_of_initializer %bool.make_type [template = bool]
  474. // CHECK:STDOUT: %.loc62_13.2: type = converted %bool.make_type, %.loc62_13.1 [template = bool]
  475. // CHECK:STDOUT: }
  476. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  477. // CHECK:STDOUT: }
  478. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  479. // CHECK:STDOUT:
  480. // CHECK:STDOUT: !members:
  481. // CHECK:STDOUT: .F = %F.decl
  482. // CHECK:STDOUT: witness = %interface
  483. // CHECK:STDOUT: }
  484. // CHECK:STDOUT:
  485. // CHECK:STDOUT: impl @impl.5: %Self.ref as %I.ref {
  486. // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.4] {
  487. // CHECK:STDOUT: %self.patt: %FExtraImplicitParam = binding_pattern self
  488. // CHECK:STDOUT: %self.param_patt: %FExtraImplicitParam = value_param_pattern %self.patt, runtime_param0
  489. // CHECK:STDOUT: } {
  490. // CHECK:STDOUT: %self.param: %FExtraImplicitParam = value_param runtime_param0
  491. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam]
  492. // CHECK:STDOUT: %self: %FExtraImplicitParam = bind_name self, %self.param
  493. // CHECK:STDOUT: }
  494. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  495. // CHECK:STDOUT:
  496. // CHECK:STDOUT: !members:
  497. // CHECK:STDOUT: .F = %F.decl
  498. // CHECK:STDOUT: witness = %interface
  499. // CHECK:STDOUT: }
  500. // CHECK:STDOUT:
  501. // CHECK:STDOUT: impl @impl.6: %Self.ref as %I.ref {
  502. // CHECK:STDOUT: %F.decl: %F.type.4 = fn_decl @F.4 [template = constants.%F.5] {
  503. // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
  504. // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param0
  505. // CHECK:STDOUT: } {
  506. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  507. // CHECK:STDOUT: %.loc89_15.1: type = value_of_initializer %bool.make_type [template = bool]
  508. // CHECK:STDOUT: %.loc89_15.2: type = converted %bool.make_type, %.loc89_15.1 [template = bool]
  509. // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param0
  510. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  511. // CHECK:STDOUT: }
  512. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: !members:
  515. // CHECK:STDOUT: .F = %F.decl
  516. // CHECK:STDOUT: witness = %interface
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: impl @impl.7: %Self.ref as %J.ref {
  520. // CHECK:STDOUT: %F.decl: %F.type.6 = fn_decl @F.6 [template = constants.%F.7] {
  521. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  522. // CHECK:STDOUT: %self.param_patt: bool = value_param_pattern %self.patt, runtime_param0
  523. // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
  524. // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1
  525. // CHECK:STDOUT: } {
  526. // CHECK:STDOUT: %bool.make_type.loc104_27: init type = call constants.%Bool() [template = bool]
  527. // CHECK:STDOUT: %.loc104_27.1: type = value_of_initializer %bool.make_type.loc104_27 [template = bool]
  528. // CHECK:STDOUT: %.loc104_27.2: type = converted %bool.make_type.loc104_27, %.loc104_27.1 [template = bool]
  529. // CHECK:STDOUT: %self.param: bool = value_param runtime_param0
  530. // CHECK:STDOUT: %.loc104_16.3: type = splice_block %.loc104_16.2 [template = bool] {
  531. // CHECK:STDOUT: %bool.make_type.loc104_16: init type = call constants.%Bool() [template = bool]
  532. // CHECK:STDOUT: %.loc104_16.1: type = value_of_initializer %bool.make_type.loc104_16 [template = bool]
  533. // CHECK:STDOUT: %.loc104_16.2: type = converted %bool.make_type.loc104_16, %.loc104_16.1 [template = bool]
  534. // CHECK:STDOUT: }
  535. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  536. // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1
  537. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  540. // CHECK:STDOUT:
  541. // CHECK:STDOUT: !members:
  542. // CHECK:STDOUT: .F = %F.decl
  543. // CHECK:STDOUT: witness = %interface
  544. // CHECK:STDOUT: }
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: impl @impl.8: %Self.ref as %J.ref {
  547. // CHECK:STDOUT: %F.decl: %F.type.7 = fn_decl @F.7 [template = constants.%F.8] {
  548. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  549. // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param0
  550. // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
  551. // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1
  552. // CHECK:STDOUT: } {
  553. // CHECK:STDOUT: %bool.make_type.loc117_22: init type = call constants.%Bool() [template = bool]
  554. // CHECK:STDOUT: %.loc117_22.1: type = value_of_initializer %bool.make_type.loc117_22 [template = bool]
  555. // CHECK:STDOUT: %.loc117_22.2: type = converted %bool.make_type.loc117_22, %.loc117_22.1 [template = bool]
  556. // CHECK:STDOUT: %b.param: bool = value_param runtime_param0
  557. // CHECK:STDOUT: %.loc117_13.3: type = splice_block %.loc117_13.2 [template = bool] {
  558. // CHECK:STDOUT: %bool.make_type.loc117_13: init type = call constants.%Bool() [template = bool]
  559. // CHECK:STDOUT: %.loc117_13.1: type = value_of_initializer %bool.make_type.loc117_13 [template = bool]
  560. // CHECK:STDOUT: %.loc117_13.2: type = converted %bool.make_type.loc117_13, %.loc117_13.1 [template = bool]
  561. // CHECK:STDOUT: }
  562. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  563. // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1
  564. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  565. // CHECK:STDOUT: }
  566. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: !members:
  569. // CHECK:STDOUT: .F = %F.decl
  570. // CHECK:STDOUT: witness = %interface
  571. // CHECK:STDOUT: }
  572. // CHECK:STDOUT:
  573. // CHECK:STDOUT: impl @impl.9: %Self.ref as %J.ref {
  574. // CHECK:STDOUT: %F.decl: %F.type.8 = fn_decl @F.8 [template = constants.%F.9] {
  575. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  576. // CHECK:STDOUT: %self.param_patt: bool = value_param_pattern %self.patt, runtime_param0
  577. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  578. // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1
  579. // CHECK:STDOUT: } {
  580. // CHECK:STDOUT: %self.param: bool = value_param runtime_param0
  581. // CHECK:STDOUT: %.loc130_16.3: type = splice_block %.loc130_16.2 [template = bool] {
  582. // CHECK:STDOUT: %bool.make_type.loc130_16: init type = call constants.%Bool() [template = bool]
  583. // CHECK:STDOUT: %.loc130_16.1: type = value_of_initializer %bool.make_type.loc130_16 [template = bool]
  584. // CHECK:STDOUT: %.loc130_16.2: type = converted %bool.make_type.loc130_16, %.loc130_16.1 [template = bool]
  585. // CHECK:STDOUT: }
  586. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  587. // CHECK:STDOUT: %b.param: bool = value_param runtime_param1
  588. // CHECK:STDOUT: %.loc130_25.3: type = splice_block %.loc130_25.2 [template = bool] {
  589. // CHECK:STDOUT: %bool.make_type.loc130_25: init type = call constants.%Bool() [template = bool]
  590. // CHECK:STDOUT: %.loc130_25.1: type = value_of_initializer %bool.make_type.loc130_25 [template = bool]
  591. // CHECK:STDOUT: %.loc130_25.2: type = converted %bool.make_type.loc130_25, %.loc130_25.1 [template = bool]
  592. // CHECK:STDOUT: }
  593. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  594. // CHECK:STDOUT: }
  595. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  596. // CHECK:STDOUT:
  597. // CHECK:STDOUT: !members:
  598. // CHECK:STDOUT: .F = %F.decl
  599. // CHECK:STDOUT: witness = %interface
  600. // CHECK:STDOUT: }
  601. // CHECK:STDOUT:
  602. // CHECK:STDOUT: impl @impl.10: %Self.ref as %J.ref {
  603. // CHECK:STDOUT: %F.decl: %F.type.9 = fn_decl @F.9 [template = constants.%F.10] {
  604. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  605. // CHECK:STDOUT: %self.param_patt: bool = value_param_pattern %self.patt, runtime_param0
  606. // CHECK:STDOUT: %b.patt: %FDifferentParamType = binding_pattern b
  607. // CHECK:STDOUT: %b.param_patt: %FDifferentParamType = value_param_pattern %b.patt, runtime_param1
  608. // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
  609. // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2
  610. // CHECK:STDOUT: } {
  611. // CHECK:STDOUT: %bool.make_type.loc143_34: init type = call constants.%Bool() [template = bool]
  612. // CHECK:STDOUT: %.loc143_34.1: type = value_of_initializer %bool.make_type.loc143_34 [template = bool]
  613. // CHECK:STDOUT: %.loc143_34.2: type = converted %bool.make_type.loc143_34, %.loc143_34.1 [template = bool]
  614. // CHECK:STDOUT: %self.param: bool = value_param runtime_param0
  615. // CHECK:STDOUT: %.loc143_16.3: type = splice_block %.loc143_16.2 [template = bool] {
  616. // CHECK:STDOUT: %bool.make_type.loc143_16: init type = call constants.%Bool() [template = bool]
  617. // CHECK:STDOUT: %.loc143_16.1: type = value_of_initializer %bool.make_type.loc143_16 [template = bool]
  618. // CHECK:STDOUT: %.loc143_16.2: type = converted %bool.make_type.loc143_16, %.loc143_16.1 [template = bool]
  619. // CHECK:STDOUT: }
  620. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  621. // CHECK:STDOUT: %b.param: %FDifferentParamType = value_param runtime_param1
  622. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType]
  623. // CHECK:STDOUT: %b: %FDifferentParamType = bind_name b, %b.param
  624. // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2
  625. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  626. // CHECK:STDOUT: }
  627. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  628. // CHECK:STDOUT:
  629. // CHECK:STDOUT: !members:
  630. // CHECK:STDOUT: .F = %F.decl
  631. // CHECK:STDOUT: witness = %interface
  632. // CHECK:STDOUT: }
  633. // CHECK:STDOUT:
  634. // CHECK:STDOUT: impl @impl.11: %Self.ref as %J.ref {
  635. // CHECK:STDOUT: %F.decl: %F.type.10 = fn_decl @F.10 [template = constants.%F.11] {
  636. // CHECK:STDOUT: %self.patt: %FDifferentImplicitParamType = binding_pattern self
  637. // CHECK:STDOUT: %self.param_patt: %FDifferentImplicitParamType = value_param_pattern %self.patt, runtime_param0
  638. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  639. // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1
  640. // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
  641. // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2
  642. // CHECK:STDOUT: } {
  643. // CHECK:STDOUT: %bool.make_type.loc156_34: init type = call constants.%Bool() [template = bool]
  644. // CHECK:STDOUT: %.loc156_34.1: type = value_of_initializer %bool.make_type.loc156_34 [template = bool]
  645. // CHECK:STDOUT: %.loc156_34.2: type = converted %bool.make_type.loc156_34, %.loc156_34.1 [template = bool]
  646. // CHECK:STDOUT: %self.param: %FDifferentImplicitParamType = value_param runtime_param0
  647. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType]
  648. // CHECK:STDOUT: %self: %FDifferentImplicitParamType = bind_name self, %self.param
  649. // CHECK:STDOUT: %b.param: bool = value_param runtime_param1
  650. // CHECK:STDOUT: %.loc156_25.3: type = splice_block %.loc156_25.2 [template = bool] {
  651. // CHECK:STDOUT: %bool.make_type.loc156_25: init type = call constants.%Bool() [template = bool]
  652. // CHECK:STDOUT: %.loc156_25.1: type = value_of_initializer %bool.make_type.loc156_25 [template = bool]
  653. // CHECK:STDOUT: %.loc156_25.2: type = converted %bool.make_type.loc156_25, %.loc156_25.1 [template = bool]
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  656. // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2
  657. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  658. // CHECK:STDOUT: }
  659. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  660. // CHECK:STDOUT:
  661. // CHECK:STDOUT: !members:
  662. // CHECK:STDOUT: .F = %F.decl
  663. // CHECK:STDOUT: witness = %interface
  664. // CHECK:STDOUT: }
  665. // CHECK:STDOUT:
  666. // CHECK:STDOUT: impl @impl.12: %Self.ref as %J.ref {
  667. // CHECK:STDOUT: %F.decl: %F.type.11 = fn_decl @F.11 [template = constants.%F.12] {
  668. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  669. // CHECK:STDOUT: %self.param_patt: bool = value_param_pattern %self.patt, runtime_param0
  670. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  671. // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1
  672. // CHECK:STDOUT: %return.patt: %FDifferentReturnType = return_slot_pattern
  673. // CHECK:STDOUT: %return.param_patt: %FDifferentReturnType = out_param_pattern %return.patt, runtime_param2
  674. // CHECK:STDOUT: } {
  675. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [template = constants.%FDifferentReturnType]
  676. // CHECK:STDOUT: %self.param: bool = value_param runtime_param0
  677. // CHECK:STDOUT: %.loc169_16.3: type = splice_block %.loc169_16.2 [template = bool] {
  678. // CHECK:STDOUT: %bool.make_type.loc169_16: init type = call constants.%Bool() [template = bool]
  679. // CHECK:STDOUT: %.loc169_16.1: type = value_of_initializer %bool.make_type.loc169_16 [template = bool]
  680. // CHECK:STDOUT: %.loc169_16.2: type = converted %bool.make_type.loc169_16, %.loc169_16.1 [template = bool]
  681. // CHECK:STDOUT: }
  682. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  683. // CHECK:STDOUT: %b.param: bool = value_param runtime_param1
  684. // CHECK:STDOUT: %.loc169_25.3: type = splice_block %.loc169_25.2 [template = bool] {
  685. // CHECK:STDOUT: %bool.make_type.loc169_25: init type = call constants.%Bool() [template = bool]
  686. // CHECK:STDOUT: %.loc169_25.1: type = value_of_initializer %bool.make_type.loc169_25 [template = bool]
  687. // CHECK:STDOUT: %.loc169_25.2: type = converted %bool.make_type.loc169_25, %.loc169_25.1 [template = bool]
  688. // CHECK:STDOUT: }
  689. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  690. // CHECK:STDOUT: %return.param: ref %FDifferentReturnType = out_param runtime_param2
  691. // CHECK:STDOUT: %return: ref %FDifferentReturnType = return_slot %return.param
  692. // CHECK:STDOUT: }
  693. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  694. // CHECK:STDOUT:
  695. // CHECK:STDOUT: !members:
  696. // CHECK:STDOUT: .F = %F.decl
  697. // CHECK:STDOUT: witness = %interface
  698. // CHECK:STDOUT: }
  699. // CHECK:STDOUT:
  700. // CHECK:STDOUT: impl @impl.13: %Self.ref as %J.ref {
  701. // CHECK:STDOUT: %F.decl: %F.type.12 = fn_decl @F.12 [template = constants.%F.13] {
  702. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  703. // CHECK:STDOUT: %self.param_patt: bool = value_param_pattern %self.patt, runtime_param0
  704. // CHECK:STDOUT: %not_b.patt: bool = binding_pattern not_b
  705. // CHECK:STDOUT: %not_b.param_patt: bool = value_param_pattern %not_b.patt, runtime_param1
  706. // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
  707. // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2
  708. // CHECK:STDOUT: } {
  709. // CHECK:STDOUT: %bool.make_type.loc183_38: init type = call constants.%Bool() [template = bool]
  710. // CHECK:STDOUT: %.loc183_38.1: type = value_of_initializer %bool.make_type.loc183_38 [template = bool]
  711. // CHECK:STDOUT: %.loc183_38.2: type = converted %bool.make_type.loc183_38, %.loc183_38.1 [template = bool]
  712. // CHECK:STDOUT: %self.param: bool = value_param runtime_param0
  713. // CHECK:STDOUT: %.loc183_16.3: type = splice_block %.loc183_16.2 [template = bool] {
  714. // CHECK:STDOUT: %bool.make_type.loc183_16: init type = call constants.%Bool() [template = bool]
  715. // CHECK:STDOUT: %.loc183_16.1: type = value_of_initializer %bool.make_type.loc183_16 [template = bool]
  716. // CHECK:STDOUT: %.loc183_16.2: type = converted %bool.make_type.loc183_16, %.loc183_16.1 [template = bool]
  717. // CHECK:STDOUT: }
  718. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  719. // CHECK:STDOUT: %not_b.param: bool = value_param runtime_param1
  720. // CHECK:STDOUT: %.loc183_29.3: type = splice_block %.loc183_29.2 [template = bool] {
  721. // CHECK:STDOUT: %bool.make_type.loc183_29: init type = call constants.%Bool() [template = bool]
  722. // CHECK:STDOUT: %.loc183_29.1: type = value_of_initializer %bool.make_type.loc183_29 [template = bool]
  723. // CHECK:STDOUT: %.loc183_29.2: type = converted %bool.make_type.loc183_29, %.loc183_29.1 [template = bool]
  724. // CHECK:STDOUT: }
  725. // CHECK:STDOUT: %not_b: bool = bind_name not_b, %not_b.param
  726. // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2
  727. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  728. // CHECK:STDOUT: }
  729. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  730. // CHECK:STDOUT:
  731. // CHECK:STDOUT: !members:
  732. // CHECK:STDOUT: .F = %F.decl
  733. // CHECK:STDOUT: witness = %interface
  734. // CHECK:STDOUT: }
  735. // CHECK:STDOUT:
  736. // CHECK:STDOUT: impl @impl.14: %Self.ref as %SelfNested.ref {
  737. // CHECK:STDOUT: %F.decl: %F.type.14 = fn_decl @F.14 [template = constants.%F.15] {
  738. // CHECK:STDOUT: %x.patt: %tuple.type.3 = binding_pattern x
  739. // CHECK:STDOUT: %x.param_patt: %tuple.type.3 = value_param_pattern %x.patt, runtime_param0
  740. // CHECK:STDOUT: %return.patt: %array_type.2 = return_slot_pattern
  741. // CHECK:STDOUT: %return.param_patt: %array_type.2 = out_param_pattern %return.patt, runtime_param1
  742. // CHECK:STDOUT: } {
  743. // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_60: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
  744. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4]
  745. // CHECK:STDOUT: %array_type: type = array_type %int_4, %SelfNestedBadParam [template = constants.%array_type.2]
  746. // CHECK:STDOUT: %x.param: %tuple.type.3 = value_param runtime_param0
  747. // CHECK:STDOUT: %.loc200_53.3: type = splice_block %.loc200_53.2 [template = constants.%tuple.type.3] {
  748. // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
  749. // CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadParam [template = constants.%ptr.2]
  750. // CHECK:STDOUT: %int_32.loc200_40: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  751. // CHECK:STDOUT: %i32.loc200_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  752. // CHECK:STDOUT: %int_32.loc200_49: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  753. // CHECK:STDOUT: %i32.loc200_49: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  754. // CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %i32, .y: %i32} [template = constants.%struct_type.x.y.2]
  755. // CHECK:STDOUT: %.loc200_53.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y)
  756. // CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%tuple.type.3 [template = constants.%tuple.type.3]
  757. // CHECK:STDOUT: }
  758. // CHECK:STDOUT: %x: %tuple.type.3 = bind_name x, %x.param
  759. // CHECK:STDOUT: %return.param: ref %array_type.2 = out_param runtime_param1
  760. // CHECK:STDOUT: %return: ref %array_type.2 = return_slot %return.param
  761. // CHECK:STDOUT: }
  762. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  763. // CHECK:STDOUT:
  764. // CHECK:STDOUT: !members:
  765. // CHECK:STDOUT: .F = %F.decl
  766. // CHECK:STDOUT: witness = %interface
  767. // CHECK:STDOUT: }
  768. // CHECK:STDOUT:
  769. // CHECK:STDOUT: impl @impl.15: %Self.ref as %SelfNested.ref {
  770. // CHECK:STDOUT: %F.decl: %F.type.15 = fn_decl @F.15 [template = constants.%F.16] {
  771. // CHECK:STDOUT: %x.patt: %tuple.type.5 = binding_pattern x
  772. // CHECK:STDOUT: %x.param_patt: %tuple.type.5 = value_param_pattern %x.patt, runtime_param0
  773. // CHECK:STDOUT: %return.patt: %array_type.2 = return_slot_pattern
  774. // CHECK:STDOUT: %return.param_patt: %array_type.2 = out_param_pattern %return.patt, runtime_param1
  775. // CHECK:STDOUT: } {
  776. // CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
  777. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4]
  778. // CHECK:STDOUT: %array_type: type = array_type %int_4, %SelfNestedBadParam [template = constants.%array_type.2]
  779. // CHECK:STDOUT: %x.param: %tuple.type.5 = value_param runtime_param0
  780. // CHECK:STDOUT: %.loc212_78.3: type = splice_block %.loc212_78.2 [template = constants.%tuple.type.5] {
  781. // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType]
  782. // CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadReturnType [template = constants.%ptr.3]
  783. // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType]
  784. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  785. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  786. // CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [template = constants.%struct_type.x.y.4]
  787. // CHECK:STDOUT: %.loc212_78.1: %tuple.type.1 = tuple_literal (%ptr, %struct_type.x.y)
  788. // CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%tuple.type.5 [template = constants.%tuple.type.5]
  789. // CHECK:STDOUT: }
  790. // CHECK:STDOUT: %x: %tuple.type.5 = bind_name x, %x.param
  791. // CHECK:STDOUT: %return.param: ref %array_type.2 = out_param runtime_param1
  792. // CHECK:STDOUT: %return: ref %array_type.2 = return_slot %return.param
  793. // CHECK:STDOUT: }
  794. // CHECK:STDOUT: %interface: <witness> = interface_witness (<error>) [template = <error>]
  795. // CHECK:STDOUT:
  796. // CHECK:STDOUT: !members:
  797. // CHECK:STDOUT: .F = %F.decl
  798. // CHECK:STDOUT: witness = %interface
  799. // CHECK:STDOUT: }
  800. // CHECK:STDOUT:
  801. // CHECK:STDOUT: class @NoF {
  802. // CHECK:STDOUT: impl_decl @impl.1 [template] {} {
  803. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%NoF [template = constants.%NoF]
  804. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  805. // CHECK:STDOUT: }
  806. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  807. // CHECK:STDOUT:
  808. // CHECK:STDOUT: !members:
  809. // CHECK:STDOUT: .Self = constants.%NoF
  810. // CHECK:STDOUT: complete_type_witness = %complete_type
  811. // CHECK:STDOUT: }
  812. // CHECK:STDOUT:
  813. // CHECK:STDOUT: class @FNotFunction {
  814. // CHECK:STDOUT: impl_decl @impl.2 [template] {} {
  815. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FNotFunction [template = constants.%FNotFunction]
  816. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  817. // CHECK:STDOUT: }
  818. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  819. // CHECK:STDOUT:
  820. // CHECK:STDOUT: !members:
  821. // CHECK:STDOUT: .Self = constants.%FNotFunction
  822. // CHECK:STDOUT: complete_type_witness = %complete_type
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT:
  825. // CHECK:STDOUT: class @F.16;
  826. // CHECK:STDOUT:
  827. // CHECK:STDOUT: class @FAlias {
  828. // CHECK:STDOUT: impl_decl @impl.3 [template] {} {
  829. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FAlias [template = constants.%FAlias]
  830. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  831. // CHECK:STDOUT: }
  832. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  833. // CHECK:STDOUT:
  834. // CHECK:STDOUT: !members:
  835. // CHECK:STDOUT: .Self = constants.%FAlias
  836. // CHECK:STDOUT: complete_type_witness = %complete_type
  837. // CHECK:STDOUT: }
  838. // CHECK:STDOUT:
  839. // CHECK:STDOUT: class @FExtraParam {
  840. // CHECK:STDOUT: impl_decl @impl.4 [template] {} {
  841. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraParam [template = constants.%FExtraParam]
  842. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  843. // CHECK:STDOUT: }
  844. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  845. // CHECK:STDOUT:
  846. // CHECK:STDOUT: !members:
  847. // CHECK:STDOUT: .Self = constants.%FExtraParam
  848. // CHECK:STDOUT: complete_type_witness = %complete_type
  849. // CHECK:STDOUT: }
  850. // CHECK:STDOUT:
  851. // CHECK:STDOUT: class @FExtraImplicitParam {
  852. // CHECK:STDOUT: impl_decl @impl.5 [template] {} {
  853. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam]
  854. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  855. // CHECK:STDOUT: }
  856. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  857. // CHECK:STDOUT:
  858. // CHECK:STDOUT: !members:
  859. // CHECK:STDOUT: .Self = constants.%FExtraImplicitParam
  860. // CHECK:STDOUT: complete_type_witness = %complete_type
  861. // CHECK:STDOUT: }
  862. // CHECK:STDOUT:
  863. // CHECK:STDOUT: class @FExtraReturnType {
  864. // CHECK:STDOUT: impl_decl @impl.6 [template] {} {
  865. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraReturnType [template = constants.%FExtraReturnType]
  866. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  867. // CHECK:STDOUT: }
  868. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  869. // CHECK:STDOUT:
  870. // CHECK:STDOUT: !members:
  871. // CHECK:STDOUT: .Self = constants.%FExtraReturnType
  872. // CHECK:STDOUT: complete_type_witness = %complete_type
  873. // CHECK:STDOUT: }
  874. // CHECK:STDOUT:
  875. // CHECK:STDOUT: class @FMissingParam {
  876. // CHECK:STDOUT: impl_decl @impl.7 [template] {} {
  877. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingParam [template = constants.%FMissingParam]
  878. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type]
  879. // CHECK:STDOUT: }
  880. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  881. // CHECK:STDOUT:
  882. // CHECK:STDOUT: !members:
  883. // CHECK:STDOUT: .Self = constants.%FMissingParam
  884. // CHECK:STDOUT: complete_type_witness = %complete_type
  885. // CHECK:STDOUT: }
  886. // CHECK:STDOUT:
  887. // CHECK:STDOUT: class @FMissingImplicitParam {
  888. // CHECK:STDOUT: impl_decl @impl.8 [template] {} {
  889. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingImplicitParam [template = constants.%FMissingImplicitParam]
  890. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type]
  891. // CHECK:STDOUT: }
  892. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  893. // CHECK:STDOUT:
  894. // CHECK:STDOUT: !members:
  895. // CHECK:STDOUT: .Self = constants.%FMissingImplicitParam
  896. // CHECK:STDOUT: complete_type_witness = %complete_type
  897. // CHECK:STDOUT: }
  898. // CHECK:STDOUT:
  899. // CHECK:STDOUT: class @FMissingReturnType {
  900. // CHECK:STDOUT: impl_decl @impl.9 [template] {} {
  901. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingReturnType [template = constants.%FMissingReturnType]
  902. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type]
  903. // CHECK:STDOUT: }
  904. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  905. // CHECK:STDOUT:
  906. // CHECK:STDOUT: !members:
  907. // CHECK:STDOUT: .Self = constants.%FMissingReturnType
  908. // CHECK:STDOUT: complete_type_witness = %complete_type
  909. // CHECK:STDOUT: }
  910. // CHECK:STDOUT:
  911. // CHECK:STDOUT: class @FDifferentParamType {
  912. // CHECK:STDOUT: impl_decl @impl.10 [template] {} {
  913. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType]
  914. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type]
  915. // CHECK:STDOUT: }
  916. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: !members:
  919. // CHECK:STDOUT: .Self = constants.%FDifferentParamType
  920. // CHECK:STDOUT: complete_type_witness = %complete_type
  921. // CHECK:STDOUT: }
  922. // CHECK:STDOUT:
  923. // CHECK:STDOUT: class @FDifferentImplicitParamType {
  924. // CHECK:STDOUT: impl_decl @impl.11 [template] {} {
  925. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType]
  926. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type]
  927. // CHECK:STDOUT: }
  928. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  929. // CHECK:STDOUT:
  930. // CHECK:STDOUT: !members:
  931. // CHECK:STDOUT: .Self = constants.%FDifferentImplicitParamType
  932. // CHECK:STDOUT: complete_type_witness = %complete_type
  933. // CHECK:STDOUT: }
  934. // CHECK:STDOUT:
  935. // CHECK:STDOUT: class @FDifferentReturnType {
  936. // CHECK:STDOUT: impl_decl @impl.12 [template] {} {
  937. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [template = constants.%FDifferentReturnType]
  938. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type]
  939. // CHECK:STDOUT: }
  940. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  941. // CHECK:STDOUT:
  942. // CHECK:STDOUT: !members:
  943. // CHECK:STDOUT: .Self = constants.%FDifferentReturnType
  944. // CHECK:STDOUT: complete_type_witness = %complete_type
  945. // CHECK:STDOUT: }
  946. // CHECK:STDOUT:
  947. // CHECK:STDOUT: class @FDifferentParamName {
  948. // CHECK:STDOUT: impl_decl @impl.13 [template] {} {
  949. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamName [template = constants.%FDifferentParamName]
  950. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%J.type]
  951. // CHECK:STDOUT: }
  952. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  953. // CHECK:STDOUT:
  954. // CHECK:STDOUT: !members:
  955. // CHECK:STDOUT: .Self = constants.%FDifferentParamName
  956. // CHECK:STDOUT: complete_type_witness = %complete_type
  957. // CHECK:STDOUT: }
  958. // CHECK:STDOUT:
  959. // CHECK:STDOUT: class @SelfNestedBadParam {
  960. // CHECK:STDOUT: impl_decl @impl.14 [template] {} {
  961. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadParam [template = constants.%SelfNestedBadParam]
  962. // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type]
  963. // CHECK:STDOUT: }
  964. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  965. // CHECK:STDOUT:
  966. // CHECK:STDOUT: !members:
  967. // CHECK:STDOUT: .Self = constants.%SelfNestedBadParam
  968. // CHECK:STDOUT: complete_type_witness = %complete_type
  969. // CHECK:STDOUT: }
  970. // CHECK:STDOUT:
  971. // CHECK:STDOUT: class @SelfNestedBadReturnType {
  972. // CHECK:STDOUT: impl_decl @impl.15 [template] {} {
  973. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType]
  974. // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%SelfNested.type]
  975. // CHECK:STDOUT: }
  976. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.1]
  977. // CHECK:STDOUT:
  978. // CHECK:STDOUT: !members:
  979. // CHECK:STDOUT: .Self = constants.%SelfNestedBadReturnType
  980. // CHECK:STDOUT: complete_type_witness = %complete_type
  981. // CHECK:STDOUT: }
  982. // CHECK:STDOUT:
  983. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  984. // CHECK:STDOUT:
  985. // CHECK:STDOUT: fn();
  986. // CHECK:STDOUT: }
  987. // CHECK:STDOUT:
  988. // CHECK:STDOUT: fn @PossiblyF();
  989. // CHECK:STDOUT:
  990. // CHECK:STDOUT: fn @F.2(%b.param_patt: bool);
  991. // CHECK:STDOUT:
  992. // CHECK:STDOUT: fn @F.3[%self.param_patt: %FExtraImplicitParam]();
  993. // CHECK:STDOUT:
  994. // CHECK:STDOUT: fn @F.4() -> bool;
  995. // CHECK:STDOUT:
  996. // CHECK:STDOUT: generic fn @F.5(@J.%Self: %J.type) {
  997. // CHECK:STDOUT:
  998. // CHECK:STDOUT: fn[%self.param_patt: bool](%b.param_patt: bool) -> bool;
  999. // CHECK:STDOUT: }
  1000. // CHECK:STDOUT:
  1001. // CHECK:STDOUT: fn @F.6[%self.param_patt: bool]() -> bool;
  1002. // CHECK:STDOUT:
  1003. // CHECK:STDOUT: fn @F.7(%b.param_patt: bool) -> bool;
  1004. // CHECK:STDOUT:
  1005. // CHECK:STDOUT: fn @F.8[%self.param_patt: bool](%b.param_patt: bool);
  1006. // CHECK:STDOUT:
  1007. // CHECK:STDOUT: fn @F.9[%self.param_patt: bool](%b.param_patt: %FDifferentParamType) -> bool;
  1008. // CHECK:STDOUT:
  1009. // CHECK:STDOUT: fn @F.10[%self.param_patt: %FDifferentImplicitParamType](%b.param_patt: bool) -> bool;
  1010. // CHECK:STDOUT:
  1011. // CHECK:STDOUT: fn @F.11[%self.param_patt: bool](%b.param_patt: bool) -> %FDifferentReturnType;
  1012. // CHECK:STDOUT:
  1013. // CHECK:STDOUT: fn @F.12[%self.param_patt: bool](%not_b.param_patt: bool) -> bool;
  1014. // CHECK:STDOUT:
  1015. // CHECK:STDOUT: generic fn @F.13(@SelfNested.%Self: %SelfNested.type) {
  1016. // CHECK:STDOUT: %Self: %SelfNested.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.3)]
  1017. // CHECK:STDOUT: %Self.as_type.loc188_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc188_16.1 (constants.%Self.as_type)]
  1018. // CHECK:STDOUT: %ptr.loc188_16.1: type = ptr_type @F.13.%Self.as_type.loc188_16.1 (%Self.as_type) [symbolic = %ptr.loc188_16.1 (constants.%ptr.1)]
  1019. // CHECK:STDOUT: %struct_type.x.y.loc188_37.1: type = struct_type {.x: @F.13.%Self.as_type.loc188_16.1 (%Self.as_type), .y: %i32} [symbolic = %struct_type.x.y.loc188_37.1 (constants.%struct_type.x.y.1)]
  1020. // CHECK:STDOUT: %tuple.type: type = tuple_type (@F.13.%ptr.loc188_16.1 (%ptr.1), @F.13.%struct_type.x.y.loc188_37.1 (%struct_type.x.y.1)) [symbolic = %tuple.type (constants.%tuple.type.2)]
  1021. // CHECK:STDOUT: %array_type.loc188_52.1: type = array_type constants.%int_4, @F.13.%Self.as_type.loc188_16.1 (%Self.as_type) [symbolic = %array_type.loc188_52.1 (constants.%array_type.1)]
  1022. // CHECK:STDOUT:
  1023. // CHECK:STDOUT: fn(%x.param_patt: @F.13.%tuple.type (%tuple.type.2)) -> @F.13.%array_type.loc188_52.1 (%array_type.1);
  1024. // CHECK:STDOUT: }
  1025. // CHECK:STDOUT:
  1026. // CHECK:STDOUT: fn @F.14(%x.param_patt: %tuple.type.3) -> %array_type.2;
  1027. // CHECK:STDOUT:
  1028. // CHECK:STDOUT: fn @F.15(%x.param_patt: %tuple.type.5) -> %array_type.2;
  1029. // CHECK:STDOUT:
  1030. // CHECK:STDOUT: specific @F.1(constants.%Self.1) {}
  1031. // CHECK:STDOUT:
  1032. // CHECK:STDOUT: specific @F.1(constants.%I.facet.1) {}
  1033. // CHECK:STDOUT:
  1034. // CHECK:STDOUT: specific @F.1(constants.%I.facet.2) {}
  1035. // CHECK:STDOUT:
  1036. // CHECK:STDOUT: specific @F.1(constants.%I.facet.3) {}
  1037. // CHECK:STDOUT:
  1038. // CHECK:STDOUT: specific @F.5(constants.%Self.2) {}
  1039. // CHECK:STDOUT:
  1040. // CHECK:STDOUT: specific @F.5(constants.%J.facet.1) {}
  1041. // CHECK:STDOUT:
  1042. // CHECK:STDOUT: specific @F.5(constants.%J.facet.2) {}
  1043. // CHECK:STDOUT:
  1044. // CHECK:STDOUT: specific @F.5(constants.%J.facet.3) {}
  1045. // CHECK:STDOUT:
  1046. // CHECK:STDOUT: specific @F.5(constants.%J.facet.4) {}
  1047. // CHECK:STDOUT:
  1048. // CHECK:STDOUT: specific @F.5(constants.%J.facet.5) {}
  1049. // CHECK:STDOUT:
  1050. // CHECK:STDOUT: specific @F.5(constants.%J.facet.6) {}
  1051. // CHECK:STDOUT:
  1052. // CHECK:STDOUT: specific @F.5(constants.%J.facet.7) {}
  1053. // CHECK:STDOUT:
  1054. // CHECK:STDOUT: specific @F.13(constants.%Self.3) {
  1055. // CHECK:STDOUT: %Self => constants.%Self.3
  1056. // CHECK:STDOUT: %Self.as_type.loc188_16.1 => constants.%Self.as_type
  1057. // CHECK:STDOUT: %ptr.loc188_16.1 => constants.%ptr.1
  1058. // CHECK:STDOUT: %struct_type.x.y.loc188_37.1 => constants.%struct_type.x.y.1
  1059. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.2
  1060. // CHECK:STDOUT: %array_type.loc188_52.1 => constants.%array_type.1
  1061. // CHECK:STDOUT: }
  1062. // CHECK:STDOUT:
  1063. // CHECK:STDOUT: specific @F.13(constants.%SelfNested.facet.1) {
  1064. // CHECK:STDOUT: %Self => constants.%SelfNested.facet.1
  1065. // CHECK:STDOUT: %Self.as_type.loc188_16.1 => constants.%SelfNestedBadParam
  1066. // CHECK:STDOUT: %ptr.loc188_16.1 => constants.%ptr.2
  1067. // CHECK:STDOUT: %struct_type.x.y.loc188_37.1 => constants.%struct_type.x.y.3
  1068. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.4
  1069. // CHECK:STDOUT: %array_type.loc188_52.1 => constants.%array_type.2
  1070. // CHECK:STDOUT: }
  1071. // CHECK:STDOUT:
  1072. // CHECK:STDOUT: specific @F.13(constants.%SelfNested.facet.2) {
  1073. // CHECK:STDOUT: %Self => constants.%SelfNested.facet.2
  1074. // CHECK:STDOUT: %Self.as_type.loc188_16.1 => constants.%SelfNestedBadReturnType
  1075. // CHECK:STDOUT: %ptr.loc188_16.1 => constants.%ptr.3
  1076. // CHECK:STDOUT: %struct_type.x.y.loc188_37.1 => constants.%struct_type.x.y.4
  1077. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.5
  1078. // CHECK:STDOUT: %array_type.loc188_52.1 => constants.%array_type.3
  1079. // CHECK:STDOUT: }
  1080. // CHECK:STDOUT: