compound_member_access.carbon 155 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215
  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/facet_types.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/interface/min_prelude/compound_member_access.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon
  13. // --- associated_constant.carbon
  14. library "[[@TEST_NAME]]";
  15. interface J {
  16. let U:! type;
  17. }
  18. // Simple member access.
  19. fn Simple1(T:! J, S:! T.U) {}
  20. // This should be equivalent to `Simple1` above, but using compound member access.
  21. fn Compound1(V:! J, W:! V.(J.U)) {}
  22. // --- non_instance.carbon
  23. library "[[@TEST_NAME]]";
  24. interface K1 {
  25. fn Q1();
  26. }
  27. // Simple member access.
  28. fn Simple2(T:! K1) {
  29. T.Q1();
  30. }
  31. // This should be equivalent to `Simple2` above, but using compound member access.
  32. fn Compound2(V:! K1) {
  33. V.(K1.Q1)();
  34. }
  35. // --- fail_caller_instance_interface_not.carbon
  36. library "[[@TEST_NAME]]";
  37. interface K2 {
  38. fn Q2();
  39. }
  40. // Simple member access allows this.
  41. fn Simple3(T:! K2, x: T) {
  42. x.Q2();
  43. }
  44. // Compound member access does not. It tries to convert `y` to `K2`, but only
  45. // its type `V` can.
  46. fn Compound3(V:! K2, y: V) {
  47. // CHECK:STDERR: fail_caller_instance_interface_not.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `V` into type implementing `K2` [ConversionFailureNonTypeToFacet]
  48. // CHECK:STDERR: y.(K2.Q2)();
  49. // CHECK:STDERR: ^~~~~~~~~
  50. // CHECK:STDERR: fail_caller_instance_interface_not.carbon:[[@LINE+4]]:3: note: type `V` does not implement interface `Core.ImplicitAs(K2)` [MissingImplInMemberAccessNote]
  51. // CHECK:STDERR: y.(K2.Q2)();
  52. // CHECK:STDERR: ^~~~~~~~~
  53. // CHECK:STDERR:
  54. y.(K2.Q2)();
  55. }
  56. // --- instance.carbon
  57. library "[[@TEST_NAME]]";
  58. interface L1 {
  59. fn R1[self: Self]();
  60. fn S1[addr self: Self*]();
  61. }
  62. // Simple member access.
  63. fn Simple4(T:! L1, x: T) {
  64. x.R1();
  65. var xcopy: T = x;
  66. xcopy.S1();
  67. }
  68. // This should be equivalent to `Simple4` above, but using compound member access.
  69. fn Compound4(V:! L1, y: V) {
  70. y.(L1.R1)();
  71. var ycopy: V = y;
  72. ycopy.(L1.S1)();
  73. }
  74. // --- fail_interface_instance_caller_not.carbon
  75. library "[[@TEST_NAME]]";
  76. interface L2 {
  77. fn R2[self: Self]();
  78. fn S2[addr self: Self*]();
  79. }
  80. // Simple member access. Fails since calling an instance method without an object.
  81. fn Simple5(T:! L2) {
  82. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall]
  83. // CHECK:STDERR: T.R2();
  84. // CHECK:STDERR: ^~~~~~
  85. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-9]]:3: note: calling function declared here [InCallToFunction]
  86. // CHECK:STDERR: fn R2[self: Self]();
  87. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  88. // CHECK:STDERR:
  89. T.R2();
  90. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall]
  91. // CHECK:STDERR: T.S2();
  92. // CHECK:STDERR: ^~~~~~
  93. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-16]]:3: note: calling function declared here [InCallToFunction]
  94. // CHECK:STDERR: fn S2[addr self: Self*]();
  95. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  96. // CHECK:STDERR:
  97. T.S2();
  98. }
  99. // TODO: Expected to fail in the same way as `Simple5`.
  100. fn Compound5(V:! L2) {
  101. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+4]]:3: error: cannot access member of interface `L2` in type `L2` that does not implement that interface [MissingImplInMemberAccess]
  102. // CHECK:STDERR: V.(L2.R2)();
  103. // CHECK:STDERR: ^~~~~~~~~
  104. // CHECK:STDERR:
  105. V.(L2.R2)();
  106. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+4]]:3: error: cannot access member of interface `L2` in type `L2` that does not implement that interface [MissingImplInMemberAccess]
  107. // CHECK:STDERR: V.(L2.S2)();
  108. // CHECK:STDERR: ^~~~~~~~~
  109. // CHECK:STDERR:
  110. V.(L2.S2)();
  111. }
  112. // --- fail_combine_non_instance.carbon
  113. library "[[@TEST_NAME]]";
  114. interface A {
  115. fn G();
  116. }
  117. class C {}
  118. impl C as A {
  119. fn G() {}
  120. }
  121. // Since `A.G` is a non-instance method, compound member access may only be
  122. // used with a type, not an instance.
  123. fn Fails() {
  124. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `C` into type implementing `A` [ConversionFailureNonTypeToFacet]
  125. // CHECK:STDERR: ({} as C).((A & A).G)();
  126. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  127. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+4]]:3: note: type `C` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
  128. // CHECK:STDERR: ({} as C).((A & A).G)();
  129. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  130. // CHECK:STDERR:
  131. ({} as C).((A & A).G)();
  132. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `C` into type implementing `A` [ConversionFailureNonTypeToFacet]
  133. // CHECK:STDERR: (({} as C) as (C as (A & A))).((A & A).G)();
  134. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  135. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+4]]:3: note: type `C` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
  136. // CHECK:STDERR: (({} as C) as (C as (A & A))).((A & A).G)();
  137. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  138. // CHECK:STDERR:
  139. (({} as C) as (C as (A & A))).((A & A).G)();
  140. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `C` into type implementing `A` [ConversionFailureNonTypeToFacet]
  141. // CHECK:STDERR: (({} as C) as (C as (A & A))).(A.G)();
  142. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  143. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+4]]:3: note: type `C` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
  144. // CHECK:STDERR: (({} as C) as (C as (A & A))).(A.G)();
  145. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  146. // CHECK:STDERR:
  147. (({} as C) as (C as (A & A))).(A.G)();
  148. }
  149. // --- allowed_combine_non_instance.carbon
  150. library "[[@TEST_NAME]]";
  151. interface A {
  152. fn G();
  153. }
  154. class C {}
  155. impl C as A {
  156. fn G() {}
  157. }
  158. fn Works() {
  159. C.((A & A).G)();
  160. (C as (A & A)).((A & A).G)();
  161. (C as (A & A)).(A.G)();
  162. }
  163. // CHECK:STDOUT: --- associated_constant.carbon
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: constants {
  166. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  167. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic]
  168. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  169. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  170. // CHECK:STDOUT: %T: %J.type = bind_symbolic_name T, 0 [symbolic]
  171. // CHECK:STDOUT: %T.patt: %J.type = symbolic_binding_pattern T, 0 [symbolic]
  172. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  173. // CHECK:STDOUT: %T.as_wit.iface0: <witness> = facet_access_witness %T, element0 [symbolic]
  174. // CHECK:STDOUT: %J.facet.085e97.1: %J.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic]
  175. // CHECK:STDOUT: %impl.elem0.d9c3a6.1: type = impl_witness_access %T.as_wit.iface0, element0 [symbolic]
  176. // CHECK:STDOUT: %S: %impl.elem0.d9c3a6.1 = bind_symbolic_name S, 1 [symbolic]
  177. // CHECK:STDOUT: %S.patt: %impl.elem0.d9c3a6.1 = symbolic_binding_pattern S, 1 [symbolic]
  178. // CHECK:STDOUT: %Simple1.type: type = fn_type @Simple1 [concrete]
  179. // CHECK:STDOUT: %Simple1: %Simple1.type = struct_value () [concrete]
  180. // CHECK:STDOUT: %V: %J.type = bind_symbolic_name V, 0 [symbolic]
  181. // CHECK:STDOUT: %V.patt: %J.type = symbolic_binding_pattern V, 0 [symbolic]
  182. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic]
  183. // CHECK:STDOUT: %V.as_wit.iface0: <witness> = facet_access_witness %V, element0 [symbolic]
  184. // CHECK:STDOUT: %J.facet.085e97.2: %J.type = facet_value %V.as_type, (%V.as_wit.iface0) [symbolic]
  185. // CHECK:STDOUT: %impl.elem0.d9c3a6.2: type = impl_witness_access %V.as_wit.iface0, element0 [symbolic]
  186. // CHECK:STDOUT: %W: %impl.elem0.d9c3a6.2 = bind_symbolic_name W, 1 [symbolic]
  187. // CHECK:STDOUT: %W.patt: %impl.elem0.d9c3a6.2 = symbolic_binding_pattern W, 1 [symbolic]
  188. // CHECK:STDOUT: %Compound1.type: type = fn_type @Compound1 [concrete]
  189. // CHECK:STDOUT: %Compound1: %Compound1.type = struct_value () [concrete]
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT:
  192. // CHECK:STDOUT: imports {
  193. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  194. // CHECK:STDOUT: import Core//prelude
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT: }
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: file {
  199. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  200. // CHECK:STDOUT: .Core = imports.%Core
  201. // CHECK:STDOUT: .J = %J.decl
  202. // CHECK:STDOUT: .Simple1 = %Simple1.decl
  203. // CHECK:STDOUT: .Compound1 = %Compound1.decl
  204. // CHECK:STDOUT: }
  205. // CHECK:STDOUT: %Core.import = import Core
  206. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  207. // CHECK:STDOUT: %Simple1.decl: %Simple1.type = fn_decl @Simple1 [concrete = constants.%Simple1] {
  208. // CHECK:STDOUT: %T.patt.loc8_12.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_12.2 (constants.%T.patt)]
  209. // CHECK:STDOUT: %S.patt.loc8_19.1: @Simple1.%impl.elem0.loc8_24.2 (%impl.elem0.d9c3a6.1) = symbolic_binding_pattern S, 1 [symbolic = %S.patt.loc8_19.2 (constants.%S.patt)]
  210. // CHECK:STDOUT: } {
  211. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  212. // CHECK:STDOUT: %T.loc8_12.1: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T)]
  213. // CHECK:STDOUT: %.loc8_24.1: type = splice_block %impl.elem0.loc8_24.1 [symbolic = %impl.elem0.loc8_24.2 (constants.%impl.elem0.d9c3a6.1)] {
  214. // CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc8_12.1 [symbolic = %T.loc8_12.2 (constants.%T)]
  215. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  216. // CHECK:STDOUT: %T.as_type.loc8_24.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc8_24.2 (constants.%T.as_type)]
  217. // CHECK:STDOUT: %.loc8_24.2: type = converted %T.ref, %T.as_type.loc8_24.1 [symbolic = %T.as_type.loc8_24.2 (constants.%T.as_type)]
  218. // CHECK:STDOUT: %T.as_wit.iface0.loc8_24.1: <witness> = facet_access_witness %T.ref, element0 [symbolic = %T.as_wit.iface0.loc8_24.2 (constants.%T.as_wit.iface0)]
  219. // CHECK:STDOUT: %impl.elem0.loc8_24.1: type = impl_witness_access %T.as_wit.iface0.loc8_24.1, element0 [symbolic = %impl.elem0.loc8_24.2 (constants.%impl.elem0.d9c3a6.1)]
  220. // CHECK:STDOUT: }
  221. // CHECK:STDOUT: %S.loc8_19.1: @Simple1.%impl.elem0.loc8_24.2 (%impl.elem0.d9c3a6.1) = bind_symbolic_name S, 1 [symbolic = %S.loc8_19.2 (constants.%S)]
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT: %Compound1.decl: %Compound1.type = fn_decl @Compound1 [concrete = constants.%Compound1] {
  224. // CHECK:STDOUT: %V.patt.loc11_14.1: %J.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc11_14.2 (constants.%V.patt)]
  225. // CHECK:STDOUT: %W.patt.loc11_21.1: @Compound1.%impl.elem0.loc11_26.2 (%impl.elem0.d9c3a6.2) = symbolic_binding_pattern W, 1 [symbolic = %W.patt.loc11_21.2 (constants.%W.patt)]
  226. // CHECK:STDOUT: } {
  227. // CHECK:STDOUT: %J.ref.loc11_18: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  228. // CHECK:STDOUT: %V.loc11_14.1: %J.type = bind_symbolic_name V, 0 [symbolic = %V.loc11_14.2 (constants.%V)]
  229. // CHECK:STDOUT: %.loc11: type = splice_block %impl.elem0.loc11_26.1 [symbolic = %impl.elem0.loc11_26.2 (constants.%impl.elem0.d9c3a6.2)] {
  230. // CHECK:STDOUT: %V.ref: %J.type = name_ref V, %V.loc11_14.1 [symbolic = %V.loc11_14.2 (constants.%V)]
  231. // CHECK:STDOUT: %J.ref.loc11_28: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  232. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  233. // CHECK:STDOUT: %V.as_wit.iface0.loc11_26.1: <witness> = facet_access_witness %V.ref, element0 [symbolic = %V.as_wit.iface0.loc11_26.2 (constants.%V.as_wit.iface0)]
  234. // CHECK:STDOUT: %impl.elem0.loc11_26.1: type = impl_witness_access %V.as_wit.iface0.loc11_26.1, element0 [symbolic = %impl.elem0.loc11_26.2 (constants.%impl.elem0.d9c3a6.2)]
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT: %W.loc11_21.1: @Compound1.%impl.elem0.loc11_26.2 (%impl.elem0.d9c3a6.2) = bind_symbolic_name W, 1 [symbolic = %W.loc11_21.2 (constants.%W)]
  237. // CHECK:STDOUT: }
  238. // CHECK:STDOUT: }
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: interface @J {
  241. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  242. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  243. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0]
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: !members:
  247. // CHECK:STDOUT: .Self = %Self
  248. // CHECK:STDOUT: .U = @U.%assoc0
  249. // CHECK:STDOUT: witness = (%U)
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  253. // CHECK:STDOUT: assoc_const U:! type;
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: generic fn @Simple1(%T.loc8_12.1: %J.type, %S.loc8_19.1: @Simple1.%impl.elem0.loc8_24.2 (%impl.elem0.d9c3a6.1)) {
  257. // CHECK:STDOUT: %T.loc8_12.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T)]
  258. // CHECK:STDOUT: %T.patt.loc8_12.2: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_12.2 (constants.%T.patt)]
  259. // CHECK:STDOUT: %T.as_type.loc8_24.2: type = facet_access_type %T.loc8_12.2 [symbolic = %T.as_type.loc8_24.2 (constants.%T.as_type)]
  260. // CHECK:STDOUT: %T.as_wit.iface0.loc8_24.2: <witness> = facet_access_witness %T.loc8_12.2, element0 [symbolic = %T.as_wit.iface0.loc8_24.2 (constants.%T.as_wit.iface0)]
  261. // CHECK:STDOUT: %impl.elem0.loc8_24.2: type = impl_witness_access %T.as_wit.iface0.loc8_24.2, element0 [symbolic = %impl.elem0.loc8_24.2 (constants.%impl.elem0.d9c3a6.1)]
  262. // CHECK:STDOUT: %S.loc8_19.2: @Simple1.%impl.elem0.loc8_24.2 (%impl.elem0.d9c3a6.1) = bind_symbolic_name S, 1 [symbolic = %S.loc8_19.2 (constants.%S)]
  263. // CHECK:STDOUT: %S.patt.loc8_19.2: @Simple1.%impl.elem0.loc8_24.2 (%impl.elem0.d9c3a6.1) = symbolic_binding_pattern S, 1 [symbolic = %S.patt.loc8_19.2 (constants.%S.patt)]
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: !definition:
  266. // CHECK:STDOUT:
  267. // CHECK:STDOUT: fn(%T.patt.loc8_12.1: %J.type, %S.patt.loc8_19.1: @Simple1.%impl.elem0.loc8_24.2 (%impl.elem0.d9c3a6.1)) {
  268. // CHECK:STDOUT: !entry:
  269. // CHECK:STDOUT: return
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT:
  273. // CHECK:STDOUT: generic fn @Compound1(%V.loc11_14.1: %J.type, %W.loc11_21.1: @Compound1.%impl.elem0.loc11_26.2 (%impl.elem0.d9c3a6.2)) {
  274. // CHECK:STDOUT: %V.loc11_14.2: %J.type = bind_symbolic_name V, 0 [symbolic = %V.loc11_14.2 (constants.%V)]
  275. // CHECK:STDOUT: %V.patt.loc11_14.2: %J.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc11_14.2 (constants.%V.patt)]
  276. // CHECK:STDOUT: %V.as_wit.iface0.loc11_26.2: <witness> = facet_access_witness %V.loc11_14.2, element0 [symbolic = %V.as_wit.iface0.loc11_26.2 (constants.%V.as_wit.iface0)]
  277. // CHECK:STDOUT: %impl.elem0.loc11_26.2: type = impl_witness_access %V.as_wit.iface0.loc11_26.2, element0 [symbolic = %impl.elem0.loc11_26.2 (constants.%impl.elem0.d9c3a6.2)]
  278. // CHECK:STDOUT: %W.loc11_21.2: @Compound1.%impl.elem0.loc11_26.2 (%impl.elem0.d9c3a6.2) = bind_symbolic_name W, 1 [symbolic = %W.loc11_21.2 (constants.%W)]
  279. // CHECK:STDOUT: %W.patt.loc11_21.2: @Compound1.%impl.elem0.loc11_26.2 (%impl.elem0.d9c3a6.2) = symbolic_binding_pattern W, 1 [symbolic = %W.patt.loc11_21.2 (constants.%W.patt)]
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: !definition:
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: fn(%V.patt.loc11_14.1: %J.type, %W.patt.loc11_21.1: @Compound1.%impl.elem0.loc11_26.2 (%impl.elem0.d9c3a6.2)) {
  284. // CHECK:STDOUT: !entry:
  285. // CHECK:STDOUT: return
  286. // CHECK:STDOUT: }
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: specific @U(constants.%Self) {}
  290. // CHECK:STDOUT:
  291. // CHECK:STDOUT: specific @U(constants.%J.facet.085e97.1) {}
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: specific @Simple1(constants.%T, constants.%S) {
  294. // CHECK:STDOUT: %T.loc8_12.2 => constants.%T
  295. // CHECK:STDOUT: %T.patt.loc8_12.2 => constants.%T.patt
  296. // CHECK:STDOUT: %T.as_type.loc8_24.2 => constants.%T.as_type
  297. // CHECK:STDOUT: %T.as_wit.iface0.loc8_24.2 => constants.%T.as_wit.iface0
  298. // CHECK:STDOUT: %impl.elem0.loc8_24.2 => constants.%impl.elem0.d9c3a6.1
  299. // CHECK:STDOUT: %S.loc8_19.2 => constants.%S
  300. // CHECK:STDOUT: %S.patt.loc8_19.2 => constants.%S.patt
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: specific @U(constants.%J.facet.085e97.2) {}
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: specific @Compound1(constants.%V, constants.%W) {
  306. // CHECK:STDOUT: %V.loc11_14.2 => constants.%V
  307. // CHECK:STDOUT: %V.patt.loc11_14.2 => constants.%V.patt
  308. // CHECK:STDOUT: %V.as_wit.iface0.loc11_26.2 => constants.%V.as_wit.iface0
  309. // CHECK:STDOUT: %impl.elem0.loc11_26.2 => constants.%impl.elem0.d9c3a6.2
  310. // CHECK:STDOUT: %W.loc11_21.2 => constants.%W
  311. // CHECK:STDOUT: %W.patt.loc11_21.2 => constants.%W.patt
  312. // CHECK:STDOUT: }
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: --- non_instance.carbon
  315. // CHECK:STDOUT:
  316. // CHECK:STDOUT: constants {
  317. // CHECK:STDOUT: %K1.type: type = facet_type <@K1> [concrete]
  318. // CHECK:STDOUT: %Self: %K1.type = bind_symbolic_name Self, 0 [symbolic]
  319. // CHECK:STDOUT: %Q1.type: type = fn_type @Q1 [concrete]
  320. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  321. // CHECK:STDOUT: %Q1: %Q1.type = struct_value () [concrete]
  322. // CHECK:STDOUT: %K1.assoc_type: type = assoc_entity_type @K1 [concrete]
  323. // CHECK:STDOUT: %assoc0: %K1.assoc_type = assoc_entity element0, @K1.%Q1.decl [concrete]
  324. // CHECK:STDOUT: %T: %K1.type = bind_symbolic_name T, 0 [symbolic]
  325. // CHECK:STDOUT: %T.patt: %K1.type = symbolic_binding_pattern T, 0 [symbolic]
  326. // CHECK:STDOUT: %Simple2.type: type = fn_type @Simple2 [concrete]
  327. // CHECK:STDOUT: %Simple2: %Simple2.type = struct_value () [concrete]
  328. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  329. // CHECK:STDOUT: %T.as_wit.iface0: <witness> = facet_access_witness %T, element0 [symbolic]
  330. // CHECK:STDOUT: %K1.facet.07e9b4.1: %K1.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic]
  331. // CHECK:STDOUT: %.d66c00.1: type = fn_type_with_self_type %Q1.type, %K1.facet.07e9b4.1 [symbolic]
  332. // CHECK:STDOUT: %impl.elem0.d9a98e.1: %.d66c00.1 = impl_witness_access %T.as_wit.iface0, element0 [symbolic]
  333. // CHECK:STDOUT: %specific_impl_fn.26c74d.1: <specific function> = specific_impl_function %impl.elem0.d9a98e.1, @Q1(%K1.facet.07e9b4.1) [symbolic]
  334. // CHECK:STDOUT: %V: %K1.type = bind_symbolic_name V, 0 [symbolic]
  335. // CHECK:STDOUT: %V.patt: %K1.type = symbolic_binding_pattern V, 0 [symbolic]
  336. // CHECK:STDOUT: %Compound2.type: type = fn_type @Compound2 [concrete]
  337. // CHECK:STDOUT: %Compound2: %Compound2.type = struct_value () [concrete]
  338. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic]
  339. // CHECK:STDOUT: %V.as_wit.iface0: <witness> = facet_access_witness %V, element0 [symbolic]
  340. // CHECK:STDOUT: %K1.facet.07e9b4.2: %K1.type = facet_value %V.as_type, (%V.as_wit.iface0) [symbolic]
  341. // CHECK:STDOUT: %.d66c00.2: type = fn_type_with_self_type %Q1.type, %K1.facet.07e9b4.2 [symbolic]
  342. // CHECK:STDOUT: %impl.elem0.d9a98e.2: %.d66c00.2 = impl_witness_access %V.as_wit.iface0, element0 [symbolic]
  343. // CHECK:STDOUT: %specific_impl_fn.26c74d.2: <specific function> = specific_impl_function %impl.elem0.d9a98e.2, @Q1(%K1.facet.07e9b4.2) [symbolic]
  344. // CHECK:STDOUT: }
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: imports {
  347. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  348. // CHECK:STDOUT: import Core//prelude
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT: }
  351. // CHECK:STDOUT:
  352. // CHECK:STDOUT: file {
  353. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  354. // CHECK:STDOUT: .Core = imports.%Core
  355. // CHECK:STDOUT: .K1 = %K1.decl
  356. // CHECK:STDOUT: .Simple2 = %Simple2.decl
  357. // CHECK:STDOUT: .Compound2 = %Compound2.decl
  358. // CHECK:STDOUT: }
  359. // CHECK:STDOUT: %Core.import = import Core
  360. // CHECK:STDOUT: %K1.decl: type = interface_decl @K1 [concrete = constants.%K1.type] {} {}
  361. // CHECK:STDOUT: %Simple2.decl: %Simple2.type = fn_decl @Simple2 [concrete = constants.%Simple2] {
  362. // CHECK:STDOUT: %T.patt.loc8_12.1: %K1.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_12.2 (constants.%T.patt)]
  363. // CHECK:STDOUT: } {
  364. // CHECK:STDOUT: %K1.ref: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type]
  365. // CHECK:STDOUT: %T.loc8_12.1: %K1.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T)]
  366. // CHECK:STDOUT: }
  367. // CHECK:STDOUT: %Compound2.decl: %Compound2.type = fn_decl @Compound2 [concrete = constants.%Compound2] {
  368. // CHECK:STDOUT: %V.patt.loc13_14.1: %K1.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc13_14.2 (constants.%V.patt)]
  369. // CHECK:STDOUT: } {
  370. // CHECK:STDOUT: %K1.ref.loc13: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type]
  371. // CHECK:STDOUT: %V.loc13_14.1: %K1.type = bind_symbolic_name V, 0 [symbolic = %V.loc13_14.2 (constants.%V)]
  372. // CHECK:STDOUT: }
  373. // CHECK:STDOUT: }
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: interface @K1 {
  376. // CHECK:STDOUT: %Self: %K1.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  377. // CHECK:STDOUT: %Q1.decl: %Q1.type = fn_decl @Q1 [concrete = constants.%Q1] {} {}
  378. // CHECK:STDOUT: %assoc0: %K1.assoc_type = assoc_entity element0, %Q1.decl [concrete = constants.%assoc0]
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: !members:
  381. // CHECK:STDOUT: .Self = %Self
  382. // CHECK:STDOUT: .Q1 = %assoc0
  383. // CHECK:STDOUT: witness = (%Q1.decl)
  384. // CHECK:STDOUT: }
  385. // CHECK:STDOUT:
  386. // CHECK:STDOUT: generic fn @Q1(@K1.%Self: %K1.type) {
  387. // CHECK:STDOUT: fn();
  388. // CHECK:STDOUT: }
  389. // CHECK:STDOUT:
  390. // CHECK:STDOUT: generic fn @Simple2(%T.loc8_12.1: %K1.type) {
  391. // CHECK:STDOUT: %T.loc8_12.2: %K1.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T)]
  392. // CHECK:STDOUT: %T.patt.loc8_12.2: %K1.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_12.2 (constants.%T.patt)]
  393. // CHECK:STDOUT:
  394. // CHECK:STDOUT: !definition:
  395. // CHECK:STDOUT: %T.as_type.loc9_4.2: type = facet_access_type %T.loc8_12.2 [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)]
  396. // CHECK:STDOUT: %T.as_wit.iface0.loc9_4.2: <witness> = facet_access_witness %T.loc8_12.2, element0 [symbolic = %T.as_wit.iface0.loc9_4.2 (constants.%T.as_wit.iface0)]
  397. // CHECK:STDOUT: %K1.facet: %K1.type = facet_value %T.as_type.loc9_4.2, (%T.as_wit.iface0.loc9_4.2) [symbolic = %K1.facet (constants.%K1.facet.07e9b4.1)]
  398. // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%Q1.type, %K1.facet [symbolic = %.loc9_4.2 (constants.%.d66c00.1)]
  399. // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Simple2.%.loc9_4.2 (%.d66c00.1) = impl_witness_access %T.as_wit.iface0.loc9_4.2, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0.d9a98e.1)]
  400. // CHECK:STDOUT: %specific_impl_fn.loc9_4.2: <specific function> = specific_impl_function %impl.elem0.loc9_4.2, @Q1(%K1.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn.26c74d.1)]
  401. // CHECK:STDOUT:
  402. // CHECK:STDOUT: fn(%T.patt.loc8_12.1: %K1.type) {
  403. // CHECK:STDOUT: !entry:
  404. // CHECK:STDOUT: %T.ref: %K1.type = name_ref T, %T.loc8_12.1 [symbolic = %T.loc8_12.2 (constants.%T)]
  405. // CHECK:STDOUT: %Q1.ref: %K1.assoc_type = name_ref Q1, @K1.%assoc0 [concrete = constants.%assoc0]
  406. // CHECK:STDOUT: %T.as_type.loc9_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)]
  407. // CHECK:STDOUT: %.loc9_4.1: type = converted %T.ref, %T.as_type.loc9_4.1 [symbolic = %T.as_type.loc9_4.2 (constants.%T.as_type)]
  408. // CHECK:STDOUT: %T.as_wit.iface0.loc9_4.1: <witness> = facet_access_witness %T.ref, element0 [symbolic = %T.as_wit.iface0.loc9_4.2 (constants.%T.as_wit.iface0)]
  409. // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Simple2.%.loc9_4.2 (%.d66c00.1) = impl_witness_access %T.as_wit.iface0.loc9_4.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0.d9a98e.1)]
  410. // CHECK:STDOUT: %specific_impl_fn.loc9_4.1: <specific function> = specific_impl_function %impl.elem0.loc9_4.1, @Q1(constants.%K1.facet.07e9b4.1) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn.26c74d.1)]
  411. // CHECK:STDOUT: %.loc9_8: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1()
  412. // CHECK:STDOUT: return
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT:
  416. // CHECK:STDOUT: generic fn @Compound2(%V.loc13_14.1: %K1.type) {
  417. // CHECK:STDOUT: %V.loc13_14.2: %K1.type = bind_symbolic_name V, 0 [symbolic = %V.loc13_14.2 (constants.%V)]
  418. // CHECK:STDOUT: %V.patt.loc13_14.2: %K1.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc13_14.2 (constants.%V.patt)]
  419. // CHECK:STDOUT:
  420. // CHECK:STDOUT: !definition:
  421. // CHECK:STDOUT: %V.as_wit.iface0.loc14_4.2: <witness> = facet_access_witness %V.loc13_14.2, element0 [symbolic = %V.as_wit.iface0.loc14_4.2 (constants.%V.as_wit.iface0)]
  422. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V.loc13_14.2 [symbolic = %V.as_type (constants.%V.as_type)]
  423. // CHECK:STDOUT: %K1.facet: %K1.type = facet_value %V.as_type, (%V.as_wit.iface0.loc14_4.2) [symbolic = %K1.facet (constants.%K1.facet.07e9b4.2)]
  424. // CHECK:STDOUT: %.loc14_4: type = fn_type_with_self_type constants.%Q1.type, %K1.facet [symbolic = %.loc14_4 (constants.%.d66c00.2)]
  425. // CHECK:STDOUT: %impl.elem0.loc14_4.2: @Compound2.%.loc14_4 (%.d66c00.2) = impl_witness_access %V.as_wit.iface0.loc14_4.2, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.d9a98e.2)]
  426. // CHECK:STDOUT: %specific_impl_fn.loc14_4.2: <specific function> = specific_impl_function %impl.elem0.loc14_4.2, @Q1(%K1.facet) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.26c74d.2)]
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: fn(%V.patt.loc13_14.1: %K1.type) {
  429. // CHECK:STDOUT: !entry:
  430. // CHECK:STDOUT: %V.ref: %K1.type = name_ref V, %V.loc13_14.1 [symbolic = %V.loc13_14.2 (constants.%V)]
  431. // CHECK:STDOUT: %K1.ref.loc14: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type]
  432. // CHECK:STDOUT: %Q1.ref: %K1.assoc_type = name_ref Q1, @K1.%assoc0 [concrete = constants.%assoc0]
  433. // CHECK:STDOUT: %V.as_wit.iface0.loc14_4.1: <witness> = facet_access_witness %V.ref, element0 [symbolic = %V.as_wit.iface0.loc14_4.2 (constants.%V.as_wit.iface0)]
  434. // CHECK:STDOUT: %impl.elem0.loc14_4.1: @Compound2.%.loc14_4 (%.d66c00.2) = impl_witness_access %V.as_wit.iface0.loc14_4.1, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.d9a98e.2)]
  435. // CHECK:STDOUT: %specific_impl_fn.loc14_4.1: <specific function> = specific_impl_function %impl.elem0.loc14_4.1, @Q1(constants.%K1.facet.07e9b4.2) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.26c74d.2)]
  436. // CHECK:STDOUT: %.loc14_13: init %empty_tuple.type = call %specific_impl_fn.loc14_4.1()
  437. // CHECK:STDOUT: return
  438. // CHECK:STDOUT: }
  439. // CHECK:STDOUT: }
  440. // CHECK:STDOUT:
  441. // CHECK:STDOUT: specific @Q1(constants.%Self) {}
  442. // CHECK:STDOUT:
  443. // CHECK:STDOUT: specific @Simple2(constants.%T) {
  444. // CHECK:STDOUT: %T.loc8_12.2 => constants.%T
  445. // CHECK:STDOUT: %T.patt.loc8_12.2 => constants.%T.patt
  446. // CHECK:STDOUT: }
  447. // CHECK:STDOUT:
  448. // CHECK:STDOUT: specific @Q1(constants.%K1.facet.07e9b4.1) {}
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: specific @Q1(@Simple2.%K1.facet) {}
  451. // CHECK:STDOUT:
  452. // CHECK:STDOUT: specific @Compound2(constants.%V) {
  453. // CHECK:STDOUT: %V.loc13_14.2 => constants.%V
  454. // CHECK:STDOUT: %V.patt.loc13_14.2 => constants.%V.patt
  455. // CHECK:STDOUT: }
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: specific @Q1(constants.%K1.facet.07e9b4.2) {}
  458. // CHECK:STDOUT:
  459. // CHECK:STDOUT: specific @Q1(@Compound2.%K1.facet) {}
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: --- fail_caller_instance_interface_not.carbon
  462. // CHECK:STDOUT:
  463. // CHECK:STDOUT: constants {
  464. // CHECK:STDOUT: %K2.type: type = facet_type <@K2> [concrete]
  465. // CHECK:STDOUT: %Self.0ce: %K2.type = bind_symbolic_name Self, 0 [symbolic]
  466. // CHECK:STDOUT: %Q2.type: type = fn_type @Q2 [concrete]
  467. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  468. // CHECK:STDOUT: %Q2: %Q2.type = struct_value () [concrete]
  469. // CHECK:STDOUT: %K2.assoc_type: type = assoc_entity_type @K2 [concrete]
  470. // CHECK:STDOUT: %assoc0.d67: %K2.assoc_type = assoc_entity element0, @K2.%Q2.decl [concrete]
  471. // CHECK:STDOUT: %T.0ce: %K2.type = bind_symbolic_name T, 0 [symbolic]
  472. // CHECK:STDOUT: %T.patt.6d1: %K2.type = symbolic_binding_pattern T, 0 [symbolic]
  473. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.0ce [symbolic]
  474. // CHECK:STDOUT: %Simple3.type: type = fn_type @Simple3 [concrete]
  475. // CHECK:STDOUT: %Simple3: %Simple3.type = struct_value () [concrete]
  476. // CHECK:STDOUT: %require_complete.022e81.1: <witness> = require_complete_type %T.as_type [symbolic]
  477. // CHECK:STDOUT: %T.as_wit.iface0: <witness> = facet_access_witness %T.0ce, element0 [symbolic]
  478. // CHECK:STDOUT: %K2.facet: %K2.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic]
  479. // CHECK:STDOUT: %.75b: type = fn_type_with_self_type %Q2.type, %K2.facet [symbolic]
  480. // CHECK:STDOUT: %impl.elem0: %.75b = impl_witness_access %T.as_wit.iface0, element0 [symbolic]
  481. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @Q2(%K2.facet) [symbolic]
  482. // CHECK:STDOUT: %V: %K2.type = bind_symbolic_name V, 0 [symbolic]
  483. // CHECK:STDOUT: %V.patt: %K2.type = symbolic_binding_pattern V, 0 [symbolic]
  484. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic]
  485. // CHECK:STDOUT: %Compound3.type: type = fn_type @Compound3 [concrete]
  486. // CHECK:STDOUT: %Compound3: %Compound3.type = struct_value () [concrete]
  487. // CHECK:STDOUT: %require_complete.022e81.2: <witness> = require_complete_type %V.as_type [symbolic]
  488. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  489. // CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  490. // CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic]
  491. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  492. // CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
  493. // CHECK:STDOUT: %Convert.42e: %Convert.type.275 = struct_value () [symbolic]
  494. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.519 [symbolic]
  495. // CHECK:STDOUT: %ImplicitAs.assoc_type.ca0: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  496. // CHECK:STDOUT: %assoc0.9f5: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic]
  497. // CHECK:STDOUT: %ImplicitAs.type.014: type = facet_type <@ImplicitAs, @ImplicitAs(%K2.type)> [concrete]
  498. // CHECK:STDOUT: %Self.5a9: %ImplicitAs.type.014 = bind_symbolic_name Self, 1 [symbolic]
  499. // CHECK:STDOUT: %Convert.type.a72: type = fn_type @Convert, @ImplicitAs(%K2.type) [concrete]
  500. // CHECK:STDOUT: %Convert.2ea: %Convert.type.a72 = struct_value () [concrete]
  501. // CHECK:STDOUT: %ImplicitAs.assoc_type.79b: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%K2.type) [concrete]
  502. // CHECK:STDOUT: %assoc0.b18: %ImplicitAs.assoc_type.79b = assoc_entity element0, imports.%Core.import_ref.1c7 [concrete]
  503. // CHECK:STDOUT: %assoc0.dc0: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.207 [symbolic]
  504. // CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
  505. // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
  506. // CHECK:STDOUT: %T.patt.e01: type = symbolic_binding_pattern T, 0 [symbolic]
  507. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Core.import_ref.bd4), @impl(%T.8b3) [symbolic]
  508. // CHECK:STDOUT: %Op.type: type = fn_type @Op, @impl(%T.8b3) [symbolic]
  509. // CHECK:STDOUT: %Op: %Op.type = struct_value () [symbolic]
  510. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T.8b3 [symbolic]
  511. // CHECK:STDOUT: }
  512. // CHECK:STDOUT:
  513. // CHECK:STDOUT: imports {
  514. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  515. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  516. // CHECK:STDOUT: import Core//prelude
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
  519. // CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//prelude, inst66 [no loc], unloaded
  520. // CHECK:STDOUT: %Core.import_ref.492: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.dc0)]
  521. // CHECK:STDOUT: %Core.Convert = import_ref Core//prelude, Convert, unloaded
  522. // CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
  523. // CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//prelude, inst66 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)]
  524. // CHECK:STDOUT: %Core.import_ref.1c7: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)]
  525. // CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst101 [no loc], unloaded
  526. // CHECK:STDOUT: %Core.import_ref.02e = import_ref Core//prelude, loc18_41, unloaded
  527. // CHECK:STDOUT: %Core.Op = import_ref Core//prelude, Op, unloaded
  528. // CHECK:STDOUT: %Core.import_ref.f80 = import_ref Core//prelude, loc21_36, unloaded
  529. // CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T.8b3)]
  530. // CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.%T (constants.%T.8b3)]
  531. // CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type]
  532. // CHECK:STDOUT: %Core.import_ref.bd4 = import_ref Core//prelude, loc22_42, unloaded
  533. // CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T.8b3)]
  534. // CHECK:STDOUT: }
  535. // CHECK:STDOUT:
  536. // CHECK:STDOUT: file {
  537. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  538. // CHECK:STDOUT: .Core = imports.%Core
  539. // CHECK:STDOUT: .K2 = %K2.decl
  540. // CHECK:STDOUT: .Simple3 = %Simple3.decl
  541. // CHECK:STDOUT: .Compound3 = %Compound3.decl
  542. // CHECK:STDOUT: }
  543. // CHECK:STDOUT: %Core.import = import Core
  544. // CHECK:STDOUT: %K2.decl: type = interface_decl @K2 [concrete = constants.%K2.type] {} {}
  545. // CHECK:STDOUT: %Simple3.decl: %Simple3.type = fn_decl @Simple3 [concrete = constants.%Simple3] {
  546. // CHECK:STDOUT: %T.patt.loc8_12.1: %K2.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_12.2 (constants.%T.patt.6d1)]
  547. // CHECK:STDOUT: %x.patt: @Simple3.%T.as_type.loc8_23.2 (%T.as_type) = binding_pattern x
  548. // CHECK:STDOUT: %x.param_patt: @Simple3.%T.as_type.loc8_23.2 (%T.as_type) = value_param_pattern %x.patt, call_param0
  549. // CHECK:STDOUT: } {
  550. // CHECK:STDOUT: %K2.ref: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type]
  551. // CHECK:STDOUT: %T.loc8_12.1: %K2.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T.0ce)]
  552. // CHECK:STDOUT: %x.param: @Simple3.%T.as_type.loc8_23.2 (%T.as_type) = value_param call_param0
  553. // CHECK:STDOUT: %.loc8_23.1: type = splice_block %.loc8_23.2 [symbolic = %T.as_type.loc8_23.2 (constants.%T.as_type)] {
  554. // CHECK:STDOUT: %T.ref: %K2.type = name_ref T, %T.loc8_12.1 [symbolic = %T.loc8_12.2 (constants.%T.0ce)]
  555. // CHECK:STDOUT: %T.as_type.loc8_23.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc8_23.2 (constants.%T.as_type)]
  556. // CHECK:STDOUT: %.loc8_23.2: type = converted %T.ref, %T.as_type.loc8_23.1 [symbolic = %T.as_type.loc8_23.2 (constants.%T.as_type)]
  557. // CHECK:STDOUT: }
  558. // CHECK:STDOUT: %x: @Simple3.%T.as_type.loc8_23.2 (%T.as_type) = bind_name x, %x.param
  559. // CHECK:STDOUT: }
  560. // CHECK:STDOUT: %Compound3.decl: %Compound3.type = fn_decl @Compound3 [concrete = constants.%Compound3] {
  561. // CHECK:STDOUT: %V.patt.loc14_14.1: %K2.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc14_14.2 (constants.%V.patt)]
  562. // CHECK:STDOUT: %y.patt: @Compound3.%V.as_type.loc14_25.2 (%V.as_type) = binding_pattern y
  563. // CHECK:STDOUT: %y.param_patt: @Compound3.%V.as_type.loc14_25.2 (%V.as_type) = value_param_pattern %y.patt, call_param0
  564. // CHECK:STDOUT: } {
  565. // CHECK:STDOUT: %K2.ref.loc14: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type]
  566. // CHECK:STDOUT: %V.loc14_14.1: %K2.type = bind_symbolic_name V, 0 [symbolic = %V.loc14_14.2 (constants.%V)]
  567. // CHECK:STDOUT: %y.param: @Compound3.%V.as_type.loc14_25.2 (%V.as_type) = value_param call_param0
  568. // CHECK:STDOUT: %.loc14_25.1: type = splice_block %.loc14_25.2 [symbolic = %V.as_type.loc14_25.2 (constants.%V.as_type)] {
  569. // CHECK:STDOUT: %V.ref: %K2.type = name_ref V, %V.loc14_14.1 [symbolic = %V.loc14_14.2 (constants.%V)]
  570. // CHECK:STDOUT: %V.as_type.loc14_25.1: type = facet_access_type %V.ref [symbolic = %V.as_type.loc14_25.2 (constants.%V.as_type)]
  571. // CHECK:STDOUT: %.loc14_25.2: type = converted %V.ref, %V.as_type.loc14_25.1 [symbolic = %V.as_type.loc14_25.2 (constants.%V.as_type)]
  572. // CHECK:STDOUT: }
  573. // CHECK:STDOUT: %y: @Compound3.%V.as_type.loc14_25.2 (%V.as_type) = bind_name y, %y.param
  574. // CHECK:STDOUT: }
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: interface @K2 {
  578. // CHECK:STDOUT: %Self: %K2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.0ce]
  579. // CHECK:STDOUT: %Q2.decl: %Q2.type = fn_decl @Q2 [concrete = constants.%Q2] {} {}
  580. // CHECK:STDOUT: %assoc0: %K2.assoc_type = assoc_entity element0, %Q2.decl [concrete = constants.%assoc0.d67]
  581. // CHECK:STDOUT:
  582. // CHECK:STDOUT: !members:
  583. // CHECK:STDOUT: .Self = %Self
  584. // CHECK:STDOUT: .Q2 = %assoc0
  585. // CHECK:STDOUT: witness = (%Q2.decl)
  586. // CHECK:STDOUT: }
  587. // CHECK:STDOUT:
  588. // CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.1: type) [from "include_files/facet_types.carbon"] {
  589. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  590. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  591. // CHECK:STDOUT:
  592. // CHECK:STDOUT: !definition:
  593. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
  594. // CHECK:STDOUT: %Self: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
  595. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.275)]
  596. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = struct_value () [symbolic = %Convert (constants.%Convert.42e)]
  597. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.ca0)]
  598. // CHECK:STDOUT: %assoc0: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic = %assoc0 (constants.%assoc0.9f5)]
  599. // CHECK:STDOUT:
  600. // CHECK:STDOUT: interface {
  601. // CHECK:STDOUT: !members:
  602. // CHECK:STDOUT: .Self = imports.%Core.import_ref.ff5
  603. // CHECK:STDOUT: .Convert = imports.%Core.import_ref.492
  604. // CHECK:STDOUT: witness = (imports.%Core.Convert)
  605. // CHECK:STDOUT: }
  606. // CHECK:STDOUT: }
  607. // CHECK:STDOUT:
  608. // CHECK:STDOUT: interface @BitAnd [from "include_files/facet_types.carbon"] {
  609. // CHECK:STDOUT: !members:
  610. // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0
  611. // CHECK:STDOUT: .Op = imports.%Core.import_ref.02e
  612. // CHECK:STDOUT: witness = (imports.%Core.Op)
  613. // CHECK:STDOUT: }
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: generic impl @impl(imports.%Core.import_ref.5ab3ec.3: type) [from "include_files/facet_types.carbon"] {
  616. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
  617. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.e01)]
  618. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Core.import_ref.bd4), @impl(%T) [symbolic = %impl_witness (constants.%impl_witness)]
  619. // CHECK:STDOUT:
  620. // CHECK:STDOUT: !definition:
  621. // CHECK:STDOUT: %Op.type: type = fn_type @Op, @impl(%T) [symbolic = %Op.type (constants.%Op.type)]
  622. // CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type) = struct_value () [symbolic = %Op (constants.%Op)]
  623. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.%T (%T.8b3) [symbolic = %require_complete (constants.%require_complete.4ae)]
  624. // CHECK:STDOUT:
  625. // CHECK:STDOUT: impl: imports.%Core.import_ref.583 as imports.%Core.import_ref.9c1 {
  626. // CHECK:STDOUT: !members:
  627. // CHECK:STDOUT: witness = imports.%Core.import_ref.f80
  628. // CHECK:STDOUT: }
  629. // CHECK:STDOUT: }
  630. // CHECK:STDOUT:
  631. // CHECK:STDOUT: generic fn @Q2(@K2.%Self: %K2.type) {
  632. // CHECK:STDOUT: fn();
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: generic fn @Simple3(%T.loc8_12.1: %K2.type) {
  636. // CHECK:STDOUT: %T.loc8_12.2: %K2.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T.0ce)]
  637. // CHECK:STDOUT: %T.patt.loc8_12.2: %K2.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_12.2 (constants.%T.patt.6d1)]
  638. // CHECK:STDOUT: %T.as_type.loc8_23.2: type = facet_access_type %T.loc8_12.2 [symbolic = %T.as_type.loc8_23.2 (constants.%T.as_type)]
  639. // CHECK:STDOUT:
  640. // CHECK:STDOUT: !definition:
  641. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Simple3.%T.as_type.loc8_23.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.022e81.1)]
  642. // CHECK:STDOUT: %T.as_wit.iface0.loc9_4.2: <witness> = facet_access_witness %T.loc8_12.2, element0 [symbolic = %T.as_wit.iface0.loc9_4.2 (constants.%T.as_wit.iface0)]
  643. // CHECK:STDOUT: %K2.facet: %K2.type = facet_value %T.as_type.loc8_23.2, (%T.as_wit.iface0.loc9_4.2) [symbolic = %K2.facet (constants.%K2.facet)]
  644. // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%Q2.type, %K2.facet [symbolic = %.loc9_4.2 (constants.%.75b)]
  645. // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Simple3.%.loc9_4.2 (%.75b) = impl_witness_access %T.as_wit.iface0.loc9_4.2, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)]
  646. // CHECK:STDOUT: %specific_impl_fn.loc9_4.2: <specific function> = specific_impl_function %impl.elem0.loc9_4.2, @Q2(%K2.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)]
  647. // CHECK:STDOUT:
  648. // CHECK:STDOUT: fn(%T.patt.loc8_12.1: %K2.type, %x.param_patt: @Simple3.%T.as_type.loc8_23.2 (%T.as_type)) {
  649. // CHECK:STDOUT: !entry:
  650. // CHECK:STDOUT: %x.ref: @Simple3.%T.as_type.loc8_23.2 (%T.as_type) = name_ref x, %x
  651. // CHECK:STDOUT: %Q2.ref: %K2.assoc_type = name_ref Q2, @K2.%assoc0 [concrete = constants.%assoc0.d67]
  652. // CHECK:STDOUT: %T.as_type.loc9: type = facet_access_type constants.%T.0ce [symbolic = %T.as_type.loc8_23.2 (constants.%T.as_type)]
  653. // CHECK:STDOUT: %.loc9_4.1: type = converted constants.%T.0ce, %T.as_type.loc9 [symbolic = %T.as_type.loc8_23.2 (constants.%T.as_type)]
  654. // CHECK:STDOUT: %T.as_wit.iface0.loc9_4.1: <witness> = facet_access_witness constants.%T.0ce, element0 [symbolic = %T.as_wit.iface0.loc9_4.2 (constants.%T.as_wit.iface0)]
  655. // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Simple3.%.loc9_4.2 (%.75b) = impl_witness_access %T.as_wit.iface0.loc9_4.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)]
  656. // CHECK:STDOUT: %specific_impl_fn.loc9_4.1: <specific function> = specific_impl_function %impl.elem0.loc9_4.1, @Q2(constants.%K2.facet) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn)]
  657. // CHECK:STDOUT: %.loc9_8: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1()
  658. // CHECK:STDOUT: return
  659. // CHECK:STDOUT: }
  660. // CHECK:STDOUT: }
  661. // CHECK:STDOUT:
  662. // CHECK:STDOUT: generic fn @Compound3(%V.loc14_14.1: %K2.type) {
  663. // CHECK:STDOUT: %V.loc14_14.2: %K2.type = bind_symbolic_name V, 0 [symbolic = %V.loc14_14.2 (constants.%V)]
  664. // CHECK:STDOUT: %V.patt.loc14_14.2: %K2.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc14_14.2 (constants.%V.patt)]
  665. // CHECK:STDOUT: %V.as_type.loc14_25.2: type = facet_access_type %V.loc14_14.2 [symbolic = %V.as_type.loc14_25.2 (constants.%V.as_type)]
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: !definition:
  668. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Compound3.%V.as_type.loc14_25.2 (%V.as_type) [symbolic = %require_complete (constants.%require_complete.022e81.2)]
  669. // CHECK:STDOUT:
  670. // CHECK:STDOUT: fn(%V.patt.loc14_14.1: %K2.type, %y.param_patt: @Compound3.%V.as_type.loc14_25.2 (%V.as_type)) {
  671. // CHECK:STDOUT: !entry:
  672. // CHECK:STDOUT: %y.ref: @Compound3.%V.as_type.loc14_25.2 (%V.as_type) = name_ref y, %y
  673. // CHECK:STDOUT: %K2.ref.loc22: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type]
  674. // CHECK:STDOUT: %Q2.ref: %K2.assoc_type = name_ref Q2, @K2.%assoc0 [concrete = constants.%assoc0.d67]
  675. // CHECK:STDOUT: %.loc22: %K2.type = converted %y.ref, <error> [concrete = <error>]
  676. // CHECK:STDOUT: return
  677. // CHECK:STDOUT: }
  678. // CHECK:STDOUT: }
  679. // CHECK:STDOUT:
  680. // CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "include_files/facet_types.carbon"] {
  681. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  682. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
  683. // CHECK:STDOUT: %Self: @Convert.%ImplicitAs.type (%ImplicitAs.type.d62) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
  684. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  685. // CHECK:STDOUT:
  686. // CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type (%Self.as_type)]() -> @Convert.%Dest (%Dest);
  687. // CHECK:STDOUT: }
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: generic fn @Op(imports.%Core.import_ref.5ab3ec.4: type) [from "include_files/facet_types.carbon"] {
  690. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
  691. // CHECK:STDOUT:
  692. // CHECK:STDOUT: !definition:
  693. // CHECK:STDOUT:
  694. // CHECK:STDOUT: fn[%self.param_patt: @Op.%T (%T.8b3)](%other.param_patt: @Op.%T (%T.8b3)) -> @Op.%T (%T.8b3) = "type.and";
  695. // CHECK:STDOUT: }
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: specific @Q2(constants.%Self.0ce) {}
  698. // CHECK:STDOUT:
  699. // CHECK:STDOUT: specific @Simple3(constants.%T.0ce) {
  700. // CHECK:STDOUT: %T.loc8_12.2 => constants.%T.0ce
  701. // CHECK:STDOUT: %T.patt.loc8_12.2 => constants.%T.patt.6d1
  702. // CHECK:STDOUT: %T.as_type.loc8_23.2 => constants.%T.as_type
  703. // CHECK:STDOUT: }
  704. // CHECK:STDOUT:
  705. // CHECK:STDOUT: specific @Q2(constants.%K2.facet) {}
  706. // CHECK:STDOUT:
  707. // CHECK:STDOUT: specific @Q2(@Simple3.%K2.facet) {}
  708. // CHECK:STDOUT:
  709. // CHECK:STDOUT: specific @Compound3(constants.%V) {
  710. // CHECK:STDOUT: %V.loc14_14.2 => constants.%V
  711. // CHECK:STDOUT: %V.patt.loc14_14.2 => constants.%V.patt
  712. // CHECK:STDOUT: %V.as_type.loc14_25.2 => constants.%V.as_type
  713. // CHECK:STDOUT: }
  714. // CHECK:STDOUT:
  715. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  716. // CHECK:STDOUT: %Dest => constants.%Dest
  717. // CHECK:STDOUT: %Dest.patt => constants.%Dest.patt
  718. // CHECK:STDOUT: }
  719. // CHECK:STDOUT:
  720. // CHECK:STDOUT: specific @ImplicitAs(%Dest) {}
  721. // CHECK:STDOUT:
  722. // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {}
  723. // CHECK:STDOUT:
  724. // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.519) {
  725. // CHECK:STDOUT: %Dest => constants.%Dest
  726. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d62
  727. // CHECK:STDOUT: %Self => constants.%Self.519
  728. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  729. // CHECK:STDOUT: }
  730. // CHECK:STDOUT:
  731. // CHECK:STDOUT: specific @ImplicitAs(constants.%K2.type) {
  732. // CHECK:STDOUT: %Dest => constants.%K2.type
  733. // CHECK:STDOUT: %Dest.patt => constants.%Dest.patt
  734. // CHECK:STDOUT:
  735. // CHECK:STDOUT: !definition:
  736. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.014
  737. // CHECK:STDOUT: %Self => constants.%Self.5a9
  738. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.a72
  739. // CHECK:STDOUT: %Convert => constants.%Convert.2ea
  740. // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.79b
  741. // CHECK:STDOUT: %assoc0 => constants.%assoc0.b18
  742. // CHECK:STDOUT: }
  743. // CHECK:STDOUT:
  744. // CHECK:STDOUT: specific @impl(constants.%T.8b3) {
  745. // CHECK:STDOUT: %T => constants.%T.8b3
  746. // CHECK:STDOUT: %T.patt => constants.%T.patt.e01
  747. // CHECK:STDOUT: %impl_witness => constants.%impl_witness
  748. // CHECK:STDOUT: }
  749. // CHECK:STDOUT:
  750. // CHECK:STDOUT: specific @impl(%T) {}
  751. // CHECK:STDOUT:
  752. // CHECK:STDOUT: specific @Op(constants.%T.8b3) {
  753. // CHECK:STDOUT: %T => constants.%T.8b3
  754. // CHECK:STDOUT: }
  755. // CHECK:STDOUT:
  756. // CHECK:STDOUT: --- instance.carbon
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: constants {
  759. // CHECK:STDOUT: %L1.type: type = facet_type <@L1> [concrete]
  760. // CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic]
  761. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  762. // CHECK:STDOUT: %R1.type: type = fn_type @R1 [concrete]
  763. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  764. // CHECK:STDOUT: %R1: %R1.type = struct_value () [concrete]
  765. // CHECK:STDOUT: %L1.assoc_type: type = assoc_entity_type @L1 [concrete]
  766. // CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, @L1.%R1.decl [concrete]
  767. // CHECK:STDOUT: %ptr.72f01d.1: type = ptr_type %Self.as_type [symbolic]
  768. // CHECK:STDOUT: %S1.type: type = fn_type @S1 [concrete]
  769. // CHECK:STDOUT: %S1: %S1.type = struct_value () [concrete]
  770. // CHECK:STDOUT: %assoc1: %L1.assoc_type = assoc_entity element1, @L1.%S1.decl [concrete]
  771. // CHECK:STDOUT: %T: %L1.type = bind_symbolic_name T, 0 [symbolic]
  772. // CHECK:STDOUT: %T.patt: %L1.type = symbolic_binding_pattern T, 0 [symbolic]
  773. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  774. // CHECK:STDOUT: %Simple4.type: type = fn_type @Simple4 [concrete]
  775. // CHECK:STDOUT: %Simple4: %Simple4.type = struct_value () [concrete]
  776. // CHECK:STDOUT: %require_complete.97cd40.1: <witness> = require_complete_type %T.as_type [symbolic]
  777. // CHECK:STDOUT: %T.as_wit.iface0: <witness> = facet_access_witness %T, element0 [symbolic]
  778. // CHECK:STDOUT: %L1.facet.4e6342.1: %L1.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic]
  779. // CHECK:STDOUT: %.0c30d6.1: type = fn_type_with_self_type %R1.type, %L1.facet.4e6342.1 [symbolic]
  780. // CHECK:STDOUT: %impl.elem0.b469d1.1: %.0c30d6.1 = impl_witness_access %T.as_wit.iface0, element0 [symbolic]
  781. // CHECK:STDOUT: %specific_impl_fn.5798a5.1: <specific function> = specific_impl_function %impl.elem0.b469d1.1, @R1(%L1.facet.4e6342.1) [symbolic]
  782. // CHECK:STDOUT: %.e74b40.1: type = fn_type_with_self_type %S1.type, %L1.facet.4e6342.1 [symbolic]
  783. // CHECK:STDOUT: %impl.elem1.094686.1: %.e74b40.1 = impl_witness_access %T.as_wit.iface0, element1 [symbolic]
  784. // CHECK:STDOUT: %ptr.72f01d.2: type = ptr_type %T.as_type [symbolic]
  785. // CHECK:STDOUT: %specific_impl_fn.e8e9e6.1: <specific function> = specific_impl_function %impl.elem1.094686.1, @S1(%L1.facet.4e6342.1) [symbolic]
  786. // CHECK:STDOUT: %require_complete.9326df.1: <witness> = require_complete_type %ptr.72f01d.2 [symbolic]
  787. // CHECK:STDOUT: %V: %L1.type = bind_symbolic_name V, 0 [symbolic]
  788. // CHECK:STDOUT: %V.patt: %L1.type = symbolic_binding_pattern V, 0 [symbolic]
  789. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic]
  790. // CHECK:STDOUT: %Compound4.type: type = fn_type @Compound4 [concrete]
  791. // CHECK:STDOUT: %Compound4: %Compound4.type = struct_value () [concrete]
  792. // CHECK:STDOUT: %require_complete.97cd40.2: <witness> = require_complete_type %V.as_type [symbolic]
  793. // CHECK:STDOUT: %V.as_wit.iface0: <witness> = facet_access_witness %V, element0 [symbolic]
  794. // CHECK:STDOUT: %L1.facet.4e6342.2: %L1.type = facet_value %V.as_type, (%V.as_wit.iface0) [symbolic]
  795. // CHECK:STDOUT: %.0c30d6.2: type = fn_type_with_self_type %R1.type, %L1.facet.4e6342.2 [symbolic]
  796. // CHECK:STDOUT: %impl.elem0.b469d1.2: %.0c30d6.2 = impl_witness_access %V.as_wit.iface0, element0 [symbolic]
  797. // CHECK:STDOUT: %specific_impl_fn.5798a5.2: <specific function> = specific_impl_function %impl.elem0.b469d1.2, @R1(%L1.facet.4e6342.2) [symbolic]
  798. // CHECK:STDOUT: %.e74b40.2: type = fn_type_with_self_type %S1.type, %L1.facet.4e6342.2 [symbolic]
  799. // CHECK:STDOUT: %impl.elem1.094686.2: %.e74b40.2 = impl_witness_access %V.as_wit.iface0, element1 [symbolic]
  800. // CHECK:STDOUT: %ptr.72f01d.3: type = ptr_type %V.as_type [symbolic]
  801. // CHECK:STDOUT: %specific_impl_fn.e8e9e6.2: <specific function> = specific_impl_function %impl.elem1.094686.2, @S1(%L1.facet.4e6342.2) [symbolic]
  802. // CHECK:STDOUT: %require_complete.9326df.2: <witness> = require_complete_type %ptr.72f01d.3 [symbolic]
  803. // CHECK:STDOUT: }
  804. // CHECK:STDOUT:
  805. // CHECK:STDOUT: imports {
  806. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  807. // CHECK:STDOUT: import Core//prelude
  808. // CHECK:STDOUT: }
  809. // CHECK:STDOUT: }
  810. // CHECK:STDOUT:
  811. // CHECK:STDOUT: file {
  812. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  813. // CHECK:STDOUT: .Core = imports.%Core
  814. // CHECK:STDOUT: .L1 = %L1.decl
  815. // CHECK:STDOUT: .Simple4 = %Simple4.decl
  816. // CHECK:STDOUT: .Compound4 = %Compound4.decl
  817. // CHECK:STDOUT: }
  818. // CHECK:STDOUT: %Core.import = import Core
  819. // CHECK:STDOUT: %L1.decl: type = interface_decl @L1 [concrete = constants.%L1.type] {} {}
  820. // CHECK:STDOUT: %Simple4.decl: %Simple4.type = fn_decl @Simple4 [concrete = constants.%Simple4] {
  821. // CHECK:STDOUT: %T.patt.loc9_12.1: %L1.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_12.2 (constants.%T.patt)]
  822. // CHECK:STDOUT: %x.patt: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = binding_pattern x
  823. // CHECK:STDOUT: %x.param_patt: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = value_param_pattern %x.patt, call_param0
  824. // CHECK:STDOUT: } {
  825. // CHECK:STDOUT: %L1.ref: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  826. // CHECK:STDOUT: %T.loc9_12.1: %L1.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.2 (constants.%T)]
  827. // CHECK:STDOUT: %x.param: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = value_param call_param0
  828. // CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] {
  829. // CHECK:STDOUT: %T.ref.loc9: %L1.type = name_ref T, %T.loc9_12.1 [symbolic = %T.loc9_12.2 (constants.%T)]
  830. // CHECK:STDOUT: %T.as_type.loc9_23.1: type = facet_access_type %T.ref.loc9 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  831. // CHECK:STDOUT: %.loc9_23.2: type = converted %T.ref.loc9, %T.as_type.loc9_23.1 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  832. // CHECK:STDOUT: }
  833. // CHECK:STDOUT: %x: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = bind_name x, %x.param
  834. // CHECK:STDOUT: }
  835. // CHECK:STDOUT: %Compound4.decl: %Compound4.type = fn_decl @Compound4 [concrete = constants.%Compound4] {
  836. // CHECK:STDOUT: %V.patt.loc16_14.1: %L1.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc16_14.2 (constants.%V.patt)]
  837. // CHECK:STDOUT: %y.patt: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = binding_pattern y
  838. // CHECK:STDOUT: %y.param_patt: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = value_param_pattern %y.patt, call_param0
  839. // CHECK:STDOUT: } {
  840. // CHECK:STDOUT: %L1.ref.loc16: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  841. // CHECK:STDOUT: %V.loc16_14.1: %L1.type = bind_symbolic_name V, 0 [symbolic = %V.loc16_14.2 (constants.%V)]
  842. // CHECK:STDOUT: %y.param: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = value_param call_param0
  843. // CHECK:STDOUT: %.loc16_25.1: type = splice_block %.loc16_25.2 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)] {
  844. // CHECK:STDOUT: %V.ref.loc16: %L1.type = name_ref V, %V.loc16_14.1 [symbolic = %V.loc16_14.2 (constants.%V)]
  845. // CHECK:STDOUT: %V.as_type.loc16_25.1: type = facet_access_type %V.ref.loc16 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)]
  846. // CHECK:STDOUT: %.loc16_25.2: type = converted %V.ref.loc16, %V.as_type.loc16_25.1 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)]
  847. // CHECK:STDOUT: }
  848. // CHECK:STDOUT: %y: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = bind_name y, %y.param
  849. // CHECK:STDOUT: }
  850. // CHECK:STDOUT: }
  851. // CHECK:STDOUT:
  852. // CHECK:STDOUT: interface @L1 {
  853. // CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  854. // CHECK:STDOUT: %R1.decl: %R1.type = fn_decl @R1 [concrete = constants.%R1] {
  855. // CHECK:STDOUT: %self.patt: @R1.%Self.as_type.loc4_15.1 (%Self.as_type) = binding_pattern self
  856. // CHECK:STDOUT: %self.param_patt: @R1.%Self.as_type.loc4_15.1 (%Self.as_type) = value_param_pattern %self.patt, call_param0
  857. // CHECK:STDOUT: } {
  858. // CHECK:STDOUT: %self.param: @R1.%Self.as_type.loc4_15.1 (%Self.as_type) = value_param call_param0
  859. // CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] {
  860. // CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self)]
  861. // CHECK:STDOUT: %Self.as_type.loc4_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)]
  862. // CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref, %Self.as_type.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)]
  863. // CHECK:STDOUT: }
  864. // CHECK:STDOUT: %self: @R1.%Self.as_type.loc4_15.1 (%Self.as_type) = bind_name self, %self.param
  865. // CHECK:STDOUT: }
  866. // CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, %R1.decl [concrete = constants.%assoc0]
  867. // CHECK:STDOUT: %S1.decl: %S1.type = fn_decl @S1 [concrete = constants.%S1] {
  868. // CHECK:STDOUT: %self.patt: @S1.%ptr.loc5_24.1 (%ptr.72f01d.1) = binding_pattern self
  869. // CHECK:STDOUT: %self.param_patt: @S1.%ptr.loc5_24.1 (%ptr.72f01d.1) = value_param_pattern %self.patt, call_param0
  870. // CHECK:STDOUT: %.loc5_9: auto = addr_pattern %self.param_patt
  871. // CHECK:STDOUT: } {
  872. // CHECK:STDOUT: %self.param: @S1.%ptr.loc5_24.1 (%ptr.72f01d.1) = value_param call_param0
  873. // CHECK:STDOUT: %.loc5_24.1: type = splice_block %ptr.loc5_24.2 [symbolic = %ptr.loc5_24.1 (constants.%ptr.72f01d.1)] {
  874. // CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self)]
  875. // CHECK:STDOUT: %Self.as_type.loc5_24.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type)]
  876. // CHECK:STDOUT: %.loc5_24.2: type = converted %Self.ref, %Self.as_type.loc5_24.2 [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type)]
  877. // CHECK:STDOUT: %ptr.loc5_24.2: type = ptr_type %.loc5_24.2 [symbolic = %ptr.loc5_24.1 (constants.%ptr.72f01d.1)]
  878. // CHECK:STDOUT: }
  879. // CHECK:STDOUT: %self: @S1.%ptr.loc5_24.1 (%ptr.72f01d.1) = bind_name self, %self.param
  880. // CHECK:STDOUT: }
  881. // CHECK:STDOUT: %assoc1: %L1.assoc_type = assoc_entity element1, %S1.decl [concrete = constants.%assoc1]
  882. // CHECK:STDOUT:
  883. // CHECK:STDOUT: !members:
  884. // CHECK:STDOUT: .Self = %Self
  885. // CHECK:STDOUT: .R1 = %assoc0
  886. // CHECK:STDOUT: .S1 = %assoc1
  887. // CHECK:STDOUT: witness = (%R1.decl, %S1.decl)
  888. // CHECK:STDOUT: }
  889. // CHECK:STDOUT:
  890. // CHECK:STDOUT: generic fn @R1(@L1.%Self: %L1.type) {
  891. // CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  892. // CHECK:STDOUT: %Self.as_type.loc4_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)]
  893. // CHECK:STDOUT:
  894. // CHECK:STDOUT: fn[%self.param_patt: @R1.%Self.as_type.loc4_15.1 (%Self.as_type)]();
  895. // CHECK:STDOUT: }
  896. // CHECK:STDOUT:
  897. // CHECK:STDOUT: generic fn @S1(@L1.%Self: %L1.type) {
  898. // CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  899. // CHECK:STDOUT: %Self.as_type.loc5_24.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type)]
  900. // CHECK:STDOUT: %ptr.loc5_24.1: type = ptr_type %Self.as_type.loc5_24.1 [symbolic = %ptr.loc5_24.1 (constants.%ptr.72f01d.1)]
  901. // CHECK:STDOUT:
  902. // CHECK:STDOUT: fn[addr %self.param_patt: @S1.%ptr.loc5_24.1 (%ptr.72f01d.1)]();
  903. // CHECK:STDOUT: }
  904. // CHECK:STDOUT:
  905. // CHECK:STDOUT: generic fn @Simple4(%T.loc9_12.1: %L1.type) {
  906. // CHECK:STDOUT: %T.loc9_12.2: %L1.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.2 (constants.%T)]
  907. // CHECK:STDOUT: %T.patt.loc9_12.2: %L1.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_12.2 (constants.%T.patt)]
  908. // CHECK:STDOUT: %T.as_type.loc9_23.2: type = facet_access_type %T.loc9_12.2 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  909. // CHECK:STDOUT:
  910. // CHECK:STDOUT: !definition:
  911. // CHECK:STDOUT: %require_complete.loc9: <witness> = require_complete_type @Simple4.%T.as_type.loc9_23.2 (%T.as_type) [symbolic = %require_complete.loc9 (constants.%require_complete.97cd40.1)]
  912. // CHECK:STDOUT: %T.as_wit.iface0.loc10_4.2: <witness> = facet_access_witness %T.loc9_12.2, element0 [symbolic = %T.as_wit.iface0.loc10_4.2 (constants.%T.as_wit.iface0)]
  913. // CHECK:STDOUT: %L1.facet: %L1.type = facet_value %T.as_type.loc9_23.2, (%T.as_wit.iface0.loc10_4.2) [symbolic = %L1.facet (constants.%L1.facet.4e6342.1)]
  914. // CHECK:STDOUT: %.loc10_4.2: type = fn_type_with_self_type constants.%R1.type, %L1.facet [symbolic = %.loc10_4.2 (constants.%.0c30d6.1)]
  915. // CHECK:STDOUT: %impl.elem0.loc10_4.2: @Simple4.%.loc10_4.2 (%.0c30d6.1) = impl_witness_access %T.as_wit.iface0.loc10_4.2, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.b469d1.1)]
  916. // CHECK:STDOUT: %specific_impl_fn.loc10_4.2: <specific function> = specific_impl_function %impl.elem0.loc10_4.2, @R1(%L1.facet) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.5798a5.1)]
  917. // CHECK:STDOUT: %.loc12_8.2: type = fn_type_with_self_type constants.%S1.type, %L1.facet [symbolic = %.loc12_8.2 (constants.%.e74b40.1)]
  918. // CHECK:STDOUT: %impl.elem1.loc12_8.2: @Simple4.%.loc12_8.2 (%.e74b40.1) = impl_witness_access %T.as_wit.iface0.loc10_4.2, element1 [symbolic = %impl.elem1.loc12_8.2 (constants.%impl.elem1.094686.1)]
  919. // CHECK:STDOUT: %specific_impl_fn.loc12_8.2: <specific function> = specific_impl_function %impl.elem1.loc12_8.2, @S1(%L1.facet) [symbolic = %specific_impl_fn.loc12_8.2 (constants.%specific_impl_fn.e8e9e6.1)]
  920. // CHECK:STDOUT: %ptr: type = ptr_type %T.as_type.loc9_23.2 [symbolic = %ptr (constants.%ptr.72f01d.2)]
  921. // CHECK:STDOUT: %require_complete.loc12: <witness> = require_complete_type @Simple4.%ptr (%ptr.72f01d.2) [symbolic = %require_complete.loc12 (constants.%require_complete.9326df.1)]
  922. // CHECK:STDOUT:
  923. // CHECK:STDOUT: fn(%T.patt.loc9_12.1: %L1.type, %x.param_patt: @Simple4.%T.as_type.loc9_23.2 (%T.as_type)) {
  924. // CHECK:STDOUT: !entry:
  925. // CHECK:STDOUT: %x.ref.loc10: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = name_ref x, %x
  926. // CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0]
  927. // CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type constants.%T [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  928. // CHECK:STDOUT: %.loc10_4.1: type = converted constants.%T, %T.as_type.loc10 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  929. // CHECK:STDOUT: %T.as_wit.iface0.loc10_4.1: <witness> = facet_access_witness constants.%T, element0 [symbolic = %T.as_wit.iface0.loc10_4.2 (constants.%T.as_wit.iface0)]
  930. // CHECK:STDOUT: %impl.elem0.loc10_4.1: @Simple4.%.loc10_4.2 (%.0c30d6.1) = impl_witness_access %T.as_wit.iface0.loc10_4.1, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.b469d1.1)]
  931. // CHECK:STDOUT: %bound_method.loc10_4: <bound method> = bound_method %x.ref.loc10, %impl.elem0.loc10_4.1
  932. // CHECK:STDOUT: %specific_impl_fn.loc10_4.1: <specific function> = specific_impl_function %impl.elem0.loc10_4.1, @R1(constants.%L1.facet.4e6342.1) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.5798a5.1)]
  933. // CHECK:STDOUT: %bound_method.loc10_8: <bound method> = bound_method %x.ref.loc10, %specific_impl_fn.loc10_4.1
  934. // CHECK:STDOUT: %.loc10_8: init %empty_tuple.type = call %bound_method.loc10_8(%x.ref.loc10)
  935. // CHECK:STDOUT: name_binding_decl {
  936. // CHECK:STDOUT: %xcopy.patt: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = binding_pattern xcopy
  937. // CHECK:STDOUT: %.loc11_3: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = var_pattern %xcopy.patt
  938. // CHECK:STDOUT: }
  939. // CHECK:STDOUT: %xcopy.var: ref @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = var xcopy
  940. // CHECK:STDOUT: %x.ref.loc11: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = name_ref x, %x
  941. // CHECK:STDOUT: assign %xcopy.var, %x.ref.loc11
  942. // CHECK:STDOUT: %.loc11_14.1: type = splice_block %.loc11_14.2 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] {
  943. // CHECK:STDOUT: %T.ref.loc11: %L1.type = name_ref T, %T.loc9_12.1 [symbolic = %T.loc9_12.2 (constants.%T)]
  944. // CHECK:STDOUT: %T.as_type.loc11: type = facet_access_type %T.ref.loc11 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  945. // CHECK:STDOUT: %.loc11_14.2: type = converted %T.ref.loc11, %T.as_type.loc11 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  946. // CHECK:STDOUT: }
  947. // CHECK:STDOUT: %xcopy: ref @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = bind_name xcopy, %xcopy.var
  948. // CHECK:STDOUT: %xcopy.ref: ref @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = name_ref xcopy, %xcopy
  949. // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.%assoc1 [concrete = constants.%assoc1]
  950. // CHECK:STDOUT: %T.as_type.loc12: type = facet_access_type constants.%T [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  951. // CHECK:STDOUT: %.loc12_8.1: type = converted constants.%T, %T.as_type.loc12 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  952. // CHECK:STDOUT: %T.as_wit.iface0.loc12: <witness> = facet_access_witness constants.%T, element0 [symbolic = %T.as_wit.iface0.loc10_4.2 (constants.%T.as_wit.iface0)]
  953. // CHECK:STDOUT: %impl.elem1.loc12_8.1: @Simple4.%.loc12_8.2 (%.e74b40.1) = impl_witness_access %T.as_wit.iface0.loc12, element1 [symbolic = %impl.elem1.loc12_8.2 (constants.%impl.elem1.094686.1)]
  954. // CHECK:STDOUT: %bound_method.loc12_8: <bound method> = bound_method %xcopy.ref, %impl.elem1.loc12_8.1
  955. // CHECK:STDOUT: %specific_impl_fn.loc12_8.1: <specific function> = specific_impl_function %impl.elem1.loc12_8.1, @S1(constants.%L1.facet.4e6342.1) [symbolic = %specific_impl_fn.loc12_8.2 (constants.%specific_impl_fn.e8e9e6.1)]
  956. // CHECK:STDOUT: %bound_method.loc12_12: <bound method> = bound_method %xcopy.ref, %specific_impl_fn.loc12_8.1
  957. // CHECK:STDOUT: %addr: @Simple4.%ptr (%ptr.72f01d.2) = addr_of %xcopy.ref
  958. // CHECK:STDOUT: %.loc12_12: init %empty_tuple.type = call %bound_method.loc12_12(%addr)
  959. // CHECK:STDOUT: return
  960. // CHECK:STDOUT: }
  961. // CHECK:STDOUT: }
  962. // CHECK:STDOUT:
  963. // CHECK:STDOUT: generic fn @Compound4(%V.loc16_14.1: %L1.type) {
  964. // CHECK:STDOUT: %V.loc16_14.2: %L1.type = bind_symbolic_name V, 0 [symbolic = %V.loc16_14.2 (constants.%V)]
  965. // CHECK:STDOUT: %V.patt.loc16_14.2: %L1.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc16_14.2 (constants.%V.patt)]
  966. // CHECK:STDOUT: %V.as_type.loc16_25.2: type = facet_access_type %V.loc16_14.2 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)]
  967. // CHECK:STDOUT:
  968. // CHECK:STDOUT: !definition:
  969. // CHECK:STDOUT: %require_complete.loc16: <witness> = require_complete_type @Compound4.%V.as_type.loc16_25.2 (%V.as_type) [symbolic = %require_complete.loc16 (constants.%require_complete.97cd40.2)]
  970. // CHECK:STDOUT: %V.as_wit.iface0.loc17_4.2: <witness> = facet_access_witness %V.loc16_14.2, element0 [symbolic = %V.as_wit.iface0.loc17_4.2 (constants.%V.as_wit.iface0)]
  971. // CHECK:STDOUT: %L1.facet: %L1.type = facet_value %V.as_type.loc16_25.2, (%V.as_wit.iface0.loc17_4.2) [symbolic = %L1.facet (constants.%L1.facet.4e6342.2)]
  972. // CHECK:STDOUT: %.loc17_4: type = fn_type_with_self_type constants.%R1.type, %L1.facet [symbolic = %.loc17_4 (constants.%.0c30d6.2)]
  973. // CHECK:STDOUT: %impl.elem0.loc17_4.2: @Compound4.%.loc17_4 (%.0c30d6.2) = impl_witness_access %V.as_wit.iface0.loc17_4.2, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.b469d1.2)]
  974. // CHECK:STDOUT: %specific_impl_fn.loc17_4.2: <specific function> = specific_impl_function %impl.elem0.loc17_4.2, @R1(%L1.facet) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.5798a5.2)]
  975. // CHECK:STDOUT: %.loc19_8: type = fn_type_with_self_type constants.%S1.type, %L1.facet [symbolic = %.loc19_8 (constants.%.e74b40.2)]
  976. // CHECK:STDOUT: %impl.elem1.loc19_8.2: @Compound4.%.loc19_8 (%.e74b40.2) = impl_witness_access %V.as_wit.iface0.loc17_4.2, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.094686.2)]
  977. // CHECK:STDOUT: %specific_impl_fn.loc19_8.2: <specific function> = specific_impl_function %impl.elem1.loc19_8.2, @S1(%L1.facet) [symbolic = %specific_impl_fn.loc19_8.2 (constants.%specific_impl_fn.e8e9e6.2)]
  978. // CHECK:STDOUT: %ptr: type = ptr_type %V.as_type.loc16_25.2 [symbolic = %ptr (constants.%ptr.72f01d.3)]
  979. // CHECK:STDOUT: %require_complete.loc19: <witness> = require_complete_type @Compound4.%ptr (%ptr.72f01d.3) [symbolic = %require_complete.loc19 (constants.%require_complete.9326df.2)]
  980. // CHECK:STDOUT:
  981. // CHECK:STDOUT: fn(%V.patt.loc16_14.1: %L1.type, %y.param_patt: @Compound4.%V.as_type.loc16_25.2 (%V.as_type)) {
  982. // CHECK:STDOUT: !entry:
  983. // CHECK:STDOUT: %y.ref.loc17: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = name_ref y, %y
  984. // CHECK:STDOUT: %L1.ref.loc17: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  985. // CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0]
  986. // CHECK:STDOUT: %V.as_wit.iface0.loc17_4.1: <witness> = facet_access_witness constants.%V, element0 [symbolic = %V.as_wit.iface0.loc17_4.2 (constants.%V.as_wit.iface0)]
  987. // CHECK:STDOUT: %impl.elem0.loc17_4.1: @Compound4.%.loc17_4 (%.0c30d6.2) = impl_witness_access %V.as_wit.iface0.loc17_4.1, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.b469d1.2)]
  988. // CHECK:STDOUT: %bound_method.loc17_4: <bound method> = bound_method %y.ref.loc17, %impl.elem0.loc17_4.1
  989. // CHECK:STDOUT: %specific_impl_fn.loc17_4.1: <specific function> = specific_impl_function %impl.elem0.loc17_4.1, @R1(constants.%L1.facet.4e6342.2) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.5798a5.2)]
  990. // CHECK:STDOUT: %bound_method.loc17_13: <bound method> = bound_method %y.ref.loc17, %specific_impl_fn.loc17_4.1
  991. // CHECK:STDOUT: %.loc17_13: init %empty_tuple.type = call %bound_method.loc17_13(%y.ref.loc17)
  992. // CHECK:STDOUT: name_binding_decl {
  993. // CHECK:STDOUT: %ycopy.patt: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = binding_pattern ycopy
  994. // CHECK:STDOUT: %.loc18_3: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = var_pattern %ycopy.patt
  995. // CHECK:STDOUT: }
  996. // CHECK:STDOUT: %ycopy.var: ref @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = var ycopy
  997. // CHECK:STDOUT: %y.ref.loc18: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = name_ref y, %y
  998. // CHECK:STDOUT: assign %ycopy.var, %y.ref.loc18
  999. // CHECK:STDOUT: %.loc18_14.1: type = splice_block %.loc18_14.2 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)] {
  1000. // CHECK:STDOUT: %V.ref.loc18: %L1.type = name_ref V, %V.loc16_14.1 [symbolic = %V.loc16_14.2 (constants.%V)]
  1001. // CHECK:STDOUT: %V.as_type.loc18: type = facet_access_type %V.ref.loc18 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)]
  1002. // CHECK:STDOUT: %.loc18_14.2: type = converted %V.ref.loc18, %V.as_type.loc18 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)]
  1003. // CHECK:STDOUT: }
  1004. // CHECK:STDOUT: %ycopy: ref @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = bind_name ycopy, %ycopy.var
  1005. // CHECK:STDOUT: %ycopy.ref: ref @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = name_ref ycopy, %ycopy
  1006. // CHECK:STDOUT: %L1.ref.loc19: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  1007. // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.%assoc1 [concrete = constants.%assoc1]
  1008. // CHECK:STDOUT: %V.as_wit.iface0.loc19: <witness> = facet_access_witness constants.%V, element0 [symbolic = %V.as_wit.iface0.loc17_4.2 (constants.%V.as_wit.iface0)]
  1009. // CHECK:STDOUT: %impl.elem1.loc19_8.1: @Compound4.%.loc19_8 (%.e74b40.2) = impl_witness_access %V.as_wit.iface0.loc19, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.094686.2)]
  1010. // CHECK:STDOUT: %bound_method.loc19_8: <bound method> = bound_method %ycopy.ref, %impl.elem1.loc19_8.1
  1011. // CHECK:STDOUT: %specific_impl_fn.loc19_8.1: <specific function> = specific_impl_function %impl.elem1.loc19_8.1, @S1(constants.%L1.facet.4e6342.2) [symbolic = %specific_impl_fn.loc19_8.2 (constants.%specific_impl_fn.e8e9e6.2)]
  1012. // CHECK:STDOUT: %bound_method.loc19_17: <bound method> = bound_method %ycopy.ref, %specific_impl_fn.loc19_8.1
  1013. // CHECK:STDOUT: %addr: @Compound4.%ptr (%ptr.72f01d.3) = addr_of %ycopy.ref
  1014. // CHECK:STDOUT: %.loc19_17: init %empty_tuple.type = call %bound_method.loc19_17(%addr)
  1015. // CHECK:STDOUT: return
  1016. // CHECK:STDOUT: }
  1017. // CHECK:STDOUT: }
  1018. // CHECK:STDOUT:
  1019. // CHECK:STDOUT: specific @R1(constants.%Self) {
  1020. // CHECK:STDOUT: %Self => constants.%Self
  1021. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%Self.as_type
  1022. // CHECK:STDOUT: }
  1023. // CHECK:STDOUT:
  1024. // CHECK:STDOUT: specific @S1(constants.%Self) {
  1025. // CHECK:STDOUT: %Self => constants.%Self
  1026. // CHECK:STDOUT: %Self.as_type.loc5_24.1 => constants.%Self.as_type
  1027. // CHECK:STDOUT: %ptr.loc5_24.1 => constants.%ptr.72f01d.1
  1028. // CHECK:STDOUT: }
  1029. // CHECK:STDOUT:
  1030. // CHECK:STDOUT: specific @Simple4(constants.%T) {
  1031. // CHECK:STDOUT: %T.loc9_12.2 => constants.%T
  1032. // CHECK:STDOUT: %T.patt.loc9_12.2 => constants.%T.patt
  1033. // CHECK:STDOUT: %T.as_type.loc9_23.2 => constants.%T.as_type
  1034. // CHECK:STDOUT: }
  1035. // CHECK:STDOUT:
  1036. // CHECK:STDOUT: specific @R1(constants.%L1.facet.4e6342.1) {
  1037. // CHECK:STDOUT: %Self => constants.%L1.facet.4e6342.1
  1038. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%T.as_type
  1039. // CHECK:STDOUT: }
  1040. // CHECK:STDOUT:
  1041. // CHECK:STDOUT: specific @S1(constants.%L1.facet.4e6342.1) {
  1042. // CHECK:STDOUT: %Self => constants.%L1.facet.4e6342.1
  1043. // CHECK:STDOUT: %Self.as_type.loc5_24.1 => constants.%T.as_type
  1044. // CHECK:STDOUT: %ptr.loc5_24.1 => constants.%ptr.72f01d.2
  1045. // CHECK:STDOUT: }
  1046. // CHECK:STDOUT:
  1047. // CHECK:STDOUT: specific @R1(@Simple4.%L1.facet) {}
  1048. // CHECK:STDOUT:
  1049. // CHECK:STDOUT: specific @S1(@Simple4.%L1.facet) {}
  1050. // CHECK:STDOUT:
  1051. // CHECK:STDOUT: specific @Compound4(constants.%V) {
  1052. // CHECK:STDOUT: %V.loc16_14.2 => constants.%V
  1053. // CHECK:STDOUT: %V.patt.loc16_14.2 => constants.%V.patt
  1054. // CHECK:STDOUT: %V.as_type.loc16_25.2 => constants.%V.as_type
  1055. // CHECK:STDOUT: }
  1056. // CHECK:STDOUT:
  1057. // CHECK:STDOUT: specific @R1(constants.%L1.facet.4e6342.2) {
  1058. // CHECK:STDOUT: %Self => constants.%L1.facet.4e6342.2
  1059. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%V.as_type
  1060. // CHECK:STDOUT: }
  1061. // CHECK:STDOUT:
  1062. // CHECK:STDOUT: specific @S1(constants.%L1.facet.4e6342.2) {
  1063. // CHECK:STDOUT: %Self => constants.%L1.facet.4e6342.2
  1064. // CHECK:STDOUT: %Self.as_type.loc5_24.1 => constants.%V.as_type
  1065. // CHECK:STDOUT: %ptr.loc5_24.1 => constants.%ptr.72f01d.3
  1066. // CHECK:STDOUT: }
  1067. // CHECK:STDOUT:
  1068. // CHECK:STDOUT: specific @R1(@Compound4.%L1.facet) {}
  1069. // CHECK:STDOUT:
  1070. // CHECK:STDOUT: specific @S1(@Compound4.%L1.facet) {}
  1071. // CHECK:STDOUT:
  1072. // CHECK:STDOUT: --- fail_interface_instance_caller_not.carbon
  1073. // CHECK:STDOUT:
  1074. // CHECK:STDOUT: constants {
  1075. // CHECK:STDOUT: %L2.type: type = facet_type <@L2> [concrete]
  1076. // CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic]
  1077. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1078. // CHECK:STDOUT: %R2.type: type = fn_type @R2 [concrete]
  1079. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1080. // CHECK:STDOUT: %R2: %R2.type = struct_value () [concrete]
  1081. // CHECK:STDOUT: %L2.assoc_type: type = assoc_entity_type @L2 [concrete]
  1082. // CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, @L2.%R2.decl [concrete]
  1083. // CHECK:STDOUT: %ptr.f3e54b.1: type = ptr_type %Self.as_type [symbolic]
  1084. // CHECK:STDOUT: %S2.type: type = fn_type @S2 [concrete]
  1085. // CHECK:STDOUT: %S2: %S2.type = struct_value () [concrete]
  1086. // CHECK:STDOUT: %assoc1: %L2.assoc_type = assoc_entity element1, @L2.%S2.decl [concrete]
  1087. // CHECK:STDOUT: %T: %L2.type = bind_symbolic_name T, 0 [symbolic]
  1088. // CHECK:STDOUT: %T.patt: %L2.type = symbolic_binding_pattern T, 0 [symbolic]
  1089. // CHECK:STDOUT: %Simple5.type: type = fn_type @Simple5 [concrete]
  1090. // CHECK:STDOUT: %Simple5: %Simple5.type = struct_value () [concrete]
  1091. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  1092. // CHECK:STDOUT: %T.as_wit.iface0: <witness> = facet_access_witness %T, element0 [symbolic]
  1093. // CHECK:STDOUT: %L2.facet: %L2.type = facet_value %T.as_type, (%T.as_wit.iface0) [symbolic]
  1094. // CHECK:STDOUT: %.f52: type = fn_type_with_self_type %R2.type, %L2.facet [symbolic]
  1095. // CHECK:STDOUT: %impl.elem0: %.f52 = impl_witness_access %T.as_wit.iface0, element0 [symbolic]
  1096. // CHECK:STDOUT: %specific_impl_fn.298: <specific function> = specific_impl_function %impl.elem0, @R2(%L2.facet) [symbolic]
  1097. // CHECK:STDOUT: %.f66: type = fn_type_with_self_type %S2.type, %L2.facet [symbolic]
  1098. // CHECK:STDOUT: %impl.elem1: %.f66 = impl_witness_access %T.as_wit.iface0, element1 [symbolic]
  1099. // CHECK:STDOUT: %ptr.f3e54b.2: type = ptr_type %T.as_type [symbolic]
  1100. // CHECK:STDOUT: %specific_impl_fn.b32: <specific function> = specific_impl_function %impl.elem1, @S2(%L2.facet) [symbolic]
  1101. // CHECK:STDOUT: %V: %L2.type = bind_symbolic_name V, 0 [symbolic]
  1102. // CHECK:STDOUT: %V.patt: %L2.type = symbolic_binding_pattern V, 0 [symbolic]
  1103. // CHECK:STDOUT: %Compound5.type: type = fn_type @Compound5 [concrete]
  1104. // CHECK:STDOUT: %Compound5: %Compound5.type = struct_value () [concrete]
  1105. // CHECK:STDOUT: }
  1106. // CHECK:STDOUT:
  1107. // CHECK:STDOUT: imports {
  1108. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1109. // CHECK:STDOUT: import Core//prelude
  1110. // CHECK:STDOUT: }
  1111. // CHECK:STDOUT: }
  1112. // CHECK:STDOUT:
  1113. // CHECK:STDOUT: file {
  1114. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1115. // CHECK:STDOUT: .Core = imports.%Core
  1116. // CHECK:STDOUT: .L2 = %L2.decl
  1117. // CHECK:STDOUT: .Simple5 = %Simple5.decl
  1118. // CHECK:STDOUT: .Compound5 = %Compound5.decl
  1119. // CHECK:STDOUT: }
  1120. // CHECK:STDOUT: %Core.import = import Core
  1121. // CHECK:STDOUT: %L2.decl: type = interface_decl @L2 [concrete = constants.%L2.type] {} {}
  1122. // CHECK:STDOUT: %Simple5.decl: %Simple5.type = fn_decl @Simple5 [concrete = constants.%Simple5] {
  1123. // CHECK:STDOUT: %T.patt.loc10_12.1: %L2.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_12.2 (constants.%T.patt)]
  1124. // CHECK:STDOUT: } {
  1125. // CHECK:STDOUT: %L2.ref: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1126. // CHECK:STDOUT: %T.loc10_12.1: %L2.type = bind_symbolic_name T, 0 [symbolic = %T.loc10_12.2 (constants.%T)]
  1127. // CHECK:STDOUT: }
  1128. // CHECK:STDOUT: %Compound5.decl: %Compound5.type = fn_decl @Compound5 [concrete = constants.%Compound5] {
  1129. // CHECK:STDOUT: %V.patt.loc30_14.1: %L2.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc30_14.2 (constants.%V.patt)]
  1130. // CHECK:STDOUT: } {
  1131. // CHECK:STDOUT: %L2.ref.loc30: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1132. // CHECK:STDOUT: %V.loc30_14.1: %L2.type = bind_symbolic_name V, 0 [symbolic = %V.loc30_14.2 (constants.%V)]
  1133. // CHECK:STDOUT: }
  1134. // CHECK:STDOUT: }
  1135. // CHECK:STDOUT:
  1136. // CHECK:STDOUT: interface @L2 {
  1137. // CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1138. // CHECK:STDOUT: %R2.decl: %R2.type = fn_decl @R2 [concrete = constants.%R2] {
  1139. // CHECK:STDOUT: %self.patt: @R2.%Self.as_type.loc5_15.1 (%Self.as_type) = binding_pattern self
  1140. // CHECK:STDOUT: %self.param_patt: @R2.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param_pattern %self.patt, call_param0
  1141. // CHECK:STDOUT: } {
  1142. // CHECK:STDOUT: %self.param: @R2.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0
  1143. // CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] {
  1144. // CHECK:STDOUT: %Self.ref: %L2.type = name_ref Self, @L2.%Self [symbolic = %Self (constants.%Self)]
  1145. // 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)]
  1146. // CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  1147. // CHECK:STDOUT: }
  1148. // CHECK:STDOUT: %self: @R2.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name self, %self.param
  1149. // CHECK:STDOUT: }
  1150. // CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, %R2.decl [concrete = constants.%assoc0]
  1151. // CHECK:STDOUT: %S2.decl: %S2.type = fn_decl @S2 [concrete = constants.%S2] {
  1152. // CHECK:STDOUT: %self.patt: @S2.%ptr.loc6_24.1 (%ptr.f3e54b.1) = binding_pattern self
  1153. // CHECK:STDOUT: %self.param_patt: @S2.%ptr.loc6_24.1 (%ptr.f3e54b.1) = value_param_pattern %self.patt, call_param0
  1154. // CHECK:STDOUT: %.loc6_9: auto = addr_pattern %self.param_patt
  1155. // CHECK:STDOUT: } {
  1156. // CHECK:STDOUT: %self.param: @S2.%ptr.loc6_24.1 (%ptr.f3e54b.1) = value_param call_param0
  1157. // CHECK:STDOUT: %.loc6_24.1: type = splice_block %ptr.loc6_24.2 [symbolic = %ptr.loc6_24.1 (constants.%ptr.f3e54b.1)] {
  1158. // CHECK:STDOUT: %Self.ref: %L2.type = name_ref Self, @L2.%Self [symbolic = %Self (constants.%Self)]
  1159. // CHECK:STDOUT: %Self.as_type.loc6_24.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_24.1 (constants.%Self.as_type)]
  1160. // CHECK:STDOUT: %.loc6_24.2: type = converted %Self.ref, %Self.as_type.loc6_24.2 [symbolic = %Self.as_type.loc6_24.1 (constants.%Self.as_type)]
  1161. // CHECK:STDOUT: %ptr.loc6_24.2: type = ptr_type %.loc6_24.2 [symbolic = %ptr.loc6_24.1 (constants.%ptr.f3e54b.1)]
  1162. // CHECK:STDOUT: }
  1163. // CHECK:STDOUT: %self: @S2.%ptr.loc6_24.1 (%ptr.f3e54b.1) = bind_name self, %self.param
  1164. // CHECK:STDOUT: }
  1165. // CHECK:STDOUT: %assoc1: %L2.assoc_type = assoc_entity element1, %S2.decl [concrete = constants.%assoc1]
  1166. // CHECK:STDOUT:
  1167. // CHECK:STDOUT: !members:
  1168. // CHECK:STDOUT: .Self = %Self
  1169. // CHECK:STDOUT: .R2 = %assoc0
  1170. // CHECK:STDOUT: .S2 = %assoc1
  1171. // CHECK:STDOUT: witness = (%R2.decl, %S2.decl)
  1172. // CHECK:STDOUT: }
  1173. // CHECK:STDOUT:
  1174. // CHECK:STDOUT: generic fn @R2(@L2.%Self: %L2.type) {
  1175. // CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1176. // CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  1177. // CHECK:STDOUT:
  1178. // CHECK:STDOUT: fn[%self.param_patt: @R2.%Self.as_type.loc5_15.1 (%Self.as_type)]();
  1179. // CHECK:STDOUT: }
  1180. // CHECK:STDOUT:
  1181. // CHECK:STDOUT: generic fn @S2(@L2.%Self: %L2.type) {
  1182. // CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1183. // CHECK:STDOUT: %Self.as_type.loc6_24.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_24.1 (constants.%Self.as_type)]
  1184. // CHECK:STDOUT: %ptr.loc6_24.1: type = ptr_type %Self.as_type.loc6_24.1 [symbolic = %ptr.loc6_24.1 (constants.%ptr.f3e54b.1)]
  1185. // CHECK:STDOUT:
  1186. // CHECK:STDOUT: fn[addr %self.param_patt: @S2.%ptr.loc6_24.1 (%ptr.f3e54b.1)]();
  1187. // CHECK:STDOUT: }
  1188. // CHECK:STDOUT:
  1189. // CHECK:STDOUT: generic fn @Simple5(%T.loc10_12.1: %L2.type) {
  1190. // CHECK:STDOUT: %T.loc10_12.2: %L2.type = bind_symbolic_name T, 0 [symbolic = %T.loc10_12.2 (constants.%T)]
  1191. // CHECK:STDOUT: %T.patt.loc10_12.2: %L2.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_12.2 (constants.%T.patt)]
  1192. // CHECK:STDOUT:
  1193. // CHECK:STDOUT: !definition:
  1194. // CHECK:STDOUT: %T.as_type.loc18_4.2: type = facet_access_type %T.loc10_12.2 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)]
  1195. // CHECK:STDOUT: %T.as_wit.iface0.loc18_4.2: <witness> = facet_access_witness %T.loc10_12.2, element0 [symbolic = %T.as_wit.iface0.loc18_4.2 (constants.%T.as_wit.iface0)]
  1196. // CHECK:STDOUT: %L2.facet: %L2.type = facet_value %T.as_type.loc18_4.2, (%T.as_wit.iface0.loc18_4.2) [symbolic = %L2.facet (constants.%L2.facet)]
  1197. // CHECK:STDOUT: %.loc18_4.2: type = fn_type_with_self_type constants.%R2.type, %L2.facet [symbolic = %.loc18_4.2 (constants.%.f52)]
  1198. // CHECK:STDOUT: %impl.elem0.loc18_4.2: @Simple5.%.loc18_4.2 (%.f52) = impl_witness_access %T.as_wit.iface0.loc18_4.2, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)]
  1199. // CHECK:STDOUT: %specific_impl_fn.loc18_4.2: <specific function> = specific_impl_function %impl.elem0.loc18_4.2, @R2(%L2.facet) [symbolic = %specific_impl_fn.loc18_4.2 (constants.%specific_impl_fn.298)]
  1200. // CHECK:STDOUT: %.loc26_4.2: type = fn_type_with_self_type constants.%S2.type, %L2.facet [symbolic = %.loc26_4.2 (constants.%.f66)]
  1201. // CHECK:STDOUT: %impl.elem1.loc26_4.2: @Simple5.%.loc26_4.2 (%.f66) = impl_witness_access %T.as_wit.iface0.loc18_4.2, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)]
  1202. // CHECK:STDOUT: %specific_impl_fn.loc26_4.2: <specific function> = specific_impl_function %impl.elem1.loc26_4.2, @S2(%L2.facet) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.b32)]
  1203. // CHECK:STDOUT:
  1204. // CHECK:STDOUT: fn(%T.patt.loc10_12.1: %L2.type) {
  1205. // CHECK:STDOUT: !entry:
  1206. // CHECK:STDOUT: %T.ref.loc18: %L2.type = name_ref T, %T.loc10_12.1 [symbolic = %T.loc10_12.2 (constants.%T)]
  1207. // CHECK:STDOUT: %R2.ref: %L2.assoc_type = name_ref R2, @L2.%assoc0 [concrete = constants.%assoc0]
  1208. // CHECK:STDOUT: %T.as_type.loc18_4.1: type = facet_access_type %T.ref.loc18 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)]
  1209. // CHECK:STDOUT: %.loc18_4.1: type = converted %T.ref.loc18, %T.as_type.loc18_4.1 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)]
  1210. // CHECK:STDOUT: %T.as_wit.iface0.loc18_4.1: <witness> = facet_access_witness %T.ref.loc18, element0 [symbolic = %T.as_wit.iface0.loc18_4.2 (constants.%T.as_wit.iface0)]
  1211. // CHECK:STDOUT: %impl.elem0.loc18_4.1: @Simple5.%.loc18_4.2 (%.f52) = impl_witness_access %T.as_wit.iface0.loc18_4.1, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)]
  1212. // CHECK:STDOUT: %specific_impl_fn.loc18_4.1: <specific function> = specific_impl_function %impl.elem0.loc18_4.1, @R2(constants.%L2.facet) [symbolic = %specific_impl_fn.loc18_4.2 (constants.%specific_impl_fn.298)]
  1213. // CHECK:STDOUT: %.loc18_8: init %empty_tuple.type = call %specific_impl_fn.loc18_4.1(<error>) [concrete = <error>]
  1214. // CHECK:STDOUT: %T.ref.loc26: %L2.type = name_ref T, %T.loc10_12.1 [symbolic = %T.loc10_12.2 (constants.%T)]
  1215. // CHECK:STDOUT: %S2.ref: %L2.assoc_type = name_ref S2, @L2.%assoc1 [concrete = constants.%assoc1]
  1216. // CHECK:STDOUT: %T.as_type.loc26: type = facet_access_type %T.ref.loc26 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)]
  1217. // CHECK:STDOUT: %.loc26_4.1: type = converted %T.ref.loc26, %T.as_type.loc26 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)]
  1218. // CHECK:STDOUT: %T.as_wit.iface0.loc26: <witness> = facet_access_witness %T.ref.loc26, element0 [symbolic = %T.as_wit.iface0.loc18_4.2 (constants.%T.as_wit.iface0)]
  1219. // CHECK:STDOUT: %impl.elem1.loc26_4.1: @Simple5.%.loc26_4.2 (%.f66) = impl_witness_access %T.as_wit.iface0.loc26, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)]
  1220. // CHECK:STDOUT: %specific_impl_fn.loc26_4.1: <specific function> = specific_impl_function %impl.elem1.loc26_4.1, @S2(constants.%L2.facet) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.b32)]
  1221. // CHECK:STDOUT: %addr: <error> = addr_of <error> [concrete = <error>]
  1222. // CHECK:STDOUT: %.loc26_8: init %empty_tuple.type = call %specific_impl_fn.loc26_4.1(<error>) [concrete = <error>]
  1223. // CHECK:STDOUT: return
  1224. // CHECK:STDOUT: }
  1225. // CHECK:STDOUT: }
  1226. // CHECK:STDOUT:
  1227. // CHECK:STDOUT: generic fn @Compound5(%V.loc30_14.1: %L2.type) {
  1228. // CHECK:STDOUT: %V.loc30_14.2: %L2.type = bind_symbolic_name V, 0 [symbolic = %V.loc30_14.2 (constants.%V)]
  1229. // CHECK:STDOUT: %V.patt.loc30_14.2: %L2.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc30_14.2 (constants.%V.patt)]
  1230. // CHECK:STDOUT:
  1231. // CHECK:STDOUT: !definition:
  1232. // CHECK:STDOUT:
  1233. // CHECK:STDOUT: fn(%V.patt.loc30_14.1: %L2.type) {
  1234. // CHECK:STDOUT: !entry:
  1235. // CHECK:STDOUT: %V.ref.loc35: %L2.type = name_ref V, %V.loc30_14.1 [symbolic = %V.loc30_14.2 (constants.%V)]
  1236. // CHECK:STDOUT: %L2.ref.loc35: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1237. // CHECK:STDOUT: %R2.ref: %L2.assoc_type = name_ref R2, @L2.%assoc0 [concrete = constants.%assoc0]
  1238. // CHECK:STDOUT: %V.ref.loc40: %L2.type = name_ref V, %V.loc30_14.1 [symbolic = %V.loc30_14.2 (constants.%V)]
  1239. // CHECK:STDOUT: %L2.ref.loc40: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1240. // CHECK:STDOUT: %S2.ref: %L2.assoc_type = name_ref S2, @L2.%assoc1 [concrete = constants.%assoc1]
  1241. // CHECK:STDOUT: return
  1242. // CHECK:STDOUT: }
  1243. // CHECK:STDOUT: }
  1244. // CHECK:STDOUT:
  1245. // CHECK:STDOUT: specific @R2(constants.%Self) {
  1246. // CHECK:STDOUT: %Self => constants.%Self
  1247. // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type
  1248. // CHECK:STDOUT: }
  1249. // CHECK:STDOUT:
  1250. // CHECK:STDOUT: specific @S2(constants.%Self) {
  1251. // CHECK:STDOUT: %Self => constants.%Self
  1252. // CHECK:STDOUT: %Self.as_type.loc6_24.1 => constants.%Self.as_type
  1253. // CHECK:STDOUT: %ptr.loc6_24.1 => constants.%ptr.f3e54b.1
  1254. // CHECK:STDOUT: }
  1255. // CHECK:STDOUT:
  1256. // CHECK:STDOUT: specific @Simple5(constants.%T) {
  1257. // CHECK:STDOUT: %T.loc10_12.2 => constants.%T
  1258. // CHECK:STDOUT: %T.patt.loc10_12.2 => constants.%T.patt
  1259. // CHECK:STDOUT: }
  1260. // CHECK:STDOUT:
  1261. // CHECK:STDOUT: specific @R2(constants.%L2.facet) {
  1262. // CHECK:STDOUT: %Self => constants.%L2.facet
  1263. // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%T.as_type
  1264. // CHECK:STDOUT: }
  1265. // CHECK:STDOUT:
  1266. // CHECK:STDOUT: specific @S2(constants.%L2.facet) {
  1267. // CHECK:STDOUT: %Self => constants.%L2.facet
  1268. // CHECK:STDOUT: %Self.as_type.loc6_24.1 => constants.%T.as_type
  1269. // CHECK:STDOUT: %ptr.loc6_24.1 => constants.%ptr.f3e54b.2
  1270. // CHECK:STDOUT: }
  1271. // CHECK:STDOUT:
  1272. // CHECK:STDOUT: specific @R2(@Simple5.%L2.facet) {}
  1273. // CHECK:STDOUT:
  1274. // CHECK:STDOUT: specific @S2(@Simple5.%L2.facet) {}
  1275. // CHECK:STDOUT:
  1276. // CHECK:STDOUT: specific @Compound5(constants.%V) {
  1277. // CHECK:STDOUT: %V.loc30_14.2 => constants.%V
  1278. // CHECK:STDOUT: %V.patt.loc30_14.2 => constants.%V.patt
  1279. // CHECK:STDOUT: }
  1280. // CHECK:STDOUT:
  1281. // CHECK:STDOUT: --- fail_combine_non_instance.carbon
  1282. // CHECK:STDOUT:
  1283. // CHECK:STDOUT: constants {
  1284. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  1285. // CHECK:STDOUT: %Self.31d: %A.type = bind_symbolic_name Self, 0 [symbolic]
  1286. // CHECK:STDOUT: %G.type.c3a: type = fn_type @G.1 [concrete]
  1287. // CHECK:STDOUT: %G.11a: %G.type.c3a = struct_value () [concrete]
  1288. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete]
  1289. // CHECK:STDOUT: %assoc0.d52: %A.assoc_type = assoc_entity element0, @A.%G.decl [concrete]
  1290. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1291. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1292. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1293. // CHECK:STDOUT: %impl_witness.a7a: <witness> = impl_witness (@impl.77d.%G.decl) [concrete]
  1294. // CHECK:STDOUT: %G.type.486: type = fn_type @G.2 [concrete]
  1295. // CHECK:STDOUT: %G.001: %G.type.486 = struct_value () [concrete]
  1296. // CHECK:STDOUT: %A.facet: %A.type = facet_value %C, (%impl_witness.a7a) [concrete]
  1297. // CHECK:STDOUT: %Fails.type: type = fn_type @Fails [concrete]
  1298. // CHECK:STDOUT: %Fails: %Fails.type = struct_value () [concrete]
  1299. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  1300. // CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
  1301. // CHECK:STDOUT: %Self.25f: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic]
  1302. // CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type @BitAnd [concrete]
  1303. // CHECK:STDOUT: %assoc0.d45: %BitAnd.assoc_type = assoc_entity element0, imports.%Core.import_ref.a93 [concrete]
  1304. // CHECK:STDOUT: %Op.type.27a: type = fn_type @Op.1 [concrete]
  1305. // CHECK:STDOUT: %Self.as_type.19f: type = facet_access_type %Self.25f [symbolic]
  1306. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1307. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1308. // CHECK:STDOUT: %impl_witness.db8: <witness> = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(%T) [symbolic]
  1309. // CHECK:STDOUT: %Op.type.f99: type = fn_type @Op.2, @impl.f92(%T) [symbolic]
  1310. // CHECK:STDOUT: %Op.05a: %Op.type.f99 = struct_value () [symbolic]
  1311. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
  1312. // CHECK:STDOUT: %impl_witness.3ea: <witness> = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(type) [concrete]
  1313. // CHECK:STDOUT: %impl_witness.b81: <witness> = impl_witness (imports.%Core.import_ref.bd4), @impl.f92(%T) [symbolic]
  1314. // CHECK:STDOUT: %Op.type.eb8: type = fn_type @Op.2, @impl.f92(type) [concrete]
  1315. // CHECK:STDOUT: %Op.444: %Op.type.eb8 = struct_value () [concrete]
  1316. // CHECK:STDOUT: %complete_type.473: <witness> = complete_type_witness type [concrete]
  1317. // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, (%impl_witness.3ea) [concrete]
  1318. // CHECK:STDOUT: %.2ac: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete]
  1319. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %A.type, %Op.444 [concrete]
  1320. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.444, @Op.2(type) [concrete]
  1321. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %A.type, %Op.specific_fn [concrete]
  1322. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  1323. // CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  1324. // CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic]
  1325. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  1326. // CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
  1327. // CHECK:STDOUT: %Convert.42e: %Convert.type.275 = struct_value () [symbolic]
  1328. // CHECK:STDOUT: %Self.as_type.40a: type = facet_access_type %Self.519 [symbolic]
  1329. // CHECK:STDOUT: %ImplicitAs.assoc_type.ca0: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  1330. // CHECK:STDOUT: %assoc0.9f5: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic]
  1331. // CHECK:STDOUT: %ImplicitAs.type.2d2: type = facet_type <@ImplicitAs, @ImplicitAs(%A.type)> [concrete]
  1332. // CHECK:STDOUT: %Self.56d: %ImplicitAs.type.2d2 = bind_symbolic_name Self, 1 [symbolic]
  1333. // CHECK:STDOUT: %Convert.type.597: type = fn_type @Convert, @ImplicitAs(%A.type) [concrete]
  1334. // CHECK:STDOUT: %Convert.d1e: %Convert.type.597 = struct_value () [concrete]
  1335. // CHECK:STDOUT: %ImplicitAs.assoc_type.aa4: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%A.type) [concrete]
  1336. // CHECK:STDOUT: %assoc0.f00: %ImplicitAs.assoc_type.aa4 = assoc_entity element0, imports.%Core.import_ref.1c7 [concrete]
  1337. // CHECK:STDOUT: %assoc0.dc0: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.207 [symbolic]
  1338. // CHECK:STDOUT: }
  1339. // CHECK:STDOUT:
  1340. // CHECK:STDOUT: imports {
  1341. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1342. // CHECK:STDOUT: .BitAnd = %Core.BitAnd
  1343. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1344. // CHECK:STDOUT: import Core//prelude
  1345. // CHECK:STDOUT: }
  1346. // CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst101 [no loc], unloaded
  1347. // CHECK:STDOUT: %Core.import_ref.a46: %BitAnd.assoc_type = import_ref Core//prelude, loc18_41, loaded [concrete = constants.%assoc0.d45]
  1348. // CHECK:STDOUT: %Core.Op = import_ref Core//prelude, Op, unloaded
  1349. // CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//prelude, inst101 [no loc], loaded [symbolic = constants.%Self.25f]
  1350. // CHECK:STDOUT: %Core.import_ref.51c: <witness> = import_ref Core//prelude, loc21_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)]
  1351. // CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)]
  1352. // CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.f92.%T (constants.%T)]
  1353. // CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type]
  1354. // CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//prelude, loc22_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)]
  1355. // CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)]
  1356. // CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
  1357. // CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//prelude, inst66 [no loc], unloaded
  1358. // CHECK:STDOUT: %Core.import_ref.492: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.dc0)]
  1359. // CHECK:STDOUT: %Core.Convert = import_ref Core//prelude, Convert, unloaded
  1360. // CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
  1361. // CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//prelude, inst66 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)]
  1362. // CHECK:STDOUT: %Core.import_ref.1c7: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)]
  1363. // CHECK:STDOUT: }
  1364. // CHECK:STDOUT:
  1365. // CHECK:STDOUT: file {
  1366. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1367. // CHECK:STDOUT: .Core = imports.%Core
  1368. // CHECK:STDOUT: .A = %A.decl
  1369. // CHECK:STDOUT: .C = %C.decl
  1370. // CHECK:STDOUT: .Fails = %Fails.decl
  1371. // CHECK:STDOUT: }
  1372. // CHECK:STDOUT: %Core.import = import Core
  1373. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  1374. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1375. // CHECK:STDOUT: impl_decl @impl.77d [concrete] {} {
  1376. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1377. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1378. // CHECK:STDOUT: }
  1379. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.77d.%G.decl) [concrete = constants.%impl_witness.a7a]
  1380. // CHECK:STDOUT: %Fails.decl: %Fails.type = fn_decl @Fails [concrete = constants.%Fails] {} {}
  1381. // CHECK:STDOUT: }
  1382. // CHECK:STDOUT:
  1383. // CHECK:STDOUT: interface @A {
  1384. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.31d]
  1385. // CHECK:STDOUT: %G.decl: %G.type.c3a = fn_decl @G.1 [concrete = constants.%G.11a] {} {}
  1386. // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, %G.decl [concrete = constants.%assoc0.d52]
  1387. // CHECK:STDOUT:
  1388. // CHECK:STDOUT: !members:
  1389. // CHECK:STDOUT: .Self = %Self
  1390. // CHECK:STDOUT: .G = %assoc0
  1391. // CHECK:STDOUT: witness = (%G.decl)
  1392. // CHECK:STDOUT: }
  1393. // CHECK:STDOUT:
  1394. // CHECK:STDOUT: interface @BitAnd [from "include_files/facet_types.carbon"] {
  1395. // CHECK:STDOUT: !members:
  1396. // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0
  1397. // CHECK:STDOUT: .Op = imports.%Core.import_ref.a46
  1398. // CHECK:STDOUT: witness = (imports.%Core.Op)
  1399. // CHECK:STDOUT: }
  1400. // CHECK:STDOUT:
  1401. // CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.3: type) [from "include_files/facet_types.carbon"] {
  1402. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  1403. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  1404. // CHECK:STDOUT:
  1405. // CHECK:STDOUT: !definition:
  1406. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
  1407. // CHECK:STDOUT: %Self: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
  1408. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.275)]
  1409. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = struct_value () [symbolic = %Convert (constants.%Convert.42e)]
  1410. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.ca0)]
  1411. // CHECK:STDOUT: %assoc0: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic = %assoc0 (constants.%assoc0.9f5)]
  1412. // CHECK:STDOUT:
  1413. // CHECK:STDOUT: interface {
  1414. // CHECK:STDOUT: !members:
  1415. // CHECK:STDOUT: .Self = imports.%Core.import_ref.ff5
  1416. // CHECK:STDOUT: .Convert = imports.%Core.import_ref.492
  1417. // CHECK:STDOUT: witness = (imports.%Core.Convert)
  1418. // CHECK:STDOUT: }
  1419. // CHECK:STDOUT: }
  1420. // CHECK:STDOUT:
  1421. // CHECK:STDOUT: impl @impl.77d: %C.ref as %A.ref {
  1422. // CHECK:STDOUT: %G.decl: %G.type.486 = fn_decl @G.2 [concrete = constants.%G.001] {} {}
  1423. // CHECK:STDOUT:
  1424. // CHECK:STDOUT: !members:
  1425. // CHECK:STDOUT: .G = %G.decl
  1426. // CHECK:STDOUT: witness = file.%impl_witness
  1427. // CHECK:STDOUT: }
  1428. // CHECK:STDOUT:
  1429. // CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "include_files/facet_types.carbon"] {
  1430. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1431. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  1432. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(%T) [symbolic = %impl_witness (constants.%impl_witness.db8)]
  1433. // CHECK:STDOUT:
  1434. // CHECK:STDOUT: !definition:
  1435. // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl.f92(%T) [symbolic = %Op.type (constants.%Op.type.f99)]
  1436. // CHECK:STDOUT: %Op: @impl.f92.%Op.type (%Op.type.f99) = struct_value () [symbolic = %Op (constants.%Op.05a)]
  1437. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.f92.%T (%T) [symbolic = %require_complete (constants.%require_complete)]
  1438. // CHECK:STDOUT:
  1439. // CHECK:STDOUT: impl: imports.%Core.import_ref.583 as imports.%Core.import_ref.9c1 {
  1440. // CHECK:STDOUT: !members:
  1441. // CHECK:STDOUT: witness = imports.%Core.import_ref.51c
  1442. // CHECK:STDOUT: }
  1443. // CHECK:STDOUT: }
  1444. // CHECK:STDOUT:
  1445. // CHECK:STDOUT: class @C {
  1446. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  1447. // CHECK:STDOUT: complete_type_witness = %complete_type
  1448. // CHECK:STDOUT:
  1449. // CHECK:STDOUT: !members:
  1450. // CHECK:STDOUT: .Self = constants.%C
  1451. // CHECK:STDOUT: }
  1452. // CHECK:STDOUT:
  1453. // CHECK:STDOUT: generic fn @G.1(@A.%Self: %A.type) {
  1454. // CHECK:STDOUT: fn();
  1455. // CHECK:STDOUT: }
  1456. // CHECK:STDOUT:
  1457. // CHECK:STDOUT: fn @G.2() {
  1458. // CHECK:STDOUT: !entry:
  1459. // CHECK:STDOUT: return
  1460. // CHECK:STDOUT: }
  1461. // CHECK:STDOUT:
  1462. // CHECK:STDOUT: fn @Fails() {
  1463. // CHECK:STDOUT: !entry:
  1464. // CHECK:STDOUT: %.loc22_5.1: %empty_struct_type = struct_literal ()
  1465. // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1466. // CHECK:STDOUT: %.loc22_5.2: ref %C = temporary_storage
  1467. // CHECK:STDOUT: %.loc22_5.3: init %C = class_init (), %.loc22_5.2 [concrete = constants.%C.val]
  1468. // CHECK:STDOUT: %.loc22_5.4: ref %C = temporary %.loc22_5.2, %.loc22_5.3
  1469. // CHECK:STDOUT: %.loc22_7: ref %C = converted %.loc22_5.1, %.loc22_5.4
  1470. // CHECK:STDOUT: %A.ref.loc22_15: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1471. // CHECK:STDOUT: %A.ref.loc22_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1472. // CHECK:STDOUT: %impl.elem0.loc22: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444]
  1473. // CHECK:STDOUT: %bound_method.loc22_17.1: <bound method> = bound_method %A.ref.loc22_15, %impl.elem0.loc22 [concrete = constants.%Op.bound]
  1474. // CHECK:STDOUT: %specific_fn.loc22: <specific function> = specific_function %impl.elem0.loc22, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1475. // CHECK:STDOUT: %bound_method.loc22_17.2: <bound method> = bound_method %A.ref.loc22_15, %specific_fn.loc22 [concrete = constants.%bound_method]
  1476. // CHECK:STDOUT: %type.and.loc22: init type = call %bound_method.loc22_17.2(%A.ref.loc22_15, %A.ref.loc22_19) [concrete = constants.%A.type]
  1477. // CHECK:STDOUT: %G.ref.loc22: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1478. // CHECK:STDOUT: %.loc22_12: %A.type = converted %.loc22_7, <error> [concrete = <error>]
  1479. // CHECK:STDOUT: %.loc30_6.1: %empty_struct_type = struct_literal ()
  1480. // CHECK:STDOUT: %C.ref.loc30_11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1481. // CHECK:STDOUT: %.loc30_6.2: ref %C = temporary_storage
  1482. // CHECK:STDOUT: %.loc30_6.3: init %C = class_init (), %.loc30_6.2 [concrete = constants.%C.val]
  1483. // CHECK:STDOUT: %.loc30_6.4: ref %C = temporary %.loc30_6.2, %.loc30_6.3
  1484. // CHECK:STDOUT: %.loc30_8: ref %C = converted %.loc30_6.1, %.loc30_6.4
  1485. // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1486. // CHECK:STDOUT: %A.ref.loc30_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1487. // CHECK:STDOUT: %A.ref.loc30_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1488. // CHECK:STDOUT: %impl.elem0.loc30_26: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444]
  1489. // CHECK:STDOUT: %bound_method.loc30_26.1: <bound method> = bound_method %A.ref.loc30_24, %impl.elem0.loc30_26 [concrete = constants.%Op.bound]
  1490. // CHECK:STDOUT: %specific_fn.loc30_26: <specific function> = specific_function %impl.elem0.loc30_26, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1491. // CHECK:STDOUT: %bound_method.loc30_26.2: <bound method> = bound_method %A.ref.loc30_24, %specific_fn.loc30_26 [concrete = constants.%bound_method]
  1492. // CHECK:STDOUT: %type.and.loc30_26: init type = call %bound_method.loc30_26.2(%A.ref.loc30_24, %A.ref.loc30_28) [concrete = constants.%A.type]
  1493. // CHECK:STDOUT: %.loc30_29.1: type = value_of_initializer %type.and.loc30_26 [concrete = constants.%A.type]
  1494. // CHECK:STDOUT: %.loc30_29.2: type = converted %type.and.loc30_26, %.loc30_29.1 [concrete = constants.%A.type]
  1495. // CHECK:STDOUT: %A.facet.loc30: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet]
  1496. // CHECK:STDOUT: %.loc30_20: %A.type = converted %C.ref.loc30_18, %A.facet.loc30 [concrete = constants.%A.facet]
  1497. // CHECK:STDOUT: %as_type.loc30: type = facet_access_type %.loc30_20 [concrete = constants.%C]
  1498. // CHECK:STDOUT: %.loc30_30: type = converted %.loc30_20, %as_type.loc30 [concrete = constants.%C]
  1499. // CHECK:STDOUT: %A.ref.loc30_35: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1500. // CHECK:STDOUT: %A.ref.loc30_39: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1501. // CHECK:STDOUT: %impl.elem0.loc30_37: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444]
  1502. // CHECK:STDOUT: %bound_method.loc30_37.1: <bound method> = bound_method %A.ref.loc30_35, %impl.elem0.loc30_37 [concrete = constants.%Op.bound]
  1503. // CHECK:STDOUT: %specific_fn.loc30_37: <specific function> = specific_function %impl.elem0.loc30_37, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1504. // CHECK:STDOUT: %bound_method.loc30_37.2: <bound method> = bound_method %A.ref.loc30_35, %specific_fn.loc30_37 [concrete = constants.%bound_method]
  1505. // CHECK:STDOUT: %type.and.loc30_37: init type = call %bound_method.loc30_37.2(%A.ref.loc30_35, %A.ref.loc30_39) [concrete = constants.%A.type]
  1506. // CHECK:STDOUT: %G.ref.loc30: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1507. // CHECK:STDOUT: %.loc30_32: %A.type = converted %.loc30_8, <error> [concrete = <error>]
  1508. // CHECK:STDOUT: %.loc38_6.1: %empty_struct_type = struct_literal ()
  1509. // CHECK:STDOUT: %C.ref.loc38_11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1510. // CHECK:STDOUT: %.loc38_6.2: ref %C = temporary_storage
  1511. // CHECK:STDOUT: %.loc38_6.3: init %C = class_init (), %.loc38_6.2 [concrete = constants.%C.val]
  1512. // CHECK:STDOUT: %.loc38_6.4: ref %C = temporary %.loc38_6.2, %.loc38_6.3
  1513. // CHECK:STDOUT: %.loc38_8: ref %C = converted %.loc38_6.1, %.loc38_6.4
  1514. // CHECK:STDOUT: %C.ref.loc38_18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1515. // CHECK:STDOUT: %A.ref.loc38_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1516. // CHECK:STDOUT: %A.ref.loc38_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1517. // CHECK:STDOUT: %impl.elem0.loc38: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444]
  1518. // CHECK:STDOUT: %bound_method.loc38_26.1: <bound method> = bound_method %A.ref.loc38_24, %impl.elem0.loc38 [concrete = constants.%Op.bound]
  1519. // CHECK:STDOUT: %specific_fn.loc38: <specific function> = specific_function %impl.elem0.loc38, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1520. // CHECK:STDOUT: %bound_method.loc38_26.2: <bound method> = bound_method %A.ref.loc38_24, %specific_fn.loc38 [concrete = constants.%bound_method]
  1521. // CHECK:STDOUT: %type.and.loc38: init type = call %bound_method.loc38_26.2(%A.ref.loc38_24, %A.ref.loc38_28) [concrete = constants.%A.type]
  1522. // CHECK:STDOUT: %.loc38_29.1: type = value_of_initializer %type.and.loc38 [concrete = constants.%A.type]
  1523. // CHECK:STDOUT: %.loc38_29.2: type = converted %type.and.loc38, %.loc38_29.1 [concrete = constants.%A.type]
  1524. // CHECK:STDOUT: %A.facet.loc38: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet]
  1525. // CHECK:STDOUT: %.loc38_20: %A.type = converted %C.ref.loc38_18, %A.facet.loc38 [concrete = constants.%A.facet]
  1526. // CHECK:STDOUT: %as_type.loc38: type = facet_access_type %.loc38_20 [concrete = constants.%C]
  1527. // CHECK:STDOUT: %.loc38_30: type = converted %.loc38_20, %as_type.loc38 [concrete = constants.%C]
  1528. // CHECK:STDOUT: %A.ref.loc38_34: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1529. // CHECK:STDOUT: %G.ref.loc38: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1530. // CHECK:STDOUT: %.loc38_32: %A.type = converted %.loc38_8, <error> [concrete = <error>]
  1531. // CHECK:STDOUT: return
  1532. // CHECK:STDOUT: }
  1533. // CHECK:STDOUT:
  1534. // CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "include_files/facet_types.carbon"] {
  1535. // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.25f)]
  1536. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.19f)]
  1537. // CHECK:STDOUT:
  1538. // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type (%Self.as_type.19f)](%other.param_patt: @Op.1.%Self.as_type (%Self.as_type.19f)) -> @Op.1.%Self.as_type (%Self.as_type.19f);
  1539. // CHECK:STDOUT: }
  1540. // CHECK:STDOUT:
  1541. // CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "include_files/facet_types.carbon"] {
  1542. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1543. // CHECK:STDOUT:
  1544. // CHECK:STDOUT: !definition:
  1545. // CHECK:STDOUT:
  1546. // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and";
  1547. // CHECK:STDOUT: }
  1548. // CHECK:STDOUT:
  1549. // CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "include_files/facet_types.carbon"] {
  1550. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  1551. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
  1552. // CHECK:STDOUT: %Self: @Convert.%ImplicitAs.type (%ImplicitAs.type.d62) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
  1553. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.40a)]
  1554. // CHECK:STDOUT:
  1555. // CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type (%Self.as_type.40a)]() -> @Convert.%Dest (%Dest);
  1556. // CHECK:STDOUT: }
  1557. // CHECK:STDOUT:
  1558. // CHECK:STDOUT: specific @G.1(constants.%Self.31d) {}
  1559. // CHECK:STDOUT:
  1560. // CHECK:STDOUT: specific @G.1(constants.%A.facet) {}
  1561. // CHECK:STDOUT:
  1562. // CHECK:STDOUT: specific @Op.1(constants.%Self.25f) {
  1563. // CHECK:STDOUT: %Self => constants.%Self.25f
  1564. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.19f
  1565. // CHECK:STDOUT: }
  1566. // CHECK:STDOUT:
  1567. // CHECK:STDOUT: specific @impl.f92(constants.%T) {
  1568. // CHECK:STDOUT: %T => constants.%T
  1569. // CHECK:STDOUT: %T.patt => constants.%T.patt
  1570. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.db8
  1571. // CHECK:STDOUT: }
  1572. // CHECK:STDOUT:
  1573. // CHECK:STDOUT: specific @impl.f92(%T) {}
  1574. // CHECK:STDOUT:
  1575. // CHECK:STDOUT: specific @Op.2(constants.%T) {
  1576. // CHECK:STDOUT: %T => constants.%T
  1577. // CHECK:STDOUT: }
  1578. // CHECK:STDOUT:
  1579. // CHECK:STDOUT: specific @impl.f92(type) {
  1580. // CHECK:STDOUT: %T => type
  1581. // CHECK:STDOUT: %T.patt => constants.%T.patt
  1582. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.3ea
  1583. // CHECK:STDOUT:
  1584. // CHECK:STDOUT: !definition:
  1585. // CHECK:STDOUT: %Op.type => constants.%Op.type.eb8
  1586. // CHECK:STDOUT: %Op => constants.%Op.444
  1587. // CHECK:STDOUT: %require_complete => constants.%complete_type.473
  1588. // CHECK:STDOUT: }
  1589. // CHECK:STDOUT:
  1590. // CHECK:STDOUT: specific @Op.2(type) {
  1591. // CHECK:STDOUT: %T => type
  1592. // CHECK:STDOUT:
  1593. // CHECK:STDOUT: !definition:
  1594. // CHECK:STDOUT: }
  1595. // CHECK:STDOUT:
  1596. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  1597. // CHECK:STDOUT: %Dest => constants.%Dest
  1598. // CHECK:STDOUT: %Dest.patt => constants.%Dest.patt
  1599. // CHECK:STDOUT: }
  1600. // CHECK:STDOUT:
  1601. // CHECK:STDOUT: specific @ImplicitAs(%Dest) {}
  1602. // CHECK:STDOUT:
  1603. // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {}
  1604. // CHECK:STDOUT:
  1605. // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.519) {
  1606. // CHECK:STDOUT: %Dest => constants.%Dest
  1607. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d62
  1608. // CHECK:STDOUT: %Self => constants.%Self.519
  1609. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.40a
  1610. // CHECK:STDOUT: }
  1611. // CHECK:STDOUT:
  1612. // CHECK:STDOUT: specific @ImplicitAs(constants.%A.type) {
  1613. // CHECK:STDOUT: %Dest => constants.%A.type
  1614. // CHECK:STDOUT: %Dest.patt => constants.%Dest.patt
  1615. // CHECK:STDOUT:
  1616. // CHECK:STDOUT: !definition:
  1617. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2d2
  1618. // CHECK:STDOUT: %Self => constants.%Self.56d
  1619. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.597
  1620. // CHECK:STDOUT: %Convert => constants.%Convert.d1e
  1621. // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.aa4
  1622. // CHECK:STDOUT: %assoc0 => constants.%assoc0.f00
  1623. // CHECK:STDOUT: }
  1624. // CHECK:STDOUT:
  1625. // CHECK:STDOUT: --- allowed_combine_non_instance.carbon
  1626. // CHECK:STDOUT:
  1627. // CHECK:STDOUT: constants {
  1628. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  1629. // CHECK:STDOUT: %Self.31d: %A.type = bind_symbolic_name Self, 0 [symbolic]
  1630. // CHECK:STDOUT: %G.type.c3a: type = fn_type @G.1 [concrete]
  1631. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1632. // CHECK:STDOUT: %G.11a: %G.type.c3a = struct_value () [concrete]
  1633. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete]
  1634. // CHECK:STDOUT: %assoc0.d52: %A.assoc_type = assoc_entity element0, @A.%G.decl [concrete]
  1635. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1636. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1637. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1638. // CHECK:STDOUT: %impl_witness.a7a: <witness> = impl_witness (@impl.77d.%G.decl) [concrete]
  1639. // CHECK:STDOUT: %G.type.486: type = fn_type @G.2 [concrete]
  1640. // CHECK:STDOUT: %G.001: %G.type.486 = struct_value () [concrete]
  1641. // CHECK:STDOUT: %A.facet: %A.type = facet_value %C, (%impl_witness.a7a) [concrete]
  1642. // CHECK:STDOUT: %Works.type: type = fn_type @Works [concrete]
  1643. // CHECK:STDOUT: %Works: %Works.type = struct_value () [concrete]
  1644. // CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
  1645. // CHECK:STDOUT: %Self.25f: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic]
  1646. // CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type @BitAnd [concrete]
  1647. // CHECK:STDOUT: %assoc0.d45: %BitAnd.assoc_type = assoc_entity element0, imports.%Core.import_ref.a93 [concrete]
  1648. // CHECK:STDOUT: %Op.type.27a: type = fn_type @Op.1 [concrete]
  1649. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.25f [symbolic]
  1650. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1651. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1652. // CHECK:STDOUT: %impl_witness.db8: <witness> = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(%T) [symbolic]
  1653. // CHECK:STDOUT: %Op.type.f99: type = fn_type @Op.2, @impl.f92(%T) [symbolic]
  1654. // CHECK:STDOUT: %Op.05a: %Op.type.f99 = struct_value () [symbolic]
  1655. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
  1656. // CHECK:STDOUT: %impl_witness.3ea: <witness> = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(type) [concrete]
  1657. // CHECK:STDOUT: %impl_witness.b81: <witness> = impl_witness (imports.%Core.import_ref.bd4), @impl.f92(%T) [symbolic]
  1658. // CHECK:STDOUT: %Op.type.eb8: type = fn_type @Op.2, @impl.f92(type) [concrete]
  1659. // CHECK:STDOUT: %Op.444: %Op.type.eb8 = struct_value () [concrete]
  1660. // CHECK:STDOUT: %complete_type.473: <witness> = complete_type_witness type [concrete]
  1661. // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, (%impl_witness.3ea) [concrete]
  1662. // CHECK:STDOUT: %.2ac: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete]
  1663. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %A.type, %Op.444 [concrete]
  1664. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.444, @Op.2(type) [concrete]
  1665. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %A.type, %Op.specific_fn [concrete]
  1666. // CHECK:STDOUT: %.db5: type = fn_type_with_self_type %G.type.c3a, %A.facet [concrete]
  1667. // CHECK:STDOUT: }
  1668. // CHECK:STDOUT:
  1669. // CHECK:STDOUT: imports {
  1670. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1671. // CHECK:STDOUT: .BitAnd = %Core.BitAnd
  1672. // CHECK:STDOUT: import Core//prelude
  1673. // CHECK:STDOUT: }
  1674. // CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst101 [no loc], unloaded
  1675. // CHECK:STDOUT: %Core.import_ref.a46: %BitAnd.assoc_type = import_ref Core//prelude, loc18_41, loaded [concrete = constants.%assoc0.d45]
  1676. // CHECK:STDOUT: %Core.Op = import_ref Core//prelude, Op, unloaded
  1677. // CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//prelude, inst101 [no loc], loaded [symbolic = constants.%Self.25f]
  1678. // CHECK:STDOUT: %Core.import_ref.51c: <witness> = import_ref Core//prelude, loc21_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)]
  1679. // CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)]
  1680. // CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.f92.%T (constants.%T)]
  1681. // CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type]
  1682. // CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//prelude, loc22_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)]
  1683. // CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)]
  1684. // CHECK:STDOUT: }
  1685. // CHECK:STDOUT:
  1686. // CHECK:STDOUT: file {
  1687. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1688. // CHECK:STDOUT: .Core = imports.%Core
  1689. // CHECK:STDOUT: .A = %A.decl
  1690. // CHECK:STDOUT: .C = %C.decl
  1691. // CHECK:STDOUT: .Works = %Works.decl
  1692. // CHECK:STDOUT: }
  1693. // CHECK:STDOUT: %Core.import = import Core
  1694. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  1695. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1696. // CHECK:STDOUT: impl_decl @impl.77d [concrete] {} {
  1697. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1698. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1699. // CHECK:STDOUT: }
  1700. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.77d.%G.decl) [concrete = constants.%impl_witness.a7a]
  1701. // CHECK:STDOUT: %Works.decl: %Works.type = fn_decl @Works [concrete = constants.%Works] {} {}
  1702. // CHECK:STDOUT: }
  1703. // CHECK:STDOUT:
  1704. // CHECK:STDOUT: interface @A {
  1705. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.31d]
  1706. // CHECK:STDOUT: %G.decl: %G.type.c3a = fn_decl @G.1 [concrete = constants.%G.11a] {} {}
  1707. // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, %G.decl [concrete = constants.%assoc0.d52]
  1708. // CHECK:STDOUT:
  1709. // CHECK:STDOUT: !members:
  1710. // CHECK:STDOUT: .Self = %Self
  1711. // CHECK:STDOUT: .G = %assoc0
  1712. // CHECK:STDOUT: witness = (%G.decl)
  1713. // CHECK:STDOUT: }
  1714. // CHECK:STDOUT:
  1715. // CHECK:STDOUT: interface @BitAnd [from "include_files/facet_types.carbon"] {
  1716. // CHECK:STDOUT: !members:
  1717. // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0
  1718. // CHECK:STDOUT: .Op = imports.%Core.import_ref.a46
  1719. // CHECK:STDOUT: witness = (imports.%Core.Op)
  1720. // CHECK:STDOUT: }
  1721. // CHECK:STDOUT:
  1722. // CHECK:STDOUT: impl @impl.77d: %C.ref as %A.ref {
  1723. // CHECK:STDOUT: %G.decl: %G.type.486 = fn_decl @G.2 [concrete = constants.%G.001] {} {}
  1724. // CHECK:STDOUT:
  1725. // CHECK:STDOUT: !members:
  1726. // CHECK:STDOUT: .G = %G.decl
  1727. // CHECK:STDOUT: witness = file.%impl_witness
  1728. // CHECK:STDOUT: }
  1729. // CHECK:STDOUT:
  1730. // CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "include_files/facet_types.carbon"] {
  1731. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1732. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  1733. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(%T) [symbolic = %impl_witness (constants.%impl_witness.db8)]
  1734. // CHECK:STDOUT:
  1735. // CHECK:STDOUT: !definition:
  1736. // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl.f92(%T) [symbolic = %Op.type (constants.%Op.type.f99)]
  1737. // CHECK:STDOUT: %Op: @impl.f92.%Op.type (%Op.type.f99) = struct_value () [symbolic = %Op (constants.%Op.05a)]
  1738. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.f92.%T (%T) [symbolic = %require_complete (constants.%require_complete)]
  1739. // CHECK:STDOUT:
  1740. // CHECK:STDOUT: impl: imports.%Core.import_ref.583 as imports.%Core.import_ref.9c1 {
  1741. // CHECK:STDOUT: !members:
  1742. // CHECK:STDOUT: witness = imports.%Core.import_ref.51c
  1743. // CHECK:STDOUT: }
  1744. // CHECK:STDOUT: }
  1745. // CHECK:STDOUT:
  1746. // CHECK:STDOUT: class @C {
  1747. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  1748. // CHECK:STDOUT: complete_type_witness = %complete_type
  1749. // CHECK:STDOUT:
  1750. // CHECK:STDOUT: !members:
  1751. // CHECK:STDOUT: .Self = constants.%C
  1752. // CHECK:STDOUT: }
  1753. // CHECK:STDOUT:
  1754. // CHECK:STDOUT: generic fn @G.1(@A.%Self: %A.type) {
  1755. // CHECK:STDOUT: fn();
  1756. // CHECK:STDOUT: }
  1757. // CHECK:STDOUT:
  1758. // CHECK:STDOUT: fn @G.2() {
  1759. // CHECK:STDOUT: !entry:
  1760. // CHECK:STDOUT: return
  1761. // CHECK:STDOUT: }
  1762. // CHECK:STDOUT:
  1763. // CHECK:STDOUT: fn @Works() {
  1764. // CHECK:STDOUT: !entry:
  1765. // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1766. // CHECK:STDOUT: %A.ref.loc13_7: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1767. // CHECK:STDOUT: %A.ref.loc13_11: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1768. // CHECK:STDOUT: %impl.elem0.loc13_9: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444]
  1769. // CHECK:STDOUT: %bound_method.loc13_9.1: <bound method> = bound_method %A.ref.loc13_7, %impl.elem0.loc13_9 [concrete = constants.%Op.bound]
  1770. // CHECK:STDOUT: %specific_fn.loc13: <specific function> = specific_function %impl.elem0.loc13_9, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1771. // CHECK:STDOUT: %bound_method.loc13_9.2: <bound method> = bound_method %A.ref.loc13_7, %specific_fn.loc13 [concrete = constants.%bound_method]
  1772. // CHECK:STDOUT: %type.and.loc13: init type = call %bound_method.loc13_9.2(%A.ref.loc13_7, %A.ref.loc13_11) [concrete = constants.%A.type]
  1773. // CHECK:STDOUT: %G.ref.loc13: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1774. // CHECK:STDOUT: %A.facet.loc13: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet]
  1775. // CHECK:STDOUT: %.loc13: %A.type = converted %C.ref.loc13, %A.facet.loc13 [concrete = constants.%A.facet]
  1776. // CHECK:STDOUT: %as_wit.iface0.loc13: <witness> = facet_access_witness %.loc13, element0 [concrete = constants.%impl_witness.a7a]
  1777. // CHECK:STDOUT: %impl.elem0.loc13_4: %.db5 = impl_witness_access %as_wit.iface0.loc13, element0 [concrete = constants.%G.001]
  1778. // CHECK:STDOUT: %G.call.loc13: init %empty_tuple.type = call %impl.elem0.loc13_4()
  1779. // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1780. // CHECK:STDOUT: %A.ref.loc14_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1781. // CHECK:STDOUT: %A.ref.loc14_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1782. // CHECK:STDOUT: %impl.elem0.loc14_12: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444]
  1783. // CHECK:STDOUT: %bound_method.loc14_12.1: <bound method> = bound_method %A.ref.loc14_10, %impl.elem0.loc14_12 [concrete = constants.%Op.bound]
  1784. // CHECK:STDOUT: %specific_fn.loc14_12: <specific function> = specific_function %impl.elem0.loc14_12, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1785. // CHECK:STDOUT: %bound_method.loc14_12.2: <bound method> = bound_method %A.ref.loc14_10, %specific_fn.loc14_12 [concrete = constants.%bound_method]
  1786. // CHECK:STDOUT: %type.and.loc14_12: init type = call %bound_method.loc14_12.2(%A.ref.loc14_10, %A.ref.loc14_14) [concrete = constants.%A.type]
  1787. // CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %type.and.loc14_12 [concrete = constants.%A.type]
  1788. // CHECK:STDOUT: %.loc14_15.2: type = converted %type.and.loc14_12, %.loc14_15.1 [concrete = constants.%A.type]
  1789. // CHECK:STDOUT: %A.facet.loc14: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet]
  1790. // CHECK:STDOUT: %.loc14_6: %A.type = converted %C.ref.loc14, %A.facet.loc14 [concrete = constants.%A.facet]
  1791. // CHECK:STDOUT: %A.ref.loc14_20: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1792. // CHECK:STDOUT: %A.ref.loc14_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1793. // CHECK:STDOUT: %impl.elem0.loc14_22: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444]
  1794. // CHECK:STDOUT: %bound_method.loc14_22.1: <bound method> = bound_method %A.ref.loc14_20, %impl.elem0.loc14_22 [concrete = constants.%Op.bound]
  1795. // CHECK:STDOUT: %specific_fn.loc14_22: <specific function> = specific_function %impl.elem0.loc14_22, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1796. // CHECK:STDOUT: %bound_method.loc14_22.2: <bound method> = bound_method %A.ref.loc14_20, %specific_fn.loc14_22 [concrete = constants.%bound_method]
  1797. // CHECK:STDOUT: %type.and.loc14_22: init type = call %bound_method.loc14_22.2(%A.ref.loc14_20, %A.ref.loc14_24) [concrete = constants.%A.type]
  1798. // CHECK:STDOUT: %G.ref.loc14: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1799. // CHECK:STDOUT: %as_wit.iface0.loc14: <witness> = facet_access_witness %.loc14_6, element0 [concrete = constants.%impl_witness.a7a]
  1800. // CHECK:STDOUT: %impl.elem0.loc14_17: %.db5 = impl_witness_access %as_wit.iface0.loc14, element0 [concrete = constants.%G.001]
  1801. // CHECK:STDOUT: %G.call.loc14: init %empty_tuple.type = call %impl.elem0.loc14_17()
  1802. // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1803. // CHECK:STDOUT: %A.ref.loc15_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1804. // CHECK:STDOUT: %A.ref.loc15_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1805. // CHECK:STDOUT: %impl.elem0.loc15_12: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444]
  1806. // CHECK:STDOUT: %bound_method.loc15_12.1: <bound method> = bound_method %A.ref.loc15_10, %impl.elem0.loc15_12 [concrete = constants.%Op.bound]
  1807. // CHECK:STDOUT: %specific_fn.loc15: <specific function> = specific_function %impl.elem0.loc15_12, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1808. // CHECK:STDOUT: %bound_method.loc15_12.2: <bound method> = bound_method %A.ref.loc15_10, %specific_fn.loc15 [concrete = constants.%bound_method]
  1809. // CHECK:STDOUT: %type.and.loc15: init type = call %bound_method.loc15_12.2(%A.ref.loc15_10, %A.ref.loc15_14) [concrete = constants.%A.type]
  1810. // CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %type.and.loc15 [concrete = constants.%A.type]
  1811. // CHECK:STDOUT: %.loc15_15.2: type = converted %type.and.loc15, %.loc15_15.1 [concrete = constants.%A.type]
  1812. // CHECK:STDOUT: %A.facet.loc15: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet]
  1813. // CHECK:STDOUT: %.loc15_6: %A.type = converted %C.ref.loc15, %A.facet.loc15 [concrete = constants.%A.facet]
  1814. // CHECK:STDOUT: %A.ref.loc15_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1815. // CHECK:STDOUT: %G.ref.loc15: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1816. // CHECK:STDOUT: %as_wit.iface0.loc15: <witness> = facet_access_witness %.loc15_6, element0 [concrete = constants.%impl_witness.a7a]
  1817. // CHECK:STDOUT: %impl.elem0.loc15_17: %.db5 = impl_witness_access %as_wit.iface0.loc15, element0 [concrete = constants.%G.001]
  1818. // CHECK:STDOUT: %G.call.loc15: init %empty_tuple.type = call %impl.elem0.loc15_17()
  1819. // CHECK:STDOUT: return
  1820. // CHECK:STDOUT: }
  1821. // CHECK:STDOUT:
  1822. // CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "include_files/facet_types.carbon"] {
  1823. // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.25f)]
  1824. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  1825. // CHECK:STDOUT:
  1826. // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type (%Self.as_type)](%other.param_patt: @Op.1.%Self.as_type (%Self.as_type)) -> @Op.1.%Self.as_type (%Self.as_type);
  1827. // CHECK:STDOUT: }
  1828. // CHECK:STDOUT:
  1829. // CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "include_files/facet_types.carbon"] {
  1830. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1831. // CHECK:STDOUT:
  1832. // CHECK:STDOUT: !definition:
  1833. // CHECK:STDOUT:
  1834. // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and";
  1835. // CHECK:STDOUT: }
  1836. // CHECK:STDOUT:
  1837. // CHECK:STDOUT: specific @G.1(constants.%Self.31d) {}
  1838. // CHECK:STDOUT:
  1839. // CHECK:STDOUT: specific @G.1(constants.%A.facet) {}
  1840. // CHECK:STDOUT:
  1841. // CHECK:STDOUT: specific @Op.1(constants.%Self.25f) {
  1842. // CHECK:STDOUT: %Self => constants.%Self.25f
  1843. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  1844. // CHECK:STDOUT: }
  1845. // CHECK:STDOUT:
  1846. // CHECK:STDOUT: specific @impl.f92(constants.%T) {
  1847. // CHECK:STDOUT: %T => constants.%T
  1848. // CHECK:STDOUT: %T.patt => constants.%T.patt
  1849. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.db8
  1850. // CHECK:STDOUT: }
  1851. // CHECK:STDOUT:
  1852. // CHECK:STDOUT: specific @impl.f92(%T) {}
  1853. // CHECK:STDOUT:
  1854. // CHECK:STDOUT: specific @Op.2(constants.%T) {
  1855. // CHECK:STDOUT: %T => constants.%T
  1856. // CHECK:STDOUT: }
  1857. // CHECK:STDOUT:
  1858. // CHECK:STDOUT: specific @impl.f92(type) {
  1859. // CHECK:STDOUT: %T => type
  1860. // CHECK:STDOUT: %T.patt => constants.%T.patt
  1861. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.3ea
  1862. // CHECK:STDOUT:
  1863. // CHECK:STDOUT: !definition:
  1864. // CHECK:STDOUT: %Op.type => constants.%Op.type.eb8
  1865. // CHECK:STDOUT: %Op => constants.%Op.444
  1866. // CHECK:STDOUT: %require_complete => constants.%complete_type.473
  1867. // CHECK:STDOUT: }
  1868. // CHECK:STDOUT:
  1869. // CHECK:STDOUT: specific @Op.2(type) {
  1870. // CHECK:STDOUT: %T => type
  1871. // CHECK:STDOUT:
  1872. // CHECK:STDOUT: !definition:
  1873. // CHECK:STDOUT: }
  1874. // CHECK:STDOUT:
  1875. // CHECK:STDOUT: --- include_files/facet_types.carbon
  1876. // CHECK:STDOUT:
  1877. // CHECK:STDOUT: constants {
  1878. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  1879. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  1880. // CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete]
  1881. // CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete]
  1882. // CHECK:STDOUT: %As.type.8ba: type = facet_type <@As, @As(%Dest)> [symbolic]
  1883. // CHECK:STDOUT: %Self.b4e: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic]
  1884. // CHECK:STDOUT: %Self.as_type.7f0: type = facet_access_type %Self.b4e [symbolic]
  1885. // CHECK:STDOUT: %Convert.type.ad1: type = fn_type @Convert.1, @As(%Dest) [symbolic]
  1886. // CHECK:STDOUT: %Convert.0ed: %Convert.type.ad1 = struct_value () [symbolic]
  1887. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As, @As(%Dest) [symbolic]
  1888. // CHECK:STDOUT: %assoc0.1d5: %As.assoc_type = assoc_entity element0, @As.%Convert.decl [symbolic]
  1889. // CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete]
  1890. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete]
  1891. // CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  1892. // CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic]
  1893. // CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic]
  1894. // CHECK:STDOUT: %Convert.type.4cf: type = fn_type @Convert.2, @ImplicitAs(%Dest) [symbolic]
  1895. // CHECK:STDOUT: %Convert.147: %Convert.type.4cf = struct_value () [symbolic]
  1896. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  1897. // CHECK:STDOUT: %assoc0.8f8: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic]
  1898. // CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
  1899. // CHECK:STDOUT: %Self.e44: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic]
  1900. // CHECK:STDOUT: %Self.as_type.560: type = facet_access_type %Self.e44 [symbolic]
  1901. // CHECK:STDOUT: %Op.type.613: type = fn_type @Op.1 [concrete]
  1902. // CHECK:STDOUT: %Op.d98: %Op.type.613 = struct_value () [concrete]
  1903. // CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type @BitAnd [concrete]
  1904. // CHECK:STDOUT: %assoc0.220: %BitAnd.assoc_type = assoc_entity element0, @BitAnd.%Op.decl [concrete]
  1905. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1906. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1907. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl), @impl(%T) [symbolic]
  1908. // CHECK:STDOUT: %Op.type.28d: type = fn_type @Op.2, @impl(%T) [symbolic]
  1909. // CHECK:STDOUT: %Op.902: %Op.type.28d = struct_value () [symbolic]
  1910. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
  1911. // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value %T, (%impl_witness) [symbolic]
  1912. // CHECK:STDOUT: }
  1913. // CHECK:STDOUT:
  1914. // CHECK:STDOUT: file {
  1915. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1916. // CHECK:STDOUT: .As = %As.decl
  1917. // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
  1918. // CHECK:STDOUT: .BitAnd = %BitAnd.decl
  1919. // CHECK:STDOUT: }
  1920. // CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] {
  1921. // CHECK:STDOUT: %Dest.patt.loc9_14.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc9_14.2 (constants.%Dest.patt)]
  1922. // CHECK:STDOUT: } {
  1923. // CHECK:STDOUT: %Dest.loc9_14.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc9_14.2 (constants.%Dest)]
  1924. // CHECK:STDOUT: }
  1925. // CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] {
  1926. // CHECK:STDOUT: %Dest.patt.loc13_22.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc13_22.2 (constants.%Dest.patt)]
  1927. // CHECK:STDOUT: } {
  1928. // CHECK:STDOUT: %Dest.loc13_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc13_22.2 (constants.%Dest)]
  1929. // CHECK:STDOUT: }
  1930. // CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [concrete = constants.%BitAnd.type] {} {}
  1931. // CHECK:STDOUT: impl_decl @impl [concrete] {
  1932. // CHECK:STDOUT: %T.patt.loc21_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)]
  1933. // CHECK:STDOUT: } {
  1934. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T)]
  1935. // CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, file.%BitAnd.decl [concrete = constants.%BitAnd.type]
  1936. // CHECK:STDOUT: %T.loc21_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)]
  1937. // CHECK:STDOUT: }
  1938. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)]
  1939. // CHECK:STDOUT: }
  1940. // CHECK:STDOUT:
  1941. // CHECK:STDOUT: generic interface @As(%Dest.loc9_14.1: type) {
  1942. // CHECK:STDOUT: %Dest.loc9_14.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc9_14.2 (constants.%Dest)]
  1943. // CHECK:STDOUT: %Dest.patt.loc9_14.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc9_14.2 (constants.%Dest.patt)]
  1944. // CHECK:STDOUT:
  1945. // CHECK:STDOUT: !definition:
  1946. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest.loc9_14.2)> [symbolic = %As.type (constants.%As.type.8ba)]
  1947. // CHECK:STDOUT: %Self.2: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)]
  1948. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest.loc9_14.2) [symbolic = %Convert.type (constants.%Convert.type.ad1)]
  1949. // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.ad1) = struct_value () [symbolic = %Convert (constants.%Convert.0ed)]
  1950. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As, @As(%Dest.loc9_14.2) [symbolic = %As.assoc_type (constants.%As.assoc_type)]
  1951. // CHECK:STDOUT: %assoc0.loc10_35.2: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc10_35.2 (constants.%assoc0.1d5)]
  1952. // CHECK:STDOUT:
  1953. // CHECK:STDOUT: interface {
  1954. // CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)]
  1955. // CHECK:STDOUT: %Convert.decl: @As.%Convert.type (%Convert.type.ad1) = fn_decl @Convert.1 [symbolic = @As.%Convert (constants.%Convert.0ed)] {
  1956. // CHECK:STDOUT: %self.patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = binding_pattern self
  1957. // CHECK:STDOUT: %self.param_patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = value_param_pattern %self.patt, call_param0
  1958. // CHECK:STDOUT: %return.patt: @Convert.1.%Dest (%Dest) = return_slot_pattern
  1959. // CHECK:STDOUT: %return.param_patt: @Convert.1.%Dest (%Dest) = out_param_pattern %return.patt, call_param1
  1960. // CHECK:STDOUT: } {
  1961. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @As.%Dest.loc9_14.1 [symbolic = %Dest (constants.%Dest)]
  1962. // CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = value_param call_param0
  1963. // CHECK:STDOUT: %.loc10_20.1: type = splice_block %.loc10_20.3 [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] {
  1964. // CHECK:STDOUT: %.loc10_20.2: @Convert.1.%As.type (%As.type.8ba) = specific_constant @As.%Self.1, @As(constants.%Dest) [symbolic = %Self (constants.%Self.b4e)]
  1965. // CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.8ba) = name_ref Self, %.loc10_20.2 [symbolic = %Self (constants.%Self.b4e)]
  1966. // CHECK:STDOUT: %Self.as_type.loc10_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)]
  1967. // CHECK:STDOUT: %.loc10_20.3: type = converted %Self.ref, %Self.as_type.loc10_20.2 [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)]
  1968. // CHECK:STDOUT: }
  1969. // CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = bind_name self, %self.param
  1970. // CHECK:STDOUT: %return.param: ref @Convert.1.%Dest (%Dest) = out_param call_param1
  1971. // CHECK:STDOUT: %return: ref @Convert.1.%Dest (%Dest) = return_slot %return.param
  1972. // CHECK:STDOUT: }
  1973. // CHECK:STDOUT: %assoc0.loc10_35.1: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc10_35.2 (constants.%assoc0.1d5)]
  1974. // CHECK:STDOUT:
  1975. // CHECK:STDOUT: !members:
  1976. // CHECK:STDOUT: .Self = %Self.1
  1977. // CHECK:STDOUT: .Dest = <poisoned>
  1978. // CHECK:STDOUT: .Convert = %assoc0.loc10_35.1
  1979. // CHECK:STDOUT: witness = (%Convert.decl)
  1980. // CHECK:STDOUT: }
  1981. // CHECK:STDOUT: }
  1982. // CHECK:STDOUT:
  1983. // CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc13_22.1: type) {
  1984. // CHECK:STDOUT: %Dest.loc13_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc13_22.2 (constants.%Dest)]
  1985. // CHECK:STDOUT: %Dest.patt.loc13_22.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc13_22.2 (constants.%Dest.patt)]
  1986. // CHECK:STDOUT:
  1987. // CHECK:STDOUT: !definition:
  1988. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc13_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  1989. // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
  1990. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%Dest.loc13_22.2) [symbolic = %Convert.type (constants.%Convert.type.4cf)]
  1991. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.4cf) = struct_value () [symbolic = %Convert (constants.%Convert.147)]
  1992. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest.loc13_22.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)]
  1993. // CHECK:STDOUT: %assoc0.loc14_35.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.8f8)]
  1994. // CHECK:STDOUT:
  1995. // CHECK:STDOUT: interface {
  1996. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
  1997. // CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.4cf) = fn_decl @Convert.2 [symbolic = @ImplicitAs.%Convert (constants.%Convert.147)] {
  1998. // CHECK:STDOUT: %self.patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = binding_pattern self
  1999. // CHECK:STDOUT: %self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0
  2000. // CHECK:STDOUT: %return.patt: @Convert.2.%Dest (%Dest) = return_slot_pattern
  2001. // CHECK:STDOUT: %return.param_patt: @Convert.2.%Dest (%Dest) = out_param_pattern %return.patt, call_param1
  2002. // CHECK:STDOUT: } {
  2003. // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc13_22.1 [symbolic = %Dest (constants.%Dest)]
  2004. // CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param call_param0
  2005. // CHECK:STDOUT: %.loc14_20.1: type = splice_block %.loc14_20.3 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] {
  2006. // CHECK:STDOUT: %.loc14_20.2: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self.0f3)]
  2007. // CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc14_20.2 [symbolic = %Self (constants.%Self.0f3)]
  2008. // CHECK:STDOUT: %Self.as_type.loc14_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)]
  2009. // CHECK:STDOUT: %.loc14_20.3: type = converted %Self.ref, %Self.as_type.loc14_20.2 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)]
  2010. // CHECK:STDOUT: }
  2011. // CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = bind_name self, %self.param
  2012. // CHECK:STDOUT: %return.param: ref @Convert.2.%Dest (%Dest) = out_param call_param1
  2013. // CHECK:STDOUT: %return: ref @Convert.2.%Dest (%Dest) = return_slot %return.param
  2014. // CHECK:STDOUT: }
  2015. // CHECK:STDOUT: %assoc0.loc14_35.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.8f8)]
  2016. // CHECK:STDOUT:
  2017. // CHECK:STDOUT: !members:
  2018. // CHECK:STDOUT: .Self = %Self.1
  2019. // CHECK:STDOUT: .Dest = <poisoned>
  2020. // CHECK:STDOUT: .Convert = %assoc0.loc14_35.1
  2021. // CHECK:STDOUT: witness = (%Convert.decl)
  2022. // CHECK:STDOUT: }
  2023. // CHECK:STDOUT: }
  2024. // CHECK:STDOUT:
  2025. // CHECK:STDOUT: interface @BitAnd {
  2026. // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.e44]
  2027. // CHECK:STDOUT: %Op.decl: %Op.type.613 = fn_decl @Op.1 [concrete = constants.%Op.d98] {
  2028. // CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = binding_pattern self
  2029. // CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param_pattern %self.patt, call_param0
  2030. // CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = binding_pattern other
  2031. // CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param_pattern %other.patt, call_param1
  2032. // CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = return_slot_pattern
  2033. // CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = out_param_pattern %return.patt, call_param2
  2034. // CHECK:STDOUT: } {
  2035. // CHECK:STDOUT: %Self.ref.loc18_37: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)]
  2036. // CHECK:STDOUT: %Self.as_type.loc18_37: type = facet_access_type %Self.ref.loc18_37 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)]
  2037. // CHECK:STDOUT: %.loc18_37: type = converted %Self.ref.loc18_37, %Self.as_type.loc18_37 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)]
  2038. // CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param call_param0
  2039. // CHECK:STDOUT: %.loc18_15.1: type = splice_block %.loc18_15.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] {
  2040. // CHECK:STDOUT: %Self.ref.loc18_15: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)]
  2041. // CHECK:STDOUT: %Self.as_type.loc18_15.2: type = facet_access_type %Self.ref.loc18_15 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)]
  2042. // CHECK:STDOUT: %.loc18_15.2: type = converted %Self.ref.loc18_15, %Self.as_type.loc18_15.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)]
  2043. // CHECK:STDOUT: }
  2044. // CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = bind_name self, %self.param
  2045. // CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param call_param1
  2046. // CHECK:STDOUT: %.loc18_28.1: type = splice_block %.loc18_28.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] {
  2047. // CHECK:STDOUT: %Self.ref.loc18_28: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)]
  2048. // CHECK:STDOUT: %Self.as_type.loc18_28: type = facet_access_type %Self.ref.loc18_28 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)]
  2049. // CHECK:STDOUT: %.loc18_28.2: type = converted %Self.ref.loc18_28, %Self.as_type.loc18_28 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)]
  2050. // CHECK:STDOUT: }
  2051. // CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = bind_name other, %other.param
  2052. // CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = out_param call_param2
  2053. // CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = return_slot %return.param
  2054. // CHECK:STDOUT: }
  2055. // CHECK:STDOUT: %assoc0: %BitAnd.assoc_type = assoc_entity element0, %Op.decl [concrete = constants.%assoc0.220]
  2056. // CHECK:STDOUT:
  2057. // CHECK:STDOUT: !members:
  2058. // CHECK:STDOUT: .Self = %Self
  2059. // CHECK:STDOUT: .Op = %assoc0
  2060. // CHECK:STDOUT: witness = (%Op.decl)
  2061. // CHECK:STDOUT: }
  2062. // CHECK:STDOUT:
  2063. // CHECK:STDOUT: generic impl @impl(%T.loc21_14.1: type) {
  2064. // CHECK:STDOUT: %T.loc21_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)]
  2065. // CHECK:STDOUT: %T.patt.loc21_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)]
  2066. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (%Op.decl), @impl(%T.loc21_14.2) [symbolic = %impl_witness (constants.%impl_witness)]
  2067. // CHECK:STDOUT:
  2068. // CHECK:STDOUT: !definition:
  2069. // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%T.loc21_14.2) [symbolic = %Op.type (constants.%Op.type.28d)]
  2070. // CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.28d) = struct_value () [symbolic = %Op (constants.%Op.902)]
  2071. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.%T.loc21_14.2 (%T) [symbolic = %require_complete (constants.%require_complete)]
  2072. // CHECK:STDOUT:
  2073. // CHECK:STDOUT: impl: %T.ref as %BitAnd.ref {
  2074. // CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.28d) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.902)] {
  2075. // CHECK:STDOUT: %self.patt: @Op.2.%T (%T) = binding_pattern self
  2076. // CHECK:STDOUT: %self.param_patt: @Op.2.%T (%T) = value_param_pattern %self.patt, call_param0
  2077. // CHECK:STDOUT: %other.patt: @Op.2.%T (%T) = binding_pattern other
  2078. // CHECK:STDOUT: %other.param_patt: @Op.2.%T (%T) = value_param_pattern %other.patt, call_param1
  2079. // CHECK:STDOUT: %return.patt: @Op.2.%T (%T) = return_slot_pattern
  2080. // CHECK:STDOUT: %return.param_patt: @Op.2.%T (%T) = out_param_pattern %return.patt, call_param2
  2081. // CHECK:STDOUT: } {
  2082. // CHECK:STDOUT: %Self.ref.loc22_37: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)]
  2083. // CHECK:STDOUT: %self.param: @Op.2.%T (%T) = value_param call_param0
  2084. // CHECK:STDOUT: %Self.ref.loc22_15: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)]
  2085. // CHECK:STDOUT: %self: @Op.2.%T (%T) = bind_name self, %self.param
  2086. // CHECK:STDOUT: %other.param: @Op.2.%T (%T) = value_param call_param1
  2087. // CHECK:STDOUT: %Self.ref.loc22_28: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)]
  2088. // CHECK:STDOUT: %other: @Op.2.%T (%T) = bind_name other, %other.param
  2089. // CHECK:STDOUT: %return.param: ref @Op.2.%T (%T) = out_param call_param2
  2090. // CHECK:STDOUT: %return: ref @Op.2.%T (%T) = return_slot %return.param
  2091. // CHECK:STDOUT: }
  2092. // CHECK:STDOUT:
  2093. // CHECK:STDOUT: !members:
  2094. // CHECK:STDOUT: .Op = %Op.decl
  2095. // CHECK:STDOUT: witness = file.%impl_witness
  2096. // CHECK:STDOUT: }
  2097. // CHECK:STDOUT: }
  2098. // CHECK:STDOUT:
  2099. // CHECK:STDOUT: generic fn @Convert.1(@As.%Dest.loc9_14.1: type, @As.%Self.1: @As.%As.type (%As.type.8ba)) {
  2100. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  2101. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.8ba)]
  2102. // CHECK:STDOUT: %Self: @Convert.1.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b4e)]
  2103. // CHECK:STDOUT: %Self.as_type.loc10_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)]
  2104. // CHECK:STDOUT:
  2105. // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0)]() -> @Convert.1.%Dest (%Dest);
  2106. // CHECK:STDOUT: }
  2107. // CHECK:STDOUT:
  2108. // CHECK:STDOUT: generic fn @Convert.2(@ImplicitAs.%Dest.loc13_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) {
  2109. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  2110. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
  2111. // CHECK:STDOUT: %Self: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)]
  2112. // CHECK:STDOUT: %Self.as_type.loc14_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)]
  2113. // CHECK:STDOUT:
  2114. // CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419)]() -> @Convert.2.%Dest (%Dest);
  2115. // CHECK:STDOUT: }
  2116. // CHECK:STDOUT:
  2117. // CHECK:STDOUT: generic fn @Op.1(@BitAnd.%Self: %BitAnd.type) {
  2118. // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.e44)]
  2119. // CHECK:STDOUT: %Self.as_type.loc18_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)]
  2120. // CHECK:STDOUT:
  2121. // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560)](%other.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560)) -> @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560);
  2122. // CHECK:STDOUT: }
  2123. // CHECK:STDOUT:
  2124. // CHECK:STDOUT: generic fn @Op.2(@impl.%T.loc21_14.1: type) {
  2125. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  2126. // CHECK:STDOUT:
  2127. // CHECK:STDOUT: !definition:
  2128. // CHECK:STDOUT:
  2129. // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and";
  2130. // CHECK:STDOUT: }
  2131. // CHECK:STDOUT:
  2132. // CHECK:STDOUT: specific @As(constants.%Dest) {
  2133. // CHECK:STDOUT: %Dest.loc9_14.2 => constants.%Dest
  2134. // CHECK:STDOUT: %Dest.patt.loc9_14.2 => constants.%Dest.patt
  2135. // CHECK:STDOUT: }
  2136. // CHECK:STDOUT:
  2137. // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.b4e) {
  2138. // CHECK:STDOUT: %Dest => constants.%Dest
  2139. // CHECK:STDOUT: %As.type => constants.%As.type.8ba
  2140. // CHECK:STDOUT: %Self => constants.%Self.b4e
  2141. // CHECK:STDOUT: %Self.as_type.loc10_20.1 => constants.%Self.as_type.7f0
  2142. // CHECK:STDOUT: }
  2143. // CHECK:STDOUT:
  2144. // CHECK:STDOUT: specific @As(@Convert.1.%Dest) {}
  2145. // CHECK:STDOUT:
  2146. // CHECK:STDOUT: specific @As(%Dest.loc9_14.2) {}
  2147. // CHECK:STDOUT:
  2148. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  2149. // CHECK:STDOUT: %Dest.loc13_22.2 => constants.%Dest
  2150. // CHECK:STDOUT: %Dest.patt.loc13_22.2 => constants.%Dest.patt
  2151. // CHECK:STDOUT: }
  2152. // CHECK:STDOUT:
  2153. // CHECK:STDOUT: specific @Convert.2(constants.%Dest, constants.%Self.0f3) {
  2154. // CHECK:STDOUT: %Dest => constants.%Dest
  2155. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f
  2156. // CHECK:STDOUT: %Self => constants.%Self.0f3
  2157. // CHECK:STDOUT: %Self.as_type.loc14_20.1 => constants.%Self.as_type.419
  2158. // CHECK:STDOUT: }
  2159. // CHECK:STDOUT:
  2160. // CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%Dest) {}
  2161. // CHECK:STDOUT:
  2162. // CHECK:STDOUT: specific @ImplicitAs(%Dest.loc13_22.2) {}
  2163. // CHECK:STDOUT:
  2164. // CHECK:STDOUT: specific @Op.1(constants.%Self.e44) {
  2165. // CHECK:STDOUT: %Self => constants.%Self.e44
  2166. // CHECK:STDOUT: %Self.as_type.loc18_15.1 => constants.%Self.as_type.560
  2167. // CHECK:STDOUT: }
  2168. // CHECK:STDOUT:
  2169. // CHECK:STDOUT: specific @impl(constants.%T) {
  2170. // CHECK:STDOUT: %T.loc21_14.2 => constants.%T
  2171. // CHECK:STDOUT: %T.patt.loc21_14.2 => constants.%T.patt
  2172. // CHECK:STDOUT: %impl_witness => constants.%impl_witness
  2173. // CHECK:STDOUT: }
  2174. // CHECK:STDOUT:
  2175. // CHECK:STDOUT: specific @impl(%T.loc21_14.2) {}
  2176. // CHECK:STDOUT:
  2177. // CHECK:STDOUT: specific @Op.2(constants.%T) {
  2178. // CHECK:STDOUT: %T => constants.%T
  2179. // CHECK:STDOUT: }
  2180. // CHECK:STDOUT:
  2181. // CHECK:STDOUT: specific @Op.1(constants.%BitAnd.facet) {
  2182. // CHECK:STDOUT: %Self => constants.%BitAnd.facet
  2183. // CHECK:STDOUT: %Self.as_type.loc18_15.1 => constants.%T
  2184. // CHECK:STDOUT: }
  2185. // CHECK:STDOUT: