interface_args.carbon 100 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548
  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/min_prelude/destroy.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/impl/min_prelude/interface_args.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/min_prelude/interface_args.carbon
  12. // --- core.carbon
  13. package Core;
  14. interface ImplicitAs(Dest:! type) {
  15. fn Convert[self: Self]() -> Dest;
  16. }
  17. // --- action.carbon
  18. library "[[@TEST_NAME]]";
  19. interface Action(T:! type) {
  20. fn Op[self: Self]();
  21. }
  22. class A {}
  23. class B {}
  24. class C {}
  25. impl A as Action(B) {
  26. fn Op[self: Self]() {}
  27. }
  28. fn F(a: A) { a.(Action(B).Op)(); }
  29. // --- action.impl.carbon
  30. impl library "[[@TEST_NAME]]";
  31. fn G(a: A) { a.(Action(B).Op)(); }
  32. // --- fail_action.impl.carbon
  33. impl library "[[@TEST_NAME]]";
  34. // CHECK:STDERR: fail_action.impl.carbon:[[@LINE+4]]:14: error: cannot access member of interface `Action(C)` in type `A` that does not implement that interface [MissingImplInMemberAccess]
  35. // CHECK:STDERR: fn G(a: A) { a.(Action(C).Op)(); }
  36. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  37. // CHECK:STDERR:
  38. fn G(a: A) { a.(Action(C).Op)(); }
  39. // --- factory.carbon
  40. library "[[@TEST_NAME]]";
  41. interface Factory(T:! type) {
  42. // Non-instance class function
  43. fn Make() -> T;
  44. // Instance method
  45. fn Method[self: Self]() -> T;
  46. }
  47. class A {}
  48. class B {}
  49. impl A as Factory(B) {
  50. fn Make() -> B;
  51. fn Method[self: Self]() -> B;
  52. }
  53. // --- factory.impl.carbon
  54. impl library "[[@TEST_NAME]]";
  55. fn MakeB() -> B {
  56. return A.(Factory(B).Make)();
  57. }
  58. fn InstanceB(a: A) -> B {
  59. return a.(Factory(B).Method)();
  60. }
  61. // --- fail_factory.impl.carbon
  62. impl library "[[@TEST_NAME]]";
  63. import Core;
  64. class C {}
  65. fn MakeC() -> C {
  66. // CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+4]]:10: error: cannot convert type `A` into type implementing `Factory(C)` [ConversionFailureTypeToFacet]
  67. // CHECK:STDERR: return A.(Factory(C).Make)();
  68. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
  69. // CHECK:STDERR:
  70. return A.(Factory(C).Make)();
  71. }
  72. fn InstanceC(a: A) -> C {
  73. // CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Factory(C)` in type `A` that does not implement that interface [MissingImplInMemberAccess]
  74. // CHECK:STDERR: return a.(Factory(C).Method)();
  75. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  76. // CHECK:STDERR:
  77. return a.(Factory(C).Method)();
  78. }
  79. // CHECK:STDOUT: --- core.carbon
  80. // CHECK:STDOUT:
  81. // CHECK:STDOUT: constants {
  82. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  83. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  84. // CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete]
  85. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete]
  86. // CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  87. // CHECK:STDOUT: %Self: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic]
  88. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  89. // CHECK:STDOUT: %pattern_type.a93: type = pattern_type %Self.as_type [symbolic]
  90. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %Dest [symbolic]
  91. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
  92. // CHECK:STDOUT: %Convert: %Convert.type = struct_value () [symbolic]
  93. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  94. // CHECK:STDOUT: %assoc0: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic]
  95. // CHECK:STDOUT: }
  96. // CHECK:STDOUT:
  97. // CHECK:STDOUT: file {
  98. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  99. // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
  100. // CHECK:STDOUT: }
  101. // CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] {
  102. // CHECK:STDOUT: %Dest.patt: %pattern_type.98f = symbolic_binding_pattern Dest, 0 [concrete]
  103. // CHECK:STDOUT: } {
  104. // CHECK:STDOUT: %Dest.loc3_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc3_22.2 (constants.%Dest)]
  105. // CHECK:STDOUT: }
  106. // CHECK:STDOUT: }
  107. // CHECK:STDOUT:
  108. // CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc3_22.1: type) {
  109. // CHECK:STDOUT: %Dest.loc3_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc3_22.2 (constants.%Dest)]
  110. // CHECK:STDOUT:
  111. // CHECK:STDOUT: !definition:
  112. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc3_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  113. // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  114. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest.loc3_22.2) [symbolic = %Convert.type (constants.%Convert.type)]
  115. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type) = struct_value () [symbolic = %Convert (constants.%Convert)]
  116. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest.loc3_22.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)]
  117. // CHECK:STDOUT: %assoc0.loc4_35.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0)]
  118. // CHECK:STDOUT:
  119. // CHECK:STDOUT: interface {
  120. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  121. // CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type) = fn_decl @Convert [symbolic = @ImplicitAs.%Convert (constants.%Convert)] {
  122. // CHECK:STDOUT: %self.patt: @Convert.%pattern_type.loc4_14 (%pattern_type.a93) = binding_pattern self [concrete]
  123. // CHECK:STDOUT: %self.param_patt: @Convert.%pattern_type.loc4_14 (%pattern_type.a93) = value_param_pattern %self.patt, call_param0 [concrete]
  124. // CHECK:STDOUT: %return.patt: @Convert.%pattern_type.loc4_28 (%pattern_type.7dc) = return_slot_pattern [concrete]
  125. // CHECK:STDOUT: %return.param_patt: @Convert.%pattern_type.loc4_28 (%pattern_type.7dc) = out_param_pattern %return.patt, call_param1 [concrete]
  126. // CHECK:STDOUT: } {
  127. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc3_22.1 [symbolic = %Dest (constants.%Dest)]
  128. // CHECK:STDOUT: %self.param: @Convert.%Self.as_type.loc4_20.1 (%Self.as_type) = value_param call_param0
  129. // CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.3 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] {
  130. // CHECK:STDOUT: %.loc4_20.2: @Convert.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self)]
  131. // CHECK:STDOUT: %Self.ref: @Convert.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc4_20.2 [symbolic = %Self (constants.%Self)]
  132. // CHECK:STDOUT: %Self.as_type.loc4_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)]
  133. // CHECK:STDOUT: %.loc4_20.3: type = converted %Self.ref, %Self.as_type.loc4_20.2 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)]
  134. // CHECK:STDOUT: }
  135. // CHECK:STDOUT: %self: @Convert.%Self.as_type.loc4_20.1 (%Self.as_type) = bind_name self, %self.param
  136. // CHECK:STDOUT: %return.param: ref @Convert.%Dest (%Dest) = out_param call_param1
  137. // CHECK:STDOUT: %return: ref @Convert.%Dest (%Dest) = return_slot %return.param
  138. // CHECK:STDOUT: }
  139. // CHECK:STDOUT: %assoc0.loc4_35.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0)]
  140. // CHECK:STDOUT:
  141. // CHECK:STDOUT: !members:
  142. // CHECK:STDOUT: .Self = %Self.1
  143. // CHECK:STDOUT: .Dest = <poisoned>
  144. // CHECK:STDOUT: .Convert = %assoc0.loc4_35.1
  145. // CHECK:STDOUT: witness = (%Convert.decl)
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: generic fn @Convert(@ImplicitAs.%Dest.loc3_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) {
  150. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  151. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  152. // CHECK:STDOUT: %Self: @Convert.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
  153. // CHECK:STDOUT: %Self.as_type.loc4_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)]
  154. // CHECK:STDOUT: %pattern_type.loc4_14: type = pattern_type %Self.as_type.loc4_20.1 [symbolic = %pattern_type.loc4_14 (constants.%pattern_type.a93)]
  155. // CHECK:STDOUT: %pattern_type.loc4_28: type = pattern_type %Dest [symbolic = %pattern_type.loc4_28 (constants.%pattern_type.7dc)]
  156. // CHECK:STDOUT:
  157. // CHECK:STDOUT: fn(%self.param: @Convert.%Self.as_type.loc4_20.1 (%Self.as_type)) -> @Convert.%Dest (%Dest);
  158. // CHECK:STDOUT: }
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  161. // CHECK:STDOUT: %Dest.loc3_22.2 => constants.%Dest
  162. // CHECK:STDOUT: }
  163. // CHECK:STDOUT:
  164. // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self) {
  165. // CHECK:STDOUT: %Dest => constants.%Dest
  166. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f
  167. // CHECK:STDOUT: %Self => constants.%Self
  168. // CHECK:STDOUT: %Self.as_type.loc4_20.1 => constants.%Self.as_type
  169. // CHECK:STDOUT: %pattern_type.loc4_14 => constants.%pattern_type.a93
  170. // CHECK:STDOUT: %pattern_type.loc4_28 => constants.%pattern_type.7dc
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT:
  173. // CHECK:STDOUT: --- action.carbon
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: constants {
  176. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  177. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  178. // CHECK:STDOUT: %Action.type.29c: type = generic_interface_type @Action [concrete]
  179. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  180. // CHECK:STDOUT: %Action.generic: %Action.type.29c = struct_value () [concrete]
  181. // CHECK:STDOUT: %Action.type.cca: type = facet_type <@Action, @Action(%T)> [symbolic]
  182. // CHECK:STDOUT: %Self.e98: %Action.type.cca = bind_symbolic_name Self, 1 [symbolic]
  183. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.e98 [symbolic]
  184. // CHECK:STDOUT: %pattern_type.8db: type = pattern_type %Self.as_type [symbolic]
  185. // CHECK:STDOUT: %Op.type.036: type = fn_type @Op.1, @Action(%T) [symbolic]
  186. // CHECK:STDOUT: %Op.6ed: %Op.type.036 = struct_value () [symbolic]
  187. // CHECK:STDOUT: %Action.assoc_type.32e: type = assoc_entity_type @Action, @Action(%T) [symbolic]
  188. // CHECK:STDOUT: %assoc0.268: %Action.assoc_type.32e = assoc_entity element0, @Action.%Op.decl [symbolic]
  189. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  190. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  191. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  192. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  193. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  194. // CHECK:STDOUT: %Action.type.cb0: type = facet_type <@Action, @Action(%B)> [concrete]
  195. // CHECK:STDOUT: %Self.0d1: %Action.type.cb0 = bind_symbolic_name Self, 1 [symbolic]
  196. // CHECK:STDOUT: %Op.type.54d: type = fn_type @Op.1, @Action(%B) [concrete]
  197. // CHECK:STDOUT: %Op.dba: %Op.type.54d = struct_value () [concrete]
  198. // CHECK:STDOUT: %Action.assoc_type.4ee: type = assoc_entity_type @Action, @Action(%B) [concrete]
  199. // CHECK:STDOUT: %assoc0.f3b: %Action.assoc_type.4ee = assoc_entity element0, @Action.%Op.decl [concrete]
  200. // CHECK:STDOUT: %Action.impl_witness: <witness> = impl_witness file.%Action.impl_witness_table [concrete]
  201. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  202. // CHECK:STDOUT: %Op.type.4b4: type = fn_type @Op.2 [concrete]
  203. // CHECK:STDOUT: %Op.40d: %Op.type.4b4 = struct_value () [concrete]
  204. // CHECK:STDOUT: %Action.facet: %Action.type.cb0 = facet_value %A, (%Action.impl_witness) [concrete]
  205. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  206. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  207. // CHECK:STDOUT: %.584: type = fn_type_with_self_type %Op.type.54d, %Action.facet [concrete]
  208. // CHECK:STDOUT: }
  209. // CHECK:STDOUT:
  210. // CHECK:STDOUT: imports {
  211. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  212. // CHECK:STDOUT: import Core//prelude
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT: }
  215. // CHECK:STDOUT:
  216. // CHECK:STDOUT: file {
  217. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  218. // CHECK:STDOUT: .Core = imports.%Core
  219. // CHECK:STDOUT: .Action = %Action.decl
  220. // CHECK:STDOUT: .A = %A.decl
  221. // CHECK:STDOUT: .B = %B.decl
  222. // CHECK:STDOUT: .C = %C.decl
  223. // CHECK:STDOUT: .F = %F.decl
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT: %Core.import = import Core
  226. // CHECK:STDOUT: %Action.decl: %Action.type.29c = interface_decl @Action [concrete = constants.%Action.generic] {
  227. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  228. // CHECK:STDOUT: } {
  229. // CHECK:STDOUT: %T.loc4_18.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_18.2 (constants.%T)]
  230. // CHECK:STDOUT: }
  231. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  232. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  233. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  234. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  235. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  236. // CHECK:STDOUT: %Action.ref: %Action.type.29c = name_ref Action, file.%Action.decl [concrete = constants.%Action.generic]
  237. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  238. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [concrete = constants.%Action.type.cb0]
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT: %Action.impl_witness_table = impl_witness_table (@impl.%Op.decl), @impl [concrete]
  241. // CHECK:STDOUT: %Action.impl_witness: <witness> = impl_witness %Action.impl_witness_table [concrete = constants.%Action.impl_witness]
  242. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  243. // CHECK:STDOUT: %a.patt: %pattern_type.c10 = binding_pattern a [concrete]
  244. // CHECK:STDOUT: %a.param_patt: %pattern_type.c10 = value_param_pattern %a.patt, call_param0 [concrete]
  245. // CHECK:STDOUT: } {
  246. // CHECK:STDOUT: %a.param: %A = value_param call_param0
  247. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  248. // CHECK:STDOUT: %a: %A = bind_name a, %a.param
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: generic interface @Action(%T.loc4_18.1: type) {
  253. // CHECK:STDOUT: %T.loc4_18.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_18.2 (constants.%T)]
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: !definition:
  256. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T.loc4_18.2)> [symbolic = %Action.type (constants.%Action.type.cca)]
  257. // CHECK:STDOUT: %Self.2: @Action.%Action.type (%Action.type.cca) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.e98)]
  258. // CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @Action(%T.loc4_18.2) [symbolic = %Op.type (constants.%Op.type.036)]
  259. // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.036) = struct_value () [symbolic = %Op (constants.%Op.6ed)]
  260. // CHECK:STDOUT: %Action.assoc_type: type = assoc_entity_type @Action, @Action(%T.loc4_18.2) [symbolic = %Action.assoc_type (constants.%Action.assoc_type.32e)]
  261. // CHECK:STDOUT: %assoc0.loc5_22.2: @Action.%Action.assoc_type (%Action.assoc_type.32e) = assoc_entity element0, %Op.decl [symbolic = %assoc0.loc5_22.2 (constants.%assoc0.268)]
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: interface {
  264. // CHECK:STDOUT: %Self.1: @Action.%Action.type (%Action.type.cca) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.e98)]
  265. // CHECK:STDOUT: %Op.decl: @Action.%Op.type (%Op.type.036) = fn_decl @Op.1 [symbolic = @Action.%Op (constants.%Op.6ed)] {
  266. // CHECK:STDOUT: %self.patt: @Op.1.%pattern_type (%pattern_type.8db) = binding_pattern self [concrete]
  267. // CHECK:STDOUT: %self.param_patt: @Op.1.%pattern_type (%pattern_type.8db) = value_param_pattern %self.patt, call_param0 [concrete]
  268. // CHECK:STDOUT: } {
  269. // CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0
  270. // CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.3 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] {
  271. // CHECK:STDOUT: %.loc5_15.2: @Op.1.%Action.type (%Action.type.cca) = specific_constant @Action.%Self.1, @Action(constants.%T) [symbolic = %Self (constants.%Self.e98)]
  272. // CHECK:STDOUT: %Self.ref: @Op.1.%Action.type (%Action.type.cca) = name_ref Self, %.loc5_15.2 [symbolic = %Self (constants.%Self.e98)]
  273. // CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  274. // CHECK:STDOUT: %.loc5_15.3: type = converted %Self.ref, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name self, %self.param
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT: %assoc0.loc5_22.1: @Action.%Action.assoc_type (%Action.assoc_type.32e) = assoc_entity element0, %Op.decl [symbolic = %assoc0.loc5_22.2 (constants.%assoc0.268)]
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: !members:
  281. // CHECK:STDOUT: .Self = %Self.1
  282. // CHECK:STDOUT: .Op = %assoc0.loc5_22.1
  283. // CHECK:STDOUT: witness = (%Op.decl)
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: impl @impl: %A.ref as %Action.type {
  288. // CHECK:STDOUT: %Op.decl: %Op.type.4b4 = fn_decl @Op.2 [concrete = constants.%Op.40d] {
  289. // CHECK:STDOUT: %self.patt: %pattern_type.c10 = binding_pattern self [concrete]
  290. // CHECK:STDOUT: %self.param_patt: %pattern_type.c10 = value_param_pattern %self.patt, call_param0 [concrete]
  291. // CHECK:STDOUT: } {
  292. // CHECK:STDOUT: %self.param: %A = value_param call_param0
  293. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%A.ref [concrete = constants.%A]
  294. // CHECK:STDOUT: %self: %A = bind_name self, %self.param
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT:
  297. // CHECK:STDOUT: !members:
  298. // CHECK:STDOUT: .Op = %Op.decl
  299. // CHECK:STDOUT: witness = file.%Action.impl_witness
  300. // CHECK:STDOUT: }
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: class @A {
  303. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  304. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  305. // CHECK:STDOUT: complete_type_witness = %complete_type
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: !members:
  308. // CHECK:STDOUT: .Self = constants.%A
  309. // CHECK:STDOUT: }
  310. // CHECK:STDOUT:
  311. // CHECK:STDOUT: class @B {
  312. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  313. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  314. // CHECK:STDOUT: complete_type_witness = %complete_type
  315. // CHECK:STDOUT:
  316. // CHECK:STDOUT: !members:
  317. // CHECK:STDOUT: .Self = constants.%B
  318. // CHECK:STDOUT: }
  319. // CHECK:STDOUT:
  320. // CHECK:STDOUT: class @C {
  321. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  322. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  323. // CHECK:STDOUT: complete_type_witness = %complete_type
  324. // CHECK:STDOUT:
  325. // CHECK:STDOUT: !members:
  326. // CHECK:STDOUT: .Self = constants.%C
  327. // CHECK:STDOUT: }
  328. // CHECK:STDOUT:
  329. // CHECK:STDOUT: generic fn @Op.1(@Action.%T.loc4_18.1: type, @Action.%Self.1: @Action.%Action.type (%Action.type.cca)) {
  330. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  331. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T)> [symbolic = %Action.type (constants.%Action.type.cca)]
  332. // CHECK:STDOUT: %Self: @Op.1.%Action.type (%Action.type.cca) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.e98)]
  333. // CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  334. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type (constants.%pattern_type.8db)]
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: fn(%self.param: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type));
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: fn @Op.2(%self.param: %A) {
  340. // CHECK:STDOUT: !entry:
  341. // CHECK:STDOUT: return
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: fn @F(%a.param: %A) {
  345. // CHECK:STDOUT: !entry:
  346. // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
  347. // CHECK:STDOUT: %Action.ref: %Action.type.29c = name_ref Action, file.%Action.decl [concrete = constants.%Action.generic]
  348. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  349. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [concrete = constants.%Action.type.cb0]
  350. // CHECK:STDOUT: %.loc16: %Action.assoc_type.4ee = specific_constant @Action.%assoc0.loc5_22.1, @Action(constants.%B) [concrete = constants.%assoc0.f3b]
  351. // CHECK:STDOUT: %Op.ref: %Action.assoc_type.4ee = name_ref Op, %.loc16 [concrete = constants.%assoc0.f3b]
  352. // CHECK:STDOUT: %impl.elem0: %.584 = impl_witness_access constants.%Action.impl_witness, element0 [concrete = constants.%Op.40d]
  353. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem0
  354. // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%a.ref)
  355. // CHECK:STDOUT: return
  356. // CHECK:STDOUT: }
  357. // CHECK:STDOUT:
  358. // CHECK:STDOUT: specific @Action(constants.%T) {
  359. // CHECK:STDOUT: %T.loc4_18.2 => constants.%T
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: specific @Op.1(constants.%T, constants.%Self.e98) {
  363. // CHECK:STDOUT: %T => constants.%T
  364. // CHECK:STDOUT: %Action.type => constants.%Action.type.cca
  365. // CHECK:STDOUT: %Self => constants.%Self.e98
  366. // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type
  367. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.8db
  368. // CHECK:STDOUT: }
  369. // CHECK:STDOUT:
  370. // CHECK:STDOUT: specific @Action(constants.%B) {
  371. // CHECK:STDOUT: %T.loc4_18.2 => constants.%B
  372. // CHECK:STDOUT:
  373. // CHECK:STDOUT: !definition:
  374. // CHECK:STDOUT: %Action.type => constants.%Action.type.cb0
  375. // CHECK:STDOUT: %Self.2 => constants.%Self.0d1
  376. // CHECK:STDOUT: %Op.type => constants.%Op.type.54d
  377. // CHECK:STDOUT: %Op => constants.%Op.dba
  378. // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.4ee
  379. // CHECK:STDOUT: %assoc0.loc5_22.2 => constants.%assoc0.f3b
  380. // CHECK:STDOUT: }
  381. // CHECK:STDOUT:
  382. // CHECK:STDOUT: specific @Op.1(constants.%B, constants.%Action.facet) {
  383. // CHECK:STDOUT: %T => constants.%B
  384. // CHECK:STDOUT: %Action.type => constants.%Action.type.cb0
  385. // CHECK:STDOUT: %Self => constants.%Action.facet
  386. // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%A
  387. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c10
  388. // CHECK:STDOUT: }
  389. // CHECK:STDOUT:
  390. // CHECK:STDOUT: --- action.impl.carbon
  391. // CHECK:STDOUT:
  392. // CHECK:STDOUT: constants {
  393. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  394. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  395. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  396. // CHECK:STDOUT: %Action.type.29c: type = generic_interface_type @Action [concrete]
  397. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  398. // CHECK:STDOUT: %Action.generic: %Action.type.29c = struct_value () [concrete]
  399. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  400. // CHECK:STDOUT: %Action.type.cca: type = facet_type <@Action, @Action(%T)> [symbolic]
  401. // CHECK:STDOUT: %Self.e98: %Action.type.cca = bind_symbolic_name Self, 1 [symbolic]
  402. // CHECK:STDOUT: %Action.type.cb0: type = facet_type <@Action, @Action(%B)> [concrete]
  403. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  404. // CHECK:STDOUT: %Op.type.036: type = fn_type @Op.1, @Action(%T) [symbolic]
  405. // CHECK:STDOUT: %Op.6ed: %Op.type.036 = struct_value () [symbolic]
  406. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.e98 [symbolic]
  407. // CHECK:STDOUT: %pattern_type.8db: type = pattern_type %Self.as_type [symbolic]
  408. // CHECK:STDOUT: %Action.assoc_type.32e: type = assoc_entity_type @Action, @Action(%T) [symbolic]
  409. // CHECK:STDOUT: %assoc0.f18741.1: %Action.assoc_type.32e = assoc_entity element0, imports.%Main.import_ref.0e3753.1 [symbolic]
  410. // CHECK:STDOUT: %Self.0d1: %Action.type.cb0 = bind_symbolic_name Self, 1 [symbolic]
  411. // CHECK:STDOUT: %Op.type.54d: type = fn_type @Op.1, @Action(%B) [concrete]
  412. // CHECK:STDOUT: %Op.dba: %Op.type.54d = struct_value () [concrete]
  413. // CHECK:STDOUT: %Action.assoc_type.4ee: type = assoc_entity_type @Action, @Action(%B) [concrete]
  414. // CHECK:STDOUT: %assoc0.8a8: %Action.assoc_type.4ee = assoc_entity element0, imports.%Main.import_ref.1f6 [concrete]
  415. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  416. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  417. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  418. // CHECK:STDOUT: %assoc0.f18741.2: %Action.assoc_type.32e = assoc_entity element0, imports.%Main.import_ref.0e3753.2 [symbolic]
  419. // CHECK:STDOUT: %Action.impl_witness: <witness> = impl_witness imports.%Action.impl_witness_table [concrete]
  420. // CHECK:STDOUT: %Action.facet: %Action.type.cb0 = facet_value %A, (%Action.impl_witness) [concrete]
  421. // CHECK:STDOUT: %.6c7: type = fn_type_with_self_type %Op.type.54d, %Action.facet [concrete]
  422. // CHECK:STDOUT: %Op.type.4b4: type = fn_type @Op.2 [concrete]
  423. // CHECK:STDOUT: %Op.40d: %Op.type.4b4 = struct_value () [concrete]
  424. // CHECK:STDOUT: }
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: imports {
  427. // CHECK:STDOUT: %Main.Action: %Action.type.29c = import_ref Main//action, Action, loaded [concrete = constants.%Action.generic]
  428. // CHECK:STDOUT: %Main.A: type = import_ref Main//action, A, loaded [concrete = constants.%A]
  429. // CHECK:STDOUT: %Main.B: type = import_ref Main//action, B, loaded [concrete = constants.%B]
  430. // CHECK:STDOUT: %Main.C = import_ref Main//action, C, unloaded
  431. // CHECK:STDOUT: %Main.F = import_ref Main//action, F, unloaded
  432. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  433. // CHECK:STDOUT: import Core//prelude
  434. // CHECK:STDOUT: }
  435. // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//action, loc9_10, loaded [concrete = constants.%complete_type]
  436. // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//action, inst64 [no loc], unloaded
  437. // CHECK:STDOUT: %Main.import_ref.5ab3ec.1: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
  438. // CHECK:STDOUT: %Main.import_ref.ddc = import_ref Main//action, inst27 [no loc], unloaded
  439. // CHECK:STDOUT: %Main.import_ref.c55: @Action.%Action.assoc_type (%Action.assoc_type.32e) = import_ref Main//action, loc5_22, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.f18741.2)]
  440. // CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded
  441. // CHECK:STDOUT: %Main.import_ref.995: <witness> = import_ref Main//action, loc12_21, loaded [concrete = constants.%Action.impl_witness]
  442. // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//action, loc8_10, loaded [concrete = constants.%complete_type]
  443. // CHECK:STDOUT: %Main.import_ref.da3 = import_ref Main//action, inst58 [no loc], unloaded
  444. // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A]
  445. // CHECK:STDOUT: %Main.import_ref.bb2: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.cb0]
  446. // CHECK:STDOUT: %Main.import_ref.7b5 = import_ref Main//action, loc13_23, unloaded
  447. // CHECK:STDOUT: %Main.import_ref.5ab3ec.2: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
  448. // CHECK:STDOUT: %Main.import_ref.835: @Action.%Action.type (%Action.type.cca) = import_ref Main//action, inst27 [no loc], loaded [symbolic = @Action.%Self (constants.%Self.e98)]
  449. // CHECK:STDOUT: %Main.import_ref.0e3753.1 = import_ref Main//action, loc5_22, unloaded
  450. // CHECK:STDOUT: %Main.import_ref.1f6: @Action.%Op.type (%Op.type.036) = import_ref Main//action, loc5_22, loaded [symbolic = @Action.%Op (constants.%Op.6ed)]
  451. // CHECK:STDOUT: %Main.import_ref.0e3753.2 = import_ref Main//action, loc5_22, unloaded
  452. // CHECK:STDOUT: %Main.import_ref.d0b: %Op.type.4b4 = import_ref Main//action, loc13_23, loaded [concrete = constants.%Op.40d]
  453. // CHECK:STDOUT: %Action.impl_witness_table = impl_witness_table (%Main.import_ref.d0b), @impl [concrete]
  454. // CHECK:STDOUT: }
  455. // CHECK:STDOUT:
  456. // CHECK:STDOUT: file {
  457. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  458. // CHECK:STDOUT: .Action = imports.%Main.Action
  459. // CHECK:STDOUT: .A = imports.%Main.A
  460. // CHECK:STDOUT: .B = imports.%Main.B
  461. // CHECK:STDOUT: .C = imports.%Main.C
  462. // CHECK:STDOUT: .F = imports.%Main.F
  463. // CHECK:STDOUT: .Core = imports.%Core
  464. // CHECK:STDOUT: .G = %G.decl
  465. // CHECK:STDOUT: }
  466. // CHECK:STDOUT: %default.import.loc2_22.1 = import <none>
  467. // CHECK:STDOUT: %default.import.loc2_22.2 = import <none>
  468. // CHECK:STDOUT: %Core.import = import Core
  469. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  470. // CHECK:STDOUT: %a.patt: %pattern_type.c10 = binding_pattern a [concrete]
  471. // CHECK:STDOUT: %a.param_patt: %pattern_type.c10 = value_param_pattern %a.patt, call_param0 [concrete]
  472. // CHECK:STDOUT: } {
  473. // CHECK:STDOUT: %a.param: %A = value_param call_param0
  474. // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
  475. // CHECK:STDOUT: %a: %A = bind_name a, %a.param
  476. // CHECK:STDOUT: }
  477. // CHECK:STDOUT: }
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: generic interface @Action(imports.%Main.import_ref.5ab3ec.1: type) [from "action.carbon"] {
  480. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: !definition:
  483. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T)> [symbolic = %Action.type (constants.%Action.type.cca)]
  484. // CHECK:STDOUT: %Self: @Action.%Action.type (%Action.type.cca) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.e98)]
  485. // CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @Action(%T) [symbolic = %Op.type (constants.%Op.type.036)]
  486. // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.036) = struct_value () [symbolic = %Op (constants.%Op.6ed)]
  487. // CHECK:STDOUT: %Action.assoc_type: type = assoc_entity_type @Action, @Action(%T) [symbolic = %Action.assoc_type (constants.%Action.assoc_type.32e)]
  488. // CHECK:STDOUT: %assoc0: @Action.%Action.assoc_type (%Action.assoc_type.32e) = assoc_entity element0, imports.%Main.import_ref.0e3753.1 [symbolic = %assoc0 (constants.%assoc0.f18741.1)]
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: interface {
  491. // CHECK:STDOUT: !members:
  492. // CHECK:STDOUT: .Self = imports.%Main.import_ref.ddc
  493. // CHECK:STDOUT: .Op = imports.%Main.import_ref.c55
  494. // CHECK:STDOUT: witness = (imports.%Main.Op)
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT: }
  497. // CHECK:STDOUT:
  498. // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.984 as imports.%Main.import_ref.bb2 [from "action.carbon"] {
  499. // CHECK:STDOUT: !members:
  500. // CHECK:STDOUT: .Op = imports.%Main.import_ref.7b5
  501. // CHECK:STDOUT: witness = imports.%Main.import_ref.995
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: class @B [from "action.carbon"] {
  505. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
  506. // CHECK:STDOUT:
  507. // CHECK:STDOUT: !members:
  508. // CHECK:STDOUT: .Self = imports.%Main.import_ref.54a
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT:
  511. // CHECK:STDOUT: class @A [from "action.carbon"] {
  512. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: !members:
  515. // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT:
  518. // CHECK:STDOUT: generic fn @Op.1(imports.%Main.import_ref.5ab3ec.2: type, imports.%Main.import_ref.835: @Action.%Action.type (%Action.type.cca)) [from "action.carbon"] {
  519. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  520. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T)> [symbolic = %Action.type (constants.%Action.type.cca)]
  521. // CHECK:STDOUT: %Self: @Op.1.%Action.type (%Action.type.cca) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.e98)]
  522. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  523. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.8db)]
  524. // CHECK:STDOUT:
  525. // CHECK:STDOUT: fn;
  526. // CHECK:STDOUT: }
  527. // CHECK:STDOUT:
  528. // CHECK:STDOUT: fn @G(%a.param: %A) {
  529. // CHECK:STDOUT: !entry:
  530. // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
  531. // CHECK:STDOUT: %Action.ref: %Action.type.29c = name_ref Action, imports.%Main.Action [concrete = constants.%Action.generic]
  532. // CHECK:STDOUT: %B.ref: type = name_ref B, imports.%Main.B [concrete = constants.%B]
  533. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [concrete = constants.%Action.type.cb0]
  534. // CHECK:STDOUT: %.loc4: %Action.assoc_type.4ee = specific_constant imports.%Main.import_ref.c55, @Action(constants.%B) [concrete = constants.%assoc0.8a8]
  535. // CHECK:STDOUT: %Op.ref: %Action.assoc_type.4ee = name_ref Op, %.loc4 [concrete = constants.%assoc0.8a8]
  536. // CHECK:STDOUT: %impl.elem0: %.6c7 = impl_witness_access constants.%Action.impl_witness, element0 [concrete = constants.%Op.40d]
  537. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem0
  538. // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %bound_method(%a.ref)
  539. // CHECK:STDOUT: return
  540. // CHECK:STDOUT: }
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: fn @Op.2 [from "action.carbon"];
  543. // CHECK:STDOUT:
  544. // CHECK:STDOUT: specific @Action(constants.%T) {
  545. // CHECK:STDOUT: %T => constants.%T
  546. // CHECK:STDOUT: }
  547. // CHECK:STDOUT:
  548. // CHECK:STDOUT: specific @Action(constants.%B) {
  549. // CHECK:STDOUT: %T => constants.%B
  550. // CHECK:STDOUT:
  551. // CHECK:STDOUT: !definition:
  552. // CHECK:STDOUT: %Action.type => constants.%Action.type.cb0
  553. // CHECK:STDOUT: %Self => constants.%Self.0d1
  554. // CHECK:STDOUT: %Op.type => constants.%Op.type.54d
  555. // CHECK:STDOUT: %Op => constants.%Op.dba
  556. // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.4ee
  557. // CHECK:STDOUT: %assoc0 => constants.%assoc0.8a8
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT:
  560. // CHECK:STDOUT: specific @Op.1(constants.%T, constants.%Self.e98) {
  561. // CHECK:STDOUT: %T => constants.%T
  562. // CHECK:STDOUT: %Action.type => constants.%Action.type.cca
  563. // CHECK:STDOUT: %Self => constants.%Self.e98
  564. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  565. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.8db
  566. // CHECK:STDOUT: }
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: --- fail_action.impl.carbon
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: constants {
  571. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  572. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  573. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  574. // CHECK:STDOUT: %Action.type.29c: type = generic_interface_type @Action [concrete]
  575. // CHECK:STDOUT: %Action.generic: %Action.type.29c = struct_value () [concrete]
  576. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  577. // CHECK:STDOUT: %Action.type.cca: type = facet_type <@Action, @Action(%T)> [symbolic]
  578. // CHECK:STDOUT: %Self.e98: %Action.type.cca = bind_symbolic_name Self, 1 [symbolic]
  579. // CHECK:STDOUT: %Action.type.cb0: type = facet_type <@Action, @Action(%B)> [concrete]
  580. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  581. // CHECK:STDOUT: %Op.type.036: type = fn_type @Op, @Action(%T) [symbolic]
  582. // CHECK:STDOUT: %Op.6ed: %Op.type.036 = struct_value () [symbolic]
  583. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.e98 [symbolic]
  584. // CHECK:STDOUT: %pattern_type.8db: type = pattern_type %Self.as_type [symbolic]
  585. // CHECK:STDOUT: %Action.assoc_type.32e: type = assoc_entity_type @Action, @Action(%T) [symbolic]
  586. // CHECK:STDOUT: %assoc0.326: %Action.assoc_type.32e = assoc_entity element0, imports.%Main.import_ref.1f6 [symbolic]
  587. // CHECK:STDOUT: %Self.0d1: %Action.type.cb0 = bind_symbolic_name Self, 1 [symbolic]
  588. // CHECK:STDOUT: %Op.type.54d: type = fn_type @Op, @Action(%B) [concrete]
  589. // CHECK:STDOUT: %Op.dba: %Op.type.54d = struct_value () [concrete]
  590. // CHECK:STDOUT: %Action.assoc_type.4ee: type = assoc_entity_type @Action, @Action(%B) [concrete]
  591. // CHECK:STDOUT: %assoc0.338: %Action.assoc_type.4ee = assoc_entity element0, imports.%Main.import_ref.0e3753.1 [concrete]
  592. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  593. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  594. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  595. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  596. // CHECK:STDOUT: %Action.type.e2b: type = facet_type <@Action, @Action(%C)> [concrete]
  597. // CHECK:STDOUT: %Self.4bb: %Action.type.e2b = bind_symbolic_name Self, 1 [symbolic]
  598. // CHECK:STDOUT: %Op.type.5ad: type = fn_type @Op, @Action(%C) [concrete]
  599. // CHECK:STDOUT: %Op.b10: %Op.type.5ad = struct_value () [concrete]
  600. // CHECK:STDOUT: %Action.assoc_type.79f: type = assoc_entity_type @Action, @Action(%C) [concrete]
  601. // CHECK:STDOUT: %assoc0.37d: %Action.assoc_type.79f = assoc_entity element0, imports.%Main.import_ref.1f6 [concrete]
  602. // CHECK:STDOUT: %assoc0.f18: %Action.assoc_type.32e = assoc_entity element0, imports.%Main.import_ref.0e3753.2 [symbolic]
  603. // CHECK:STDOUT: }
  604. // CHECK:STDOUT:
  605. // CHECK:STDOUT: imports {
  606. // CHECK:STDOUT: %Main.Action: %Action.type.29c = import_ref Main//action, Action, loaded [concrete = constants.%Action.generic]
  607. // CHECK:STDOUT: %Main.A: type = import_ref Main//action, A, loaded [concrete = constants.%A]
  608. // CHECK:STDOUT: %Main.B = import_ref Main//action, B, unloaded
  609. // CHECK:STDOUT: %Main.C: type = import_ref Main//action, C, loaded [concrete = constants.%C]
  610. // CHECK:STDOUT: %Main.F = import_ref Main//action, F, unloaded
  611. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  612. // CHECK:STDOUT: import Core//prelude
  613. // CHECK:STDOUT: }
  614. // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//action, loc9_10, loaded [concrete = constants.%complete_type]
  615. // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//action, inst64 [no loc], unloaded
  616. // CHECK:STDOUT: %Main.import_ref.5ab3ec.1: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
  617. // CHECK:STDOUT: %Main.import_ref.ddc = import_ref Main//action, inst27 [no loc], unloaded
  618. // CHECK:STDOUT: %Main.import_ref.c55: @Action.%Action.assoc_type (%Action.assoc_type.32e) = import_ref Main//action, loc5_22, loaded [symbolic = @Action.%assoc0 (constants.%assoc0.f18)]
  619. // CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded
  620. // CHECK:STDOUT: %Main.import_ref.19c = import_ref Main//action, loc12_21, unloaded
  621. // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//action, loc8_10, loaded [concrete = constants.%complete_type]
  622. // CHECK:STDOUT: %Main.import_ref.da3 = import_ref Main//action, inst58 [no loc], unloaded
  623. // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A]
  624. // CHECK:STDOUT: %Main.import_ref.bb2: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.cb0]
  625. // CHECK:STDOUT: %Main.import_ref.7b5 = import_ref Main//action, loc13_23, unloaded
  626. // CHECK:STDOUT: %Main.import_ref.5ab3ec.2: type = import_ref Main//action, loc4_18, loaded [symbolic = @Action.%T (constants.%T)]
  627. // CHECK:STDOUT: %Main.import_ref.835: @Action.%Action.type (%Action.type.cca) = import_ref Main//action, inst27 [no loc], loaded [symbolic = @Action.%Self (constants.%Self.e98)]
  628. // CHECK:STDOUT: %Main.import_ref.1f6: @Action.%Op.type (%Op.type.036) = import_ref Main//action, loc5_22, loaded [symbolic = @Action.%Op (constants.%Op.6ed)]
  629. // CHECK:STDOUT: %Main.import_ref.0e3753.1 = import_ref Main//action, loc5_22, unloaded
  630. // CHECK:STDOUT: %Main.import_ref.8f24d3.3: <witness> = import_ref Main//action, loc10_10, loaded [concrete = constants.%complete_type]
  631. // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//action, inst68 [no loc], unloaded
  632. // CHECK:STDOUT: %Main.import_ref.0e3753.2 = import_ref Main//action, loc5_22, unloaded
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: file {
  636. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  637. // CHECK:STDOUT: .Action = imports.%Main.Action
  638. // CHECK:STDOUT: .A = imports.%Main.A
  639. // CHECK:STDOUT: .B = imports.%Main.B
  640. // CHECK:STDOUT: .C = imports.%Main.C
  641. // CHECK:STDOUT: .F = imports.%Main.F
  642. // CHECK:STDOUT: .Core = imports.%Core
  643. // CHECK:STDOUT: .G = %G.decl
  644. // CHECK:STDOUT: }
  645. // CHECK:STDOUT: %default.import.loc2_22.1 = import <none>
  646. // CHECK:STDOUT: %default.import.loc2_22.2 = import <none>
  647. // CHECK:STDOUT: %Core.import = import Core
  648. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  649. // CHECK:STDOUT: %a.patt: %pattern_type.c10 = binding_pattern a [concrete]
  650. // CHECK:STDOUT: %a.param_patt: %pattern_type.c10 = value_param_pattern %a.patt, call_param0 [concrete]
  651. // CHECK:STDOUT: } {
  652. // CHECK:STDOUT: %a.param: %A = value_param call_param0
  653. // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
  654. // CHECK:STDOUT: %a: %A = bind_name a, %a.param
  655. // CHECK:STDOUT: }
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT:
  658. // CHECK:STDOUT: generic interface @Action(imports.%Main.import_ref.5ab3ec.1: type) [from "action.carbon"] {
  659. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  660. // CHECK:STDOUT:
  661. // CHECK:STDOUT: !definition:
  662. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T)> [symbolic = %Action.type (constants.%Action.type.cca)]
  663. // CHECK:STDOUT: %Self: @Action.%Action.type (%Action.type.cca) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.e98)]
  664. // CHECK:STDOUT: %Op.type: type = fn_type @Op, @Action(%T) [symbolic = %Op.type (constants.%Op.type.036)]
  665. // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.036) = struct_value () [symbolic = %Op (constants.%Op.6ed)]
  666. // CHECK:STDOUT: %Action.assoc_type: type = assoc_entity_type @Action, @Action(%T) [symbolic = %Action.assoc_type (constants.%Action.assoc_type.32e)]
  667. // CHECK:STDOUT: %assoc0: @Action.%Action.assoc_type (%Action.assoc_type.32e) = assoc_entity element0, imports.%Main.import_ref.1f6 [symbolic = %assoc0 (constants.%assoc0.326)]
  668. // CHECK:STDOUT:
  669. // CHECK:STDOUT: interface {
  670. // CHECK:STDOUT: !members:
  671. // CHECK:STDOUT: .Self = imports.%Main.import_ref.ddc
  672. // CHECK:STDOUT: .Op = imports.%Main.import_ref.c55
  673. // CHECK:STDOUT: witness = (imports.%Main.Op)
  674. // CHECK:STDOUT: }
  675. // CHECK:STDOUT: }
  676. // CHECK:STDOUT:
  677. // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.984 as imports.%Main.import_ref.bb2 [from "action.carbon"] {
  678. // CHECK:STDOUT: !members:
  679. // CHECK:STDOUT: .Op = imports.%Main.import_ref.7b5
  680. // CHECK:STDOUT: witness = imports.%Main.import_ref.19c
  681. // CHECK:STDOUT: }
  682. // CHECK:STDOUT:
  683. // CHECK:STDOUT: class @B [from "action.carbon"] {
  684. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
  685. // CHECK:STDOUT:
  686. // CHECK:STDOUT: !members:
  687. // CHECK:STDOUT: .Self = imports.%Main.import_ref.54a
  688. // CHECK:STDOUT: }
  689. // CHECK:STDOUT:
  690. // CHECK:STDOUT: class @A [from "action.carbon"] {
  691. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
  692. // CHECK:STDOUT:
  693. // CHECK:STDOUT: !members:
  694. // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
  695. // CHECK:STDOUT: }
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: class @C [from "action.carbon"] {
  698. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.3
  699. // CHECK:STDOUT:
  700. // CHECK:STDOUT: !members:
  701. // CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4
  702. // CHECK:STDOUT: }
  703. // CHECK:STDOUT:
  704. // CHECK:STDOUT: generic fn @Op(imports.%Main.import_ref.5ab3ec.2: type, imports.%Main.import_ref.835: @Action.%Action.type (%Action.type.cca)) [from "action.carbon"] {
  705. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  706. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T)> [symbolic = %Action.type (constants.%Action.type.cca)]
  707. // CHECK:STDOUT: %Self: @Op.%Action.type (%Action.type.cca) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.e98)]
  708. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  709. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.8db)]
  710. // CHECK:STDOUT:
  711. // CHECK:STDOUT: fn;
  712. // CHECK:STDOUT: }
  713. // CHECK:STDOUT:
  714. // CHECK:STDOUT: fn @G(%a.param: %A) {
  715. // CHECK:STDOUT: !entry:
  716. // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
  717. // CHECK:STDOUT: %Action.ref: %Action.type.29c = name_ref Action, imports.%Main.Action [concrete = constants.%Action.generic]
  718. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
  719. // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%C)> [concrete = constants.%Action.type.e2b]
  720. // CHECK:STDOUT: %.loc8: %Action.assoc_type.79f = specific_constant imports.%Main.import_ref.c55, @Action(constants.%C) [concrete = constants.%assoc0.37d]
  721. // CHECK:STDOUT: %Op.ref: %Action.assoc_type.79f = name_ref Op, %.loc8 [concrete = constants.%assoc0.37d]
  722. // CHECK:STDOUT: return
  723. // CHECK:STDOUT: }
  724. // CHECK:STDOUT:
  725. // CHECK:STDOUT: specific @Action(constants.%T) {
  726. // CHECK:STDOUT: %T => constants.%T
  727. // CHECK:STDOUT: }
  728. // CHECK:STDOUT:
  729. // CHECK:STDOUT: specific @Action(constants.%B) {
  730. // CHECK:STDOUT: %T => constants.%B
  731. // CHECK:STDOUT:
  732. // CHECK:STDOUT: !definition:
  733. // CHECK:STDOUT: %Action.type => constants.%Action.type.cb0
  734. // CHECK:STDOUT: %Self => constants.%Self.0d1
  735. // CHECK:STDOUT: %Op.type => constants.%Op.type.54d
  736. // CHECK:STDOUT: %Op => constants.%Op.dba
  737. // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.4ee
  738. // CHECK:STDOUT: %assoc0 => constants.%assoc0.338
  739. // CHECK:STDOUT: }
  740. // CHECK:STDOUT:
  741. // CHECK:STDOUT: specific @Op(constants.%T, constants.%Self.e98) {
  742. // CHECK:STDOUT: %T => constants.%T
  743. // CHECK:STDOUT: %Action.type => constants.%Action.type.cca
  744. // CHECK:STDOUT: %Self => constants.%Self.e98
  745. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  746. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.8db
  747. // CHECK:STDOUT: }
  748. // CHECK:STDOUT:
  749. // CHECK:STDOUT: specific @Action(constants.%C) {
  750. // CHECK:STDOUT: %T => constants.%C
  751. // CHECK:STDOUT:
  752. // CHECK:STDOUT: !definition:
  753. // CHECK:STDOUT: %Action.type => constants.%Action.type.e2b
  754. // CHECK:STDOUT: %Self => constants.%Self.4bb
  755. // CHECK:STDOUT: %Op.type => constants.%Op.type.5ad
  756. // CHECK:STDOUT: %Op => constants.%Op.b10
  757. // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.79f
  758. // CHECK:STDOUT: %assoc0 => constants.%assoc0.37d
  759. // CHECK:STDOUT: }
  760. // CHECK:STDOUT:
  761. // CHECK:STDOUT: --- factory.carbon
  762. // CHECK:STDOUT:
  763. // CHECK:STDOUT: constants {
  764. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  765. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  766. // CHECK:STDOUT: %Factory.type.1a8: type = generic_interface_type @Factory [concrete]
  767. // CHECK:STDOUT: %Factory.generic: %Factory.type.1a8 = struct_value () [concrete]
  768. // CHECK:STDOUT: %Factory.type.c96: type = facet_type <@Factory, @Factory(%T)> [symbolic]
  769. // CHECK:STDOUT: %Self.9ba: %Factory.type.c96 = bind_symbolic_name Self, 1 [symbolic]
  770. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  771. // CHECK:STDOUT: %Make.type.598: type = fn_type @Make.1, @Factory(%T) [symbolic]
  772. // CHECK:STDOUT: %Make.737: %Make.type.598 = struct_value () [symbolic]
  773. // CHECK:STDOUT: %Factory.assoc_type.207: type = assoc_entity_type @Factory, @Factory(%T) [symbolic]
  774. // CHECK:STDOUT: %assoc0.b3c: %Factory.assoc_type.207 = assoc_entity element0, @Factory.%Make.decl [symbolic]
  775. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.9ba [symbolic]
  776. // CHECK:STDOUT: %pattern_type.5ea: type = pattern_type %Self.as_type [symbolic]
  777. // CHECK:STDOUT: %Method.type.7ee: type = fn_type @Method.1, @Factory(%T) [symbolic]
  778. // CHECK:STDOUT: %Method.a71: %Method.type.7ee = struct_value () [symbolic]
  779. // CHECK:STDOUT: %assoc1.e30: %Factory.assoc_type.207 = assoc_entity element1, @Factory.%Method.decl [symbolic]
  780. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  781. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  782. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  783. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  784. // CHECK:STDOUT: %Factory.type.a5d: type = facet_type <@Factory, @Factory(%B)> [concrete]
  785. // CHECK:STDOUT: %Self.187: %Factory.type.a5d = bind_symbolic_name Self, 1 [symbolic]
  786. // CHECK:STDOUT: %Make.type.c59: type = fn_type @Make.1, @Factory(%B) [concrete]
  787. // CHECK:STDOUT: %Make.efe: %Make.type.c59 = struct_value () [concrete]
  788. // CHECK:STDOUT: %Factory.assoc_type.579: type = assoc_entity_type @Factory, @Factory(%B) [concrete]
  789. // CHECK:STDOUT: %assoc0.fe7: %Factory.assoc_type.579 = assoc_entity element0, @Factory.%Make.decl [concrete]
  790. // CHECK:STDOUT: %Method.type.117: type = fn_type @Method.1, @Factory(%B) [concrete]
  791. // CHECK:STDOUT: %Method.ea9: %Method.type.117 = struct_value () [concrete]
  792. // CHECK:STDOUT: %assoc1.02a: %Factory.assoc_type.579 = assoc_entity element1, @Factory.%Method.decl [concrete]
  793. // CHECK:STDOUT: %Factory.impl_witness: <witness> = impl_witness file.%Factory.impl_witness_table [concrete]
  794. // CHECK:STDOUT: %pattern_type.049: type = pattern_type %B [concrete]
  795. // CHECK:STDOUT: %Make.type.ec4: type = fn_type @Make.2 [concrete]
  796. // CHECK:STDOUT: %Make.377: %Make.type.ec4 = struct_value () [concrete]
  797. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  798. // CHECK:STDOUT: %Method.type.af5: type = fn_type @Method.2 [concrete]
  799. // CHECK:STDOUT: %Method.3d4: %Method.type.af5 = struct_value () [concrete]
  800. // CHECK:STDOUT: %Factory.facet: %Factory.type.a5d = facet_value %A, (%Factory.impl_witness) [concrete]
  801. // CHECK:STDOUT: }
  802. // CHECK:STDOUT:
  803. // CHECK:STDOUT: imports {
  804. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  805. // CHECK:STDOUT: import Core//prelude
  806. // CHECK:STDOUT: }
  807. // CHECK:STDOUT: }
  808. // CHECK:STDOUT:
  809. // CHECK:STDOUT: file {
  810. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  811. // CHECK:STDOUT: .Core = imports.%Core
  812. // CHECK:STDOUT: .Factory = %Factory.decl
  813. // CHECK:STDOUT: .A = %A.decl
  814. // CHECK:STDOUT: .B = %B.decl
  815. // CHECK:STDOUT: }
  816. // CHECK:STDOUT: %Core.import = import Core
  817. // CHECK:STDOUT: %Factory.decl: %Factory.type.1a8 = interface_decl @Factory [concrete = constants.%Factory.generic] {
  818. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  819. // CHECK:STDOUT: } {
  820. // CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T)]
  821. // CHECK:STDOUT: }
  822. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  823. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  824. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  825. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  826. // CHECK:STDOUT: %Factory.ref: %Factory.type.1a8 = name_ref Factory, file.%Factory.decl [concrete = constants.%Factory.generic]
  827. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  828. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [concrete = constants.%Factory.type.a5d]
  829. // CHECK:STDOUT: }
  830. // CHECK:STDOUT: %Factory.impl_witness_table = impl_witness_table (@impl.%Make.decl, @impl.%Method.decl), @impl [concrete]
  831. // CHECK:STDOUT: %Factory.impl_witness: <witness> = impl_witness %Factory.impl_witness_table [concrete = constants.%Factory.impl_witness]
  832. // CHECK:STDOUT: }
  833. // CHECK:STDOUT:
  834. // CHECK:STDOUT: generic interface @Factory(%T.loc4_19.1: type) {
  835. // CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T)]
  836. // CHECK:STDOUT:
  837. // CHECK:STDOUT: !definition:
  838. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T.loc4_19.2)> [symbolic = %Factory.type (constants.%Factory.type.c96)]
  839. // CHECK:STDOUT: %Self.2: @Factory.%Factory.type (%Factory.type.c96) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.9ba)]
  840. // CHECK:STDOUT: %Make.type: type = fn_type @Make.1, @Factory(%T.loc4_19.2) [symbolic = %Make.type (constants.%Make.type.598)]
  841. // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.598) = struct_value () [symbolic = %Make (constants.%Make.737)]
  842. // CHECK:STDOUT: %Factory.assoc_type: type = assoc_entity_type @Factory, @Factory(%T.loc4_19.2) [symbolic = %Factory.assoc_type (constants.%Factory.assoc_type.207)]
  843. // CHECK:STDOUT: %assoc0.loc6_17.2: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = assoc_entity element0, %Make.decl [symbolic = %assoc0.loc6_17.2 (constants.%assoc0.b3c)]
  844. // CHECK:STDOUT: %Method.type: type = fn_type @Method.1, @Factory(%T.loc4_19.2) [symbolic = %Method.type (constants.%Method.type.7ee)]
  845. // CHECK:STDOUT: %Method: @Factory.%Method.type (%Method.type.7ee) = struct_value () [symbolic = %Method (constants.%Method.a71)]
  846. // CHECK:STDOUT: %assoc1.loc8_31.2: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = assoc_entity element1, %Method.decl [symbolic = %assoc1.loc8_31.2 (constants.%assoc1.e30)]
  847. // CHECK:STDOUT:
  848. // CHECK:STDOUT: interface {
  849. // CHECK:STDOUT: %Self.1: @Factory.%Factory.type (%Factory.type.c96) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.9ba)]
  850. // CHECK:STDOUT: %Make.decl: @Factory.%Make.type (%Make.type.598) = fn_decl @Make.1 [symbolic = @Factory.%Make (constants.%Make.737)] {
  851. // CHECK:STDOUT: %return.patt: @Make.1.%pattern_type (%pattern_type.7dc) = return_slot_pattern [concrete]
  852. // CHECK:STDOUT: %return.param_patt: @Make.1.%pattern_type (%pattern_type.7dc) = out_param_pattern %return.patt, call_param0 [concrete]
  853. // CHECK:STDOUT: } {
  854. // CHECK:STDOUT: %T.ref: type = name_ref T, @Factory.%T.loc4_19.1 [symbolic = %T (constants.%T)]
  855. // CHECK:STDOUT: %return.param: ref @Make.1.%T (%T) = out_param call_param0
  856. // CHECK:STDOUT: %return: ref @Make.1.%T (%T) = return_slot %return.param
  857. // CHECK:STDOUT: }
  858. // CHECK:STDOUT: %assoc0.loc6_17.1: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = assoc_entity element0, %Make.decl [symbolic = %assoc0.loc6_17.2 (constants.%assoc0.b3c)]
  859. // CHECK:STDOUT: %Method.decl: @Factory.%Method.type (%Method.type.7ee) = fn_decl @Method.1 [symbolic = @Factory.%Method (constants.%Method.a71)] {
  860. // CHECK:STDOUT: %self.patt: @Method.1.%pattern_type.loc8_13 (%pattern_type.5ea) = binding_pattern self [concrete]
  861. // CHECK:STDOUT: %self.param_patt: @Method.1.%pattern_type.loc8_13 (%pattern_type.5ea) = value_param_pattern %self.patt, call_param0 [concrete]
  862. // CHECK:STDOUT: %return.patt: @Method.1.%pattern_type.loc8_27 (%pattern_type.7dc) = return_slot_pattern [concrete]
  863. // CHECK:STDOUT: %return.param_patt: @Method.1.%pattern_type.loc8_27 (%pattern_type.7dc) = out_param_pattern %return.patt, call_param1 [concrete]
  864. // CHECK:STDOUT: } {
  865. // CHECK:STDOUT: %T.ref: type = name_ref T, @Factory.%T.loc4_19.1 [symbolic = %T (constants.%T)]
  866. // CHECK:STDOUT: %self.param: @Method.1.%Self.as_type.loc8_19.1 (%Self.as_type) = value_param call_param0
  867. // CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.3 [symbolic = %Self.as_type.loc8_19.1 (constants.%Self.as_type)] {
  868. // CHECK:STDOUT: %.loc8_19.2: @Method.1.%Factory.type (%Factory.type.c96) = specific_constant @Factory.%Self.1, @Factory(constants.%T) [symbolic = %Self (constants.%Self.9ba)]
  869. // CHECK:STDOUT: %Self.ref: @Method.1.%Factory.type (%Factory.type.c96) = name_ref Self, %.loc8_19.2 [symbolic = %Self (constants.%Self.9ba)]
  870. // CHECK:STDOUT: %Self.as_type.loc8_19.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_19.1 (constants.%Self.as_type)]
  871. // CHECK:STDOUT: %.loc8_19.3: type = converted %Self.ref, %Self.as_type.loc8_19.2 [symbolic = %Self.as_type.loc8_19.1 (constants.%Self.as_type)]
  872. // CHECK:STDOUT: }
  873. // CHECK:STDOUT: %self: @Method.1.%Self.as_type.loc8_19.1 (%Self.as_type) = bind_name self, %self.param
  874. // CHECK:STDOUT: %return.param: ref @Method.1.%T (%T) = out_param call_param1
  875. // CHECK:STDOUT: %return: ref @Method.1.%T (%T) = return_slot %return.param
  876. // CHECK:STDOUT: }
  877. // CHECK:STDOUT: %assoc1.loc8_31.1: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = assoc_entity element1, %Method.decl [symbolic = %assoc1.loc8_31.2 (constants.%assoc1.e30)]
  878. // CHECK:STDOUT:
  879. // CHECK:STDOUT: !members:
  880. // CHECK:STDOUT: .Self = %Self.1
  881. // CHECK:STDOUT: .T = <poisoned>
  882. // CHECK:STDOUT: .Make = %assoc0.loc6_17.1
  883. // CHECK:STDOUT: .Method = %assoc1.loc8_31.1
  884. // CHECK:STDOUT: witness = (%Make.decl, %Method.decl)
  885. // CHECK:STDOUT: }
  886. // CHECK:STDOUT: }
  887. // CHECK:STDOUT:
  888. // CHECK:STDOUT: impl @impl: %A.ref as %Factory.type {
  889. // CHECK:STDOUT: %Make.decl: %Make.type.ec4 = fn_decl @Make.2 [concrete = constants.%Make.377] {
  890. // CHECK:STDOUT: %return.patt: %pattern_type.049 = return_slot_pattern [concrete]
  891. // CHECK:STDOUT: %return.param_patt: %pattern_type.049 = out_param_pattern %return.patt, call_param0 [concrete]
  892. // CHECK:STDOUT: } {
  893. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  894. // CHECK:STDOUT: %return.param: ref %B = out_param call_param0
  895. // CHECK:STDOUT: %return: ref %B = return_slot %return.param
  896. // CHECK:STDOUT: }
  897. // CHECK:STDOUT: %Method.decl: %Method.type.af5 = fn_decl @Method.2 [concrete = constants.%Method.3d4] {
  898. // CHECK:STDOUT: %self.patt: %pattern_type.c10 = binding_pattern self [concrete]
  899. // CHECK:STDOUT: %self.param_patt: %pattern_type.c10 = value_param_pattern %self.patt, call_param0 [concrete]
  900. // CHECK:STDOUT: %return.patt: %pattern_type.049 = return_slot_pattern [concrete]
  901. // CHECK:STDOUT: %return.param_patt: %pattern_type.049 = out_param_pattern %return.patt, call_param1 [concrete]
  902. // CHECK:STDOUT: } {
  903. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  904. // CHECK:STDOUT: %self.param: %A = value_param call_param0
  905. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%A.ref [concrete = constants.%A]
  906. // CHECK:STDOUT: %self: %A = bind_name self, %self.param
  907. // CHECK:STDOUT: %return.param: ref %B = out_param call_param1
  908. // CHECK:STDOUT: %return: ref %B = return_slot %return.param
  909. // CHECK:STDOUT: }
  910. // CHECK:STDOUT:
  911. // CHECK:STDOUT: !members:
  912. // CHECK:STDOUT: .B = <poisoned>
  913. // CHECK:STDOUT: .Make = %Make.decl
  914. // CHECK:STDOUT: .Method = %Method.decl
  915. // CHECK:STDOUT: witness = file.%Factory.impl_witness
  916. // CHECK:STDOUT: }
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: class @A {
  919. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  920. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  921. // CHECK:STDOUT: complete_type_witness = %complete_type
  922. // CHECK:STDOUT:
  923. // CHECK:STDOUT: !members:
  924. // CHECK:STDOUT: .Self = constants.%A
  925. // CHECK:STDOUT: }
  926. // CHECK:STDOUT:
  927. // CHECK:STDOUT: class @B {
  928. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  929. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  930. // CHECK:STDOUT: complete_type_witness = %complete_type
  931. // CHECK:STDOUT:
  932. // CHECK:STDOUT: !members:
  933. // CHECK:STDOUT: .Self = constants.%B
  934. // CHECK:STDOUT: }
  935. // CHECK:STDOUT:
  936. // CHECK:STDOUT: generic fn @Make.1(@Factory.%T.loc4_19.1: type, @Factory.%Self.1: @Factory.%Factory.type (%Factory.type.c96)) {
  937. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  938. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  939. // CHECK:STDOUT:
  940. // CHECK:STDOUT: fn() -> @Make.1.%T (%T);
  941. // CHECK:STDOUT: }
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: generic fn @Method.1(@Factory.%T.loc4_19.1: type, @Factory.%Self.1: @Factory.%Factory.type (%Factory.type.c96)) {
  944. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  945. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T)> [symbolic = %Factory.type (constants.%Factory.type.c96)]
  946. // CHECK:STDOUT: %Self: @Method.1.%Factory.type (%Factory.type.c96) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.9ba)]
  947. // CHECK:STDOUT: %Self.as_type.loc8_19.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_19.1 (constants.%Self.as_type)]
  948. // CHECK:STDOUT: %pattern_type.loc8_13: type = pattern_type %Self.as_type.loc8_19.1 [symbolic = %pattern_type.loc8_13 (constants.%pattern_type.5ea)]
  949. // CHECK:STDOUT: %pattern_type.loc8_27: type = pattern_type %T [symbolic = %pattern_type.loc8_27 (constants.%pattern_type.7dc)]
  950. // CHECK:STDOUT:
  951. // CHECK:STDOUT: fn(%self.param: @Method.1.%Self.as_type.loc8_19.1 (%Self.as_type)) -> @Method.1.%T (%T);
  952. // CHECK:STDOUT: }
  953. // CHECK:STDOUT:
  954. // CHECK:STDOUT: fn @Make.2() -> %B;
  955. // CHECK:STDOUT:
  956. // CHECK:STDOUT: fn @Method.2(%self.param: %A) -> %B;
  957. // CHECK:STDOUT:
  958. // CHECK:STDOUT: specific @Factory(constants.%T) {
  959. // CHECK:STDOUT: %T.loc4_19.2 => constants.%T
  960. // CHECK:STDOUT: }
  961. // CHECK:STDOUT:
  962. // CHECK:STDOUT: specific @Make.1(constants.%T, constants.%Self.9ba) {
  963. // CHECK:STDOUT: %T => constants.%T
  964. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  965. // CHECK:STDOUT: }
  966. // CHECK:STDOUT:
  967. // CHECK:STDOUT: specific @Method.1(constants.%T, constants.%Self.9ba) {
  968. // CHECK:STDOUT: %T => constants.%T
  969. // CHECK:STDOUT: %Factory.type => constants.%Factory.type.c96
  970. // CHECK:STDOUT: %Self => constants.%Self.9ba
  971. // CHECK:STDOUT: %Self.as_type.loc8_19.1 => constants.%Self.as_type
  972. // CHECK:STDOUT: %pattern_type.loc8_13 => constants.%pattern_type.5ea
  973. // CHECK:STDOUT: %pattern_type.loc8_27 => constants.%pattern_type.7dc
  974. // CHECK:STDOUT: }
  975. // CHECK:STDOUT:
  976. // CHECK:STDOUT: specific @Factory(constants.%B) {
  977. // CHECK:STDOUT: %T.loc4_19.2 => constants.%B
  978. // CHECK:STDOUT:
  979. // CHECK:STDOUT: !definition:
  980. // CHECK:STDOUT: %Factory.type => constants.%Factory.type.a5d
  981. // CHECK:STDOUT: %Self.2 => constants.%Self.187
  982. // CHECK:STDOUT: %Make.type => constants.%Make.type.c59
  983. // CHECK:STDOUT: %Make => constants.%Make.efe
  984. // CHECK:STDOUT: %Factory.assoc_type => constants.%Factory.assoc_type.579
  985. // CHECK:STDOUT: %assoc0.loc6_17.2 => constants.%assoc0.fe7
  986. // CHECK:STDOUT: %Method.type => constants.%Method.type.117
  987. // CHECK:STDOUT: %Method => constants.%Method.ea9
  988. // CHECK:STDOUT: %assoc1.loc8_31.2 => constants.%assoc1.02a
  989. // CHECK:STDOUT: }
  990. // CHECK:STDOUT:
  991. // CHECK:STDOUT: specific @Make.1(constants.%B, constants.%Factory.facet) {
  992. // CHECK:STDOUT: %T => constants.%B
  993. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.049
  994. // CHECK:STDOUT: }
  995. // CHECK:STDOUT:
  996. // CHECK:STDOUT: specific @Method.1(constants.%B, constants.%Factory.facet) {
  997. // CHECK:STDOUT: %T => constants.%B
  998. // CHECK:STDOUT: %Factory.type => constants.%Factory.type.a5d
  999. // CHECK:STDOUT: %Self => constants.%Factory.facet
  1000. // CHECK:STDOUT: %Self.as_type.loc8_19.1 => constants.%A
  1001. // CHECK:STDOUT: %pattern_type.loc8_13 => constants.%pattern_type.c10
  1002. // CHECK:STDOUT: %pattern_type.loc8_27 => constants.%pattern_type.049
  1003. // CHECK:STDOUT: }
  1004. // CHECK:STDOUT:
  1005. // CHECK:STDOUT: --- factory.impl.carbon
  1006. // CHECK:STDOUT:
  1007. // CHECK:STDOUT: constants {
  1008. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  1009. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1010. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1011. // CHECK:STDOUT: %Factory.type.1a8: type = generic_interface_type @Factory [concrete]
  1012. // CHECK:STDOUT: %Factory.generic: %Factory.type.1a8 = struct_value () [concrete]
  1013. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1014. // CHECK:STDOUT: %Factory.type.c96: type = facet_type <@Factory, @Factory(%T)> [symbolic]
  1015. // CHECK:STDOUT: %Self.9ba: %Factory.type.c96 = bind_symbolic_name Self, 1 [symbolic]
  1016. // CHECK:STDOUT: %Factory.type.a5d: type = facet_type <@Factory, @Factory(%B)> [concrete]
  1017. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  1018. // CHECK:STDOUT: %Make.type.598: type = fn_type @Make.1, @Factory(%T) [symbolic]
  1019. // CHECK:STDOUT: %Make.737: %Make.type.598 = struct_value () [symbolic]
  1020. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1021. // CHECK:STDOUT: %Factory.assoc_type.207: type = assoc_entity_type @Factory, @Factory(%T) [symbolic]
  1022. // CHECK:STDOUT: %assoc0.46d25f.1: %Factory.assoc_type.207 = assoc_entity element0, imports.%Main.import_ref.21018a.1 [symbolic]
  1023. // CHECK:STDOUT: %Method.type.7ee: type = fn_type @Method.1, @Factory(%T) [symbolic]
  1024. // CHECK:STDOUT: %Method.a71: %Method.type.7ee = struct_value () [symbolic]
  1025. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.9ba [symbolic]
  1026. // CHECK:STDOUT: %pattern_type.5ea: type = pattern_type %Self.as_type [symbolic]
  1027. // CHECK:STDOUT: %assoc1.16541d.1: %Factory.assoc_type.207 = assoc_entity element1, imports.%Main.import_ref.46fc3c.1 [symbolic]
  1028. // CHECK:STDOUT: %Self.187: %Factory.type.a5d = bind_symbolic_name Self, 1 [symbolic]
  1029. // CHECK:STDOUT: %Make.type.c59: type = fn_type @Make.1, @Factory(%B) [concrete]
  1030. // CHECK:STDOUT: %Make.efe: %Make.type.c59 = struct_value () [concrete]
  1031. // CHECK:STDOUT: %Factory.assoc_type.579: type = assoc_entity_type @Factory, @Factory(%B) [concrete]
  1032. // CHECK:STDOUT: %assoc0.153: %Factory.assoc_type.579 = assoc_entity element0, imports.%Main.import_ref.1aa [concrete]
  1033. // CHECK:STDOUT: %Method.type.117: type = fn_type @Method.1, @Factory(%B) [concrete]
  1034. // CHECK:STDOUT: %Method.ea9: %Method.type.117 = struct_value () [concrete]
  1035. // CHECK:STDOUT: %assoc1.a48: %Factory.assoc_type.579 = assoc_entity element1, imports.%Main.import_ref.5be [concrete]
  1036. // CHECK:STDOUT: %pattern_type.049: type = pattern_type %B [concrete]
  1037. // CHECK:STDOUT: %MakeB.type: type = fn_type @MakeB [concrete]
  1038. // CHECK:STDOUT: %MakeB: %MakeB.type = struct_value () [concrete]
  1039. // CHECK:STDOUT: %assoc0.46d25f.2: %Factory.assoc_type.207 = assoc_entity element0, imports.%Main.import_ref.21018a.2 [symbolic]
  1040. // CHECK:STDOUT: %Factory.impl_witness: <witness> = impl_witness imports.%Factory.impl_witness_table [concrete]
  1041. // CHECK:STDOUT: %Factory.facet: %Factory.type.a5d = facet_value %A, (%Factory.impl_witness) [concrete]
  1042. // CHECK:STDOUT: %.711: type = fn_type_with_self_type %Make.type.c59, %Factory.facet [concrete]
  1043. // CHECK:STDOUT: %Make.type.ec4: type = fn_type @Make.2 [concrete]
  1044. // CHECK:STDOUT: %Make.377: %Make.type.ec4 = struct_value () [concrete]
  1045. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  1046. // CHECK:STDOUT: %InstanceB.type: type = fn_type @InstanceB [concrete]
  1047. // CHECK:STDOUT: %InstanceB: %InstanceB.type = struct_value () [concrete]
  1048. // CHECK:STDOUT: %assoc1.16541d.2: %Factory.assoc_type.207 = assoc_entity element1, imports.%Main.import_ref.46fc3c.2 [symbolic]
  1049. // CHECK:STDOUT: %.fed: type = fn_type_with_self_type %Method.type.117, %Factory.facet [concrete]
  1050. // CHECK:STDOUT: %Method.type.af5: type = fn_type @Method.2 [concrete]
  1051. // CHECK:STDOUT: %Method.3d4: %Method.type.af5 = struct_value () [concrete]
  1052. // CHECK:STDOUT: }
  1053. // CHECK:STDOUT:
  1054. // CHECK:STDOUT: imports {
  1055. // CHECK:STDOUT: %Main.Factory: %Factory.type.1a8 = import_ref Main//factory, Factory, loaded [concrete = constants.%Factory.generic]
  1056. // CHECK:STDOUT: %Main.A: type = import_ref Main//factory, A, loaded [concrete = constants.%A]
  1057. // CHECK:STDOUT: %Main.B: type = import_ref Main//factory, B, loaded [concrete = constants.%B]
  1058. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1059. // CHECK:STDOUT: import Core//prelude
  1060. // CHECK:STDOUT: }
  1061. // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//factory, loc12_10, loaded [concrete = constants.%complete_type]
  1062. // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//factory, inst86 [no loc], unloaded
  1063. // CHECK:STDOUT: %Main.import_ref.5ab3ec.1: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
  1064. // CHECK:STDOUT: %Main.import_ref.fbb = import_ref Main//factory, inst27 [no loc], unloaded
  1065. // CHECK:STDOUT: %Main.import_ref.46c: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = import_ref Main//factory, loc6_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.46d25f.2)]
  1066. // CHECK:STDOUT: %Main.import_ref.2e4: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = import_ref Main//factory, loc8_31, loaded [symbolic = @Factory.%assoc1 (constants.%assoc1.16541d.2)]
  1067. // CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded
  1068. // CHECK:STDOUT: %Main.Method = import_ref Main//factory, Method, unloaded
  1069. // CHECK:STDOUT: %Main.import_ref.6fd: <witness> = import_ref Main//factory, loc14_22, loaded [concrete = constants.%Factory.impl_witness]
  1070. // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//factory, loc11_10, loaded [concrete = constants.%complete_type]
  1071. // CHECK:STDOUT: %Main.import_ref.da3 = import_ref Main//factory, inst80 [no loc], unloaded
  1072. // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//factory, loc14_6, loaded [concrete = constants.%A]
  1073. // CHECK:STDOUT: %Main.import_ref.bd2: type = import_ref Main//factory, loc14_20, loaded [concrete = constants.%Factory.type.a5d]
  1074. // CHECK:STDOUT: %Main.import_ref.a27 = import_ref Main//factory, loc15_17, unloaded
  1075. // CHECK:STDOUT: %Main.import_ref.163 = import_ref Main//factory, loc16_31, unloaded
  1076. // CHECK:STDOUT: %Main.import_ref.5ab3ec.2: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
  1077. // CHECK:STDOUT: %Main.import_ref.91b53a.1: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst27 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self.9ba)]
  1078. // CHECK:STDOUT: %Main.import_ref.21018a.1 = import_ref Main//factory, loc6_17, unloaded
  1079. // CHECK:STDOUT: %Main.import_ref.5ab3ec.3: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
  1080. // CHECK:STDOUT: %Main.import_ref.91b53a.2: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst27 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self.9ba)]
  1081. // CHECK:STDOUT: %Main.import_ref.46fc3c.1 = import_ref Main//factory, loc8_31, unloaded
  1082. // CHECK:STDOUT: %Main.import_ref.1aa: @Factory.%Make.type (%Make.type.598) = import_ref Main//factory, loc6_17, loaded [symbolic = @Factory.%Make (constants.%Make.737)]
  1083. // CHECK:STDOUT: %Main.import_ref.5be: @Factory.%Method.type (%Method.type.7ee) = import_ref Main//factory, loc8_31, loaded [symbolic = @Factory.%Method (constants.%Method.a71)]
  1084. // CHECK:STDOUT: %Main.import_ref.21018a.2 = import_ref Main//factory, loc6_17, unloaded
  1085. // CHECK:STDOUT: %Main.import_ref.9ec: %Make.type.ec4 = import_ref Main//factory, loc15_17, loaded [concrete = constants.%Make.377]
  1086. // CHECK:STDOUT: %Main.import_ref.7dd: %Method.type.af5 = import_ref Main//factory, loc16_31, loaded [concrete = constants.%Method.3d4]
  1087. // CHECK:STDOUT: %Factory.impl_witness_table = impl_witness_table (%Main.import_ref.9ec, %Main.import_ref.7dd), @impl [concrete]
  1088. // CHECK:STDOUT: %Main.import_ref.46fc3c.2 = import_ref Main//factory, loc8_31, unloaded
  1089. // CHECK:STDOUT: }
  1090. // CHECK:STDOUT:
  1091. // CHECK:STDOUT: file {
  1092. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1093. // CHECK:STDOUT: .Factory = imports.%Main.Factory
  1094. // CHECK:STDOUT: .A = imports.%Main.A
  1095. // CHECK:STDOUT: .B = imports.%Main.B
  1096. // CHECK:STDOUT: .Core = imports.%Core
  1097. // CHECK:STDOUT: .MakeB = %MakeB.decl
  1098. // CHECK:STDOUT: .InstanceB = %InstanceB.decl
  1099. // CHECK:STDOUT: }
  1100. // CHECK:STDOUT: %default.import.loc2_23.1 = import <none>
  1101. // CHECK:STDOUT: %default.import.loc2_23.2 = import <none>
  1102. // CHECK:STDOUT: %Core.import = import Core
  1103. // CHECK:STDOUT: %MakeB.decl: %MakeB.type = fn_decl @MakeB [concrete = constants.%MakeB] {
  1104. // CHECK:STDOUT: %return.patt: %pattern_type.049 = return_slot_pattern [concrete]
  1105. // CHECK:STDOUT: %return.param_patt: %pattern_type.049 = out_param_pattern %return.patt, call_param0 [concrete]
  1106. // CHECK:STDOUT: } {
  1107. // CHECK:STDOUT: %B.ref.loc4: type = name_ref B, imports.%Main.B [concrete = constants.%B]
  1108. // CHECK:STDOUT: %return.param: ref %B = out_param call_param0
  1109. // CHECK:STDOUT: %return: ref %B = return_slot %return.param
  1110. // CHECK:STDOUT: }
  1111. // CHECK:STDOUT: %InstanceB.decl: %InstanceB.type = fn_decl @InstanceB [concrete = constants.%InstanceB] {
  1112. // CHECK:STDOUT: %a.patt: %pattern_type.c10 = binding_pattern a [concrete]
  1113. // CHECK:STDOUT: %a.param_patt: %pattern_type.c10 = value_param_pattern %a.patt, call_param0 [concrete]
  1114. // CHECK:STDOUT: %return.patt: %pattern_type.049 = return_slot_pattern [concrete]
  1115. // CHECK:STDOUT: %return.param_patt: %pattern_type.049 = out_param_pattern %return.patt, call_param1 [concrete]
  1116. // CHECK:STDOUT: } {
  1117. // CHECK:STDOUT: %B.ref.loc7: type = name_ref B, imports.%Main.B [concrete = constants.%B]
  1118. // CHECK:STDOUT: %a.param: %A = value_param call_param0
  1119. // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
  1120. // CHECK:STDOUT: %a: %A = bind_name a, %a.param
  1121. // CHECK:STDOUT: %return.param: ref %B = out_param call_param1
  1122. // CHECK:STDOUT: %return: ref %B = return_slot %return.param
  1123. // CHECK:STDOUT: }
  1124. // CHECK:STDOUT: }
  1125. // CHECK:STDOUT:
  1126. // CHECK:STDOUT: generic interface @Factory(imports.%Main.import_ref.5ab3ec.1: type) [from "factory.carbon"] {
  1127. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1128. // CHECK:STDOUT:
  1129. // CHECK:STDOUT: !definition:
  1130. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T)> [symbolic = %Factory.type (constants.%Factory.type.c96)]
  1131. // CHECK:STDOUT: %Self: @Factory.%Factory.type (%Factory.type.c96) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.9ba)]
  1132. // CHECK:STDOUT: %Make.type: type = fn_type @Make.1, @Factory(%T) [symbolic = %Make.type (constants.%Make.type.598)]
  1133. // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.598) = struct_value () [symbolic = %Make (constants.%Make.737)]
  1134. // CHECK:STDOUT: %Factory.assoc_type: type = assoc_entity_type @Factory, @Factory(%T) [symbolic = %Factory.assoc_type (constants.%Factory.assoc_type.207)]
  1135. // CHECK:STDOUT: %assoc0: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = assoc_entity element0, imports.%Main.import_ref.21018a.1 [symbolic = %assoc0 (constants.%assoc0.46d25f.1)]
  1136. // CHECK:STDOUT: %Method.type: type = fn_type @Method.1, @Factory(%T) [symbolic = %Method.type (constants.%Method.type.7ee)]
  1137. // CHECK:STDOUT: %Method: @Factory.%Method.type (%Method.type.7ee) = struct_value () [symbolic = %Method (constants.%Method.a71)]
  1138. // CHECK:STDOUT: %assoc1: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = assoc_entity element1, imports.%Main.import_ref.46fc3c.1 [symbolic = %assoc1 (constants.%assoc1.16541d.1)]
  1139. // CHECK:STDOUT:
  1140. // CHECK:STDOUT: interface {
  1141. // CHECK:STDOUT: !members:
  1142. // CHECK:STDOUT: .Self = imports.%Main.import_ref.fbb
  1143. // CHECK:STDOUT: .Make = imports.%Main.import_ref.46c
  1144. // CHECK:STDOUT: .Method = imports.%Main.import_ref.2e4
  1145. // CHECK:STDOUT: witness = (imports.%Main.Make, imports.%Main.Method)
  1146. // CHECK:STDOUT: }
  1147. // CHECK:STDOUT: }
  1148. // CHECK:STDOUT:
  1149. // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.984 as imports.%Main.import_ref.bd2 [from "factory.carbon"] {
  1150. // CHECK:STDOUT: !members:
  1151. // CHECK:STDOUT: .Make = imports.%Main.import_ref.a27
  1152. // CHECK:STDOUT: .Method = imports.%Main.import_ref.163
  1153. // CHECK:STDOUT: witness = imports.%Main.import_ref.6fd
  1154. // CHECK:STDOUT: }
  1155. // CHECK:STDOUT:
  1156. // CHECK:STDOUT: class @B [from "factory.carbon"] {
  1157. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
  1158. // CHECK:STDOUT:
  1159. // CHECK:STDOUT: !members:
  1160. // CHECK:STDOUT: .Self = imports.%Main.import_ref.54a
  1161. // CHECK:STDOUT: }
  1162. // CHECK:STDOUT:
  1163. // CHECK:STDOUT: class @A [from "factory.carbon"] {
  1164. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
  1165. // CHECK:STDOUT:
  1166. // CHECK:STDOUT: !members:
  1167. // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
  1168. // CHECK:STDOUT: }
  1169. // CHECK:STDOUT:
  1170. // CHECK:STDOUT: generic fn @Make.1(imports.%Main.import_ref.5ab3ec.2: type, imports.%Main.import_ref.91b53a.1: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] {
  1171. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1172. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1173. // CHECK:STDOUT:
  1174. // CHECK:STDOUT: fn;
  1175. // CHECK:STDOUT: }
  1176. // CHECK:STDOUT:
  1177. // CHECK:STDOUT: generic fn @Method.1(imports.%Main.import_ref.5ab3ec.3: type, imports.%Main.import_ref.91b53a.2: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] {
  1178. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1179. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T)> [symbolic = %Factory.type (constants.%Factory.type.c96)]
  1180. // CHECK:STDOUT: %Self: @Method.1.%Factory.type (%Factory.type.c96) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.9ba)]
  1181. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  1182. // CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.5ea)]
  1183. // CHECK:STDOUT: %pattern_type.2: type = pattern_type %T [symbolic = %pattern_type.2 (constants.%pattern_type.7dc)]
  1184. // CHECK:STDOUT:
  1185. // CHECK:STDOUT: fn;
  1186. // CHECK:STDOUT: }
  1187. // CHECK:STDOUT:
  1188. // CHECK:STDOUT: fn @MakeB() -> %return.param: %B {
  1189. // CHECK:STDOUT: !entry:
  1190. // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
  1191. // CHECK:STDOUT: %Factory.ref: %Factory.type.1a8 = name_ref Factory, imports.%Main.Factory [concrete = constants.%Factory.generic]
  1192. // CHECK:STDOUT: %B.ref.loc5: type = name_ref B, imports.%Main.B [concrete = constants.%B]
  1193. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [concrete = constants.%Factory.type.a5d]
  1194. // CHECK:STDOUT: %.loc5_23: %Factory.assoc_type.579 = specific_constant imports.%Main.import_ref.46c, @Factory(constants.%B) [concrete = constants.%assoc0.153]
  1195. // CHECK:STDOUT: %Make.ref: %Factory.assoc_type.579 = name_ref Make, %.loc5_23 [concrete = constants.%assoc0.153]
  1196. // CHECK:STDOUT: %Factory.facet: %Factory.type.a5d = facet_value constants.%A, (constants.%Factory.impl_witness) [concrete = constants.%Factory.facet]
  1197. // CHECK:STDOUT: %.loc5_11: %Factory.type.a5d = converted %A.ref, %Factory.facet [concrete = constants.%Factory.facet]
  1198. // CHECK:STDOUT: %impl.elem0: %.711 = impl_witness_access constants.%Factory.impl_witness, element0 [concrete = constants.%Make.377]
  1199. // CHECK:STDOUT: %.loc4: ref %B = splice_block %return {}
  1200. // CHECK:STDOUT: %Make.call: init %B = call %impl.elem0() to %.loc4
  1201. // CHECK:STDOUT: return %Make.call to %return
  1202. // CHECK:STDOUT: }
  1203. // CHECK:STDOUT:
  1204. // CHECK:STDOUT: fn @Make.2 [from "factory.carbon"];
  1205. // CHECK:STDOUT:
  1206. // CHECK:STDOUT: fn @InstanceB(%a.param: %A) -> %return.param: %B {
  1207. // CHECK:STDOUT: !entry:
  1208. // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
  1209. // CHECK:STDOUT: %Factory.ref: %Factory.type.1a8 = name_ref Factory, imports.%Main.Factory [concrete = constants.%Factory.generic]
  1210. // CHECK:STDOUT: %B.ref.loc8: type = name_ref B, imports.%Main.B [concrete = constants.%B]
  1211. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [concrete = constants.%Factory.type.a5d]
  1212. // CHECK:STDOUT: %.loc8: %Factory.assoc_type.579 = specific_constant imports.%Main.import_ref.2e4, @Factory(constants.%B) [concrete = constants.%assoc1.a48]
  1213. // CHECK:STDOUT: %Method.ref: %Factory.assoc_type.579 = name_ref Method, %.loc8 [concrete = constants.%assoc1.a48]
  1214. // CHECK:STDOUT: %impl.elem1: %.fed = impl_witness_access constants.%Factory.impl_witness, element1 [concrete = constants.%Method.3d4]
  1215. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem1
  1216. // CHECK:STDOUT: %.loc7: ref %B = splice_block %return {}
  1217. // CHECK:STDOUT: %Method.call: init %B = call %bound_method(%a.ref) to %.loc7
  1218. // CHECK:STDOUT: return %Method.call to %return
  1219. // CHECK:STDOUT: }
  1220. // CHECK:STDOUT:
  1221. // CHECK:STDOUT: fn @Method.2 [from "factory.carbon"];
  1222. // CHECK:STDOUT:
  1223. // CHECK:STDOUT: specific @Factory(constants.%T) {
  1224. // CHECK:STDOUT: %T => constants.%T
  1225. // CHECK:STDOUT: }
  1226. // CHECK:STDOUT:
  1227. // CHECK:STDOUT: specific @Factory(constants.%B) {
  1228. // CHECK:STDOUT: %T => constants.%B
  1229. // CHECK:STDOUT:
  1230. // CHECK:STDOUT: !definition:
  1231. // CHECK:STDOUT: %Factory.type => constants.%Factory.type.a5d
  1232. // CHECK:STDOUT: %Self => constants.%Self.187
  1233. // CHECK:STDOUT: %Make.type => constants.%Make.type.c59
  1234. // CHECK:STDOUT: %Make => constants.%Make.efe
  1235. // CHECK:STDOUT: %Factory.assoc_type => constants.%Factory.assoc_type.579
  1236. // CHECK:STDOUT: %assoc0 => constants.%assoc0.153
  1237. // CHECK:STDOUT: %Method.type => constants.%Method.type.117
  1238. // CHECK:STDOUT: %Method => constants.%Method.ea9
  1239. // CHECK:STDOUT: %assoc1 => constants.%assoc1.a48
  1240. // CHECK:STDOUT: }
  1241. // CHECK:STDOUT:
  1242. // CHECK:STDOUT: specific @Make.1(constants.%T, constants.%Self.9ba) {
  1243. // CHECK:STDOUT: %T => constants.%T
  1244. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1245. // CHECK:STDOUT: }
  1246. // CHECK:STDOUT:
  1247. // CHECK:STDOUT: specific @Method.1(constants.%T, constants.%Self.9ba) {
  1248. // CHECK:STDOUT: %T => constants.%T
  1249. // CHECK:STDOUT: %Factory.type => constants.%Factory.type.c96
  1250. // CHECK:STDOUT: %Self => constants.%Self.9ba
  1251. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  1252. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.5ea
  1253. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.7dc
  1254. // CHECK:STDOUT: }
  1255. // CHECK:STDOUT:
  1256. // CHECK:STDOUT: --- fail_factory.impl.carbon
  1257. // CHECK:STDOUT:
  1258. // CHECK:STDOUT: constants {
  1259. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  1260. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1261. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1262. // CHECK:STDOUT: %Factory.type.1a8: type = generic_interface_type @Factory [concrete]
  1263. // CHECK:STDOUT: %Factory.generic: %Factory.type.1a8 = struct_value () [concrete]
  1264. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1265. // CHECK:STDOUT: %Factory.type.c96: type = facet_type <@Factory, @Factory(%T)> [symbolic]
  1266. // CHECK:STDOUT: %Self.9ba: %Factory.type.c96 = bind_symbolic_name Self, 1 [symbolic]
  1267. // CHECK:STDOUT: %Factory.type.a5d: type = facet_type <@Factory, @Factory(%B)> [concrete]
  1268. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  1269. // CHECK:STDOUT: %Make.type.598: type = fn_type @Make, @Factory(%T) [symbolic]
  1270. // CHECK:STDOUT: %Make.737: %Make.type.598 = struct_value () [symbolic]
  1271. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1272. // CHECK:STDOUT: %Factory.assoc_type.207: type = assoc_entity_type @Factory, @Factory(%T) [symbolic]
  1273. // CHECK:STDOUT: %assoc0.fe4: %Factory.assoc_type.207 = assoc_entity element0, imports.%Main.import_ref.1aa [symbolic]
  1274. // CHECK:STDOUT: %Method.type.7ee: type = fn_type @Method, @Factory(%T) [symbolic]
  1275. // CHECK:STDOUT: %Method.a71: %Method.type.7ee = struct_value () [symbolic]
  1276. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.9ba [symbolic]
  1277. // CHECK:STDOUT: %pattern_type.5ea: type = pattern_type %Self.as_type [symbolic]
  1278. // CHECK:STDOUT: %assoc1.ea6: %Factory.assoc_type.207 = assoc_entity element1, imports.%Main.import_ref.5be [symbolic]
  1279. // CHECK:STDOUT: %Self.187: %Factory.type.a5d = bind_symbolic_name Self, 1 [symbolic]
  1280. // CHECK:STDOUT: %Make.type.c59: type = fn_type @Make, @Factory(%B) [concrete]
  1281. // CHECK:STDOUT: %Make.efe: %Make.type.c59 = struct_value () [concrete]
  1282. // CHECK:STDOUT: %Factory.assoc_type.579: type = assoc_entity_type @Factory, @Factory(%B) [concrete]
  1283. // CHECK:STDOUT: %assoc0.cc7: %Factory.assoc_type.579 = assoc_entity element0, imports.%Main.import_ref.21018a.1 [concrete]
  1284. // CHECK:STDOUT: %Method.type.117: type = fn_type @Method, @Factory(%B) [concrete]
  1285. // CHECK:STDOUT: %Method.ea9: %Method.type.117 = struct_value () [concrete]
  1286. // CHECK:STDOUT: %assoc1.535: %Factory.assoc_type.579 = assoc_entity element1, imports.%Main.import_ref.46fc3c.1 [concrete]
  1287. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1288. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  1289. // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [concrete]
  1290. // CHECK:STDOUT: %MakeC: %MakeC.type = struct_value () [concrete]
  1291. // CHECK:STDOUT: %Factory.type.5c5: type = facet_type <@Factory, @Factory(%C)> [concrete]
  1292. // CHECK:STDOUT: %Self.424: %Factory.type.5c5 = bind_symbolic_name Self, 1 [symbolic]
  1293. // CHECK:STDOUT: %Make.type.0de: type = fn_type @Make, @Factory(%C) [concrete]
  1294. // CHECK:STDOUT: %Make.8ba: %Make.type.0de = struct_value () [concrete]
  1295. // CHECK:STDOUT: %Factory.assoc_type.d01: type = assoc_entity_type @Factory, @Factory(%C) [concrete]
  1296. // CHECK:STDOUT: %assoc0.38e: %Factory.assoc_type.d01 = assoc_entity element0, imports.%Main.import_ref.1aa [concrete]
  1297. // CHECK:STDOUT: %Method.type.d46: type = fn_type @Method, @Factory(%C) [concrete]
  1298. // CHECK:STDOUT: %Method.f9e: %Method.type.d46 = struct_value () [concrete]
  1299. // CHECK:STDOUT: %assoc1.263: %Factory.assoc_type.d01 = assoc_entity element1, imports.%Main.import_ref.5be [concrete]
  1300. // CHECK:STDOUT: %assoc0.46d: %Factory.assoc_type.207 = assoc_entity element0, imports.%Main.import_ref.21018a.2 [symbolic]
  1301. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  1302. // CHECK:STDOUT: %InstanceC.type: type = fn_type @InstanceC [concrete]
  1303. // CHECK:STDOUT: %InstanceC: %InstanceC.type = struct_value () [concrete]
  1304. // CHECK:STDOUT: %assoc1.165: %Factory.assoc_type.207 = assoc_entity element1, imports.%Main.import_ref.46fc3c.2 [symbolic]
  1305. // CHECK:STDOUT: }
  1306. // CHECK:STDOUT:
  1307. // CHECK:STDOUT: imports {
  1308. // CHECK:STDOUT: %Main.Factory: %Factory.type.1a8 = import_ref Main//factory, Factory, loaded [concrete = constants.%Factory.generic]
  1309. // CHECK:STDOUT: %Main.A: type = import_ref Main//factory, A, loaded [concrete = constants.%A]
  1310. // CHECK:STDOUT: %Main.B = import_ref Main//factory, B, unloaded
  1311. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1312. // CHECK:STDOUT: import Core//prelude
  1313. // CHECK:STDOUT: import Core//default
  1314. // CHECK:STDOUT: }
  1315. // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//factory, loc12_10, loaded [concrete = constants.%complete_type]
  1316. // CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//factory, inst86 [no loc], unloaded
  1317. // CHECK:STDOUT: %Main.import_ref.5ab3ec.1: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
  1318. // CHECK:STDOUT: %Main.import_ref.fbb = import_ref Main//factory, inst27 [no loc], unloaded
  1319. // CHECK:STDOUT: %Main.import_ref.46c: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = import_ref Main//factory, loc6_17, loaded [symbolic = @Factory.%assoc0 (constants.%assoc0.46d)]
  1320. // CHECK:STDOUT: %Main.import_ref.2e4: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = import_ref Main//factory, loc8_31, loaded [symbolic = @Factory.%assoc1 (constants.%assoc1.165)]
  1321. // CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded
  1322. // CHECK:STDOUT: %Main.Method = import_ref Main//factory, Method, unloaded
  1323. // CHECK:STDOUT: %Main.import_ref.4c3 = import_ref Main//factory, loc14_22, unloaded
  1324. // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//factory, loc11_10, loaded [concrete = constants.%complete_type]
  1325. // CHECK:STDOUT: %Main.import_ref.da3 = import_ref Main//factory, inst80 [no loc], unloaded
  1326. // CHECK:STDOUT: %Main.import_ref.984: type = import_ref Main//factory, loc14_6, loaded [concrete = constants.%A]
  1327. // CHECK:STDOUT: %Main.import_ref.bd2: type = import_ref Main//factory, loc14_20, loaded [concrete = constants.%Factory.type.a5d]
  1328. // CHECK:STDOUT: %Main.import_ref.a27 = import_ref Main//factory, loc15_17, unloaded
  1329. // CHECK:STDOUT: %Main.import_ref.163 = import_ref Main//factory, loc16_31, unloaded
  1330. // CHECK:STDOUT: %Main.import_ref.5ab3ec.2: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
  1331. // CHECK:STDOUT: %Main.import_ref.91b53a.1: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst27 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self.9ba)]
  1332. // CHECK:STDOUT: %Main.import_ref.1aa: @Factory.%Make.type (%Make.type.598) = import_ref Main//factory, loc6_17, loaded [symbolic = @Factory.%Make (constants.%Make.737)]
  1333. // CHECK:STDOUT: %Main.import_ref.5ab3ec.3: type = import_ref Main//factory, loc4_19, loaded [symbolic = @Factory.%T (constants.%T)]
  1334. // CHECK:STDOUT: %Main.import_ref.91b53a.2: @Factory.%Factory.type (%Factory.type.c96) = import_ref Main//factory, inst27 [no loc], loaded [symbolic = @Factory.%Self (constants.%Self.9ba)]
  1335. // CHECK:STDOUT: %Main.import_ref.5be: @Factory.%Method.type (%Method.type.7ee) = import_ref Main//factory, loc8_31, loaded [symbolic = @Factory.%Method (constants.%Method.a71)]
  1336. // CHECK:STDOUT: %Main.import_ref.21018a.1 = import_ref Main//factory, loc6_17, unloaded
  1337. // CHECK:STDOUT: %Main.import_ref.46fc3c.1 = import_ref Main//factory, loc8_31, unloaded
  1338. // CHECK:STDOUT: %Main.import_ref.21018a.2 = import_ref Main//factory, loc6_17, unloaded
  1339. // CHECK:STDOUT: %Main.import_ref.46fc3c.2 = import_ref Main//factory, loc8_31, unloaded
  1340. // CHECK:STDOUT: }
  1341. // CHECK:STDOUT:
  1342. // CHECK:STDOUT: file {
  1343. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1344. // CHECK:STDOUT: .Factory = imports.%Main.Factory
  1345. // CHECK:STDOUT: .A = imports.%Main.A
  1346. // CHECK:STDOUT: .B = imports.%Main.B
  1347. // CHECK:STDOUT: .Core = imports.%Core
  1348. // CHECK:STDOUT: .C = %C.decl
  1349. // CHECK:STDOUT: .MakeC = %MakeC.decl
  1350. // CHECK:STDOUT: .InstanceC = %InstanceC.decl
  1351. // CHECK:STDOUT: }
  1352. // CHECK:STDOUT: %default.import.loc2_23.1 = import <none>
  1353. // CHECK:STDOUT: %default.import.loc2_23.2 = import <none>
  1354. // CHECK:STDOUT: %Core.import = import Core
  1355. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1356. // CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [concrete = constants.%MakeC] {
  1357. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  1358. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param0 [concrete]
  1359. // CHECK:STDOUT: } {
  1360. // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1361. // CHECK:STDOUT: %return.param: ref %C = out_param call_param0
  1362. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  1363. // CHECK:STDOUT: }
  1364. // CHECK:STDOUT: %InstanceC.decl: %InstanceC.type = fn_decl @InstanceC [concrete = constants.%InstanceC] {
  1365. // CHECK:STDOUT: %a.patt: %pattern_type.c10 = binding_pattern a [concrete]
  1366. // CHECK:STDOUT: %a.param_patt: %pattern_type.c10 = value_param_pattern %a.patt, call_param0 [concrete]
  1367. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  1368. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param1 [concrete]
  1369. // CHECK:STDOUT: } {
  1370. // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1371. // CHECK:STDOUT: %a.param: %A = value_param call_param0
  1372. // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
  1373. // CHECK:STDOUT: %a: %A = bind_name a, %a.param
  1374. // CHECK:STDOUT: %return.param: ref %C = out_param call_param1
  1375. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  1376. // CHECK:STDOUT: }
  1377. // CHECK:STDOUT: }
  1378. // CHECK:STDOUT:
  1379. // CHECK:STDOUT: generic interface @Factory(imports.%Main.import_ref.5ab3ec.1: type) [from "factory.carbon"] {
  1380. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1381. // CHECK:STDOUT:
  1382. // CHECK:STDOUT: !definition:
  1383. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T)> [symbolic = %Factory.type (constants.%Factory.type.c96)]
  1384. // CHECK:STDOUT: %Self: @Factory.%Factory.type (%Factory.type.c96) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.9ba)]
  1385. // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Factory(%T) [symbolic = %Make.type (constants.%Make.type.598)]
  1386. // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.598) = struct_value () [symbolic = %Make (constants.%Make.737)]
  1387. // CHECK:STDOUT: %Factory.assoc_type: type = assoc_entity_type @Factory, @Factory(%T) [symbolic = %Factory.assoc_type (constants.%Factory.assoc_type.207)]
  1388. // CHECK:STDOUT: %assoc0: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = assoc_entity element0, imports.%Main.import_ref.1aa [symbolic = %assoc0 (constants.%assoc0.fe4)]
  1389. // CHECK:STDOUT: %Method.type: type = fn_type @Method, @Factory(%T) [symbolic = %Method.type (constants.%Method.type.7ee)]
  1390. // CHECK:STDOUT: %Method: @Factory.%Method.type (%Method.type.7ee) = struct_value () [symbolic = %Method (constants.%Method.a71)]
  1391. // CHECK:STDOUT: %assoc1: @Factory.%Factory.assoc_type (%Factory.assoc_type.207) = assoc_entity element1, imports.%Main.import_ref.5be [symbolic = %assoc1 (constants.%assoc1.ea6)]
  1392. // CHECK:STDOUT:
  1393. // CHECK:STDOUT: interface {
  1394. // CHECK:STDOUT: !members:
  1395. // CHECK:STDOUT: .Self = imports.%Main.import_ref.fbb
  1396. // CHECK:STDOUT: .Make = imports.%Main.import_ref.46c
  1397. // CHECK:STDOUT: .Method = imports.%Main.import_ref.2e4
  1398. // CHECK:STDOUT: witness = (imports.%Main.Make, imports.%Main.Method)
  1399. // CHECK:STDOUT: }
  1400. // CHECK:STDOUT: }
  1401. // CHECK:STDOUT:
  1402. // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.984 as imports.%Main.import_ref.bd2 [from "factory.carbon"] {
  1403. // CHECK:STDOUT: !members:
  1404. // CHECK:STDOUT: .Make = imports.%Main.import_ref.a27
  1405. // CHECK:STDOUT: .Method = imports.%Main.import_ref.163
  1406. // CHECK:STDOUT: witness = imports.%Main.import_ref.4c3
  1407. // CHECK:STDOUT: }
  1408. // CHECK:STDOUT:
  1409. // CHECK:STDOUT: class @B [from "factory.carbon"] {
  1410. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
  1411. // CHECK:STDOUT:
  1412. // CHECK:STDOUT: !members:
  1413. // CHECK:STDOUT: .Self = imports.%Main.import_ref.54a
  1414. // CHECK:STDOUT: }
  1415. // CHECK:STDOUT:
  1416. // CHECK:STDOUT: class @A [from "factory.carbon"] {
  1417. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
  1418. // CHECK:STDOUT:
  1419. // CHECK:STDOUT: !members:
  1420. // CHECK:STDOUT: .Self = imports.%Main.import_ref.da3
  1421. // CHECK:STDOUT: }
  1422. // CHECK:STDOUT:
  1423. // CHECK:STDOUT: class @C {
  1424. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1425. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1426. // CHECK:STDOUT: complete_type_witness = %complete_type
  1427. // CHECK:STDOUT:
  1428. // CHECK:STDOUT: !members:
  1429. // CHECK:STDOUT: .Self = constants.%C
  1430. // CHECK:STDOUT: }
  1431. // CHECK:STDOUT:
  1432. // CHECK:STDOUT: generic fn @Make(imports.%Main.import_ref.5ab3ec.2: type, imports.%Main.import_ref.91b53a.1: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] {
  1433. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1434. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1435. // CHECK:STDOUT:
  1436. // CHECK:STDOUT: fn;
  1437. // CHECK:STDOUT: }
  1438. // CHECK:STDOUT:
  1439. // CHECK:STDOUT: generic fn @Method(imports.%Main.import_ref.5ab3ec.3: type, imports.%Main.import_ref.91b53a.2: @Factory.%Factory.type (%Factory.type.c96)) [from "factory.carbon"] {
  1440. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1441. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T)> [symbolic = %Factory.type (constants.%Factory.type.c96)]
  1442. // CHECK:STDOUT: %Self: @Method.%Factory.type (%Factory.type.c96) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.9ba)]
  1443. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  1444. // CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.5ea)]
  1445. // CHECK:STDOUT: %pattern_type.2: type = pattern_type %T [symbolic = %pattern_type.2 (constants.%pattern_type.7dc)]
  1446. // CHECK:STDOUT:
  1447. // CHECK:STDOUT: fn;
  1448. // CHECK:STDOUT: }
  1449. // CHECK:STDOUT:
  1450. // CHECK:STDOUT: fn @MakeC() -> %return.param: %C {
  1451. // CHECK:STDOUT: !entry:
  1452. // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
  1453. // CHECK:STDOUT: %Factory.ref: %Factory.type.1a8 = name_ref Factory, imports.%Main.Factory [concrete = constants.%Factory.generic]
  1454. // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1455. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%C)> [concrete = constants.%Factory.type.5c5]
  1456. // CHECK:STDOUT: %.loc13: %Factory.assoc_type.d01 = specific_constant imports.%Main.import_ref.46c, @Factory(constants.%C) [concrete = constants.%assoc0.38e]
  1457. // CHECK:STDOUT: %Make.ref: %Factory.assoc_type.d01 = name_ref Make, %.loc13 [concrete = constants.%assoc0.38e]
  1458. // CHECK:STDOUT: return <error> to %return
  1459. // CHECK:STDOUT: }
  1460. // CHECK:STDOUT:
  1461. // CHECK:STDOUT: fn @InstanceC(%a.param: %A) -> %return.param: %C {
  1462. // CHECK:STDOUT: !entry:
  1463. // CHECK:STDOUT: %a.ref: %A = name_ref a, %a
  1464. // CHECK:STDOUT: %Factory.ref: %Factory.type.1a8 = name_ref Factory, imports.%Main.Factory [concrete = constants.%Factory.generic]
  1465. // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1466. // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%C)> [concrete = constants.%Factory.type.5c5]
  1467. // CHECK:STDOUT: %.loc21: %Factory.assoc_type.d01 = specific_constant imports.%Main.import_ref.2e4, @Factory(constants.%C) [concrete = constants.%assoc1.263]
  1468. // CHECK:STDOUT: %Method.ref: %Factory.assoc_type.d01 = name_ref Method, %.loc21 [concrete = constants.%assoc1.263]
  1469. // CHECK:STDOUT: return <error> to %return
  1470. // CHECK:STDOUT: }
  1471. // CHECK:STDOUT:
  1472. // CHECK:STDOUT: specific @Factory(constants.%T) {
  1473. // CHECK:STDOUT: %T => constants.%T
  1474. // CHECK:STDOUT: }
  1475. // CHECK:STDOUT:
  1476. // CHECK:STDOUT: specific @Factory(constants.%B) {
  1477. // CHECK:STDOUT: %T => constants.%B
  1478. // CHECK:STDOUT:
  1479. // CHECK:STDOUT: !definition:
  1480. // CHECK:STDOUT: %Factory.type => constants.%Factory.type.a5d
  1481. // CHECK:STDOUT: %Self => constants.%Self.187
  1482. // CHECK:STDOUT: %Make.type => constants.%Make.type.c59
  1483. // CHECK:STDOUT: %Make => constants.%Make.efe
  1484. // CHECK:STDOUT: %Factory.assoc_type => constants.%Factory.assoc_type.579
  1485. // CHECK:STDOUT: %assoc0 => constants.%assoc0.cc7
  1486. // CHECK:STDOUT: %Method.type => constants.%Method.type.117
  1487. // CHECK:STDOUT: %Method => constants.%Method.ea9
  1488. // CHECK:STDOUT: %assoc1 => constants.%assoc1.535
  1489. // CHECK:STDOUT: }
  1490. // CHECK:STDOUT:
  1491. // CHECK:STDOUT: specific @Make(constants.%T, constants.%Self.9ba) {
  1492. // CHECK:STDOUT: %T => constants.%T
  1493. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1494. // CHECK:STDOUT: }
  1495. // CHECK:STDOUT:
  1496. // CHECK:STDOUT: specific @Method(constants.%T, constants.%Self.9ba) {
  1497. // CHECK:STDOUT: %T => constants.%T
  1498. // CHECK:STDOUT: %Factory.type => constants.%Factory.type.c96
  1499. // CHECK:STDOUT: %Self => constants.%Self.9ba
  1500. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  1501. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.5ea
  1502. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.7dc
  1503. // CHECK:STDOUT: }
  1504. // CHECK:STDOUT:
  1505. // CHECK:STDOUT: specific @Factory(constants.%C) {
  1506. // CHECK:STDOUT: %T => constants.%C
  1507. // CHECK:STDOUT:
  1508. // CHECK:STDOUT: !definition:
  1509. // CHECK:STDOUT: %Factory.type => constants.%Factory.type.5c5
  1510. // CHECK:STDOUT: %Self => constants.%Self.424
  1511. // CHECK:STDOUT: %Make.type => constants.%Make.type.0de
  1512. // CHECK:STDOUT: %Make => constants.%Make.8ba
  1513. // CHECK:STDOUT: %Factory.assoc_type => constants.%Factory.assoc_type.d01
  1514. // CHECK:STDOUT: %assoc0 => constants.%assoc0.38e
  1515. // CHECK:STDOUT: %Method.type => constants.%Method.type.d46
  1516. // CHECK:STDOUT: %Method => constants.%Method.f9e
  1517. // CHECK:STDOUT: %assoc1 => constants.%assoc1.263
  1518. // CHECK:STDOUT: }
  1519. // CHECK:STDOUT: