assoc_const_self.carbon 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  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. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/assoc_const_self.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/assoc_const_self.carbon
  13. // --- assoc_const_self.carbon
  14. library "[[@TEST_NAME]]";
  15. interface I {
  16. let V:! Self;
  17. }
  18. impl {} as I where .V = {} {}
  19. impl i32 as I where .V = 0 {}
  20. // --- fail_assoc_const_mismatch.carbon
  21. library "[[@TEST_NAME]]";
  22. interface I {
  23. let V:! Self;
  24. }
  25. // CHECK:STDERR: fail_assoc_const_mismatch.carbon:[[@LINE+7]]:12: error: cannot implicitly convert expression of type `Core.IntLiteral` to `{}` [ConversionFailure]
  26. // CHECK:STDERR: impl {} as I where .V = 0 {}
  27. // CHECK:STDERR: ^~~~~~~~~~~~~~
  28. // CHECK:STDERR: fail_assoc_const_mismatch.carbon:[[@LINE+4]]:12: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs({})` [MissingImplInMemberAccessNote]
  29. // CHECK:STDERR: impl {} as I where .V = 0 {}
  30. // CHECK:STDERR: ^~~~~~~~~~~~~~
  31. // CHECK:STDERR:
  32. impl {} as I where .V = 0 {}
  33. // --- fail_assoc_const_not_constant_after_conversion.carbon
  34. library "[[@TEST_NAME]]";
  35. interface I {
  36. let V:! Self;
  37. }
  38. class C {}
  39. impl () as Core.ImplicitAs(C) {
  40. fn Convert[self: ()]() -> C { return {}; }
  41. }
  42. // CHECK:STDERR: fail_assoc_const_not_constant_after_conversion.carbon:[[@LINE+4]]:11: error: associated constant V given value `()` that is not constant after conversion to `C` [AssociatedConstantNotConstantAfterConversion]
  43. // CHECK:STDERR: impl C as I where .V = () {}
  44. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  45. // CHECK:STDERR:
  46. impl C as I where .V = () {}
  47. // --- fail_monomorphization_failure.carbon
  48. library "[[@TEST_NAME]]";
  49. interface I(N:! Core.IntLiteral()) {
  50. // CHECK:STDERR: fail_monomorphization_failure.carbon:[[@LINE+3]]:17: error: array bound of -1 is negative [ArrayBoundNegative]
  51. // CHECK:STDERR: let V:! array(Self, N);
  52. // CHECK:STDERR: ^~~~
  53. let V:! array(Self, N);
  54. }
  55. // CHECK:STDERR: fail_monomorphization_failure.carbon:[[@LINE+4]]:24: note: in `V` used here [ResolvingSpecificHere]
  56. // CHECK:STDERR: impl {} as I(-1) where .V = () {}
  57. // CHECK:STDERR: ^~
  58. // CHECK:STDERR:
  59. impl {} as I(-1) where .V = () {}
  60. // --- fail_todo_constrained_fn.carbon
  61. library "[[@TEST_NAME]]";
  62. interface I {
  63. let V:! Self;
  64. }
  65. fn F(T:! I where {} impls Core.ImplicitAs(.Self) and .V = {});
  66. fn CallF() {
  67. // TODO: This call should eventually work.
  68. // CHECK:STDERR: fail_todo_constrained_fn.carbon:[[@LINE+7]]:3: error: cannot convert type `{}` into type implementing `I where .(I.V) = {} and...` [ConversionFailureTypeToFacet]
  69. // CHECK:STDERR: F({});
  70. // CHECK:STDERR: ^~~~~
  71. // CHECK:STDERR: fail_todo_constrained_fn.carbon:[[@LINE-7]]:6: note: initializing generic parameter `T` declared here [InitializingGenericParam]
  72. // CHECK:STDERR: fn F(T:! I where {} impls Core.ImplicitAs(.Self) and .V = {});
  73. // CHECK:STDERR: ^
  74. // CHECK:STDERR:
  75. F({});
  76. }
  77. // CHECK:STDOUT: --- assoc_const_self.carbon
  78. // CHECK:STDOUT:
  79. // CHECK:STDOUT: constants {
  80. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  81. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  82. // CHECK:STDOUT: %Self.as_type.b70: type = facet_access_type %Self.826 [symbolic]
  83. // CHECK:STDOUT: %require_complete.9b1: <witness> = require_complete_type %Self.as_type.b70 [symbolic]
  84. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  85. // CHECK:STDOUT: %assoc0.45f: %I.assoc_type = assoc_entity element0, @I.%V [concrete]
  86. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  87. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  88. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  89. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  90. // CHECK:STDOUT: %I.facet.74c: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  91. // CHECK:STDOUT: %require_complete.d0c: <witness> = require_complete_type %.Self.as_type [symbolic_self]
  92. // CHECK:STDOUT: %impl.elem0: %.Self.as_type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  93. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  94. // CHECK:STDOUT: %I_where.type.6ef: type = facet_type <@I where %impl.elem0 = %empty_struct> [concrete]
  95. // CHECK:STDOUT: %I.impl_witness.3d1: <witness> = impl_witness file.%I.impl_witness_table.loc8 [concrete]
  96. // CHECK:STDOUT: %I.facet.b01: %I.type = facet_value %empty_struct_type, (%I.impl_witness.3d1) [concrete]
  97. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  98. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  99. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  100. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  101. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  102. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  103. // CHECK:STDOUT: %I_where.type.3d4: type = facet_type <@I where %impl.elem0 = %int_0.5c6> [concrete]
  104. // CHECK:STDOUT: %I.impl_witness.5ef: <witness> = impl_witness file.%I.impl_witness_table.loc10 [concrete]
  105. // CHECK:STDOUT: %I.facet.4b7: %I.type = facet_value %i32, (%I.impl_witness.5ef) [concrete]
  106. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  107. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
  108. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  109. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  110. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  111. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  112. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  113. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
  114. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  115. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  116. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
  117. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  118. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  119. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
  120. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
  121. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
  122. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn [concrete]
  123. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
  124. // CHECK:STDOUT: }
  125. // CHECK:STDOUT:
  126. // CHECK:STDOUT: imports {
  127. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  128. // CHECK:STDOUT: .Int = %Core.Int
  129. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  130. // CHECK:STDOUT: import Core//prelude
  131. // CHECK:STDOUT: import Core//prelude/...
  132. // CHECK:STDOUT: }
  133. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  134. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  135. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  136. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT:
  139. // CHECK:STDOUT: file {
  140. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  141. // CHECK:STDOUT: .Core = imports.%Core
  142. // CHECK:STDOUT: .I = %I.decl
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT: %Core.import = import Core
  145. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  146. // CHECK:STDOUT: impl_decl @impl.983 [concrete] {} {
  147. // CHECK:STDOUT: %.loc8_7.1: %empty_struct_type = struct_literal ()
  148. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  149. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  150. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  151. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  152. // CHECK:STDOUT: %V.ref: %I.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.45f]
  153. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  154. // CHECK:STDOUT: %.loc8_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  155. // CHECK:STDOUT: %impl.elem0: %.Self.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  156. // CHECK:STDOUT: %.loc8_26.1: %empty_struct_type = struct_literal ()
  157. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  158. // CHECK:STDOUT: %.loc8_26.2: %empty_struct_type = converted %.loc8_26.1, %empty_struct [concrete = constants.%empty_struct]
  159. // CHECK:STDOUT: %.loc8_14: type = where_expr %.Self [concrete = constants.%I_where.type.6ef] {
  160. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_26.2
  161. // CHECK:STDOUT: }
  162. // CHECK:STDOUT: }
  163. // CHECK:STDOUT: %I.impl_witness_table.loc8 = impl_witness_table (%impl_witness_assoc_constant.loc8), @impl.983 [concrete]
  164. // CHECK:STDOUT: %I.impl_witness.loc8: <witness> = impl_witness %I.impl_witness_table.loc8 [concrete = constants.%I.impl_witness.3d1]
  165. // CHECK:STDOUT: %impl_witness_assoc_constant.loc8: %empty_struct_type = impl_witness_assoc_constant constants.%empty_struct [concrete = constants.%empty_struct]
  166. // CHECK:STDOUT: impl_decl @impl.728 [concrete] {} {
  167. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  168. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  169. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  170. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  171. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  172. // CHECK:STDOUT: %V.ref: %I.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.45f]
  173. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  174. // CHECK:STDOUT: %.loc10_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  175. // CHECK:STDOUT: %impl.elem0: %.Self.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  176. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  177. // CHECK:STDOUT: %.loc10_15: type = where_expr %.Self [concrete = constants.%I_where.type.3d4] {
  178. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %int_0
  179. // CHECK:STDOUT: }
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT: %I.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant.loc10), @impl.728 [concrete]
  182. // CHECK:STDOUT: %I.impl_witness.loc10: <witness> = impl_witness %I.impl_witness_table.loc10 [concrete = constants.%I.impl_witness.5ef]
  183. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  184. // CHECK:STDOUT: %bound_method.loc10_15.1: <bound method> = bound_method constants.%int_0.5c6, %impl.elem0 [concrete = constants.%Convert.bound]
  185. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  186. // CHECK:STDOUT: %bound_method.loc10_15.2: <bound method> = bound_method constants.%int_0.5c6, %specific_fn [concrete = constants.%bound_method]
  187. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc10_15.2(constants.%int_0.5c6) [concrete = constants.%int_0.6a9]
  188. // CHECK:STDOUT: %.loc10_15.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9]
  189. // CHECK:STDOUT: %.loc10_15.2: %i32 = converted constants.%int_0.5c6, %.loc10_15.1 [concrete = constants.%int_0.6a9]
  190. // CHECK:STDOUT: %impl_witness_assoc_constant.loc10: %i32 = impl_witness_assoc_constant constants.%int_0.6a9 [concrete = constants.%int_0.6a9]
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT:
  193. // CHECK:STDOUT: interface @I {
  194. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  195. // CHECK:STDOUT: %V: @V.%Self.as_type (%Self.as_type.b70) = assoc_const_decl @V [concrete] {
  196. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%V [concrete = constants.%assoc0.45f]
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: !members:
  200. // CHECK:STDOUT: .Self = %Self
  201. // CHECK:STDOUT: .V = @V.%assoc0
  202. // CHECK:STDOUT: witness = (%V)
  203. // CHECK:STDOUT: }
  204. // CHECK:STDOUT:
  205. // CHECK:STDOUT: generic assoc_const @V(@I.%Self: %I.type) {
  206. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.826)]
  207. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.b70)]
  208. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.9b1)]
  209. // CHECK:STDOUT:
  210. // CHECK:STDOUT: assoc_const V:! @V.%Self.as_type (%Self.as_type.b70);
  211. // CHECK:STDOUT: }
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: impl @impl.983: %.loc8_7.2 as %.loc8_14 {
  214. // CHECK:STDOUT: !members:
  215. // CHECK:STDOUT: witness = file.%I.impl_witness.loc8
  216. // CHECK:STDOUT: }
  217. // CHECK:STDOUT:
  218. // CHECK:STDOUT: impl @impl.728: %i32 as %.loc10_15 {
  219. // CHECK:STDOUT: !members:
  220. // CHECK:STDOUT: witness = file.%I.impl_witness.loc10
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: specific @V(constants.%Self.826) {
  224. // CHECK:STDOUT: %Self => constants.%Self.826
  225. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.b70
  226. // CHECK:STDOUT: %require_complete => constants.%require_complete.9b1
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: specific @V(constants.%I.facet.74c) {
  230. // CHECK:STDOUT: %Self => constants.%I.facet.74c
  231. // CHECK:STDOUT: %Self.as_type => constants.%.Self.as_type
  232. // CHECK:STDOUT: %require_complete => constants.%require_complete.d0c
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: specific @V(constants.%I.facet.b01) {
  236. // CHECK:STDOUT: %Self => constants.%I.facet.b01
  237. // CHECK:STDOUT: %Self.as_type => constants.%empty_struct_type
  238. // CHECK:STDOUT: %require_complete => constants.%complete_type.357
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: specific @V(constants.%I.facet.4b7) {
  242. // CHECK:STDOUT: %Self => constants.%I.facet.4b7
  243. // CHECK:STDOUT: %Self.as_type => constants.%i32
  244. // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
  245. // CHECK:STDOUT: }
  246. // CHECK:STDOUT:
  247. // CHECK:STDOUT: --- fail_assoc_const_mismatch.carbon
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: constants {
  250. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  251. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  252. // CHECK:STDOUT: %Self.as_type.b70: type = facet_access_type %Self.826 [symbolic]
  253. // CHECK:STDOUT: %require_complete.9b1: <witness> = require_complete_type %Self.as_type.b70 [symbolic]
  254. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  255. // CHECK:STDOUT: %assoc0.45f: %I.assoc_type = assoc_entity element0, @I.%V [concrete]
  256. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  257. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  258. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  259. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  260. // CHECK:STDOUT: %I.facet.74c: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  261. // CHECK:STDOUT: %require_complete.d0c: <witness> = require_complete_type %.Self.as_type [symbolic_self]
  262. // CHECK:STDOUT: %impl.elem0: %.Self.as_type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  263. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  264. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %int_0> [concrete]
  265. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  266. // CHECK:STDOUT: %I.facet.7ee: %I.type = facet_value %empty_struct_type, (%I.impl_witness) [concrete]
  267. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  268. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  269. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: imports {
  273. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  274. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  275. // CHECK:STDOUT: import Core//prelude
  276. // CHECK:STDOUT: import Core//prelude/...
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: file {
  282. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  283. // CHECK:STDOUT: .Core = imports.%Core
  284. // CHECK:STDOUT: .I = %I.decl
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT: %Core.import = import Core
  287. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  288. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  289. // CHECK:STDOUT: %.loc15_7.1: %empty_struct_type = struct_literal ()
  290. // CHECK:STDOUT: %.loc15_7.2: type = converted %.loc15_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  291. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  292. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  293. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  294. // CHECK:STDOUT: %V.ref: %I.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.45f]
  295. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  296. // CHECK:STDOUT: %.loc15_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  297. // CHECK:STDOUT: %impl.elem0: %.Self.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  298. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  299. // CHECK:STDOUT: %.loc15_14: type = where_expr %.Self [concrete = constants.%I_where.type] {
  300. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %int_0
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete]
  304. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  305. // CHECK:STDOUT: %.loc15: %empty_struct_type = converted constants.%int_0, <error> [concrete = <error>]
  306. // CHECK:STDOUT: %impl_witness_assoc_constant: <error> = impl_witness_assoc_constant <error> [concrete = <error>]
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: interface @I {
  310. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  311. // CHECK:STDOUT: %V: @V.%Self.as_type (%Self.as_type.b70) = assoc_const_decl @V [concrete] {
  312. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%V [concrete = constants.%assoc0.45f]
  313. // CHECK:STDOUT: }
  314. // CHECK:STDOUT:
  315. // CHECK:STDOUT: !members:
  316. // CHECK:STDOUT: .Self = %Self
  317. // CHECK:STDOUT: .V = @V.%assoc0
  318. // CHECK:STDOUT: witness = (%V)
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT:
  321. // CHECK:STDOUT: generic assoc_const @V(@I.%Self: %I.type) {
  322. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.826)]
  323. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.b70)]
  324. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.9b1)]
  325. // CHECK:STDOUT:
  326. // CHECK:STDOUT: assoc_const V:! @V.%Self.as_type (%Self.as_type.b70);
  327. // CHECK:STDOUT: }
  328. // CHECK:STDOUT:
  329. // CHECK:STDOUT: impl @impl: %.loc15_7.2 as %.loc15_14 {
  330. // CHECK:STDOUT: !members:
  331. // CHECK:STDOUT: witness = file.%I.impl_witness
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT:
  334. // CHECK:STDOUT: specific @V(constants.%Self.826) {
  335. // CHECK:STDOUT: %Self => constants.%Self.826
  336. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.b70
  337. // CHECK:STDOUT: %require_complete => constants.%require_complete.9b1
  338. // CHECK:STDOUT: }
  339. // CHECK:STDOUT:
  340. // CHECK:STDOUT: specific @V(constants.%I.facet.74c) {
  341. // CHECK:STDOUT: %Self => constants.%I.facet.74c
  342. // CHECK:STDOUT: %Self.as_type => constants.%.Self.as_type
  343. // CHECK:STDOUT: %require_complete => constants.%require_complete.d0c
  344. // CHECK:STDOUT: }
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: specific @V(constants.%I.facet.7ee) {
  347. // CHECK:STDOUT: %Self => constants.%I.facet.7ee
  348. // CHECK:STDOUT: %Self.as_type => constants.%empty_struct_type
  349. // CHECK:STDOUT: %require_complete => constants.%complete_type
  350. // CHECK:STDOUT: }
  351. // CHECK:STDOUT:
  352. // CHECK:STDOUT: --- fail_assoc_const_not_constant_after_conversion.carbon
  353. // CHECK:STDOUT:
  354. // CHECK:STDOUT: constants {
  355. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  356. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  357. // CHECK:STDOUT: %Self.as_type.b70: type = facet_access_type %Self.826 [symbolic]
  358. // CHECK:STDOUT: %require_complete.9b1: <witness> = require_complete_type %Self.as_type.b70 [symbolic]
  359. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  360. // CHECK:STDOUT: %assoc0.45f: %I.assoc_type = assoc_entity element0, @I.%V [concrete]
  361. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  362. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  363. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  364. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  365. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  366. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  367. // CHECK:STDOUT: %ImplicitAs.type.15e: type = facet_type <@ImplicitAs, @ImplicitAs(%C)> [concrete]
  368. // CHECK:STDOUT: %Convert.type.56d: type = fn_type @Convert.1, @ImplicitAs(%C) [concrete]
  369. // CHECK:STDOUT: %ImplicitAs.impl_witness: <witness> = impl_witness file.%ImplicitAs.impl_witness_table [concrete]
  370. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  371. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  372. // CHECK:STDOUT: %Convert.type.721: type = fn_type @Convert.2 [concrete]
  373. // CHECK:STDOUT: %Convert.155: %Convert.type.721 = struct_value () [concrete]
  374. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.15e = facet_value %empty_tuple.type, (%ImplicitAs.impl_witness) [concrete]
  375. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  376. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  377. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  378. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  379. // CHECK:STDOUT: %I.facet.74c: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  380. // CHECK:STDOUT: %require_complete.d0c: <witness> = require_complete_type %.Self.as_type [symbolic_self]
  381. // CHECK:STDOUT: %impl.elem0: %.Self.as_type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  382. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  383. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple> [concrete]
  384. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  385. // CHECK:STDOUT: %I.facet.5dc: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  386. // CHECK:STDOUT: %.5c3: type = fn_type_with_self_type %Convert.type.56d, %ImplicitAs.facet [concrete]
  387. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %empty_tuple, %Convert.155 [concrete]
  388. // CHECK:STDOUT: }
  389. // CHECK:STDOUT:
  390. // CHECK:STDOUT: imports {
  391. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  392. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  393. // CHECK:STDOUT: import Core//prelude
  394. // CHECK:STDOUT: import Core//prelude/...
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT:
  399. // CHECK:STDOUT: file {
  400. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  401. // CHECK:STDOUT: .Core = imports.%Core
  402. // CHECK:STDOUT: .I = %I.decl
  403. // CHECK:STDOUT: .C = %C.decl
  404. // CHECK:STDOUT: }
  405. // CHECK:STDOUT: %Core.import = import Core
  406. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  407. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  408. // CHECK:STDOUT: impl_decl @impl.e86 [concrete] {} {
  409. // CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal ()
  410. // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  411. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  412. // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.cc7 = name_ref ImplicitAs, imports.%Core.ImplicitAs [concrete = constants.%ImplicitAs.generic]
  413. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  414. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%C)> [concrete = constants.%ImplicitAs.type.15e]
  415. // CHECK:STDOUT: }
  416. // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (@impl.e86.%Convert.decl), @impl.e86 [concrete]
  417. // CHECK:STDOUT: %ImplicitAs.impl_witness: <witness> = impl_witness %ImplicitAs.impl_witness_table [concrete = constants.%ImplicitAs.impl_witness]
  418. // CHECK:STDOUT: impl_decl @impl.cbe [concrete] {} {
  419. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  420. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  421. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  422. // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  423. // CHECK:STDOUT: %V.ref: %I.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.45f]
  424. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  425. // CHECK:STDOUT: %.loc18_19: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  426. // CHECK:STDOUT: %impl.elem0: %.Self.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  427. // CHECK:STDOUT: %.loc18_25.1: %empty_tuple.type = tuple_literal ()
  428. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  429. // CHECK:STDOUT: %.loc18_25.2: %empty_tuple.type = converted %.loc18_25.1, %empty_tuple [concrete = constants.%empty_tuple]
  430. // CHECK:STDOUT: %.loc18_13: type = where_expr %.Self [concrete = constants.%I_where.type] {
  431. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc18_25.2
  432. // CHECK:STDOUT: }
  433. // CHECK:STDOUT: }
  434. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl.cbe [concrete]
  435. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  436. // CHECK:STDOUT: %impl.elem0: %.5c3 = impl_witness_access constants.%ImplicitAs.impl_witness, element0 [concrete = constants.%Convert.155]
  437. // CHECK:STDOUT: %bound_method: <bound method> = bound_method constants.%empty_tuple, %impl.elem0 [concrete = constants.%Convert.bound]
  438. // CHECK:STDOUT: %.loc18_13.1: ref %C = temporary_storage
  439. // CHECK:STDOUT: %Convert.call: init %C = call %bound_method(constants.%empty_tuple) to %.loc18_13.1
  440. // CHECK:STDOUT: %.loc18_13.2: init %C = converted constants.%empty_tuple, %Convert.call
  441. // CHECK:STDOUT: %.loc18_13.3: ref %C = temporary %.loc18_13.1, %.loc18_13.2
  442. // CHECK:STDOUT: %.loc18_13.4: %C = bind_value %.loc18_13.3
  443. // CHECK:STDOUT: %impl_witness_assoc_constant: <error> = impl_witness_assoc_constant <error> [concrete = <error>]
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: interface @I {
  447. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  448. // CHECK:STDOUT: %V: @V.%Self.as_type (%Self.as_type.b70) = assoc_const_decl @V [concrete] {
  449. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%V [concrete = constants.%assoc0.45f]
  450. // CHECK:STDOUT: }
  451. // CHECK:STDOUT:
  452. // CHECK:STDOUT: !members:
  453. // CHECK:STDOUT: .Self = %Self
  454. // CHECK:STDOUT: .V = @V.%assoc0
  455. // CHECK:STDOUT: witness = (%V)
  456. // CHECK:STDOUT: }
  457. // CHECK:STDOUT:
  458. // CHECK:STDOUT: generic assoc_const @V(@I.%Self: %I.type) {
  459. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.826)]
  460. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.b70)]
  461. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.9b1)]
  462. // CHECK:STDOUT:
  463. // CHECK:STDOUT: assoc_const V:! @V.%Self.as_type (%Self.as_type.b70);
  464. // CHECK:STDOUT: }
  465. // CHECK:STDOUT:
  466. // CHECK:STDOUT: impl @impl.e86: %.loc10_7.2 as %ImplicitAs.type {
  467. // CHECK:STDOUT: %Convert.decl: %Convert.type.721 = fn_decl @Convert.2 [concrete = constants.%Convert.155] {
  468. // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
  469. // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
  470. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  471. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param1 [concrete]
  472. // CHECK:STDOUT: } {
  473. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  474. // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
  475. // CHECK:STDOUT: %.loc11_21.1: type = splice_block %.loc11_21.3 [concrete = constants.%empty_tuple.type] {
  476. // CHECK:STDOUT: %.loc11_21.2: %empty_tuple.type = tuple_literal ()
  477. // CHECK:STDOUT: %.loc11_21.3: type = converted %.loc11_21.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
  480. // CHECK:STDOUT: %return.param: ref %C = out_param call_param1
  481. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  482. // CHECK:STDOUT: }
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: !members:
  485. // CHECK:STDOUT: .C = <poisoned>
  486. // CHECK:STDOUT: .Convert = %Convert.decl
  487. // CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: impl @impl.cbe: %C.ref as %.loc18_13 {
  491. // CHECK:STDOUT: !members:
  492. // CHECK:STDOUT: witness = file.%I.impl_witness
  493. // CHECK:STDOUT: }
  494. // CHECK:STDOUT:
  495. // CHECK:STDOUT: class @C {
  496. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  497. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  498. // CHECK:STDOUT: complete_type_witness = %complete_type
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: !members:
  501. // CHECK:STDOUT: .Self = constants.%C
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: fn @Convert.2(%self.param: %empty_tuple.type) -> %return.param: %C {
  505. // CHECK:STDOUT: !entry:
  506. // CHECK:STDOUT: %.loc11_41.1: %empty_struct_type = struct_literal ()
  507. // CHECK:STDOUT: %.loc11_41.2: init %C = class_init (), %return [concrete = constants.%C.val]
  508. // CHECK:STDOUT: %.loc11_42: init %C = converted %.loc11_41.1, %.loc11_41.2 [concrete = constants.%C.val]
  509. // CHECK:STDOUT: return %.loc11_42 to %return
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT:
  512. // CHECK:STDOUT: specific @V(constants.%Self.826) {
  513. // CHECK:STDOUT: %Self => constants.%Self.826
  514. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.b70
  515. // CHECK:STDOUT: %require_complete => constants.%require_complete.9b1
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT:
  518. // CHECK:STDOUT: specific @V(constants.%I.facet.74c) {
  519. // CHECK:STDOUT: %Self => constants.%I.facet.74c
  520. // CHECK:STDOUT: %Self.as_type => constants.%.Self.as_type
  521. // CHECK:STDOUT: %require_complete => constants.%require_complete.d0c
  522. // CHECK:STDOUT: }
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: specific @V(constants.%I.facet.5dc) {
  525. // CHECK:STDOUT: %Self => constants.%I.facet.5dc
  526. // CHECK:STDOUT: %Self.as_type => constants.%C
  527. // CHECK:STDOUT: %require_complete => constants.%complete_type
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: --- fail_monomorphization_failure.carbon
  531. // CHECK:STDOUT:
  532. // CHECK:STDOUT: constants {
  533. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  534. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  535. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  536. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  537. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  538. // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [concrete]
  539. // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [concrete]
  540. // CHECK:STDOUT: %I.type.8a1: type = facet_type <@I, @I(%N)> [symbolic]
  541. // CHECK:STDOUT: %Self.3a0: %I.type.8a1 = bind_symbolic_name Self, 1 [symbolic]
  542. // CHECK:STDOUT: %Self.as_type.72b: type = facet_access_type %Self.3a0 [symbolic]
  543. // CHECK:STDOUT: %array_type: type = array_type %N, %Self.as_type.72b [symbolic]
  544. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type [symbolic]
  545. // CHECK:STDOUT: %I.assoc_type.9df: type = assoc_entity_type @I, @I(%N) [symbolic]
  546. // CHECK:STDOUT: %assoc0.293: %I.assoc_type.9df = assoc_entity element0, @I.%V [symbolic]
  547. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  548. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  549. // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
  550. // CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.1 [concrete]
  551. // CHECK:STDOUT: %Negate.impl_witness: <witness> = impl_witness imports.%Negate.impl_witness_table [concrete]
  552. // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value Core.IntLiteral, (%Negate.impl_witness) [concrete]
  553. // CHECK:STDOUT: %.63a: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [concrete]
  554. // CHECK:STDOUT: %Op.type.1be: type = fn_type @Op.2 [concrete]
  555. // CHECK:STDOUT: %Op.bba: %Op.type.1be = struct_value () [concrete]
  556. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %int_1, %Op.bba [concrete]
  557. // CHECK:STDOUT: %int_-1: Core.IntLiteral = int_value -1 [concrete]
  558. // CHECK:STDOUT: %I.type.057: type = facet_type <@I, @I(%int_-1)> [concrete]
  559. // CHECK:STDOUT: %.Self: %I.type.057 = bind_symbolic_name .Self [symbolic_self]
  560. // CHECK:STDOUT: %Self.e2e: %I.type.057 = bind_symbolic_name Self, 1 [symbolic]
  561. // CHECK:STDOUT: %I.assoc_type.247: type = assoc_entity_type @I, @I(%int_-1) [concrete]
  562. // CHECK:STDOUT: %assoc0.350: %I.assoc_type.247 = assoc_entity element0, @I.%V [concrete]
  563. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  564. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I, @I(%int_-1) [symbolic_self]
  565. // CHECK:STDOUT: %I.facet: %I.type.057 = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  566. // CHECK:STDOUT: }
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: imports {
  569. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  570. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  571. // CHECK:STDOUT: .Negate = %Core.Negate
  572. // CHECK:STDOUT: import Core//prelude
  573. // CHECK:STDOUT: import Core//prelude/...
  574. // CHECK:STDOUT: }
  575. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  576. // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [concrete = constants.%Negate.type]
  577. // CHECK:STDOUT: %Core.import_ref.c15: %Op.type.1be = import_ref Core//prelude/operators/arithmetic, loc94_31, loaded [concrete = constants.%Op.bba]
  578. // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.c15), @impl.8cb [concrete]
  579. // CHECK:STDOUT: }
  580. // CHECK:STDOUT:
  581. // CHECK:STDOUT: file {
  582. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  583. // CHECK:STDOUT: .Core = imports.%Core
  584. // CHECK:STDOUT: .I = %I.decl
  585. // CHECK:STDOUT: }
  586. // CHECK:STDOUT: %Core.import = import Core
  587. // CHECK:STDOUT: %I.decl: %I.type.dac = interface_decl @I [concrete = constants.%I.generic] {
  588. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete]
  589. // CHECK:STDOUT: } {
  590. // CHECK:STDOUT: %.loc4_33.1: type = splice_block %.loc4_33.3 [concrete = Core.IntLiteral] {
  591. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  592. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  593. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  594. // CHECK:STDOUT: %.loc4_33.2: type = value_of_initializer %int_literal.make_type [concrete = Core.IntLiteral]
  595. // CHECK:STDOUT: %.loc4_33.3: type = converted %int_literal.make_type, %.loc4_33.2 [concrete = Core.IntLiteral]
  596. // CHECK:STDOUT: }
  597. // CHECK:STDOUT: %N.loc4_13.1: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc4_13.2 (constants.%N)]
  598. // CHECK:STDOUT: }
  599. // CHECK:STDOUT: impl_decl @impl.19e [concrete] {} {
  600. // CHECK:STDOUT: %.loc15_7.1: %empty_struct_type = struct_literal ()
  601. // CHECK:STDOUT: %.loc15_7.2: type = converted %.loc15_7.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  602. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  603. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  604. // CHECK:STDOUT: %impl.elem0.loc15_14: %.63a = impl_witness_access constants.%Negate.impl_witness, element0 [concrete = constants.%Op.bba]
  605. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1, %impl.elem0.loc15_14 [concrete = constants.%Op.bound]
  606. // CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %bound_method(%int_1) [concrete = constants.%int_-1]
  607. // CHECK:STDOUT: %.loc15_16.1: Core.IntLiteral = value_of_initializer %int.snegate [concrete = constants.%int_-1]
  608. // CHECK:STDOUT: %.loc15_16.2: Core.IntLiteral = converted %int.snegate, %.loc15_16.1 [concrete = constants.%int_-1]
  609. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%int_-1)> [concrete = constants.%I.type.057]
  610. // CHECK:STDOUT: %.Self: %I.type.057 = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  611. // CHECK:STDOUT: %.Self.ref: %I.type.057 = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  612. // CHECK:STDOUT: %.loc15_24.1: %I.assoc_type.247 = specific_constant @V.%assoc0, @I(constants.%int_-1) [concrete = constants.%assoc0.350]
  613. // CHECK:STDOUT: %V.ref: %I.assoc_type.247 = name_ref V, %.loc15_24.1 [concrete = constants.%assoc0.350]
  614. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
  615. // CHECK:STDOUT: %.loc15_24.2: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
  616. // CHECK:STDOUT: %impl.elem0.loc15_24: <error> = impl_witness_access constants.%I.lookup_impl_witness, element0 [concrete = <error>]
  617. // CHECK:STDOUT: %.loc15_30: %empty_tuple.type = tuple_literal ()
  618. // CHECK:STDOUT: %.loc15_18: type = where_expr %.Self [concrete = <error>] {
  619. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc15_24, <error>
  620. // CHECK:STDOUT: }
  621. // CHECK:STDOUT: }
  622. // CHECK:STDOUT: }
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: generic interface @I(%N.loc4_13.1: Core.IntLiteral) {
  625. // CHECK:STDOUT: %N.loc4_13.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc4_13.2 (constants.%N)]
  626. // CHECK:STDOUT:
  627. // CHECK:STDOUT: !definition:
  628. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%N.loc4_13.2)> [symbolic = %I.type (constants.%I.type.8a1)]
  629. // CHECK:STDOUT: %Self.2: @I.%I.type (%I.type.8a1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.3a0)]
  630. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%N.loc4_13.2) [symbolic = %I.assoc_type (constants.%I.assoc_type.9df)]
  631. // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.9df) = assoc_entity element0, %V [symbolic = %assoc0 (constants.%assoc0.293)]
  632. // CHECK:STDOUT:
  633. // CHECK:STDOUT: interface {
  634. // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.8a1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.3a0)]
  635. // CHECK:STDOUT: %V: @V.%array_type (%array_type) = assoc_const_decl @V [concrete] {
  636. // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.9df) = assoc_entity element0, @I.%V [symbolic = @I.%assoc0 (constants.%assoc0.293)]
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT:
  639. // CHECK:STDOUT: !members:
  640. // CHECK:STDOUT: .Self = %Self.1
  641. // CHECK:STDOUT: .N = <poisoned>
  642. // CHECK:STDOUT: .V = @V.%assoc0
  643. // CHECK:STDOUT: witness = (%V)
  644. // CHECK:STDOUT: }
  645. // CHECK:STDOUT: }
  646. // CHECK:STDOUT:
  647. // CHECK:STDOUT: generic assoc_const @V(@I.%N.loc4_13.1: Core.IntLiteral, @I.%Self.1: @I.%I.type (%I.type.8a1)) {
  648. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  649. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%N)> [symbolic = %I.type (constants.%I.type.8a1)]
  650. // CHECK:STDOUT: %Self: @V.%I.type (%I.type.8a1) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3a0)]
  651. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.72b)]
  652. // CHECK:STDOUT: %array_type: type = array_type %N, %Self.as_type [symbolic = %array_type (constants.%array_type)]
  653. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type [symbolic = %require_complete (constants.%require_complete)]
  654. // CHECK:STDOUT:
  655. // CHECK:STDOUT: assoc_const V:! @V.%array_type (%array_type);
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT:
  658. // CHECK:STDOUT: impl @impl.19e: %.loc15_7.2 as %.loc15_18 {
  659. // CHECK:STDOUT: !members:
  660. // CHECK:STDOUT: witness = <error>
  661. // CHECK:STDOUT: }
  662. // CHECK:STDOUT:
  663. // CHECK:STDOUT: specific @I(constants.%N) {
  664. // CHECK:STDOUT: %N.loc4_13.2 => constants.%N
  665. // CHECK:STDOUT: }
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: specific @V(constants.%N, constants.%Self.3a0) {
  668. // CHECK:STDOUT: %N => constants.%N
  669. // CHECK:STDOUT: %I.type => constants.%I.type.8a1
  670. // CHECK:STDOUT: %Self => constants.%Self.3a0
  671. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.72b
  672. // CHECK:STDOUT: %array_type => constants.%array_type
  673. // CHECK:STDOUT: %require_complete => constants.%require_complete
  674. // CHECK:STDOUT: }
  675. // CHECK:STDOUT:
  676. // CHECK:STDOUT: specific @I(constants.%int_-1) {
  677. // CHECK:STDOUT: %N.loc4_13.2 => constants.%int_-1
  678. // CHECK:STDOUT:
  679. // CHECK:STDOUT: !definition:
  680. // CHECK:STDOUT: %I.type => constants.%I.type.057
  681. // CHECK:STDOUT: %Self.2 => constants.%Self.e2e
  682. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.247
  683. // CHECK:STDOUT: %assoc0 => constants.%assoc0.350
  684. // CHECK:STDOUT: }
  685. // CHECK:STDOUT:
  686. // CHECK:STDOUT: specific @V(constants.%int_-1, constants.%I.facet) {
  687. // CHECK:STDOUT: %N => constants.%int_-1
  688. // CHECK:STDOUT: %I.type => constants.%I.type.057
  689. // CHECK:STDOUT: %Self => constants.%I.facet
  690. // CHECK:STDOUT: %Self.as_type => constants.%.Self.as_type
  691. // CHECK:STDOUT: %array_type => <error>
  692. // CHECK:STDOUT: %require_complete => <error>
  693. // CHECK:STDOUT: }
  694. // CHECK:STDOUT:
  695. // CHECK:STDOUT: --- fail_todo_constrained_fn.carbon
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: constants {
  698. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  699. // CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
  700. // CHECK:STDOUT: %Self.as_type.b70: type = facet_access_type %Self.826 [symbolic]
  701. // CHECK:STDOUT: %require_complete.9b1: <witness> = require_complete_type %Self.as_type.b70 [symbolic]
  702. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  703. // CHECK:STDOUT: %assoc0.45f: %I.assoc_type = assoc_entity element0, @I.%V [concrete]
  704. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
  705. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  706. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  707. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  708. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
  709. // CHECK:STDOUT: %ImplicitAs.type.2a8: type = facet_type <@ImplicitAs, @ImplicitAs(%.Self.as_type)> [symbolic_self]
  710. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
  711. // CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
  712. // CHECK:STDOUT: %require_complete.d0c: <witness> = require_complete_type %.Self.as_type [symbolic_self]
  713. // CHECK:STDOUT: %impl.elem0: %.Self.as_type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
  714. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  715. // CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct and TODO> [concrete]
  716. // CHECK:STDOUT: %T: %I_where.type = bind_symbolic_name T, 0 [symbolic]
  717. // CHECK:STDOUT: %pattern_type.189: type = pattern_type %I_where.type [concrete]
  718. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  719. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  720. // CHECK:STDOUT: %CallF.type: type = fn_type @CallF [concrete]
  721. // CHECK:STDOUT: %CallF: %CallF.type = struct_value () [concrete]
  722. // CHECK:STDOUT: }
  723. // CHECK:STDOUT:
  724. // CHECK:STDOUT: imports {
  725. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  726. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  727. // CHECK:STDOUT: import Core//prelude
  728. // CHECK:STDOUT: import Core//prelude/...
  729. // CHECK:STDOUT: }
  730. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  731. // CHECK:STDOUT: }
  732. // CHECK:STDOUT:
  733. // CHECK:STDOUT: file {
  734. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  735. // CHECK:STDOUT: .Core = imports.%Core
  736. // CHECK:STDOUT: .I = %I.decl
  737. // CHECK:STDOUT: .F = %F.decl
  738. // CHECK:STDOUT: .CallF = %CallF.decl
  739. // CHECK:STDOUT: }
  740. // CHECK:STDOUT: %Core.import = import Core
  741. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  742. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  743. // CHECK:STDOUT: %T.patt: %pattern_type.189 = symbolic_binding_pattern T, 0 [concrete]
  744. // CHECK:STDOUT: } {
  745. // CHECK:STDOUT: %.loc8_12.1: type = splice_block %.loc8_12.2 [concrete = constants.%I_where.type] {
  746. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  747. // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  748. // CHECK:STDOUT: %.loc8_19.1: %empty_struct_type = struct_literal ()
  749. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  750. // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.cc7 = name_ref ImplicitAs, imports.%Core.ImplicitAs [concrete = constants.%ImplicitAs.generic]
  751. // CHECK:STDOUT: %.Self.ref.loc8_43: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  752. // CHECK:STDOUT: %.Self.as_type.loc8_48: type = facet_access_type %.Self.ref.loc8_43 [symbolic_self = constants.%.Self.as_type]
  753. // CHECK:STDOUT: %.loc8_48: type = converted %.Self.ref.loc8_43, %.Self.as_type.loc8_48 [symbolic_self = constants.%.Self.as_type]
  754. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%.Self.as_type)> [symbolic_self = constants.%ImplicitAs.type.2a8]
  755. // CHECK:STDOUT: %.loc8_19.2: type = converted %.loc8_19.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  756. // CHECK:STDOUT: %.Self.ref.loc8_54: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
  757. // CHECK:STDOUT: %V.ref: %I.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0.45f]
  758. // CHECK:STDOUT: %.Self.as_type.loc8_54: type = facet_access_type %.Self.ref.loc8_54 [symbolic_self = constants.%.Self.as_type]
  759. // CHECK:STDOUT: %.loc8_54: type = converted %.Self.ref.loc8_54, %.Self.as_type.loc8_54 [symbolic_self = constants.%.Self.as_type]
  760. // CHECK:STDOUT: %impl.elem0: %.Self.as_type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
  761. // CHECK:STDOUT: %.loc8_60.1: %empty_struct_type = struct_literal ()
  762. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  763. // CHECK:STDOUT: %.loc8_60.2: %empty_struct_type = converted %.loc8_60.1, %empty_struct [concrete = constants.%empty_struct]
  764. // CHECK:STDOUT: %.loc8_12.2: type = where_expr %.Self [concrete = constants.%I_where.type] {
  765. // CHECK:STDOUT: requirement_impls %.loc8_19.2, %ImplicitAs.type
  766. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc8_60.2
  767. // CHECK:STDOUT: }
  768. // CHECK:STDOUT: }
  769. // CHECK:STDOUT: %T.loc8_6.1: %I_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_6.2 (constants.%T)]
  770. // CHECK:STDOUT: }
  771. // CHECK:STDOUT: %CallF.decl: %CallF.type = fn_decl @CallF [concrete = constants.%CallF] {} {}
  772. // CHECK:STDOUT: }
  773. // CHECK:STDOUT:
  774. // CHECK:STDOUT: interface @I {
  775. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
  776. // CHECK:STDOUT: %V: @V.%Self.as_type (%Self.as_type.b70) = assoc_const_decl @V [concrete] {
  777. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%V [concrete = constants.%assoc0.45f]
  778. // CHECK:STDOUT: }
  779. // CHECK:STDOUT:
  780. // CHECK:STDOUT: !members:
  781. // CHECK:STDOUT: .Self = %Self
  782. // CHECK:STDOUT: .V = @V.%assoc0
  783. // CHECK:STDOUT: witness = (%V)
  784. // CHECK:STDOUT: }
  785. // CHECK:STDOUT:
  786. // CHECK:STDOUT: generic assoc_const @V(@I.%Self: %I.type) {
  787. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.826)]
  788. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.b70)]
  789. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.9b1)]
  790. // CHECK:STDOUT:
  791. // CHECK:STDOUT: assoc_const V:! @V.%Self.as_type (%Self.as_type.b70);
  792. // CHECK:STDOUT: }
  793. // CHECK:STDOUT:
  794. // CHECK:STDOUT: generic fn @F(%T.loc8_6.1: %I_where.type) {
  795. // CHECK:STDOUT: %T.loc8_6.2: %I_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_6.2 (constants.%T)]
  796. // CHECK:STDOUT:
  797. // CHECK:STDOUT: fn();
  798. // CHECK:STDOUT: }
  799. // CHECK:STDOUT:
  800. // CHECK:STDOUT: fn @CallF() {
  801. // CHECK:STDOUT: !entry:
  802. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  803. // CHECK:STDOUT: %.loc19: %empty_struct_type = struct_literal ()
  804. // CHECK:STDOUT: return
  805. // CHECK:STDOUT: }
  806. // CHECK:STDOUT:
  807. // CHECK:STDOUT: specific @V(constants.%Self.826) {
  808. // CHECK:STDOUT: %Self => constants.%Self.826
  809. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.b70
  810. // CHECK:STDOUT: %require_complete => constants.%require_complete.9b1
  811. // CHECK:STDOUT: }
  812. // CHECK:STDOUT:
  813. // CHECK:STDOUT: specific @V(constants.%I.facet) {
  814. // CHECK:STDOUT: %Self => constants.%I.facet
  815. // CHECK:STDOUT: %Self.as_type => constants.%.Self.as_type
  816. // CHECK:STDOUT: %require_complete => constants.%require_complete.d0c
  817. // CHECK:STDOUT: }
  818. // CHECK:STDOUT:
  819. // CHECK:STDOUT: specific @F(constants.%T) {
  820. // CHECK:STDOUT: %T.loc8_6.2 => constants.%T
  821. // CHECK:STDOUT: }
  822. // CHECK:STDOUT: