require.carbon 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/require.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/require.carbon
  12. // --- fail_todo_extend.carbon
  13. library "[[@TEST_NAME]]";
  14. interface Y {
  15. fn YY();
  16. }
  17. //@dump-sem-ir-begin
  18. interface Z {
  19. extend require impls Y;
  20. }
  21. //@dump-sem-ir-end
  22. fn F(T:! Z) {
  23. // CHECK:STDERR: fail_todo_extend.carbon:[[@LINE+4]]:3: error: member name `YY` not found in `Z` [MemberNameNotFoundInInstScope]
  24. // CHECK:STDERR: T.YY();
  25. // CHECK:STDERR: ^~~~
  26. // CHECK:STDERR:
  27. T.YY();
  28. // CHECK:STDERR: fail_todo_extend.carbon:[[@LINE+4]]:3: error: cannot convert type `T` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet]
  29. // CHECK:STDERR: T.(Y.YY)();
  30. // CHECK:STDERR: ^~~~~~~~
  31. // CHECK:STDERR:
  32. T.(Y.YY)();
  33. }
  34. // --- fail_todo_implicit_self_impls.carbon
  35. library "[[@TEST_NAME]]";
  36. interface Y {
  37. fn YY();
  38. }
  39. //@dump-sem-ir-begin
  40. interface Z {
  41. require impls Y;
  42. }
  43. //@dump-sem-ir-end
  44. fn F(T:! Z) {
  45. // CHECK:STDERR: fail_todo_implicit_self_impls.carbon:[[@LINE+4]]:3: error: cannot convert type `T` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet]
  46. // CHECK:STDERR: T.(Y.YY)();
  47. // CHECK:STDERR: ^~~~~~~~
  48. // CHECK:STDERR:
  49. T.(Y.YY)();
  50. }
  51. // --- fail_todo_explicit_self_impls.carbon
  52. library "[[@TEST_NAME]]";
  53. interface Y {
  54. fn YY();
  55. }
  56. //@dump-sem-ir-begin
  57. interface Z {
  58. require Self impls Y;
  59. }
  60. //@dump-sem-ir-end
  61. fn F(T:! Z) {
  62. // CHECK:STDERR: fail_todo_explicit_self_impls.carbon:[[@LINE+4]]:3: error: cannot convert type `T` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet]
  63. // CHECK:STDERR: T.(Y.YY)();
  64. // CHECK:STDERR: ^~~~~~~~
  65. // CHECK:STDERR:
  66. T.(Y.YY)();
  67. }
  68. // --- fail_implicit_self_no_extend_name_lookup_fails.carbon
  69. library "[[@TEST_NAME]]";
  70. interface Y {
  71. fn YY();
  72. }
  73. interface Z {
  74. require impls Y;
  75. }
  76. fn F(T:! Z) {
  77. // This should fail name lookup since Z does not extend Y.
  78. //
  79. // CHECK:STDERR: fail_implicit_self_no_extend_name_lookup_fails.carbon:[[@LINE+4]]:3: error: member name `YY` not found in `Z` [MemberNameNotFoundInInstScope]
  80. // CHECK:STDERR: T.YY();
  81. // CHECK:STDERR: ^~~~
  82. // CHECK:STDERR:
  83. T.YY();
  84. }
  85. // --- fail_explicit_self_no_extend_name_lookup_fails.carbon
  86. library "[[@TEST_NAME]]";
  87. interface Y {
  88. fn YY();
  89. }
  90. interface Z {
  91. require Self impls Y;
  92. }
  93. fn F(T:! Z) {
  94. // This should fail name lookup since Z does not extend Y.
  95. //
  96. // CHECK:STDERR: fail_explicit_self_no_extend_name_lookup_fails.carbon:[[@LINE+4]]:3: error: member name `YY` not found in `Z` [MemberNameNotFoundInInstScope]
  97. // CHECK:STDERR: T.YY();
  98. // CHECK:STDERR: ^~~~
  99. // CHECK:STDERR:
  100. T.YY();
  101. }
  102. // --- explicit_self_specific_impls.carbon
  103. library "[[@TEST_NAME]]";
  104. interface Y {}
  105. class C(T:! type);
  106. //@dump-sem-ir-begin
  107. interface Z {
  108. require C(Self) impls Y;
  109. }
  110. //@dump-sem-ir-end
  111. // --- require_impls_where.carbon
  112. library "[[@TEST_NAME]]";
  113. interface Y { let Y1:! type; }
  114. //@dump-sem-ir-begin
  115. interface Z {
  116. require impls Y where .Y1 = ();
  117. }
  118. //@dump-sem-ir-end
  119. // --- require_impls_self_specific.carbon
  120. library "[[@TEST_NAME]]";
  121. //@dump-sem-ir-begin
  122. interface Z(T:! type) {
  123. require T impls Z(Self);
  124. }
  125. //@dump-sem-ir-end
  126. // --- fail_require_impls_without_self.carbon
  127. library "[[@TEST_NAME]]";
  128. interface Y {
  129. let Y1:! type;
  130. }
  131. interface Z(T:! type) {
  132. // Either the type `T` or the facet type `Y` must mention `Self` in a way that
  133. // it would appear in the type structure used for impl lookup (so inside a
  134. // `where` does not count). But they don't.
  135. //
  136. // CHECK:STDERR: fail_require_impls_without_self.carbon:[[@LINE+4]]:3: error: no `Self` reference found in `require` declaration; `Self` must appear in the self-type or as a generic parameter for each `interface` or `constraint` [RequireImplsMissingSelf]
  137. // CHECK:STDERR: require T impls Y where .Y1 = Self;
  138. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  139. // CHECK:STDERR:
  140. require T impls Y where .Y1 = Self;
  141. }
  142. // --- fail_require_impls_without_self_in_one_interface.carbon
  143. library "[[@TEST_NAME]]";
  144. interface Y(T:! type) {}
  145. interface Z(T:! type) {
  146. // Self is in one interface but not the other.
  147. //
  148. // CHECK:STDERR: fail_require_impls_without_self_in_one_interface.carbon:[[@LINE+4]]:3: error: no `Self` reference found in `require` declaration; `Self` must appear in the self-type or as a generic parameter for each `interface` or `constraint` [RequireImplsMissingSelf]
  149. // CHECK:STDERR: require T impls Y(Self) & Y({});
  150. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151. // CHECK:STDERR:
  152. require T impls Y(Self) & Y({});
  153. }
  154. // --- fail_self_impls_self.carbon
  155. library "[[@TEST_NAME]]";
  156. interface Z(T:! type) {
  157. // CHECK:STDERR: fail_self_impls_self.carbon:[[@LINE+4]]:17: error: `require` declaration constrained by a non-facet type; expected an `interface` or `constraint` name after `impls` [RequireImplsMissingFacetType]
  158. // CHECK:STDERR: require impls Self;
  159. // CHECK:STDERR: ^~~~
  160. // CHECK:STDERR:
  161. require impls Self;
  162. }
  163. // --- fail_impls_type.carbon
  164. library "[[@TEST_NAME]]";
  165. class C(T:! type) {}
  166. interface Z(T:! type) {
  167. // CHECK:STDERR: fail_impls_type.carbon:[[@LINE+4]]:19: error: `require` declaration constrained by a non-facet type; expected an `interface` or `constraint` name after `impls` [RequireImplsMissingFacetType]
  168. // CHECK:STDERR: require T impls C(Self);
  169. // CHECK:STDERR: ^~~~~~~
  170. // CHECK:STDERR:
  171. require T impls C(Self);
  172. }
  173. // --- fail_non_type_impls.carbon
  174. library "[[@TEST_NAME]]";
  175. interface Y {}
  176. interface Z(T:! type) {
  177. // CHECK:STDERR: fail_non_type_impls.carbon:[[@LINE+7]]:11: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
  178. // CHECK:STDERR: require 1 impls Y;
  179. // CHECK:STDERR: ^
  180. // CHECK:STDERR: fail_non_type_impls.carbon:[[@LINE+4]]:11: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
  181. // CHECK:STDERR: require 1 impls Y;
  182. // CHECK:STDERR: ^
  183. // CHECK:STDERR:
  184. require 1 impls Y;
  185. }
  186. // --- fail_impls_non_type.carbon
  187. library "[[@TEST_NAME]]";
  188. interface Y {}
  189. interface Z(T:! type) {
  190. // CHECK:STDERR: fail_impls_non_type.carbon:[[@LINE+4]]:17: error: `require` declaration constrained by a non-facet type; expected an `interface` or `constraint` name after `impls` [RequireImplsMissingFacetType]
  191. // CHECK:STDERR: require impls 1;
  192. // CHECK:STDERR: ^
  193. // CHECK:STDERR:
  194. require impls 1;
  195. }
  196. // --- require_self_in_requirement.carbon
  197. library "[[@TEST_NAME]]";
  198. interface Y {
  199. let Y1:! type;
  200. }
  201. //@dump-sem-ir-begin
  202. interface Z {
  203. // Self can appear in a requirement.
  204. require impls Y where .Y1 = Self;
  205. }
  206. //@dump-sem-ir-end
  207. // --- require_same.carbon
  208. library "[[@TEST_NAME]]";
  209. interface Y {
  210. require impls Y;
  211. }
  212. //@dump-sem-ir-begin
  213. interface Z(T:! type) {
  214. // This is okay because an interface Z can be identified before it's complete,
  215. // unlike a named constraint.
  216. require impls Z(T);
  217. }
  218. //@dump-sem-ir-end
  219. // CHECK:STDOUT: --- fail_todo_extend.carbon
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: constants {
  222. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  223. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  224. // CHECK:STDOUT: %Self.3b3: %Z.type = symbolic_binding Self, 0 [symbolic]
  225. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.3b3 [symbolic]
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: imports {
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: file {
  232. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: interface @Z {
  236. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.3b3]
  237. // CHECK:STDOUT: %Z.require0.decl = require_decl @Z.require0 [concrete] {
  238. // CHECK:STDOUT: require %Self.as_type impls <@Y>
  239. // CHECK:STDOUT: } {
  240. // CHECK:STDOUT: %Self.as_type: type = facet_access_type @Z.%Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  241. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: !members:
  245. // CHECK:STDOUT: .Self = %Self
  246. // CHECK:STDOUT: .Y = <poisoned>
  247. // CHECK:STDOUT: .YY = <poisoned>
  248. // CHECK:STDOUT: witness = ()
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: !requires:
  251. // CHECK:STDOUT: @Z.require0 {
  252. // CHECK:STDOUT: require @Z.require0.%Self.as_type impls <@Y>
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: generic require @Z.require0(@Z.%Self: %Z.type) {
  257. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.3b3)]
  258. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: specific @Z.require0(constants.%Self.3b3) {
  262. // CHECK:STDOUT: %Self => constants.%Self.3b3
  263. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  264. // CHECK:STDOUT: }
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: --- fail_todo_implicit_self_impls.carbon
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: constants {
  269. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  270. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  271. // CHECK:STDOUT: %Self.3b3: %Z.type = symbolic_binding Self, 0 [symbolic]
  272. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.3b3 [symbolic]
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: imports {
  276. // CHECK:STDOUT: }
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: file {
  279. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: interface @Z {
  283. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.3b3]
  284. // CHECK:STDOUT: %Z.require0.decl = require_decl @Z.require0 [concrete] {
  285. // CHECK:STDOUT: require %Self.as_type impls <@Y>
  286. // CHECK:STDOUT: } {
  287. // CHECK:STDOUT: %Self.as_type: type = facet_access_type @Z.%Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  288. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
  289. // CHECK:STDOUT: }
  290. // CHECK:STDOUT:
  291. // CHECK:STDOUT: !members:
  292. // CHECK:STDOUT: .Self = %Self
  293. // CHECK:STDOUT: .Y = <poisoned>
  294. // CHECK:STDOUT: witness = ()
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: !requires:
  297. // CHECK:STDOUT: @Z.require0 {
  298. // CHECK:STDOUT: require @Z.require0.%Self.as_type impls <@Y>
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT: }
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: generic require @Z.require0(@Z.%Self: %Z.type) {
  303. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.3b3)]
  304. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  305. // CHECK:STDOUT: }
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: specific @Z.require0(constants.%Self.3b3) {
  308. // CHECK:STDOUT: %Self => constants.%Self.3b3
  309. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: --- fail_todo_explicit_self_impls.carbon
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: constants {
  315. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  316. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  317. // CHECK:STDOUT: %Self.3b3: %Z.type = symbolic_binding Self, 0 [symbolic]
  318. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.3b3 [symbolic]
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT:
  321. // CHECK:STDOUT: imports {
  322. // CHECK:STDOUT: }
  323. // CHECK:STDOUT:
  324. // CHECK:STDOUT: file {
  325. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  326. // CHECK:STDOUT: }
  327. // CHECK:STDOUT:
  328. // CHECK:STDOUT: interface @Z {
  329. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.3b3]
  330. // CHECK:STDOUT: %Z.require0.decl = require_decl @Z.require0 [concrete] {
  331. // CHECK:STDOUT: require %.loc9 impls <@Y>
  332. // CHECK:STDOUT: } {
  333. // CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self [symbolic = %Self (constants.%Self.3b3)]
  334. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  335. // CHECK:STDOUT: %.loc9: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  336. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: !members:
  340. // CHECK:STDOUT: .Self = %Self
  341. // CHECK:STDOUT: .Y = <poisoned>
  342. // CHECK:STDOUT: witness = ()
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: !requires:
  345. // CHECK:STDOUT: @Z.require0 {
  346. // CHECK:STDOUT: require @Z.require0.%.loc9 impls <@Y>
  347. // CHECK:STDOUT: }
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT:
  350. // CHECK:STDOUT: generic require @Z.require0(@Z.%Self: %Z.type) {
  351. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.3b3)]
  352. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  353. // CHECK:STDOUT: }
  354. // CHECK:STDOUT:
  355. // CHECK:STDOUT: specific @Z.require0(constants.%Self.3b3) {
  356. // CHECK:STDOUT: %Self => constants.%Self.3b3
  357. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  358. // CHECK:STDOUT: }
  359. // CHECK:STDOUT:
  360. // CHECK:STDOUT: --- explicit_self_specific_impls.carbon
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: constants {
  363. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  364. // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
  365. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
  366. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  367. // CHECK:STDOUT: %Self.3b3: %Z.type = symbolic_binding Self, 0 [symbolic]
  368. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.3b3 [symbolic]
  369. // CHECK:STDOUT: %C.b0f: type = class_type @C, @C(%Self.binding.as_type) [symbolic]
  370. // CHECK:STDOUT: }
  371. // CHECK:STDOUT:
  372. // CHECK:STDOUT: imports {
  373. // CHECK:STDOUT: }
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: file {
  376. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT:
  379. // CHECK:STDOUT: interface @Z {
  380. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.3b3]
  381. // CHECK:STDOUT: %Z.require0.decl = require_decl @Z.require0 [concrete] {
  382. // CHECK:STDOUT: require %C.loc9_17.1 impls <@Y>
  383. // CHECK:STDOUT: } {
  384. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
  385. // CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self [symbolic = %Self (constants.%Self.3b3)]
  386. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  387. // CHECK:STDOUT: %.loc9: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  388. // CHECK:STDOUT: %C.loc9_17.1: type = class_type @C, @C(constants.%Self.binding.as_type) [symbolic = %C.loc9_17.2 (constants.%C.b0f)]
  389. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
  390. // CHECK:STDOUT: }
  391. // CHECK:STDOUT:
  392. // CHECK:STDOUT: !members:
  393. // CHECK:STDOUT: .Self = %Self
  394. // CHECK:STDOUT: .C = <poisoned>
  395. // CHECK:STDOUT: .Y = <poisoned>
  396. // CHECK:STDOUT: witness = ()
  397. // CHECK:STDOUT:
  398. // CHECK:STDOUT: !requires:
  399. // CHECK:STDOUT: @Z.require0 {
  400. // CHECK:STDOUT: require @Z.require0.%C.loc9_17.1 impls <@Y>
  401. // CHECK:STDOUT: }
  402. // CHECK:STDOUT: }
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: generic require @Z.require0(@Z.%Self: %Z.type) {
  405. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.3b3)]
  406. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  407. // CHECK:STDOUT: %C.loc9_17.2: type = class_type @C, @C(%Self.binding.as_type) [symbolic = %C.loc9_17.2 (constants.%C.b0f)]
  408. // CHECK:STDOUT: }
  409. // CHECK:STDOUT:
  410. // CHECK:STDOUT: specific @Z.require0(constants.%Self.3b3) {
  411. // CHECK:STDOUT: %Self => constants.%Self.3b3
  412. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  413. // CHECK:STDOUT: %C.loc9_17.2 => constants.%C.b0f
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT:
  416. // CHECK:STDOUT: --- require_impls_where.carbon
  417. // CHECK:STDOUT:
  418. // CHECK:STDOUT: constants {
  419. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  420. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  421. // CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, @Y.%Y1 [concrete]
  422. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  423. // CHECK:STDOUT: %Self.3b3: %Z.type = symbolic_binding Self, 0 [symbolic]
  424. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.3b3 [symbolic]
  425. // CHECK:STDOUT: %.Self: %Y.type = symbolic_binding .Self [symbolic_self]
  426. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  427. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  428. // CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @Y [symbolic_self]
  429. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic_self]
  430. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  431. // CHECK:STDOUT: %Y_where.type: type = facet_type <@Y where %impl.elem0 = %empty_tuple.type> [concrete]
  432. // CHECK:STDOUT: }
  433. // CHECK:STDOUT:
  434. // CHECK:STDOUT: imports {
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: file {
  438. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  439. // CHECK:STDOUT: }
  440. // CHECK:STDOUT:
  441. // CHECK:STDOUT: interface @Z {
  442. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.3b3]
  443. // CHECK:STDOUT: %Z.require0.decl = require_decl @Z.require0 [concrete] {
  444. // CHECK:STDOUT: require %Self.as_type impls <@Y where constants.%impl.elem0 = constants.%empty_tuple.type>
  445. // CHECK:STDOUT: } {
  446. // CHECK:STDOUT: %Self.as_type: type = facet_access_type @Z.%Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  447. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
  448. // CHECK:STDOUT: <elided>
  449. // CHECK:STDOUT: %.Self.ref: %Y.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  450. // CHECK:STDOUT: %Y1.ref: %Y.assoc_type = name_ref Y1, @Y1.%assoc0 [concrete = constants.%assoc0]
  451. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  452. // CHECK:STDOUT: %.loc7_25: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  453. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Y.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  454. // CHECK:STDOUT: %.loc7_32.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  455. // CHECK:STDOUT: %.loc7_32.2: type = converted %.loc7_32.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  456. // CHECK:STDOUT: %.loc7_19: type = where_expr %.Self [concrete = constants.%Y_where.type] {
  457. // CHECK:STDOUT: requirement_base_facet_type constants.%Y.type
  458. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc7_32.2
  459. // CHECK:STDOUT: }
  460. // CHECK:STDOUT: }
  461. // CHECK:STDOUT:
  462. // CHECK:STDOUT: !members:
  463. // CHECK:STDOUT: .Self = %Self
  464. // CHECK:STDOUT: .Y = <poisoned>
  465. // CHECK:STDOUT: witness = ()
  466. // CHECK:STDOUT:
  467. // CHECK:STDOUT: !requires:
  468. // CHECK:STDOUT: @Z.require0 {
  469. // CHECK:STDOUT: require @Z.require0.%Self.as_type impls <@Y where constants.%impl.elem0 = constants.%empty_tuple.type>
  470. // CHECK:STDOUT: }
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT:
  473. // CHECK:STDOUT: generic require @Z.require0(@Z.%Self: %Z.type) {
  474. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.3b3)]
  475. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  476. // CHECK:STDOUT: }
  477. // CHECK:STDOUT:
  478. // CHECK:STDOUT: specific @Z.require0(constants.%Self.3b3) {
  479. // CHECK:STDOUT: %Self => constants.%Self.3b3
  480. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  481. // CHECK:STDOUT: }
  482. // CHECK:STDOUT:
  483. // CHECK:STDOUT: --- require_impls_self_specific.carbon
  484. // CHECK:STDOUT:
  485. // CHECK:STDOUT: constants {
  486. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  487. // CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete]
  488. // CHECK:STDOUT: %Z.type.9fb: type = generic_interface_type @Z [concrete]
  489. // CHECK:STDOUT: %Z.generic: %Z.type.9fb = struct_value () [concrete]
  490. // CHECK:STDOUT: %Z.type.4d7: type = facet_type <@Z, @Z(%T)> [symbolic]
  491. // CHECK:STDOUT: %Self: %Z.type.4d7 = symbolic_binding Self, 1 [symbolic]
  492. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic]
  493. // CHECK:STDOUT: %Z.type.49d: type = facet_type <@Z, @Z(%Self.binding.as_type)> [symbolic]
  494. // CHECK:STDOUT: }
  495. // CHECK:STDOUT:
  496. // CHECK:STDOUT: imports {
  497. // CHECK:STDOUT: }
  498. // CHECK:STDOUT:
  499. // CHECK:STDOUT: file {
  500. // CHECK:STDOUT: %Z.decl: %Z.type.9fb = interface_decl @Z [concrete = constants.%Z.generic] {
  501. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  502. // CHECK:STDOUT: } {
  503. // CHECK:STDOUT: <elided>
  504. // CHECK:STDOUT: %T.loc4_13.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_13.1 (constants.%T)]
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT:
  508. // CHECK:STDOUT: generic interface @Z(%T.loc4_13.2: type) {
  509. // CHECK:STDOUT: %T.loc4_13.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_13.1 (constants.%T)]
  510. // CHECK:STDOUT:
  511. // CHECK:STDOUT: !definition:
  512. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%T.loc4_13.1)> [symbolic = %Z.type (constants.%Z.type.4d7)]
  513. // CHECK:STDOUT: %Self.loc4_23.2: @Z.%Z.type (%Z.type.4d7) = symbolic_binding Self, 1 [symbolic = %Self.loc4_23.2 (constants.%Self)]
  514. // CHECK:STDOUT:
  515. // CHECK:STDOUT: interface {
  516. // CHECK:STDOUT: %Self.loc4_23.1: @Z.%Z.type (%Z.type.4d7) = symbolic_binding Self, 1 [symbolic = %Self.loc4_23.2 (constants.%Self)]
  517. // CHECK:STDOUT: %Z.require0.decl = require_decl @Z.require0 [concrete] {
  518. // CHECK:STDOUT: require %T.ref impls <@Z, @Z(constants.%Self.binding.as_type)>
  519. // CHECK:STDOUT: } {
  520. // CHECK:STDOUT: %T.ref: type = name_ref T, @Z.%T.loc4_13.2 [symbolic = %T (constants.%T)]
  521. // CHECK:STDOUT: %Z.ref: %Z.type.9fb = name_ref Z, file.%Z.decl [concrete = constants.%Z.generic]
  522. // CHECK:STDOUT: %.loc5_21: @Z.require0.%Z.type.loc5_21 (%Z.type.4d7) = specific_constant @Z.%Self.loc4_23.1, @Z(constants.%T) [symbolic = %Self (constants.%Self)]
  523. // CHECK:STDOUT: %Self.ref: @Z.require0.%Z.type.loc5_21 (%Z.type.4d7) = name_ref Self, %.loc5_21 [symbolic = %Self (constants.%Self)]
  524. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  525. // CHECK:STDOUT: %.loc5_25: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  526. // CHECK:STDOUT: %Z.type.loc5_25.1: type = facet_type <@Z, @Z(constants.%Self.binding.as_type)> [symbolic = %Z.type.loc5_25.2 (constants.%Z.type.49d)]
  527. // CHECK:STDOUT: }
  528. // CHECK:STDOUT:
  529. // CHECK:STDOUT: !members:
  530. // CHECK:STDOUT: .Self = %Self.loc4_23.1
  531. // CHECK:STDOUT: .T = <poisoned>
  532. // CHECK:STDOUT: .Z = <poisoned>
  533. // CHECK:STDOUT: witness = ()
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: !requires:
  536. // CHECK:STDOUT: @Z.require0 {
  537. // CHECK:STDOUT: require @Z.require0.%T.ref impls <@Z, @Z(constants.%Self.binding.as_type)>
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT: }
  540. // CHECK:STDOUT: }
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: generic require @Z.require0(@Z.%T.loc4_13.2: type, @Z.%Self.loc4_23.1: @Z.%Z.type (%Z.type.4d7)) {
  543. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
  544. // CHECK:STDOUT: %Z.type.loc5_21: type = facet_type <@Z, @Z(%T)> [symbolic = %Z.type.loc5_21 (constants.%Z.type.4d7)]
  545. // CHECK:STDOUT: %Self: @Z.require0.%Z.type.loc5_21 (%Z.type.4d7) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self)]
  546. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  547. // CHECK:STDOUT: %Z.type.loc5_25.2: type = facet_type <@Z, @Z(%Self.binding.as_type)> [symbolic = %Z.type.loc5_25.2 (constants.%Z.type.49d)]
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT:
  550. // CHECK:STDOUT: specific @Z(constants.%T) {
  551. // CHECK:STDOUT: %T.loc4_13.1 => constants.%T
  552. // CHECK:STDOUT: }
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: specific @Z(constants.%Self.binding.as_type) {
  555. // CHECK:STDOUT: %T.loc4_13.1 => constants.%Self.binding.as_type
  556. // CHECK:STDOUT: }
  557. // CHECK:STDOUT:
  558. // CHECK:STDOUT: specific @Z.require0(constants.%T, constants.%Self) {
  559. // CHECK:STDOUT: %T => constants.%T
  560. // CHECK:STDOUT: %Z.type.loc5_21 => constants.%Z.type.4d7
  561. // CHECK:STDOUT: %Self => constants.%Self
  562. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  563. // CHECK:STDOUT: %Z.type.loc5_25.2 => constants.%Z.type.49d
  564. // CHECK:STDOUT: }
  565. // CHECK:STDOUT:
  566. // CHECK:STDOUT: --- require_self_in_requirement.carbon
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: constants {
  569. // CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
  570. // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete]
  571. // CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, @Y.%Y1 [concrete]
  572. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  573. // CHECK:STDOUT: %Self.3b3: %Z.type = symbolic_binding Self, 0 [symbolic]
  574. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self.3b3 [symbolic]
  575. // CHECK:STDOUT: %.Self: %Y.type = symbolic_binding .Self [symbolic_self]
  576. // CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
  577. // CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @Y [symbolic_self]
  578. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic_self]
  579. // CHECK:STDOUT: %Y_where.type: type = facet_type <@Y where %impl.elem0 = %Self.binding.as_type> [symbolic]
  580. // CHECK:STDOUT: }
  581. // CHECK:STDOUT:
  582. // CHECK:STDOUT: imports {
  583. // CHECK:STDOUT: }
  584. // CHECK:STDOUT:
  585. // CHECK:STDOUT: file {
  586. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT:
  589. // CHECK:STDOUT: interface @Z {
  590. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.3b3]
  591. // CHECK:STDOUT: %Z.require0.decl = require_decl @Z.require0 [concrete] {
  592. // CHECK:STDOUT: require %Self.as_type.loc10_11 impls <@Y where constants.%impl.elem0 = constants.%Self.binding.as_type>
  593. // CHECK:STDOUT: } {
  594. // CHECK:STDOUT: %Self.as_type.loc10_11: type = facet_access_type @Z.%Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  595. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
  596. // CHECK:STDOUT: <elided>
  597. // CHECK:STDOUT: %.Self.ref: %Y.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  598. // CHECK:STDOUT: %Y1.ref: %Y.assoc_type = name_ref Y1, @Y1.%assoc0 [concrete = constants.%assoc0]
  599. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
  600. // CHECK:STDOUT: %.loc10_25: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
  601. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Y.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  602. // CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self [symbolic = %Self (constants.%Self.3b3)]
  603. // CHECK:STDOUT: %Self.as_type.loc10_31: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  604. // CHECK:STDOUT: %.loc10_31: type = converted %Self.ref, %Self.as_type.loc10_31 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  605. // CHECK:STDOUT: %.loc10_19: type = where_expr %.Self [symbolic = %Y_where.type (constants.%Y_where.type)] {
  606. // CHECK:STDOUT: requirement_base_facet_type constants.%Y.type
  607. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_31
  608. // CHECK:STDOUT: }
  609. // CHECK:STDOUT: }
  610. // CHECK:STDOUT:
  611. // CHECK:STDOUT: !members:
  612. // CHECK:STDOUT: .Self = %Self
  613. // CHECK:STDOUT: .Y = <poisoned>
  614. // CHECK:STDOUT: witness = ()
  615. // CHECK:STDOUT:
  616. // CHECK:STDOUT: !requires:
  617. // CHECK:STDOUT: @Z.require0 {
  618. // CHECK:STDOUT: require @Z.require0.%Self.as_type.loc10_11 impls <@Y where constants.%impl.elem0 = constants.%Self.binding.as_type>
  619. // CHECK:STDOUT: }
  620. // CHECK:STDOUT: }
  621. // CHECK:STDOUT:
  622. // CHECK:STDOUT: generic require @Z.require0(@Z.%Self: %Z.type) {
  623. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.3b3)]
  624. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
  625. // CHECK:STDOUT: %Y_where.type: type = facet_type <@Y where constants.%impl.elem0 = %Self.binding.as_type> [symbolic = %Y_where.type (constants.%Y_where.type)]
  626. // CHECK:STDOUT: }
  627. // CHECK:STDOUT:
  628. // CHECK:STDOUT: specific @Z.require0(constants.%Self.3b3) {
  629. // CHECK:STDOUT: %Self => constants.%Self.3b3
  630. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type
  631. // CHECK:STDOUT: %Y_where.type => constants.%Y_where.type
  632. // CHECK:STDOUT: }
  633. // CHECK:STDOUT:
  634. // CHECK:STDOUT: --- require_same.carbon
  635. // CHECK:STDOUT:
  636. // CHECK:STDOUT: constants {
  637. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  638. // CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete]
  639. // CHECK:STDOUT: %Z.type.9fb: type = generic_interface_type @Z [concrete]
  640. // CHECK:STDOUT: %Z.generic: %Z.type.9fb = struct_value () [concrete]
  641. // CHECK:STDOUT: %Z.type.4d7: type = facet_type <@Z, @Z(%T)> [symbolic]
  642. // CHECK:STDOUT: %Self.c41: %Z.type.4d7 = symbolic_binding Self, 1 [symbolic]
  643. // CHECK:STDOUT: %Self.binding.as_type.6a8: type = symbolic_binding_type Self, 1, %Self.c41 [symbolic]
  644. // CHECK:STDOUT: }
  645. // CHECK:STDOUT:
  646. // CHECK:STDOUT: imports {
  647. // CHECK:STDOUT: }
  648. // CHECK:STDOUT:
  649. // CHECK:STDOUT: file {
  650. // CHECK:STDOUT: %Z.decl: %Z.type.9fb = interface_decl @Z [concrete = constants.%Z.generic] {
  651. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  652. // CHECK:STDOUT: } {
  653. // CHECK:STDOUT: <elided>
  654. // CHECK:STDOUT: %T.loc8_13.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_13.1 (constants.%T)]
  655. // CHECK:STDOUT: }
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT:
  658. // CHECK:STDOUT: generic interface @Z(%T.loc8_13.2: type) {
  659. // CHECK:STDOUT: %T.loc8_13.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_13.1 (constants.%T)]
  660. // CHECK:STDOUT:
  661. // CHECK:STDOUT: !definition:
  662. // CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%T.loc8_13.1)> [symbolic = %Z.type (constants.%Z.type.4d7)]
  663. // CHECK:STDOUT: %Self.loc8_23.2: @Z.%Z.type (%Z.type.4d7) = symbolic_binding Self, 1 [symbolic = %Self.loc8_23.2 (constants.%Self.c41)]
  664. // CHECK:STDOUT:
  665. // CHECK:STDOUT: interface {
  666. // CHECK:STDOUT: %Self.loc8_23.1: @Z.%Z.type (%Z.type.4d7) = symbolic_binding Self, 1 [symbolic = %Self.loc8_23.2 (constants.%Self.c41)]
  667. // CHECK:STDOUT: %Z.require1.decl = require_decl @Z.require1 [concrete] {
  668. // CHECK:STDOUT: require %Self.as_type impls <@Z, @Z(constants.%T)>
  669. // CHECK:STDOUT: } {
  670. // CHECK:STDOUT: %Self.as_type: type = facet_access_type @Z.%Self.loc8_23.1 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.6a8)]
  671. // CHECK:STDOUT: %Z.ref: %Z.type.9fb = name_ref Z, file.%Z.decl [concrete = constants.%Z.generic]
  672. // CHECK:STDOUT: %T.ref: type = name_ref T, @Z.%T.loc8_13.2 [symbolic = %T (constants.%T)]
  673. // CHECK:STDOUT: %Z.type.loc11_20: type = facet_type <@Z, @Z(constants.%T)> [symbolic = %Z.type.loc11_11 (constants.%Z.type.4d7)]
  674. // CHECK:STDOUT: }
  675. // CHECK:STDOUT:
  676. // CHECK:STDOUT: !members:
  677. // CHECK:STDOUT: .Self = %Self.loc8_23.1
  678. // CHECK:STDOUT: .Z = <poisoned>
  679. // CHECK:STDOUT: .T = <poisoned>
  680. // CHECK:STDOUT: witness = ()
  681. // CHECK:STDOUT:
  682. // CHECK:STDOUT: !requires:
  683. // CHECK:STDOUT: @Z.require1 {
  684. // CHECK:STDOUT: require @Z.require1.%Self.as_type impls <@Z, @Z(constants.%T)>
  685. // CHECK:STDOUT: }
  686. // CHECK:STDOUT: }
  687. // CHECK:STDOUT: }
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: generic require @Z.require1(@Z.%T.loc8_13.2: type, @Z.%Self.loc8_23.1: @Z.%Z.type (%Z.type.4d7)) {
  690. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
  691. // CHECK:STDOUT: %Z.type.loc11_11: type = facet_type <@Z, @Z(%T)> [symbolic = %Z.type.loc11_11 (constants.%Z.type.4d7)]
  692. // CHECK:STDOUT: %Self: @Z.require1.%Z.type.loc11_11 (%Z.type.4d7) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.c41)]
  693. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.6a8)]
  694. // CHECK:STDOUT: }
  695. // CHECK:STDOUT:
  696. // CHECK:STDOUT: specific @Z(constants.%T) {
  697. // CHECK:STDOUT: %T.loc8_13.1 => constants.%T
  698. // CHECK:STDOUT: }
  699. // CHECK:STDOUT:
  700. // CHECK:STDOUT: specific @Z.require1(constants.%T, constants.%Self.c41) {
  701. // CHECK:STDOUT: %T => constants.%T
  702. // CHECK:STDOUT: %Z.type.loc11_11 => constants.%Z.type.4d7
  703. // CHECK:STDOUT: %Self => constants.%Self.c41
  704. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.6a8
  705. // CHECK:STDOUT: }
  706. // CHECK:STDOUT: