fail_impl_bad_assoc_fn.carbon 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  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. interface I { fn F(); }
  7. class NoF {
  8. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:3: ERROR: Missing implementation of F in impl of interface I.
  9. // CHECK:STDERR: impl as I {}
  10. // CHECK:STDERR: ^~~~~~~~~~~
  11. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: Associated function F declared here.
  12. // CHECK:STDERR: interface I { fn F(); }
  13. // CHECK:STDERR: ^~~~~~~
  14. // CHECK:STDERR:
  15. impl as I {}
  16. }
  17. class FNotFunction {
  18. impl as I {
  19. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Associated function F implemented by non-function.
  20. // CHECK:STDERR: class F;
  21. // CHECK:STDERR: ^~~~~~~~
  22. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: Associated function F declared here.
  23. // CHECK:STDERR: interface I { fn F(); }
  24. // CHECK:STDERR: ^~~~~~~
  25. // CHECK:STDERR:
  26. class F;
  27. }
  28. }
  29. fn PossiblyF();
  30. // TODO: Should this be permitted?
  31. class FAlias {
  32. impl as I {
  33. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:11: ERROR: Associated function F implemented by non-function.
  34. // CHECK:STDERR: alias F = PossiblyF;
  35. // CHECK:STDERR: ^
  36. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: Associated function F declared here.
  37. // CHECK:STDERR: interface I { fn F(); }
  38. // CHECK:STDERR: ^~~~~~~
  39. // CHECK:STDERR:
  40. alias F = PossiblyF;
  41. }
  42. }
  43. class FExtraParam {
  44. impl as I {
  45. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because of parameter count of 1.
  46. // CHECK:STDERR: fn F(b: bool);
  47. // CHECK:STDERR: ^~~~~~~~~~~~~~
  48. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: Previously declared with parameter count of 0.
  49. // CHECK:STDERR: interface I { fn F(); }
  50. // CHECK:STDERR: ^~~~~~~
  51. // CHECK:STDERR:
  52. fn F(b: bool);
  53. }
  54. }
  55. class FExtraImplicitParam {
  56. impl as I {
  57. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because of implicit parameter count of 1.
  58. // CHECK:STDERR: fn F[self: Self]();
  59. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
  60. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: Previously declared with implicit parameter count of 0.
  61. // CHECK:STDERR: interface I { fn F(); }
  62. // CHECK:STDERR: ^~~~~~~
  63. // CHECK:STDERR:
  64. fn F[self: Self]();
  65. }
  66. }
  67. // TODO: Should this be permitted?
  68. class FExtraReturnType {
  69. impl as I {
  70. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because return type is `bool`.
  71. // CHECK:STDERR: fn F() -> bool;
  72. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  73. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: Previously declared with no return type.
  74. // CHECK:STDERR: interface I { fn F(); }
  75. // CHECK:STDERR: ^~~~~~~
  76. // CHECK:STDERR:
  77. fn F() -> bool;
  78. }
  79. }
  80. interface J { fn F[self: bool](b: bool) -> bool; }
  81. class FMissingParam {
  82. impl as J {
  83. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because of parameter count of 0.
  84. // CHECK:STDERR: fn F[self: bool]() -> bool;
  85. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: Previously declared with parameter count of 1.
  87. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  88. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  89. // CHECK:STDERR:
  90. fn F[self: bool]() -> bool;
  91. }
  92. }
  93. class FMissingImplicitParam {
  94. impl as J {
  95. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because of implicit parameter count of 0.
  96. // CHECK:STDERR: fn F(b: bool) -> bool;
  97. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
  98. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: Previously declared with implicit parameter count of 1.
  99. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  100. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101. // CHECK:STDERR:
  102. fn F(b: bool) -> bool;
  103. }
  104. }
  105. class FMissingReturnType {
  106. impl as J {
  107. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because no return type is provided.
  108. // CHECK:STDERR: fn F[self: bool](b: bool);
  109. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  110. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: Previously declared with return type `bool`.
  111. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  112. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  113. // CHECK:STDERR:
  114. fn F[self: bool](b: bool);
  115. }
  116. }
  117. class FDifferentParamType {
  118. impl as J {
  119. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: ERROR: Function redeclaration differs at parameter 1.
  120. // CHECK:STDERR: fn F[self: bool](b: Self) -> bool;
  121. // CHECK:STDERR: ^
  122. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: Previous declaration's corresponding parameter here.
  123. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  124. // CHECK:STDERR: ^
  125. // CHECK:STDERR:
  126. fn F[self: bool](b: Self) -> bool;
  127. }
  128. }
  129. class FDifferentImplicitParamType {
  130. impl as J {
  131. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: ERROR: Function redeclaration differs at implicit parameter 1.
  132. // CHECK:STDERR: fn F[self: Self](b: bool) -> bool;
  133. // CHECK:STDERR: ^~~~
  134. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: Previous declaration's corresponding implicit parameter here.
  135. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  136. // CHECK:STDERR: ^~~~
  137. // CHECK:STDERR:
  138. fn F[self: Self](b: bool) -> bool;
  139. }
  140. }
  141. class FDifferentReturnType {
  142. impl as J {
  143. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:31: ERROR: Function returns incomplete type `FDifferentReturnType`.
  144. // CHECK:STDERR: fn F[self: bool](b: bool) -> Self;
  145. // CHECK:STDERR: ^~~~~~~
  146. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-5]]:1: Class is incomplete within its definition.
  147. // CHECK:STDERR: class FDifferentReturnType {
  148. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  149. // CHECK:STDERR:
  150. fn F[self: bool](b: bool) -> Self;
  151. }
  152. }
  153. // TODO: This should probably be permitted.
  154. class FDifferentParamName {
  155. impl as J {
  156. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: ERROR: Function redeclaration differs at parameter 1.
  157. // CHECK:STDERR: fn F[self: bool](not_b: bool) -> bool;
  158. // CHECK:STDERR: ^~~~~
  159. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: Previous declaration's corresponding parameter here.
  160. // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; }
  161. // CHECK:STDERR: ^
  162. // CHECK:STDERR:
  163. fn F[self: bool](not_b: bool) -> bool;
  164. }
  165. }
  166. interface SelfNested {
  167. fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4];
  168. }
  169. class SelfNestedBadParam {
  170. impl as SelfNested {
  171. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:56: ERROR: Function returns incomplete type `[SelfNestedBadParam; 4]`.
  172. // CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4];
  173. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  174. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-5]]:1: Class is incomplete within its definition.
  175. // CHECK:STDERR: class SelfNestedBadParam {
  176. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  177. // CHECK:STDERR:
  178. fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4];
  179. }
  180. }
  181. class SelfNestedBadReturnType {
  182. impl as SelfNested {
  183. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: ERROR: Function redeclaration differs because return type is `[SelfNestedBadParam; 4]`.
  184. // CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4];
  185. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  186. // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: Previously declared with return type `[SelfNestedBadReturnType; 4]`.
  187. // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4];
  188. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  189. fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4];
  190. }
  191. }
  192. // CHECK:STDOUT: --- fail_impl_bad_assoc_fn.carbon
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: constants {
  195. // CHECK:STDOUT: %.1: type = interface_type @I [template]
  196. // CHECK:STDOUT: %.2: type = assoc_entity_type @I, <function> [template]
  197. // CHECK:STDOUT: %.3: <associated <function> in I> = assoc_entity element0, @I.%F [template]
  198. // CHECK:STDOUT: %NoF: type = class_type @NoF [template]
  199. // CHECK:STDOUT: %.4: type = struct_type {} [template]
  200. // CHECK:STDOUT: %FNotFunction: type = class_type @FNotFunction [template]
  201. // CHECK:STDOUT: %F: type = class_type @F.16 [template]
  202. // CHECK:STDOUT: %FAlias: type = class_type @FAlias [template]
  203. // CHECK:STDOUT: %FExtraParam: type = class_type @FExtraParam [template]
  204. // CHECK:STDOUT: %FExtraImplicitParam: type = class_type @FExtraImplicitParam [template]
  205. // CHECK:STDOUT: %FExtraReturnType: type = class_type @FExtraReturnType [template]
  206. // CHECK:STDOUT: %.5: type = interface_type @J [template]
  207. // CHECK:STDOUT: %.6: type = assoc_entity_type @J, <function> [template]
  208. // CHECK:STDOUT: %.7: <associated <function> in J> = assoc_entity element0, @J.%F [template]
  209. // CHECK:STDOUT: %FMissingParam: type = class_type @FMissingParam [template]
  210. // CHECK:STDOUT: %FMissingImplicitParam: type = class_type @FMissingImplicitParam [template]
  211. // CHECK:STDOUT: %FMissingReturnType: type = class_type @FMissingReturnType [template]
  212. // CHECK:STDOUT: %FDifferentParamType: type = class_type @FDifferentParamType [template]
  213. // CHECK:STDOUT: %FDifferentImplicitParamType: type = class_type @FDifferentImplicitParamType [template]
  214. // CHECK:STDOUT: %FDifferentReturnType: type = class_type @FDifferentReturnType [template]
  215. // CHECK:STDOUT: %FDifferentParamName: type = class_type @FDifferentParamName [template]
  216. // CHECK:STDOUT: %.8: type = interface_type @SelfNested [template]
  217. // CHECK:STDOUT: %.9: type = ptr_type Self [symbolic]
  218. // CHECK:STDOUT: %.10: type = struct_type {.x: Self, .y: i32} [symbolic]
  219. // CHECK:STDOUT: %.11: type = tuple_type (type, type) [template]
  220. // CHECK:STDOUT: %.12: type = tuple_type (Self*, {.x: Self, .y: i32}) [symbolic]
  221. // CHECK:STDOUT: %.13: i32 = int_literal 4 [template]
  222. // CHECK:STDOUT: %.14: type = array_type %.13, Self [symbolic]
  223. // CHECK:STDOUT: %.15: type = ptr_type [Self; 4] [symbolic]
  224. // CHECK:STDOUT: %.16: type = assoc_entity_type @SelfNested, <function> [template]
  225. // CHECK:STDOUT: %.17: <associated <function> in SelfNested> = assoc_entity element0, @SelfNested.%F [template]
  226. // CHECK:STDOUT: %SelfNestedBadParam: type = class_type @SelfNestedBadParam [template]
  227. // CHECK:STDOUT: %.18: type = ptr_type SelfNestedBadParam [template]
  228. // CHECK:STDOUT: %.19: type = struct_type {.x: i32, .y: i32} [template]
  229. // CHECK:STDOUT: %.20: type = tuple_type (SelfNestedBadParam*, {.x: i32, .y: i32}) [template]
  230. // CHECK:STDOUT: %.21: type = array_type %.13, SelfNestedBadParam [template]
  231. // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [template]
  232. // CHECK:STDOUT: %.22: type = ptr_type SelfNestedBadReturnType [template]
  233. // CHECK:STDOUT: %.23: type = struct_type {.x: SelfNestedBadReturnType, .y: i32} [template]
  234. // CHECK:STDOUT: %.24: type = tuple_type (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32}) [template]
  235. // CHECK:STDOUT: %.25: type = tuple_type () [template]
  236. // CHECK:STDOUT: %.26: type = ptr_type {} [template]
  237. // CHECK:STDOUT: %.27: type = ptr_type [SelfNestedBadParam; 4] [template]
  238. // CHECK:STDOUT: %.28: type = array_type %.13, SelfNestedBadReturnType [template]
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: file {
  242. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  243. // CHECK:STDOUT: .I = %I.decl
  244. // CHECK:STDOUT: .NoF = %NoF.decl
  245. // CHECK:STDOUT: .FNotFunction = %FNotFunction.decl
  246. // CHECK:STDOUT: .PossiblyF = %PossiblyF
  247. // CHECK:STDOUT: .FAlias = %FAlias.decl
  248. // CHECK:STDOUT: .FExtraParam = %FExtraParam.decl
  249. // CHECK:STDOUT: .FExtraImplicitParam = %FExtraImplicitParam.decl
  250. // CHECK:STDOUT: .FExtraReturnType = %FExtraReturnType.decl
  251. // CHECK:STDOUT: .J = %J.decl
  252. // CHECK:STDOUT: .FMissingParam = %FMissingParam.decl
  253. // CHECK:STDOUT: .FMissingImplicitParam = %FMissingImplicitParam.decl
  254. // CHECK:STDOUT: .FMissingReturnType = %FMissingReturnType.decl
  255. // CHECK:STDOUT: .FDifferentParamType = %FDifferentParamType.decl
  256. // CHECK:STDOUT: .FDifferentImplicitParamType = %FDifferentImplicitParamType.decl
  257. // CHECK:STDOUT: .FDifferentReturnType = %FDifferentReturnType.decl
  258. // CHECK:STDOUT: .FDifferentParamName = %FDifferentParamName.decl
  259. // CHECK:STDOUT: .SelfNested = %SelfNested.decl
  260. // CHECK:STDOUT: .SelfNestedBadParam = %SelfNestedBadParam.decl
  261. // CHECK:STDOUT: .SelfNestedBadReturnType = %SelfNestedBadReturnType.decl
  262. // CHECK:STDOUT: }
  263. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {}
  264. // CHECK:STDOUT: %NoF.decl: type = class_decl @NoF [template = constants.%NoF] {}
  265. // CHECK:STDOUT: %FNotFunction.decl: type = class_decl @FNotFunction [template = constants.%FNotFunction] {}
  266. // CHECK:STDOUT: %PossiblyF: <function> = fn_decl @PossiblyF [template] {}
  267. // CHECK:STDOUT: %FAlias.decl: type = class_decl @FAlias [template = constants.%FAlias] {}
  268. // CHECK:STDOUT: %FExtraParam.decl: type = class_decl @FExtraParam [template = constants.%FExtraParam] {}
  269. // CHECK:STDOUT: %FExtraImplicitParam.decl: type = class_decl @FExtraImplicitParam [template = constants.%FExtraImplicitParam] {}
  270. // CHECK:STDOUT: %FExtraReturnType.decl: type = class_decl @FExtraReturnType [template = constants.%FExtraReturnType] {}
  271. // CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.5] {}
  272. // CHECK:STDOUT: %FMissingParam.decl: type = class_decl @FMissingParam [template = constants.%FMissingParam] {}
  273. // CHECK:STDOUT: %FMissingImplicitParam.decl: type = class_decl @FMissingImplicitParam [template = constants.%FMissingImplicitParam] {}
  274. // CHECK:STDOUT: %FMissingReturnType.decl: type = class_decl @FMissingReturnType [template = constants.%FMissingReturnType] {}
  275. // CHECK:STDOUT: %FDifferentParamType.decl: type = class_decl @FDifferentParamType [template = constants.%FDifferentParamType] {}
  276. // CHECK:STDOUT: %FDifferentImplicitParamType.decl: type = class_decl @FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] {}
  277. // CHECK:STDOUT: %FDifferentReturnType.decl: type = class_decl @FDifferentReturnType [template = constants.%FDifferentReturnType] {}
  278. // CHECK:STDOUT: %FDifferentParamName.decl: type = class_decl @FDifferentParamName [template = constants.%FDifferentParamName] {}
  279. // CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.8] {}
  280. // CHECK:STDOUT: %SelfNestedBadParam.decl: type = class_decl @SelfNestedBadParam [template = constants.%SelfNestedBadParam] {}
  281. // CHECK:STDOUT: %SelfNestedBadReturnType.decl: type = class_decl @SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] {}
  282. // CHECK:STDOUT: }
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: interface @I {
  285. // CHECK:STDOUT: %Self: I = bind_symbolic_name Self [symbolic]
  286. // CHECK:STDOUT: %F: <function> = fn_decl @F.1 [template] {}
  287. // CHECK:STDOUT: %.loc7: <associated <function> in I> = assoc_entity element0, %F [template = constants.%.3]
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: !members:
  290. // CHECK:STDOUT: .Self = %Self
  291. // CHECK:STDOUT: .F = %.loc7
  292. // CHECK:STDOUT: witness = (%F)
  293. // CHECK:STDOUT: }
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: interface @J {
  296. // CHECK:STDOUT: %Self: J = bind_symbolic_name Self [symbolic]
  297. // CHECK:STDOUT: %F: <function> = fn_decl @F.5 [template] {
  298. // CHECK:STDOUT: %self.loc89_20.1: bool = param self
  299. // CHECK:STDOUT: %self.loc89_20.2: bool = bind_name self, %self.loc89_20.1
  300. // CHECK:STDOUT: %b.loc89_32.1: bool = param b
  301. // CHECK:STDOUT: %b.loc89_32.2: bool = bind_name b, %b.loc89_32.1
  302. // CHECK:STDOUT: %return.var: ref bool = var <return slot>
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT: %.loc89: <associated <function> in J> = assoc_entity element0, %F [template = constants.%.7]
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: !members:
  307. // CHECK:STDOUT: .Self = %Self
  308. // CHECK:STDOUT: .F = %.loc89
  309. // CHECK:STDOUT: witness = (%F)
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: interface @SelfNested {
  313. // CHECK:STDOUT: %Self: SelfNested = bind_symbolic_name Self [symbolic]
  314. // CHECK:STDOUT: %F: <function> = fn_decl @F.13 [template] {
  315. // CHECK:STDOUT: %Self.ref.loc184_12: SelfNested = name_ref Self, %Self [symbolic = %Self]
  316. // CHECK:STDOUT: %.loc184_16.1: type = facet_type_access %Self.ref.loc184_12 [symbolic = %Self]
  317. // CHECK:STDOUT: %.loc184_12: type = converted %Self.ref.loc184_12, %.loc184_16.1 [symbolic = %Self]
  318. // CHECK:STDOUT: %.loc184_16.2: type = ptr_type Self [symbolic = constants.%.9]
  319. // CHECK:STDOUT: %Self.ref.loc184_24: SelfNested = name_ref Self, %Self [symbolic = %Self]
  320. // CHECK:STDOUT: %.loc184_24.1: type = facet_type_access %Self.ref.loc184_24 [symbolic = %Self]
  321. // CHECK:STDOUT: %.loc184_24.2: type = converted %Self.ref.loc184_24, %.loc184_24.1 [symbolic = %Self]
  322. // CHECK:STDOUT: %.loc184_37: type = struct_type {.x: Self, .y: i32} [symbolic = constants.%.10]
  323. // CHECK:STDOUT: %.loc184_38.1: (type, type) = tuple_literal (%.loc184_16.2, %.loc184_37)
  324. // CHECK:STDOUT: %.loc184_38.2: type = converted %.loc184_38.1, constants.%.12 [symbolic = constants.%.12]
  325. // CHECK:STDOUT: %x.loc184_8.1: (Self*, {.x: Self, .y: i32}) = param x
  326. // CHECK:STDOUT: %x.loc184_8.2: (Self*, {.x: Self, .y: i32}) = bind_name x, %x.loc184_8.1
  327. // CHECK:STDOUT: %Self.ref.loc184_45: SelfNested = name_ref Self, %Self [symbolic = %Self]
  328. // CHECK:STDOUT: %.loc184_51: i32 = int_literal 4 [template = constants.%.13]
  329. // CHECK:STDOUT: %.loc184_45.1: type = facet_type_access %Self.ref.loc184_45 [symbolic = %Self]
  330. // CHECK:STDOUT: %.loc184_45.2: type = converted %Self.ref.loc184_45, %.loc184_45.1 [symbolic = %Self]
  331. // CHECK:STDOUT: %.loc184_52: type = array_type %.loc184_51, Self [symbolic = constants.%.14]
  332. // CHECK:STDOUT: %return.var: ref [Self; 4] = var <return slot>
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT: %.loc184_53: <associated <function> in SelfNested> = assoc_entity element0, %F [template = constants.%.17]
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: !members:
  337. // CHECK:STDOUT: .Self = %Self
  338. // CHECK:STDOUT: .F = %.loc184_53
  339. // CHECK:STDOUT: witness = (%F)
  340. // CHECK:STDOUT: }
  341. // CHECK:STDOUT:
  342. // CHECK:STDOUT: impl @impl.1: NoF as I {
  343. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  344. // CHECK:STDOUT:
  345. // CHECK:STDOUT: !members:
  346. // CHECK:STDOUT: witness = %.1
  347. // CHECK:STDOUT: }
  348. // CHECK:STDOUT:
  349. // CHECK:STDOUT: impl @impl.2: FNotFunction as I {
  350. // CHECK:STDOUT: %F.decl: type = class_decl @F.16 [template = constants.%F] {}
  351. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  352. // CHECK:STDOUT:
  353. // CHECK:STDOUT: !members:
  354. // CHECK:STDOUT: .F = %F.decl
  355. // CHECK:STDOUT: witness = %.1
  356. // CHECK:STDOUT: }
  357. // CHECK:STDOUT:
  358. // CHECK:STDOUT: impl @impl.3: FAlias as I {
  359. // CHECK:STDOUT: %PossiblyF.ref: <function> = name_ref PossiblyF, file.%PossiblyF [template = file.%PossiblyF]
  360. // CHECK:STDOUT: %F: <function> = bind_alias F, file.%PossiblyF [template = file.%PossiblyF]
  361. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  362. // CHECK:STDOUT:
  363. // CHECK:STDOUT: !members:
  364. // CHECK:STDOUT: .F = %F
  365. // CHECK:STDOUT: witness = %.1
  366. // CHECK:STDOUT: }
  367. // CHECK:STDOUT:
  368. // CHECK:STDOUT: impl @impl.4: FExtraParam as I {
  369. // CHECK:STDOUT: %F: <function> = fn_decl @F.2 [template] {
  370. // CHECK:STDOUT: %b.loc58_10.1: bool = param b
  371. // CHECK:STDOUT: %b.loc58_10.2: bool = bind_name b, %b.loc58_10.1
  372. // CHECK:STDOUT: }
  373. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: !members:
  376. // CHECK:STDOUT: .F = %F
  377. // CHECK:STDOUT: witness = %.1
  378. // CHECK:STDOUT: }
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: impl @impl.5: FExtraImplicitParam as I {
  381. // CHECK:STDOUT: %F: <function> = fn_decl @F.3 [template] {
  382. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam]
  383. // CHECK:STDOUT: %self.loc71_10.1: FExtraImplicitParam = param self
  384. // CHECK:STDOUT: %self.loc71_10.2: FExtraImplicitParam = bind_name self, %self.loc71_10.1
  385. // CHECK:STDOUT: }
  386. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: !members:
  389. // CHECK:STDOUT: .F = %F
  390. // CHECK:STDOUT: witness = %.1
  391. // CHECK:STDOUT: }
  392. // CHECK:STDOUT:
  393. // CHECK:STDOUT: impl @impl.6: FExtraReturnType as I {
  394. // CHECK:STDOUT: %F: <function> = fn_decl @F.4 [template] {
  395. // CHECK:STDOUT: %return.var: ref bool = var <return slot>
  396. // CHECK:STDOUT: }
  397. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  398. // CHECK:STDOUT:
  399. // CHECK:STDOUT: !members:
  400. // CHECK:STDOUT: .F = %F
  401. // CHECK:STDOUT: witness = %.1
  402. // CHECK:STDOUT: }
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: impl @impl.7: FMissingParam as J {
  405. // CHECK:STDOUT: %F: <function> = fn_decl @F.6 [template] {
  406. // CHECK:STDOUT: %self.loc100_10.1: bool = param self
  407. // CHECK:STDOUT: %self.loc100_10.2: bool = bind_name self, %self.loc100_10.1
  408. // CHECK:STDOUT: %return.var: ref bool = var <return slot>
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  411. // CHECK:STDOUT:
  412. // CHECK:STDOUT: !members:
  413. // CHECK:STDOUT: .F = %F
  414. // CHECK:STDOUT: witness = %.1
  415. // CHECK:STDOUT: }
  416. // CHECK:STDOUT:
  417. // CHECK:STDOUT: impl @impl.8: FMissingImplicitParam as J {
  418. // CHECK:STDOUT: %F: <function> = fn_decl @F.7 [template] {
  419. // CHECK:STDOUT: %b.loc113_10.1: bool = param b
  420. // CHECK:STDOUT: %b.loc113_10.2: bool = bind_name b, %b.loc113_10.1
  421. // CHECK:STDOUT: %return.var: ref bool = var <return slot>
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  424. // CHECK:STDOUT:
  425. // CHECK:STDOUT: !members:
  426. // CHECK:STDOUT: .F = %F
  427. // CHECK:STDOUT: witness = %.1
  428. // CHECK:STDOUT: }
  429. // CHECK:STDOUT:
  430. // CHECK:STDOUT: impl @impl.9: FMissingReturnType as J {
  431. // CHECK:STDOUT: %F: <function> = fn_decl @F.8 [template] {
  432. // CHECK:STDOUT: %self.loc126_10.1: bool = param self
  433. // CHECK:STDOUT: %self.loc126_10.2: bool = bind_name self, %self.loc126_10.1
  434. // CHECK:STDOUT: %b.loc126_22.1: bool = param b
  435. // CHECK:STDOUT: %b.loc126_22.2: bool = bind_name b, %b.loc126_22.1
  436. // CHECK:STDOUT: }
  437. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  438. // CHECK:STDOUT:
  439. // CHECK:STDOUT: !members:
  440. // CHECK:STDOUT: .F = %F
  441. // CHECK:STDOUT: witness = %.1
  442. // CHECK:STDOUT: }
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: impl @impl.10: FDifferentParamType as J {
  445. // CHECK:STDOUT: %F: <function> = fn_decl @F.9 [template] {
  446. // CHECK:STDOUT: %self.loc139_10.1: bool = param self
  447. // CHECK:STDOUT: %self.loc139_10.2: bool = bind_name self, %self.loc139_10.1
  448. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType]
  449. // CHECK:STDOUT: %b.loc139_22.1: FDifferentParamType = param b
  450. // CHECK:STDOUT: %b.loc139_22.2: FDifferentParamType = bind_name b, %b.loc139_22.1
  451. // CHECK:STDOUT: %return.var: ref bool = var <return slot>
  452. // CHECK:STDOUT: }
  453. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: !members:
  456. // CHECK:STDOUT: .F = %F
  457. // CHECK:STDOUT: witness = %.1
  458. // CHECK:STDOUT: }
  459. // CHECK:STDOUT:
  460. // CHECK:STDOUT: impl @impl.11: FDifferentImplicitParamType as J {
  461. // CHECK:STDOUT: %F: <function> = fn_decl @F.10 [template] {
  462. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType]
  463. // CHECK:STDOUT: %self.loc152_10.1: FDifferentImplicitParamType = param self
  464. // CHECK:STDOUT: %self.loc152_10.2: FDifferentImplicitParamType = bind_name self, %self.loc152_10.1
  465. // CHECK:STDOUT: %b.loc152_22.1: bool = param b
  466. // CHECK:STDOUT: %b.loc152_22.2: bool = bind_name b, %b.loc152_22.1
  467. // CHECK:STDOUT: %return.var: ref bool = var <return slot>
  468. // CHECK:STDOUT: }
  469. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  470. // CHECK:STDOUT:
  471. // CHECK:STDOUT: !members:
  472. // CHECK:STDOUT: .F = %F
  473. // CHECK:STDOUT: witness = %.1
  474. // CHECK:STDOUT: }
  475. // CHECK:STDOUT:
  476. // CHECK:STDOUT: impl @impl.12: FDifferentReturnType as J {
  477. // CHECK:STDOUT: %F: <function> = fn_decl @F.11 [template] {
  478. // CHECK:STDOUT: %self.loc165_10.1: bool = param self
  479. // CHECK:STDOUT: %self.loc165_10.2: bool = bind_name self, %self.loc165_10.1
  480. // CHECK:STDOUT: %b.loc165_22.1: bool = param b
  481. // CHECK:STDOUT: %b.loc165_22.2: bool = bind_name b, %b.loc165_22.1
  482. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [template = constants.%FDifferentReturnType]
  483. // CHECK:STDOUT: %return.var: ref FDifferentReturnType = var <return slot>
  484. // CHECK:STDOUT: }
  485. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  486. // CHECK:STDOUT:
  487. // CHECK:STDOUT: !members:
  488. // CHECK:STDOUT: .F = %F
  489. // CHECK:STDOUT: witness = %.1
  490. // CHECK:STDOUT: }
  491. // CHECK:STDOUT:
  492. // CHECK:STDOUT: impl @impl.13: FDifferentParamName as J {
  493. // CHECK:STDOUT: %F: <function> = fn_decl @F.12 [template] {
  494. // CHECK:STDOUT: %self.loc179_10.1: bool = param self
  495. // CHECK:STDOUT: %self.loc179_10.2: bool = bind_name self, %self.loc179_10.1
  496. // CHECK:STDOUT: %not_b.loc179_22.1: bool = param not_b
  497. // CHECK:STDOUT: %not_b.loc179_22.2: bool = bind_name not_b, %not_b.loc179_22.1
  498. // CHECK:STDOUT: %return.var: ref bool = var <return slot>
  499. // CHECK:STDOUT: }
  500. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  501. // CHECK:STDOUT:
  502. // CHECK:STDOUT: !members:
  503. // CHECK:STDOUT: .F = %F
  504. // CHECK:STDOUT: witness = %.1
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT:
  507. // CHECK:STDOUT: impl @impl.14: SelfNestedBadParam as SelfNested {
  508. // CHECK:STDOUT: %F: <function> = fn_decl @F.14 [template] {
  509. // CHECK:STDOUT: %SelfNestedBadParam.ref.loc196_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
  510. // CHECK:STDOUT: %.loc196_32: type = ptr_type SelfNestedBadParam [template = constants.%.18]
  511. // CHECK:STDOUT: %.loc196_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.19]
  512. // CHECK:STDOUT: %.loc196_53.1: (type, type) = tuple_literal (%.loc196_32, %.loc196_52)
  513. // CHECK:STDOUT: %.loc196_53.2: type = converted %.loc196_53.1, constants.%.20 [template = constants.%.20]
  514. // CHECK:STDOUT: %x.loc196_10.1: (SelfNestedBadParam*, {.x: i32, .y: i32}) = param x
  515. // CHECK:STDOUT: %x.loc196_10.2: (SelfNestedBadParam*, {.x: i32, .y: i32}) = bind_name x, %x.loc196_10.1
  516. // CHECK:STDOUT: %SelfNestedBadParam.ref.loc196_60: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
  517. // CHECK:STDOUT: %.loc196_80: i32 = int_literal 4 [template = constants.%.13]
  518. // CHECK:STDOUT: %.loc196_81: type = array_type %.loc196_80, SelfNestedBadParam [template = constants.%.21]
  519. // CHECK:STDOUT: %return.var: ref [SelfNestedBadParam; 4] = var <return slot>
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: !members:
  524. // CHECK:STDOUT: .F = %F
  525. // CHECK:STDOUT: witness = %.1
  526. // CHECK:STDOUT: }
  527. // CHECK:STDOUT:
  528. // CHECK:STDOUT: impl @impl.15: SelfNestedBadReturnType as SelfNested {
  529. // CHECK:STDOUT: %F: <function> = fn_decl @F.15 [template] {
  530. // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc208_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType]
  531. // CHECK:STDOUT: %.loc208_37: type = ptr_type SelfNestedBadReturnType [template = constants.%.22]
  532. // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc208_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType]
  533. // CHECK:STDOUT: %.loc208_77: type = struct_type {.x: SelfNestedBadReturnType, .y: i32} [template = constants.%.23]
  534. // CHECK:STDOUT: %.loc208_78.1: (type, type) = tuple_literal (%.loc208_37, %.loc208_77)
  535. // CHECK:STDOUT: %.loc208_78.2: type = converted %.loc208_78.1, constants.%.24 [template = constants.%.24]
  536. // CHECK:STDOUT: %x.loc208_10.1: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32}) = param x
  537. // CHECK:STDOUT: %x.loc208_10.2: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32}) = bind_name x, %x.loc208_10.1
  538. // CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
  539. // CHECK:STDOUT: %.loc208_105: i32 = int_literal 4 [template = constants.%.13]
  540. // CHECK:STDOUT: %.loc208_106: type = array_type %.loc208_105, SelfNestedBadParam [template = constants.%.21]
  541. // CHECK:STDOUT: %return.var: ref [SelfNestedBadParam; 4] = var <return slot>
  542. // CHECK:STDOUT: }
  543. // CHECK:STDOUT: %.1: <witness> = interface_witness (<error>) [template = <error>]
  544. // CHECK:STDOUT:
  545. // CHECK:STDOUT: !members:
  546. // CHECK:STDOUT: .F = %F
  547. // CHECK:STDOUT: witness = %.1
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT:
  550. // CHECK:STDOUT: class @NoF {
  551. // CHECK:STDOUT: impl_decl @impl.1 {
  552. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  553. // CHECK:STDOUT: }
  554. // CHECK:STDOUT:
  555. // CHECK:STDOUT: !members:
  556. // CHECK:STDOUT: .Self = constants.%NoF
  557. // CHECK:STDOUT: }
  558. // CHECK:STDOUT:
  559. // CHECK:STDOUT: class @FNotFunction {
  560. // CHECK:STDOUT: impl_decl @impl.2 {
  561. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: !members:
  565. // CHECK:STDOUT: .Self = constants.%FNotFunction
  566. // CHECK:STDOUT: }
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: class @F.16;
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: class @FAlias {
  571. // CHECK:STDOUT: impl_decl @impl.3 {
  572. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  573. // CHECK:STDOUT: }
  574. // CHECK:STDOUT:
  575. // CHECK:STDOUT: !members:
  576. // CHECK:STDOUT: .Self = constants.%FAlias
  577. // CHECK:STDOUT: }
  578. // CHECK:STDOUT:
  579. // CHECK:STDOUT: class @FExtraParam {
  580. // CHECK:STDOUT: impl_decl @impl.4 {
  581. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  582. // CHECK:STDOUT: }
  583. // CHECK:STDOUT:
  584. // CHECK:STDOUT: !members:
  585. // CHECK:STDOUT: .Self = constants.%FExtraParam
  586. // CHECK:STDOUT: }
  587. // CHECK:STDOUT:
  588. // CHECK:STDOUT: class @FExtraImplicitParam {
  589. // CHECK:STDOUT: impl_decl @impl.5 {
  590. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  591. // CHECK:STDOUT: }
  592. // CHECK:STDOUT:
  593. // CHECK:STDOUT: !members:
  594. // CHECK:STDOUT: .Self = constants.%FExtraImplicitParam
  595. // CHECK:STDOUT: }
  596. // CHECK:STDOUT:
  597. // CHECK:STDOUT: class @FExtraReturnType {
  598. // CHECK:STDOUT: impl_decl @impl.6 {
  599. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  600. // CHECK:STDOUT: }
  601. // CHECK:STDOUT:
  602. // CHECK:STDOUT: !members:
  603. // CHECK:STDOUT: .Self = constants.%FExtraReturnType
  604. // CHECK:STDOUT: }
  605. // CHECK:STDOUT:
  606. // CHECK:STDOUT: class @FMissingParam {
  607. // CHECK:STDOUT: impl_decl @impl.7 {
  608. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.5]
  609. // CHECK:STDOUT: }
  610. // CHECK:STDOUT:
  611. // CHECK:STDOUT: !members:
  612. // CHECK:STDOUT: .Self = constants.%FMissingParam
  613. // CHECK:STDOUT: }
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: class @FMissingImplicitParam {
  616. // CHECK:STDOUT: impl_decl @impl.8 {
  617. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.5]
  618. // CHECK:STDOUT: }
  619. // CHECK:STDOUT:
  620. // CHECK:STDOUT: !members:
  621. // CHECK:STDOUT: .Self = constants.%FMissingImplicitParam
  622. // CHECK:STDOUT: }
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: class @FMissingReturnType {
  625. // CHECK:STDOUT: impl_decl @impl.9 {
  626. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.5]
  627. // CHECK:STDOUT: }
  628. // CHECK:STDOUT:
  629. // CHECK:STDOUT: !members:
  630. // CHECK:STDOUT: .Self = constants.%FMissingReturnType
  631. // CHECK:STDOUT: }
  632. // CHECK:STDOUT:
  633. // CHECK:STDOUT: class @FDifferentParamType {
  634. // CHECK:STDOUT: impl_decl @impl.10 {
  635. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.5]
  636. // CHECK:STDOUT: }
  637. // CHECK:STDOUT:
  638. // CHECK:STDOUT: !members:
  639. // CHECK:STDOUT: .Self = constants.%FDifferentParamType
  640. // CHECK:STDOUT: }
  641. // CHECK:STDOUT:
  642. // CHECK:STDOUT: class @FDifferentImplicitParamType {
  643. // CHECK:STDOUT: impl_decl @impl.11 {
  644. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.5]
  645. // CHECK:STDOUT: }
  646. // CHECK:STDOUT:
  647. // CHECK:STDOUT: !members:
  648. // CHECK:STDOUT: .Self = constants.%FDifferentImplicitParamType
  649. // CHECK:STDOUT: }
  650. // CHECK:STDOUT:
  651. // CHECK:STDOUT: class @FDifferentReturnType {
  652. // CHECK:STDOUT: impl_decl @impl.12 {
  653. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.5]
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT:
  656. // CHECK:STDOUT: !members:
  657. // CHECK:STDOUT: .Self = constants.%FDifferentReturnType
  658. // CHECK:STDOUT: }
  659. // CHECK:STDOUT:
  660. // CHECK:STDOUT: class @FDifferentParamName {
  661. // CHECK:STDOUT: impl_decl @impl.13 {
  662. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.5]
  663. // CHECK:STDOUT: }
  664. // CHECK:STDOUT:
  665. // CHECK:STDOUT: !members:
  666. // CHECK:STDOUT: .Self = constants.%FDifferentParamName
  667. // CHECK:STDOUT: }
  668. // CHECK:STDOUT:
  669. // CHECK:STDOUT: class @SelfNestedBadParam {
  670. // CHECK:STDOUT: impl_decl @impl.14 {
  671. // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.8]
  672. // CHECK:STDOUT: }
  673. // CHECK:STDOUT:
  674. // CHECK:STDOUT: !members:
  675. // CHECK:STDOUT: .Self = constants.%SelfNestedBadParam
  676. // CHECK:STDOUT: }
  677. // CHECK:STDOUT:
  678. // CHECK:STDOUT: class @SelfNestedBadReturnType {
  679. // CHECK:STDOUT: impl_decl @impl.15 {
  680. // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.8]
  681. // CHECK:STDOUT: }
  682. // CHECK:STDOUT:
  683. // CHECK:STDOUT: !members:
  684. // CHECK:STDOUT: .Self = constants.%SelfNestedBadReturnType
  685. // CHECK:STDOUT: }
  686. // CHECK:STDOUT:
  687. // CHECK:STDOUT: fn @F.1();
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: fn @PossiblyF();
  690. // CHECK:STDOUT:
  691. // CHECK:STDOUT: fn @F.2(@impl.4.%b.loc58_10.2: bool);
  692. // CHECK:STDOUT:
  693. // CHECK:STDOUT: fn @F.3[@impl.5.%self.loc71_10.2: FExtraImplicitParam]();
  694. // CHECK:STDOUT:
  695. // CHECK:STDOUT: fn @F.4() -> bool;
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: fn @F.5[@J.%self.loc89_20.2: bool](@J.%b.loc89_32.2: bool) -> bool;
  698. // CHECK:STDOUT:
  699. // CHECK:STDOUT: fn @F.6[@impl.7.%self.loc100_10.2: bool]() -> bool;
  700. // CHECK:STDOUT:
  701. // CHECK:STDOUT: fn @F.7(@impl.8.%b.loc113_10.2: bool) -> bool;
  702. // CHECK:STDOUT:
  703. // CHECK:STDOUT: fn @F.8[@impl.9.%self.loc126_10.2: bool](@impl.9.%b.loc126_22.2: bool);
  704. // CHECK:STDOUT:
  705. // CHECK:STDOUT: fn @F.9[@impl.10.%self.loc139_10.2: bool](@impl.10.%b.loc139_22.2: FDifferentParamType) -> bool;
  706. // CHECK:STDOUT:
  707. // CHECK:STDOUT: fn @F.10[@impl.11.%self.loc152_10.2: FDifferentImplicitParamType](@impl.11.%b.loc152_22.2: bool) -> bool;
  708. // CHECK:STDOUT:
  709. // CHECK:STDOUT: fn @F.11[@impl.12.%self.loc165_10.2: bool](@impl.12.%b.loc165_22.2: bool) -> <error>;
  710. // CHECK:STDOUT:
  711. // CHECK:STDOUT: fn @F.12[@impl.13.%self.loc179_10.2: bool](@impl.13.%not_b.loc179_22.2: bool) -> bool;
  712. // CHECK:STDOUT:
  713. // CHECK:STDOUT: fn @F.13(@SelfNested.%x.loc184_8.2: (Self*, {.x: Self, .y: i32})) -> @SelfNested.%return.var: [Self; 4];
  714. // CHECK:STDOUT:
  715. // CHECK:STDOUT: fn @F.14(@impl.14.%x.loc196_10.2: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> <error>;
  716. // CHECK:STDOUT:
  717. // CHECK:STDOUT: fn @F.15(@impl.15.%x.loc208_10.2: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> @impl.15.%return.var: [SelfNestedBadParam; 4];
  718. // CHECK:STDOUT: