interface_args.carbon 100 KB

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