fail_impl_bad_assoc_fn.carbon 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  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
  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
  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
  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
  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
  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
  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
  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
  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
  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
  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`
  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
  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
  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
  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
  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
  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
  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`
  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: redeclaration differs at parameter 1
  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
  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: redeclaration differs at implicit parameter 1
  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
  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`
  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`
  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
  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
  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: redeclaration differs at parameter 1
  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
  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]`
  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]`
  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: %.1: type = interface_type @I [template]
  200. // CHECK:STDOUT: %Self.1: %.1 = bind_symbolic_name Self, 0 [symbolic]
  201. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
  202. // CHECK:STDOUT: %.2: type = tuple_type () [template]
  203. // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
  204. // CHECK:STDOUT: %.3: type = assoc_entity_type %.1, %F.type.1 [template]
  205. // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @I.%F.decl [template]
  206. // CHECK:STDOUT: %NoF: type = class_type @NoF [template]
  207. // CHECK:STDOUT: %.5: type = struct_type {} [template]
  208. // CHECK:STDOUT: %.6: <witness> = complete_type_witness %.5 [template]
  209. // CHECK:STDOUT: %FNotFunction: type = class_type @FNotFunction [template]
  210. // CHECK:STDOUT: %F.2: type = class_type @F.16 [template]
  211. // CHECK:STDOUT: %PossiblyF.type: type = fn_type @PossiblyF [template]
  212. // CHECK:STDOUT: %PossiblyF: %PossiblyF.type = struct_value () [template]
  213. // CHECK:STDOUT: %FAlias: type = class_type @FAlias [template]
  214. // CHECK:STDOUT: %FExtraParam: type = class_type @FExtraParam [template]
  215. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  216. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  217. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template]
  218. // CHECK:STDOUT: %F.3: %F.type.2 = struct_value () [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: %FExtraReturnType: type = class_type @FExtraReturnType [template]
  223. // CHECK:STDOUT: %F.type.4: type = fn_type @F.4 [template]
  224. // CHECK:STDOUT: %F.5: %F.type.4 = struct_value () [template]
  225. // CHECK:STDOUT: %.7: type = interface_type @J [template]
  226. // CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self, 0 [symbolic]
  227. // CHECK:STDOUT: %F.type.5: type = fn_type @F.5 [template]
  228. // CHECK:STDOUT: %F.6: %F.type.5 = struct_value () [template]
  229. // CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %F.type.5 [template]
  230. // CHECK:STDOUT: %.9: %.8 = assoc_entity element0, @J.%F.decl [template]
  231. // CHECK:STDOUT: %FMissingParam: type = class_type @FMissingParam [template]
  232. // CHECK:STDOUT: %F.type.6: type = fn_type @F.6 [template]
  233. // CHECK:STDOUT: %F.7: %F.type.6 = struct_value () [template]
  234. // CHECK:STDOUT: %FMissingImplicitParam: type = class_type @FMissingImplicitParam [template]
  235. // CHECK:STDOUT: %F.type.7: type = fn_type @F.7 [template]
  236. // CHECK:STDOUT: %F.8: %F.type.7 = struct_value () [template]
  237. // CHECK:STDOUT: %FMissingReturnType: type = class_type @FMissingReturnType [template]
  238. // CHECK:STDOUT: %F.type.8: type = fn_type @F.8 [template]
  239. // CHECK:STDOUT: %F.9: %F.type.8 = struct_value () [template]
  240. // CHECK:STDOUT: %FDifferentParamType: type = class_type @FDifferentParamType [template]
  241. // CHECK:STDOUT: %F.type.9: type = fn_type @F.9 [template]
  242. // CHECK:STDOUT: %F.10: %F.type.9 = struct_value () [template]
  243. // CHECK:STDOUT: %FDifferentImplicitParamType: type = class_type @FDifferentImplicitParamType [template]
  244. // CHECK:STDOUT: %F.type.10: type = fn_type @F.10 [template]
  245. // CHECK:STDOUT: %F.11: %F.type.10 = struct_value () [template]
  246. // CHECK:STDOUT: %FDifferentReturnType: type = class_type @FDifferentReturnType [template]
  247. // CHECK:STDOUT: %F.type.11: type = fn_type @F.11 [template]
  248. // CHECK:STDOUT: %F.12: %F.type.11 = struct_value () [template]
  249. // CHECK:STDOUT: %FDifferentParamName: type = class_type @FDifferentParamName [template]
  250. // CHECK:STDOUT: %F.type.12: type = fn_type @F.12 [template]
  251. // CHECK:STDOUT: %F.13: %F.type.12 = struct_value () [template]
  252. // CHECK:STDOUT: %.10: type = interface_type @SelfNested [template]
  253. // CHECK:STDOUT: %Self.3: %.10 = bind_symbolic_name Self, 0 [symbolic]
  254. // CHECK:STDOUT: %.11: type = ptr_type %Self.3 [symbolic]
  255. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  256. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  257. // CHECK:STDOUT: %.12: type = struct_type {.x: %Self.3, .y: i32} [symbolic]
  258. // CHECK:STDOUT: %.13: type = tuple_type (type, type) [template]
  259. // CHECK:STDOUT: %.14: type = tuple_type (%.11, %.12) [symbolic]
  260. // CHECK:STDOUT: %.15: i32 = int_literal 4 [template]
  261. // CHECK:STDOUT: %.16: type = array_type %.15, %Self.3 [symbolic]
  262. // CHECK:STDOUT: %F.type.13: type = fn_type @F.13 [template]
  263. // CHECK:STDOUT: %F.14: %F.type.13 = struct_value () [template]
  264. // CHECK:STDOUT: %.17: type = assoc_entity_type %.10, %F.type.13 [template]
  265. // CHECK:STDOUT: %.18: %.17 = assoc_entity element0, @SelfNested.%F.decl [template]
  266. // CHECK:STDOUT: %SelfNestedBadParam: type = class_type @SelfNestedBadParam [template]
  267. // CHECK:STDOUT: %.19: type = ptr_type %SelfNestedBadParam [template]
  268. // CHECK:STDOUT: %.20: type = struct_type {.x: i32, .y: i32} [template]
  269. // CHECK:STDOUT: %.21: type = tuple_type (%.19, %.20) [template]
  270. // CHECK:STDOUT: %.22: type = array_type %.15, %SelfNestedBadParam [template]
  271. // CHECK:STDOUT: %F.type.14: type = fn_type @F.14 [template]
  272. // CHECK:STDOUT: %F.15: %F.type.14 = struct_value () [template]
  273. // CHECK:STDOUT: %.23: type = struct_type {.x: %SelfNestedBadParam, .y: i32} [template]
  274. // CHECK:STDOUT: %.24: type = tuple_type (%.19, %.23) [template]
  275. // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [template]
  276. // CHECK:STDOUT: %.25: type = ptr_type %SelfNestedBadReturnType [template]
  277. // CHECK:STDOUT: %.26: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template]
  278. // CHECK:STDOUT: %.27: type = tuple_type (%.25, %.26) [template]
  279. // CHECK:STDOUT: %F.type.15: type = fn_type @F.15 [template]
  280. // CHECK:STDOUT: %F.16: %F.type.15 = struct_value () [template]
  281. // CHECK:STDOUT: %.28: type = array_type %.15, %SelfNestedBadReturnType [template]
  282. // CHECK:STDOUT: }
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: imports {
  285. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  286. // CHECK:STDOUT: .Bool = %import_ref.1
  287. // CHECK:STDOUT: .Int32 = %import_ref.2
  288. // CHECK:STDOUT: import Core//prelude
  289. // CHECK:STDOUT: import Core//prelude/operators
  290. // CHECK:STDOUT: import Core//prelude/types
  291. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  292. // CHECK:STDOUT: import Core//prelude/operators/as
  293. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  294. // CHECK:STDOUT: import Core//prelude/operators/comparison
  295. // CHECK:STDOUT: import Core//prelude/types/bool
  296. // CHECK:STDOUT: }
  297. // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool]
  298. // CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: file {
  302. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  303. // CHECK:STDOUT: .Core = imports.%Core
  304. // CHECK:STDOUT: .I = %I.decl
  305. // CHECK:STDOUT: .NoF = %NoF.decl
  306. // CHECK:STDOUT: .FNotFunction = %FNotFunction.decl
  307. // CHECK:STDOUT: .PossiblyF = %PossiblyF.decl
  308. // CHECK:STDOUT: .FAlias = %FAlias.decl
  309. // CHECK:STDOUT: .FExtraParam = %FExtraParam.decl
  310. // CHECK:STDOUT: .FExtraImplicitParam = %FExtraImplicitParam.decl
  311. // CHECK:STDOUT: .FExtraReturnType = %FExtraReturnType.decl
  312. // CHECK:STDOUT: .J = %J.decl
  313. // CHECK:STDOUT: .FMissingParam = %FMissingParam.decl
  314. // CHECK:STDOUT: .FMissingImplicitParam = %FMissingImplicitParam.decl
  315. // CHECK:STDOUT: .FMissingReturnType = %FMissingReturnType.decl
  316. // CHECK:STDOUT: .FDifferentParamType = %FDifferentParamType.decl
  317. // CHECK:STDOUT: .FDifferentImplicitParamType = %FDifferentImplicitParamType.decl
  318. // CHECK:STDOUT: .FDifferentReturnType = %FDifferentReturnType.decl
  319. // CHECK:STDOUT: .FDifferentParamName = %FDifferentParamName.decl
  320. // CHECK:STDOUT: .SelfNested = %SelfNested.decl
  321. // CHECK:STDOUT: .SelfNestedBadParam = %SelfNestedBadParam.decl
  322. // CHECK:STDOUT: .SelfNestedBadReturnType = %SelfNestedBadReturnType.decl
  323. // CHECK:STDOUT: }
  324. // CHECK:STDOUT: %Core.import = import Core
  325. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {}
  326. // CHECK:STDOUT: %NoF.decl: type = class_decl @NoF [template = constants.%NoF] {} {}
  327. // CHECK:STDOUT: %FNotFunction.decl: type = class_decl @FNotFunction [template = constants.%FNotFunction] {} {}
  328. // CHECK:STDOUT: %PossiblyF.decl: %PossiblyF.type = fn_decl @PossiblyF [template = constants.%PossiblyF] {} {}
  329. // CHECK:STDOUT: %FAlias.decl: type = class_decl @FAlias [template = constants.%FAlias] {} {}
  330. // CHECK:STDOUT: %FExtraParam.decl: type = class_decl @FExtraParam [template = constants.%FExtraParam] {} {}
  331. // CHECK:STDOUT: %FExtraImplicitParam.decl: type = class_decl @FExtraImplicitParam [template = constants.%FExtraImplicitParam] {} {}
  332. // CHECK:STDOUT: %FExtraReturnType.decl: type = class_decl @FExtraReturnType [template = constants.%FExtraReturnType] {} {}
  333. // CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.7] {} {}
  334. // CHECK:STDOUT: %FMissingParam.decl: type = class_decl @FMissingParam [template = constants.%FMissingParam] {} {}
  335. // CHECK:STDOUT: %FMissingImplicitParam.decl: type = class_decl @FMissingImplicitParam [template = constants.%FMissingImplicitParam] {} {}
  336. // CHECK:STDOUT: %FMissingReturnType.decl: type = class_decl @FMissingReturnType [template = constants.%FMissingReturnType] {} {}
  337. // CHECK:STDOUT: %FDifferentParamType.decl: type = class_decl @FDifferentParamType [template = constants.%FDifferentParamType] {} {}
  338. // CHECK:STDOUT: %FDifferentImplicitParamType.decl: type = class_decl @FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] {} {}
  339. // CHECK:STDOUT: %FDifferentReturnType.decl: type = class_decl @FDifferentReturnType [template = constants.%FDifferentReturnType] {} {}
  340. // CHECK:STDOUT: %FDifferentParamName.decl: type = class_decl @FDifferentParamName [template = constants.%FDifferentParamName] {} {}
  341. // CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.10] {} {}
  342. // CHECK:STDOUT: %SelfNestedBadParam.decl: type = class_decl @SelfNestedBadParam [template = constants.%SelfNestedBadParam] {} {}
  343. // CHECK:STDOUT: %SelfNestedBadReturnType.decl: type = class_decl @SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] {} {}
  344. // CHECK:STDOUT: }
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: interface @I {
  347. // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1]
  348. // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {}
  349. // CHECK:STDOUT: %.loc11: %.3 = assoc_entity element0, %F.decl [template = constants.%.4]
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: !members:
  352. // CHECK:STDOUT: .Self = %Self
  353. // CHECK:STDOUT: .F = %.loc11
  354. // CHECK:STDOUT: witness = (%F.decl)
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: interface @J {
  358. // CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self, 0 [symbolic = constants.%Self.2]
  359. // CHECK:STDOUT: %F.decl: %F.type.5 = fn_decl @F.5 [template = constants.%F.6] {
  360. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  361. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  362. // CHECK:STDOUT: } {
  363. // CHECK:STDOUT: %bool.make_type.loc93_26: init type = call constants.%Bool() [template = bool]
  364. // CHECK:STDOUT: %.loc93_26.1: type = value_of_initializer %bool.make_type.loc93_26 [template = bool]
  365. // CHECK:STDOUT: %.loc93_26.2: type = converted %bool.make_type.loc93_26, %.loc93_26.1 [template = bool]
  366. // CHECK:STDOUT: %self.param: bool = param self, runtime_param0
  367. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  368. // CHECK:STDOUT: %bool.make_type.loc93_35: init type = call constants.%Bool() [template = bool]
  369. // CHECK:STDOUT: %.loc93_35.1: type = value_of_initializer %bool.make_type.loc93_35 [template = bool]
  370. // CHECK:STDOUT: %.loc93_35.2: type = converted %bool.make_type.loc93_35, %.loc93_35.1 [template = bool]
  371. // CHECK:STDOUT: %b.param: bool = param b, runtime_param1
  372. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  373. // CHECK:STDOUT: %bool.make_type.loc93_44: init type = call constants.%Bool() [template = bool]
  374. // CHECK:STDOUT: %.loc93_44.1: type = value_of_initializer %bool.make_type.loc93_44 [template = bool]
  375. // CHECK:STDOUT: %.loc93_44.2: type = converted %bool.make_type.loc93_44, %.loc93_44.1 [template = bool]
  376. // CHECK:STDOUT: %return: ref bool = var <return slot>
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT: %.loc93: %.8 = assoc_entity element0, %F.decl [template = constants.%.9]
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: !members:
  381. // CHECK:STDOUT: .Self = %Self
  382. // CHECK:STDOUT: .F = %.loc93
  383. // CHECK:STDOUT: witness = (%F.decl)
  384. // CHECK:STDOUT: }
  385. // CHECK:STDOUT:
  386. // CHECK:STDOUT: interface @SelfNested {
  387. // CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self, 0 [symbolic = constants.%Self.3]
  388. // CHECK:STDOUT: %F.decl: %F.type.13 = fn_decl @F.13 [template = constants.%F.14] {
  389. // CHECK:STDOUT: %x.patt: @F.13.%.3 (%.14) = binding_pattern x
  390. // CHECK:STDOUT: } {
  391. // CHECK:STDOUT: %Self.ref.loc188_12: %.10 = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)]
  392. // CHECK:STDOUT: %.loc188_16.1: type = facet_type_access %Self.ref.loc188_12 [symbolic = %Self (constants.%Self.3)]
  393. // CHECK:STDOUT: %.loc188_16.2: type = converted %Self.ref.loc188_12, %.loc188_16.1 [symbolic = %Self (constants.%Self.3)]
  394. // CHECK:STDOUT: %.loc188_16.3: type = ptr_type %Self.3 [symbolic = %.1 (constants.%.11)]
  395. // CHECK:STDOUT: %Self.ref.loc188_24: %.10 = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)]
  396. // CHECK:STDOUT: %.loc188_24.1: type = facet_type_access %Self.ref.loc188_24 [symbolic = %Self (constants.%Self.3)]
  397. // CHECK:STDOUT: %.loc188_24.2: type = converted %Self.ref.loc188_24, %.loc188_24.1 [symbolic = %Self (constants.%Self.3)]
  398. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  399. // CHECK:STDOUT: %.loc188_34.1: type = value_of_initializer %int.make_type_32 [template = i32]
  400. // CHECK:STDOUT: %.loc188_34.2: type = converted %int.make_type_32, %.loc188_34.1 [template = i32]
  401. // CHECK:STDOUT: %.loc188_37: type = struct_type {.x: %Self.3, .y: i32} [symbolic = %.2 (constants.%.12)]
  402. // CHECK:STDOUT: %.loc188_38.1: %.13 = tuple_literal (%.loc188_16.3, %.loc188_37)
  403. // CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%.14 [symbolic = %.3 (constants.%.14)]
  404. // CHECK:STDOUT: %x.param: @F.13.%.3 (%.14) = param x, runtime_param0
  405. // CHECK:STDOUT: %x: @F.13.%.3 (%.14) = bind_name x, %x.param
  406. // CHECK:STDOUT: %Self.ref.loc188_45: %.10 = name_ref Self, @SelfNested.%Self [symbolic = %Self (constants.%Self.3)]
  407. // CHECK:STDOUT: %.loc188_51: i32 = int_literal 4 [template = constants.%.15]
  408. // CHECK:STDOUT: %.loc188_45.1: type = facet_type_access %Self.ref.loc188_45 [symbolic = %Self (constants.%Self.3)]
  409. // CHECK:STDOUT: %.loc188_45.2: type = converted %Self.ref.loc188_45, %.loc188_45.1 [symbolic = %Self (constants.%Self.3)]
  410. // CHECK:STDOUT: %.loc188_52: type = array_type %.loc188_51, %Self.3 [symbolic = %.4 (constants.%.16)]
  411. // CHECK:STDOUT: %return: ref @F.13.%.4 (%.16) = var <return slot>
  412. // CHECK:STDOUT: }
  413. // CHECK:STDOUT: %.loc188: %.17 = assoc_entity element0, %F.decl [template = constants.%.18]
  414. // CHECK:STDOUT:
  415. // CHECK:STDOUT: !members:
  416. // CHECK:STDOUT: .Self = %Self
  417. // CHECK:STDOUT: .F = %.loc188
  418. // CHECK:STDOUT: witness = (%F.decl)
  419. // CHECK:STDOUT: }
  420. // CHECK:STDOUT:
  421. // CHECK:STDOUT: impl @impl.1: %Self.ref as %I.ref {
  422. // CHECK:STDOUT: %.loc21: <witness> = interface_witness (<error>) [template = <error>]
  423. // CHECK:STDOUT:
  424. // CHECK:STDOUT: !members:
  425. // CHECK:STDOUT: witness = %.loc21
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: impl @impl.2: %Self.ref as %I.ref {
  429. // CHECK:STDOUT: %F.decl: type = class_decl @F.16 [template = constants.%F.2] {} {}
  430. // CHECK:STDOUT: %.loc25: <witness> = interface_witness (<error>) [template = <error>]
  431. // CHECK:STDOUT:
  432. // CHECK:STDOUT: !members:
  433. // CHECK:STDOUT: .F = %F.decl
  434. // CHECK:STDOUT: witness = %.loc25
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: impl @impl.3: %Self.ref as %I.ref {
  438. // CHECK:STDOUT: %PossiblyF.ref: %PossiblyF.type = name_ref PossiblyF, file.%PossiblyF.decl [template = constants.%PossiblyF]
  439. // CHECK:STDOUT: %F: %PossiblyF.type = bind_alias F, file.%PossiblyF.decl [template = constants.%PossiblyF]
  440. // CHECK:STDOUT: %.loc41: <witness> = interface_witness (<error>) [template = <error>]
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: !members:
  443. // CHECK:STDOUT: .F = %F
  444. // CHECK:STDOUT: witness = %.loc41
  445. // CHECK:STDOUT: }
  446. // CHECK:STDOUT:
  447. // CHECK:STDOUT: impl @impl.4: %Self.ref as %I.ref {
  448. // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.3] {
  449. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  450. // CHECK:STDOUT: } {
  451. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  452. // CHECK:STDOUT: %.loc62_13.1: type = value_of_initializer %bool.make_type [template = bool]
  453. // CHECK:STDOUT: %.loc62_13.2: type = converted %bool.make_type, %.loc62_13.1 [template = bool]
  454. // CHECK:STDOUT: %b.param: bool = param b, runtime_param0
  455. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  456. // CHECK:STDOUT: }
  457. // CHECK:STDOUT: %.loc54: <witness> = interface_witness (<error>) [template = <error>]
  458. // CHECK:STDOUT:
  459. // CHECK:STDOUT: !members:
  460. // CHECK:STDOUT: .F = %F.decl
  461. // CHECK:STDOUT: witness = %.loc54
  462. // CHECK:STDOUT: }
  463. // CHECK:STDOUT:
  464. // CHECK:STDOUT: impl @impl.5: %Self.ref as %I.ref {
  465. // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.4] {
  466. // CHECK:STDOUT: %self.patt: %FExtraImplicitParam = binding_pattern self
  467. // CHECK:STDOUT: } {
  468. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam]
  469. // CHECK:STDOUT: %self.param: %FExtraImplicitParam = param self, runtime_param0
  470. // CHECK:STDOUT: %self: %FExtraImplicitParam = bind_name self, %self.param
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT: %.loc67: <witness> = interface_witness (<error>) [template = <error>]
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: !members:
  475. // CHECK:STDOUT: .F = %F.decl
  476. // CHECK:STDOUT: witness = %.loc67
  477. // CHECK:STDOUT: }
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: impl @impl.6: %Self.ref as %I.ref {
  480. // CHECK:STDOUT: %F.decl: %F.type.4 = fn_decl @F.4 [template = constants.%F.5] {} {
  481. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  482. // CHECK:STDOUT: %.loc89_15.1: type = value_of_initializer %bool.make_type [template = bool]
  483. // CHECK:STDOUT: %.loc89_15.2: type = converted %bool.make_type, %.loc89_15.1 [template = bool]
  484. // CHECK:STDOUT: %return: ref bool = var <return slot>
  485. // CHECK:STDOUT: }
  486. // CHECK:STDOUT: %.loc81: <witness> = interface_witness (<error>) [template = <error>]
  487. // CHECK:STDOUT:
  488. // CHECK:STDOUT: !members:
  489. // CHECK:STDOUT: .F = %F.decl
  490. // CHECK:STDOUT: witness = %.loc81
  491. // CHECK:STDOUT: }
  492. // CHECK:STDOUT:
  493. // CHECK:STDOUT: impl @impl.7: %Self.ref as %J.ref {
  494. // CHECK:STDOUT: %F.decl: %F.type.6 = fn_decl @F.6 [template = constants.%F.7] {
  495. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  496. // CHECK:STDOUT: } {
  497. // CHECK:STDOUT: %bool.make_type.loc104_16: init type = call constants.%Bool() [template = bool]
  498. // CHECK:STDOUT: %.loc104_16.1: type = value_of_initializer %bool.make_type.loc104_16 [template = bool]
  499. // CHECK:STDOUT: %.loc104_16.2: type = converted %bool.make_type.loc104_16, %.loc104_16.1 [template = bool]
  500. // CHECK:STDOUT: %self.param: bool = param self, runtime_param0
  501. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  502. // CHECK:STDOUT: %bool.make_type.loc104_27: init type = call constants.%Bool() [template = bool]
  503. // CHECK:STDOUT: %.loc104_27.1: type = value_of_initializer %bool.make_type.loc104_27 [template = bool]
  504. // CHECK:STDOUT: %.loc104_27.2: type = converted %bool.make_type.loc104_27, %.loc104_27.1 [template = bool]
  505. // CHECK:STDOUT: %return: ref bool = var <return slot>
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT: %.loc96: <witness> = interface_witness (<error>) [template = <error>]
  508. // CHECK:STDOUT:
  509. // CHECK:STDOUT: !members:
  510. // CHECK:STDOUT: .F = %F.decl
  511. // CHECK:STDOUT: witness = %.loc96
  512. // CHECK:STDOUT: }
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: impl @impl.8: %Self.ref as %J.ref {
  515. // CHECK:STDOUT: %F.decl: %F.type.7 = fn_decl @F.7 [template = constants.%F.8] {
  516. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  517. // CHECK:STDOUT: } {
  518. // CHECK:STDOUT: %bool.make_type.loc117_13: init type = call constants.%Bool() [template = bool]
  519. // CHECK:STDOUT: %.loc117_13.1: type = value_of_initializer %bool.make_type.loc117_13 [template = bool]
  520. // CHECK:STDOUT: %.loc117_13.2: type = converted %bool.make_type.loc117_13, %.loc117_13.1 [template = bool]
  521. // CHECK:STDOUT: %b.param: bool = param b, runtime_param0
  522. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  523. // CHECK:STDOUT: %bool.make_type.loc117_22: init type = call constants.%Bool() [template = bool]
  524. // CHECK:STDOUT: %.loc117_22.1: type = value_of_initializer %bool.make_type.loc117_22 [template = bool]
  525. // CHECK:STDOUT: %.loc117_22.2: type = converted %bool.make_type.loc117_22, %.loc117_22.1 [template = bool]
  526. // CHECK:STDOUT: %return: ref bool = var <return slot>
  527. // CHECK:STDOUT: }
  528. // CHECK:STDOUT: %.loc109: <witness> = interface_witness (<error>) [template = <error>]
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: !members:
  531. // CHECK:STDOUT: .F = %F.decl
  532. // CHECK:STDOUT: witness = %.loc109
  533. // CHECK:STDOUT: }
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: impl @impl.9: %Self.ref as %J.ref {
  536. // CHECK:STDOUT: %F.decl: %F.type.8 = fn_decl @F.8 [template = constants.%F.9] {
  537. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  538. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  539. // CHECK:STDOUT: } {
  540. // CHECK:STDOUT: %bool.make_type.loc130_16: init type = call constants.%Bool() [template = bool]
  541. // CHECK:STDOUT: %.loc130_16.1: type = value_of_initializer %bool.make_type.loc130_16 [template = bool]
  542. // CHECK:STDOUT: %.loc130_16.2: type = converted %bool.make_type.loc130_16, %.loc130_16.1 [template = bool]
  543. // CHECK:STDOUT: %self.param: bool = param self, runtime_param0
  544. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  545. // CHECK:STDOUT: %bool.make_type.loc130_25: init type = call constants.%Bool() [template = bool]
  546. // CHECK:STDOUT: %.loc130_25.1: type = value_of_initializer %bool.make_type.loc130_25 [template = bool]
  547. // CHECK:STDOUT: %.loc130_25.2: type = converted %bool.make_type.loc130_25, %.loc130_25.1 [template = bool]
  548. // CHECK:STDOUT: %b.param: bool = param b, runtime_param1
  549. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  550. // CHECK:STDOUT: }
  551. // CHECK:STDOUT: %.loc122: <witness> = interface_witness (<error>) [template = <error>]
  552. // CHECK:STDOUT:
  553. // CHECK:STDOUT: !members:
  554. // CHECK:STDOUT: .F = %F.decl
  555. // CHECK:STDOUT: witness = %.loc122
  556. // CHECK:STDOUT: }
  557. // CHECK:STDOUT:
  558. // CHECK:STDOUT: impl @impl.10: %Self.ref as %J.ref {
  559. // CHECK:STDOUT: %F.decl: %F.type.9 = fn_decl @F.9 [template = constants.%F.10] {
  560. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  561. // CHECK:STDOUT: %b.patt: %FDifferentParamType = binding_pattern b
  562. // CHECK:STDOUT: } {
  563. // CHECK:STDOUT: %bool.make_type.loc143_16: init type = call constants.%Bool() [template = bool]
  564. // CHECK:STDOUT: %.loc143_16.1: type = value_of_initializer %bool.make_type.loc143_16 [template = bool]
  565. // CHECK:STDOUT: %.loc143_16.2: type = converted %bool.make_type.loc143_16, %.loc143_16.1 [template = bool]
  566. // CHECK:STDOUT: %self.param: bool = param self, runtime_param0
  567. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  568. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType]
  569. // CHECK:STDOUT: %b.param: %FDifferentParamType = param b, runtime_param1
  570. // CHECK:STDOUT: %b: %FDifferentParamType = bind_name b, %b.param
  571. // CHECK:STDOUT: %bool.make_type.loc143_34: init type = call constants.%Bool() [template = bool]
  572. // CHECK:STDOUT: %.loc143_34.1: type = value_of_initializer %bool.make_type.loc143_34 [template = bool]
  573. // CHECK:STDOUT: %.loc143_34.2: type = converted %bool.make_type.loc143_34, %.loc143_34.1 [template = bool]
  574. // CHECK:STDOUT: %return: ref bool = var <return slot>
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT: %.loc135: <witness> = interface_witness (<error>) [template = <error>]
  577. // CHECK:STDOUT:
  578. // CHECK:STDOUT: !members:
  579. // CHECK:STDOUT: .F = %F.decl
  580. // CHECK:STDOUT: witness = %.loc135
  581. // CHECK:STDOUT: }
  582. // CHECK:STDOUT:
  583. // CHECK:STDOUT: impl @impl.11: %Self.ref as %J.ref {
  584. // CHECK:STDOUT: %F.decl: %F.type.10 = fn_decl @F.10 [template = constants.%F.11] {
  585. // CHECK:STDOUT: %self.patt: %FDifferentImplicitParamType = binding_pattern self
  586. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  587. // CHECK:STDOUT: } {
  588. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType]
  589. // CHECK:STDOUT: %self.param: %FDifferentImplicitParamType = param self, runtime_param0
  590. // CHECK:STDOUT: %self: %FDifferentImplicitParamType = bind_name self, %self.param
  591. // CHECK:STDOUT: %bool.make_type.loc156_25: init type = call constants.%Bool() [template = bool]
  592. // CHECK:STDOUT: %.loc156_25.1: type = value_of_initializer %bool.make_type.loc156_25 [template = bool]
  593. // CHECK:STDOUT: %.loc156_25.2: type = converted %bool.make_type.loc156_25, %.loc156_25.1 [template = bool]
  594. // CHECK:STDOUT: %b.param: bool = param b, runtime_param1
  595. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  596. // CHECK:STDOUT: %bool.make_type.loc156_34: init type = call constants.%Bool() [template = bool]
  597. // CHECK:STDOUT: %.loc156_34.1: type = value_of_initializer %bool.make_type.loc156_34 [template = bool]
  598. // CHECK:STDOUT: %.loc156_34.2: type = converted %bool.make_type.loc156_34, %.loc156_34.1 [template = bool]
  599. // CHECK:STDOUT: %return: ref bool = var <return slot>
  600. // CHECK:STDOUT: }
  601. // CHECK:STDOUT: %.loc148: <witness> = interface_witness (<error>) [template = <error>]
  602. // CHECK:STDOUT:
  603. // CHECK:STDOUT: !members:
  604. // CHECK:STDOUT: .F = %F.decl
  605. // CHECK:STDOUT: witness = %.loc148
  606. // CHECK:STDOUT: }
  607. // CHECK:STDOUT:
  608. // CHECK:STDOUT: impl @impl.12: %Self.ref as %J.ref {
  609. // CHECK:STDOUT: %F.decl: %F.type.11 = fn_decl @F.11 [template = constants.%F.12] {
  610. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  611. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  612. // CHECK:STDOUT: } {
  613. // CHECK:STDOUT: %bool.make_type.loc169_16: init type = call constants.%Bool() [template = bool]
  614. // CHECK:STDOUT: %.loc169_16.1: type = value_of_initializer %bool.make_type.loc169_16 [template = bool]
  615. // CHECK:STDOUT: %.loc169_16.2: type = converted %bool.make_type.loc169_16, %.loc169_16.1 [template = bool]
  616. // CHECK:STDOUT: %self.param: bool = param self, runtime_param0
  617. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  618. // CHECK:STDOUT: %bool.make_type.loc169_25: init type = call constants.%Bool() [template = bool]
  619. // CHECK:STDOUT: %.loc169_25.1: type = value_of_initializer %bool.make_type.loc169_25 [template = bool]
  620. // CHECK:STDOUT: %.loc169_25.2: type = converted %bool.make_type.loc169_25, %.loc169_25.1 [template = bool]
  621. // CHECK:STDOUT: %b.param: bool = param b, runtime_param1
  622. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  623. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [template = constants.%FDifferentReturnType]
  624. // CHECK:STDOUT: %return: ref %FDifferentReturnType = var <return slot>
  625. // CHECK:STDOUT: }
  626. // CHECK:STDOUT: %.loc161: <witness> = interface_witness (<error>) [template = <error>]
  627. // CHECK:STDOUT:
  628. // CHECK:STDOUT: !members:
  629. // CHECK:STDOUT: .F = %F.decl
  630. // CHECK:STDOUT: witness = %.loc161
  631. // CHECK:STDOUT: }
  632. // CHECK:STDOUT:
  633. // CHECK:STDOUT: impl @impl.13: %Self.ref as %J.ref {
  634. // CHECK:STDOUT: %F.decl: %F.type.12 = fn_decl @F.12 [template = constants.%F.13] {
  635. // CHECK:STDOUT: %self.patt: bool = binding_pattern self
  636. // CHECK:STDOUT: %not_b.patt: bool = binding_pattern not_b
  637. // CHECK:STDOUT: } {
  638. // CHECK:STDOUT: %bool.make_type.loc183_16: init type = call constants.%Bool() [template = bool]
  639. // CHECK:STDOUT: %.loc183_16.1: type = value_of_initializer %bool.make_type.loc183_16 [template = bool]
  640. // CHECK:STDOUT: %.loc183_16.2: type = converted %bool.make_type.loc183_16, %.loc183_16.1 [template = bool]
  641. // CHECK:STDOUT: %self.param: bool = param self, runtime_param0
  642. // CHECK:STDOUT: %self: bool = bind_name self, %self.param
  643. // CHECK:STDOUT: %bool.make_type.loc183_29: init type = call constants.%Bool() [template = bool]
  644. // CHECK:STDOUT: %.loc183_29.1: type = value_of_initializer %bool.make_type.loc183_29 [template = bool]
  645. // CHECK:STDOUT: %.loc183_29.2: type = converted %bool.make_type.loc183_29, %.loc183_29.1 [template = bool]
  646. // CHECK:STDOUT: %not_b.param: bool = param not_b, runtime_param1
  647. // CHECK:STDOUT: %not_b: bool = bind_name not_b, %not_b.param
  648. // CHECK:STDOUT: %bool.make_type.loc183_38: init type = call constants.%Bool() [template = bool]
  649. // CHECK:STDOUT: %.loc183_38.1: type = value_of_initializer %bool.make_type.loc183_38 [template = bool]
  650. // CHECK:STDOUT: %.loc183_38.2: type = converted %bool.make_type.loc183_38, %.loc183_38.1 [template = bool]
  651. // CHECK:STDOUT: %return: ref bool = var <return slot>
  652. // CHECK:STDOUT: }
  653. // CHECK:STDOUT: %.loc175: <witness> = interface_witness (<error>) [template = <error>]
  654. // CHECK:STDOUT:
  655. // CHECK:STDOUT: !members:
  656. // CHECK:STDOUT: .F = %F.decl
  657. // CHECK:STDOUT: witness = %.loc175
  658. // CHECK:STDOUT: }
  659. // CHECK:STDOUT:
  660. // CHECK:STDOUT: impl @impl.14: %Self.ref as %SelfNested.ref {
  661. // CHECK:STDOUT: %F.decl: %F.type.14 = fn_decl @F.14 [template = constants.%F.15] {
  662. // CHECK:STDOUT: %x.patt: %.21 = binding_pattern x
  663. // CHECK:STDOUT: } {
  664. // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
  665. // CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.19]
  666. // CHECK:STDOUT: %int.make_type_32.loc200_40: init type = call constants.%Int32() [template = i32]
  667. // CHECK:STDOUT: %.loc200_40.1: type = value_of_initializer %int.make_type_32.loc200_40 [template = i32]
  668. // CHECK:STDOUT: %.loc200_40.2: type = converted %int.make_type_32.loc200_40, %.loc200_40.1 [template = i32]
  669. // CHECK:STDOUT: %int.make_type_32.loc200_49: init type = call constants.%Int32() [template = i32]
  670. // CHECK:STDOUT: %.loc200_49.1: type = value_of_initializer %int.make_type_32.loc200_49 [template = i32]
  671. // CHECK:STDOUT: %.loc200_49.2: type = converted %int.make_type_32.loc200_49, %.loc200_49.1 [template = i32]
  672. // CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.20]
  673. // CHECK:STDOUT: %.loc200_53.1: %.13 = tuple_literal (%.loc200_32, %.loc200_52)
  674. // CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%.21 [template = constants.%.21]
  675. // CHECK:STDOUT: %x.param: %.21 = param x, runtime_param0
  676. // CHECK:STDOUT: %x: %.21 = bind_name x, %x.param
  677. // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_60: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
  678. // CHECK:STDOUT: %.loc200_80: i32 = int_literal 4 [template = constants.%.15]
  679. // CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.22]
  680. // CHECK:STDOUT: %return: ref %.22 = var <return slot>
  681. // CHECK:STDOUT: }
  682. // CHECK:STDOUT: %.loc192: <witness> = interface_witness (<error>) [template = <error>]
  683. // CHECK:STDOUT:
  684. // CHECK:STDOUT: !members:
  685. // CHECK:STDOUT: .F = %F.decl
  686. // CHECK:STDOUT: witness = %.loc192
  687. // CHECK:STDOUT: }
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: impl @impl.15: %Self.ref as %SelfNested.ref {
  690. // CHECK:STDOUT: %F.decl: %F.type.15 = fn_decl @F.15 [template = constants.%F.16] {
  691. // CHECK:STDOUT: %x.patt: %.27 = binding_pattern x
  692. // CHECK:STDOUT: } {
  693. // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType]
  694. // CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.25]
  695. // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType]
  696. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  697. // CHECK:STDOUT: %.loc212_74.1: type = value_of_initializer %int.make_type_32 [template = i32]
  698. // CHECK:STDOUT: %.loc212_74.2: type = converted %int.make_type_32, %.loc212_74.1 [template = i32]
  699. // CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.26]
  700. // CHECK:STDOUT: %.loc212_78.1: %.13 = tuple_literal (%.loc212_37, %.loc212_77)
  701. // CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%.27 [template = constants.%.27]
  702. // CHECK:STDOUT: %x.param: %.27 = param x, runtime_param0
  703. // CHECK:STDOUT: %x: %.27 = bind_name x, %x.param
  704. // CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam]
  705. // CHECK:STDOUT: %.loc212_105: i32 = int_literal 4 [template = constants.%.15]
  706. // CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.22]
  707. // CHECK:STDOUT: %return: ref %.22 = var <return slot>
  708. // CHECK:STDOUT: }
  709. // CHECK:STDOUT: %.loc205: <witness> = interface_witness (<error>) [template = <error>]
  710. // CHECK:STDOUT:
  711. // CHECK:STDOUT: !members:
  712. // CHECK:STDOUT: .F = %F.decl
  713. // CHECK:STDOUT: witness = %.loc205
  714. // CHECK:STDOUT: }
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: class @NoF {
  717. // CHECK:STDOUT: impl_decl @impl.1 [template] {} {
  718. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%NoF [template = constants.%NoF]
  719. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  720. // CHECK:STDOUT: }
  721. // CHECK:STDOUT: %.loc22: <witness> = complete_type_witness %.5 [template = constants.%.6]
  722. // CHECK:STDOUT:
  723. // CHECK:STDOUT: !members:
  724. // CHECK:STDOUT: .Self = constants.%NoF
  725. // CHECK:STDOUT: }
  726. // CHECK:STDOUT:
  727. // CHECK:STDOUT: class @FNotFunction {
  728. // CHECK:STDOUT: impl_decl @impl.2 [template] {} {
  729. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FNotFunction [template = constants.%FNotFunction]
  730. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  731. // CHECK:STDOUT: }
  732. // CHECK:STDOUT: %.loc35: <witness> = complete_type_witness %.5 [template = constants.%.6]
  733. // CHECK:STDOUT:
  734. // CHECK:STDOUT: !members:
  735. // CHECK:STDOUT: .Self = constants.%FNotFunction
  736. // CHECK:STDOUT: }
  737. // CHECK:STDOUT:
  738. // CHECK:STDOUT: class @F.16;
  739. // CHECK:STDOUT:
  740. // CHECK:STDOUT: class @FAlias {
  741. // CHECK:STDOUT: impl_decl @impl.3 [template] {} {
  742. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FAlias [template = constants.%FAlias]
  743. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  744. // CHECK:STDOUT: }
  745. // CHECK:STDOUT: %.loc51: <witness> = complete_type_witness %.5 [template = constants.%.6]
  746. // CHECK:STDOUT:
  747. // CHECK:STDOUT: !members:
  748. // CHECK:STDOUT: .Self = constants.%FAlias
  749. // CHECK:STDOUT: }
  750. // CHECK:STDOUT:
  751. // CHECK:STDOUT: class @FExtraParam {
  752. // CHECK:STDOUT: impl_decl @impl.4 [template] {} {
  753. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraParam [template = constants.%FExtraParam]
  754. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  755. // CHECK:STDOUT: }
  756. // CHECK:STDOUT: %.loc64: <witness> = complete_type_witness %.5 [template = constants.%.6]
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: !members:
  759. // CHECK:STDOUT: .Self = constants.%FExtraParam
  760. // CHECK:STDOUT: }
  761. // CHECK:STDOUT:
  762. // CHECK:STDOUT: class @FExtraImplicitParam {
  763. // CHECK:STDOUT: impl_decl @impl.5 [template] {} {
  764. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [template = constants.%FExtraImplicitParam]
  765. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  766. // CHECK:STDOUT: }
  767. // CHECK:STDOUT: %.loc77: <witness> = complete_type_witness %.5 [template = constants.%.6]
  768. // CHECK:STDOUT:
  769. // CHECK:STDOUT: !members:
  770. // CHECK:STDOUT: .Self = constants.%FExtraImplicitParam
  771. // CHECK:STDOUT: }
  772. // CHECK:STDOUT:
  773. // CHECK:STDOUT: class @FExtraReturnType {
  774. // CHECK:STDOUT: impl_decl @impl.6 [template] {} {
  775. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraReturnType [template = constants.%FExtraReturnType]
  776. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
  777. // CHECK:STDOUT: }
  778. // CHECK:STDOUT: %.loc91: <witness> = complete_type_witness %.5 [template = constants.%.6]
  779. // CHECK:STDOUT:
  780. // CHECK:STDOUT: !members:
  781. // CHECK:STDOUT: .Self = constants.%FExtraReturnType
  782. // CHECK:STDOUT: }
  783. // CHECK:STDOUT:
  784. // CHECK:STDOUT: class @FMissingParam {
  785. // CHECK:STDOUT: impl_decl @impl.7 [template] {} {
  786. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingParam [template = constants.%FMissingParam]
  787. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
  788. // CHECK:STDOUT: }
  789. // CHECK:STDOUT: %.loc106: <witness> = complete_type_witness %.5 [template = constants.%.6]
  790. // CHECK:STDOUT:
  791. // CHECK:STDOUT: !members:
  792. // CHECK:STDOUT: .Self = constants.%FMissingParam
  793. // CHECK:STDOUT: }
  794. // CHECK:STDOUT:
  795. // CHECK:STDOUT: class @FMissingImplicitParam {
  796. // CHECK:STDOUT: impl_decl @impl.8 [template] {} {
  797. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingImplicitParam [template = constants.%FMissingImplicitParam]
  798. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
  799. // CHECK:STDOUT: }
  800. // CHECK:STDOUT: %.loc119: <witness> = complete_type_witness %.5 [template = constants.%.6]
  801. // CHECK:STDOUT:
  802. // CHECK:STDOUT: !members:
  803. // CHECK:STDOUT: .Self = constants.%FMissingImplicitParam
  804. // CHECK:STDOUT: }
  805. // CHECK:STDOUT:
  806. // CHECK:STDOUT: class @FMissingReturnType {
  807. // CHECK:STDOUT: impl_decl @impl.9 [template] {} {
  808. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FMissingReturnType [template = constants.%FMissingReturnType]
  809. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
  810. // CHECK:STDOUT: }
  811. // CHECK:STDOUT: %.loc132: <witness> = complete_type_witness %.5 [template = constants.%.6]
  812. // CHECK:STDOUT:
  813. // CHECK:STDOUT: !members:
  814. // CHECK:STDOUT: .Self = constants.%FMissingReturnType
  815. // CHECK:STDOUT: }
  816. // CHECK:STDOUT:
  817. // CHECK:STDOUT: class @FDifferentParamType {
  818. // CHECK:STDOUT: impl_decl @impl.10 [template] {} {
  819. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamType [template = constants.%FDifferentParamType]
  820. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
  821. // CHECK:STDOUT: }
  822. // CHECK:STDOUT: %.loc145: <witness> = complete_type_witness %.5 [template = constants.%.6]
  823. // CHECK:STDOUT:
  824. // CHECK:STDOUT: !members:
  825. // CHECK:STDOUT: .Self = constants.%FDifferentParamType
  826. // CHECK:STDOUT: }
  827. // CHECK:STDOUT:
  828. // CHECK:STDOUT: class @FDifferentImplicitParamType {
  829. // CHECK:STDOUT: impl_decl @impl.11 [template] {} {
  830. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType]
  831. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
  832. // CHECK:STDOUT: }
  833. // CHECK:STDOUT: %.loc158: <witness> = complete_type_witness %.5 [template = constants.%.6]
  834. // CHECK:STDOUT:
  835. // CHECK:STDOUT: !members:
  836. // CHECK:STDOUT: .Self = constants.%FDifferentImplicitParamType
  837. // CHECK:STDOUT: }
  838. // CHECK:STDOUT:
  839. // CHECK:STDOUT: class @FDifferentReturnType {
  840. // CHECK:STDOUT: impl_decl @impl.12 [template] {} {
  841. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentReturnType [template = constants.%FDifferentReturnType]
  842. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
  843. // CHECK:STDOUT: }
  844. // CHECK:STDOUT: %.loc171: <witness> = complete_type_witness %.5 [template = constants.%.6]
  845. // CHECK:STDOUT:
  846. // CHECK:STDOUT: !members:
  847. // CHECK:STDOUT: .Self = constants.%FDifferentReturnType
  848. // CHECK:STDOUT: }
  849. // CHECK:STDOUT:
  850. // CHECK:STDOUT: class @FDifferentParamName {
  851. // CHECK:STDOUT: impl_decl @impl.13 [template] {} {
  852. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentParamName [template = constants.%FDifferentParamName]
  853. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7]
  854. // CHECK:STDOUT: }
  855. // CHECK:STDOUT: %.loc185: <witness> = complete_type_witness %.5 [template = constants.%.6]
  856. // CHECK:STDOUT:
  857. // CHECK:STDOUT: !members:
  858. // CHECK:STDOUT: .Self = constants.%FDifferentParamName
  859. // CHECK:STDOUT: }
  860. // CHECK:STDOUT:
  861. // CHECK:STDOUT: class @SelfNestedBadParam {
  862. // CHECK:STDOUT: impl_decl @impl.14 [template] {} {
  863. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadParam [template = constants.%SelfNestedBadParam]
  864. // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10]
  865. // CHECK:STDOUT: }
  866. // CHECK:STDOUT: %.loc202: <witness> = complete_type_witness %.5 [template = constants.%.6]
  867. // CHECK:STDOUT:
  868. // CHECK:STDOUT: !members:
  869. // CHECK:STDOUT: .Self = constants.%SelfNestedBadParam
  870. // CHECK:STDOUT: }
  871. // CHECK:STDOUT:
  872. // CHECK:STDOUT: class @SelfNestedBadReturnType {
  873. // CHECK:STDOUT: impl_decl @impl.15 [template] {} {
  874. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType]
  875. // CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10]
  876. // CHECK:STDOUT: }
  877. // CHECK:STDOUT: %.loc214: <witness> = complete_type_witness %.5 [template = constants.%.6]
  878. // CHECK:STDOUT:
  879. // CHECK:STDOUT: !members:
  880. // CHECK:STDOUT: .Self = constants.%SelfNestedBadReturnType
  881. // CHECK:STDOUT: }
  882. // CHECK:STDOUT:
  883. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %.1) {
  884. // CHECK:STDOUT:
  885. // CHECK:STDOUT: fn();
  886. // CHECK:STDOUT: }
  887. // CHECK:STDOUT:
  888. // CHECK:STDOUT: fn @PossiblyF();
  889. // CHECK:STDOUT:
  890. // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type";
  891. // CHECK:STDOUT:
  892. // CHECK:STDOUT: fn @F.2(%b: bool);
  893. // CHECK:STDOUT:
  894. // CHECK:STDOUT: fn @F.3[%self: %FExtraImplicitParam]();
  895. // CHECK:STDOUT:
  896. // CHECK:STDOUT: fn @F.4() -> bool;
  897. // CHECK:STDOUT:
  898. // CHECK:STDOUT: generic fn @F.5(@J.%Self: %.7) {
  899. // CHECK:STDOUT:
  900. // CHECK:STDOUT: fn[%self: bool](%b: bool) -> bool;
  901. // CHECK:STDOUT: }
  902. // CHECK:STDOUT:
  903. // CHECK:STDOUT: fn @F.6[%self: bool]() -> bool;
  904. // CHECK:STDOUT:
  905. // CHECK:STDOUT: fn @F.7(%b: bool) -> bool;
  906. // CHECK:STDOUT:
  907. // CHECK:STDOUT: fn @F.8[%self: bool](%b: bool);
  908. // CHECK:STDOUT:
  909. // CHECK:STDOUT: fn @F.9[%self: bool](%b: %FDifferentParamType) -> bool;
  910. // CHECK:STDOUT:
  911. // CHECK:STDOUT: fn @F.10[%self: %FDifferentImplicitParamType](%b: bool) -> bool;
  912. // CHECK:STDOUT:
  913. // CHECK:STDOUT: fn @F.11[%self: bool](%b: bool) -> %FDifferentReturnType;
  914. // CHECK:STDOUT:
  915. // CHECK:STDOUT: fn @F.12[%self: bool](%not_b: bool) -> bool;
  916. // CHECK:STDOUT:
  917. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  918. // CHECK:STDOUT:
  919. // CHECK:STDOUT: generic fn @F.13(@SelfNested.%Self: %.10) {
  920. // CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.3)]
  921. // CHECK:STDOUT: %.1: type = ptr_type @F.13.%Self (%Self.3) [symbolic = %.1 (constants.%.11)]
  922. // CHECK:STDOUT: %.2: type = struct_type {.x: @F.13.%Self (%Self.3), .y: i32} [symbolic = %.2 (constants.%.12)]
  923. // CHECK:STDOUT: %.3: type = tuple_type (@F.13.%.1 (%.11), @F.13.%.2 (%.12)) [symbolic = %.3 (constants.%.14)]
  924. // CHECK:STDOUT: %.4: type = array_type constants.%.15, @F.13.%Self (%Self.3) [symbolic = %.4 (constants.%.16)]
  925. // CHECK:STDOUT:
  926. // CHECK:STDOUT: fn(%x: @F.13.%.3 (%.14)) -> @F.13.%.4 (%.16);
  927. // CHECK:STDOUT: }
  928. // CHECK:STDOUT:
  929. // CHECK:STDOUT: fn @F.14(%x: %.21) -> %.22;
  930. // CHECK:STDOUT:
  931. // CHECK:STDOUT: fn @F.15(%x: %.27) -> %.22;
  932. // CHECK:STDOUT:
  933. // CHECK:STDOUT: specific @F.1(constants.%Self.1) {}
  934. // CHECK:STDOUT:
  935. // CHECK:STDOUT: specific @F.1(constants.%FExtraParam) {}
  936. // CHECK:STDOUT:
  937. // CHECK:STDOUT: specific @F.1(constants.%FExtraImplicitParam) {}
  938. // CHECK:STDOUT:
  939. // CHECK:STDOUT: specific @F.1(constants.%FExtraReturnType) {}
  940. // CHECK:STDOUT:
  941. // CHECK:STDOUT: specific @F.5(constants.%Self.2) {}
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: specific @F.5(constants.%FMissingParam) {}
  944. // CHECK:STDOUT:
  945. // CHECK:STDOUT: specific @F.5(constants.%FMissingImplicitParam) {}
  946. // CHECK:STDOUT:
  947. // CHECK:STDOUT: specific @F.5(constants.%FMissingReturnType) {}
  948. // CHECK:STDOUT:
  949. // CHECK:STDOUT: specific @F.5(constants.%FDifferentParamType) {}
  950. // CHECK:STDOUT:
  951. // CHECK:STDOUT: specific @F.5(constants.%FDifferentImplicitParamType) {}
  952. // CHECK:STDOUT:
  953. // CHECK:STDOUT: specific @F.5(constants.%FDifferentReturnType) {}
  954. // CHECK:STDOUT:
  955. // CHECK:STDOUT: specific @F.5(constants.%FDifferentParamName) {}
  956. // CHECK:STDOUT:
  957. // CHECK:STDOUT: specific @F.13(constants.%Self.3) {
  958. // CHECK:STDOUT: %Self => constants.%Self.3
  959. // CHECK:STDOUT: %.1 => constants.%.11
  960. // CHECK:STDOUT: %.2 => constants.%.12
  961. // CHECK:STDOUT: %.3 => constants.%.14
  962. // CHECK:STDOUT: %.4 => constants.%.16
  963. // CHECK:STDOUT: }
  964. // CHECK:STDOUT:
  965. // CHECK:STDOUT: specific @F.13(constants.%SelfNestedBadParam) {
  966. // CHECK:STDOUT: %Self => constants.%SelfNestedBadParam
  967. // CHECK:STDOUT: %.1 => constants.%.19
  968. // CHECK:STDOUT: %.2 => constants.%.23
  969. // CHECK:STDOUT: %.3 => constants.%.24
  970. // CHECK:STDOUT: %.4 => constants.%.22
  971. // CHECK:STDOUT: }
  972. // CHECK:STDOUT:
  973. // CHECK:STDOUT: specific @F.13(constants.%SelfNestedBadReturnType) {
  974. // CHECK:STDOUT: %Self => constants.%SelfNestedBadReturnType
  975. // CHECK:STDOUT: %.1 => constants.%.25
  976. // CHECK:STDOUT: %.2 => constants.%.26
  977. // CHECK:STDOUT: %.3 => constants.%.27
  978. // CHECK:STDOUT: %.4 => constants.%.28
  979. // CHECK:STDOUT: }
  980. // CHECK:STDOUT: