compound_member_access.carbon 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495
  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. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon
  12. // --- associated_constant.carbon
  13. library "[[@TEST_NAME]]";
  14. interface J {
  15. let U:! type;
  16. }
  17. // Simple member access.
  18. fn Simple1(T:! J, S:! T.U) {}
  19. // This should be equivalent to `Simple1` above, but using compound member access.
  20. fn Compound1(V:! J, W:! V.(J.U)) {}
  21. // --- non_instance.carbon
  22. library "[[@TEST_NAME]]";
  23. interface K1 {
  24. fn Q1();
  25. }
  26. // Simple member access.
  27. fn Simple2(T:! K1) {
  28. T.Q1();
  29. }
  30. // This should be equivalent to `Simple2` above, but using compound member access.
  31. fn Compound2(V:! K1) {
  32. V.(K1.Q1)();
  33. }
  34. // --- fail_caller_instance_interface_not.carbon
  35. library "[[@TEST_NAME]]";
  36. interface K2 {
  37. fn Q2();
  38. }
  39. // Simple member access allows this.
  40. fn Simple3(T:! K2, x: T) {
  41. x.Q2();
  42. }
  43. // Compound member access does not. It tries to convert `y` to `K2`, but only
  44. // its type `V` can.
  45. fn Compound3(V:! K2, y: V) {
  46. // 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]
  47. // CHECK:STDERR: y.(K2.Q2)();
  48. // CHECK:STDERR: ^~~~~~~~~
  49. // CHECK:STDERR: fail_caller_instance_interface_not.carbon:[[@LINE+4]]:3: note: type `V` does not implement interface `Core.ImplicitAs(K2)` [MissingImplInMemberAccessNote]
  50. // CHECK:STDERR: y.(K2.Q2)();
  51. // CHECK:STDERR: ^~~~~~~~~
  52. // CHECK:STDERR:
  53. y.(K2.Q2)();
  54. }
  55. // --- instance.carbon
  56. library "[[@TEST_NAME]]";
  57. interface L1 {
  58. fn R1[self: Self]();
  59. fn S1[addr self: Self*]();
  60. }
  61. // Simple member access.
  62. fn Simple4(T:! L1, x: T) {
  63. x.R1();
  64. var xcopy: T = x;
  65. xcopy.S1();
  66. }
  67. // This should be equivalent to `Simple4` above, but using compound member access.
  68. fn Compound4(V:! L1, y: V) {
  69. y.(L1.R1)();
  70. var ycopy: V = y;
  71. ycopy.(L1.S1)();
  72. }
  73. // --- fail_interface_instance_caller_not.carbon
  74. library "[[@TEST_NAME]]";
  75. interface L2 {
  76. fn R2[self: Self]();
  77. fn S2[addr self: Self*]();
  78. }
  79. // Simple member access. Fails since calling an instance method without an object.
  80. fn Simple5(T:! L2) {
  81. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall]
  82. // CHECK:STDERR: T.R2();
  83. // CHECK:STDERR: ^~~~~~
  84. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-9]]:3: note: calling function declared here [InCallToFunction]
  85. // CHECK:STDERR: fn R2[self: Self]();
  86. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  87. // CHECK:STDERR:
  88. T.R2();
  89. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall]
  90. // CHECK:STDERR: T.S2();
  91. // CHECK:STDERR: ^~~~~~
  92. // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-16]]:3: note: calling function declared here [InCallToFunction]
  93. // CHECK:STDERR: fn S2[addr self: Self*]();
  94. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
  95. // CHECK:STDERR:
  96. T.S2();
  97. }
  98. // TODO: Expected to fail in the same way as `Simple5`.
  99. fn Compound5(V:! L2) {
  100. // 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]
  101. // CHECK:STDERR: V.(L2.R2)();
  102. // CHECK:STDERR: ^~~~~~~~~
  103. // CHECK:STDERR:
  104. V.(L2.R2)();
  105. // 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]
  106. // CHECK:STDERR: V.(L2.S2)();
  107. // CHECK:STDERR: ^~~~~~~~~
  108. // CHECK:STDERR:
  109. V.(L2.S2)();
  110. }
  111. // --- fail_combine_non_instance.carbon
  112. library "[[@TEST_NAME]]";
  113. interface A {
  114. fn G();
  115. }
  116. class C {}
  117. impl C as A {
  118. fn G() {}
  119. }
  120. // Since `A.G` is a non-instance method, compound member access may only be
  121. // used with a type, not an instance.
  122. fn Fails() {
  123. // 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]
  124. // CHECK:STDERR: ({} as C).((A & A).G)();
  125. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  126. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+4]]:3: note: type `C` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
  127. // CHECK:STDERR: ({} as C).((A & A).G)();
  128. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  129. // CHECK:STDERR:
  130. ({} as C).((A & A).G)();
  131. // 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]
  132. // CHECK:STDERR: (({} as C) as (C as (A & A))).((A & A).G)();
  133. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  134. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+4]]:3: note: type `C` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
  135. // CHECK:STDERR: (({} as C) as (C as (A & A))).((A & A).G)();
  136. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  137. // CHECK:STDERR:
  138. (({} as C) as (C as (A & A))).((A & A).G)();
  139. // 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]
  140. // CHECK:STDERR: (({} as C) as (C as (A & A))).(A.G)();
  141. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  142. // CHECK:STDERR: fail_combine_non_instance.carbon:[[@LINE+4]]:3: note: type `C` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
  143. // CHECK:STDERR: (({} as C) as (C as (A & A))).(A.G)();
  144. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  145. // CHECK:STDERR:
  146. (({} as C) as (C as (A & A))).(A.G)();
  147. }
  148. // --- allowed_combine_non_instance.carbon
  149. library "[[@TEST_NAME]]";
  150. interface A {
  151. fn G();
  152. }
  153. class C {}
  154. impl C as A {
  155. fn G() {}
  156. }
  157. fn Works() {
  158. C.((A & A).G)();
  159. (C as (A & A)).((A & A).G)();
  160. (C as (A & A)).(A.G)();
  161. }
  162. // CHECK:STDOUT: --- associated_constant.carbon
  163. // CHECK:STDOUT:
  164. // CHECK:STDOUT: constants {
  165. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  166. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic]
  167. // CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
  168. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete]
  169. // CHECK:STDOUT: %T: %J.type = bind_symbolic_name T, 0 [symbolic]
  170. // CHECK:STDOUT: %pattern_type.28e: type = pattern_type %J.type [concrete]
  171. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  172. // CHECK:STDOUT: %J.lookup_impl_witness.64628e.1: <witness> = lookup_impl_witness %T, @J [symbolic]
  173. // CHECK:STDOUT: %J.facet.5210a7.1: %J.type = facet_value %T.as_type, (%J.lookup_impl_witness.64628e.1) [symbolic]
  174. // CHECK:STDOUT: %impl.elem0.11fef0.1: type = impl_witness_access %J.lookup_impl_witness.64628e.1, element0 [symbolic]
  175. // CHECK:STDOUT: %S: %impl.elem0.11fef0.1 = bind_symbolic_name S, 1 [symbolic]
  176. // CHECK:STDOUT: %pattern_type.b984e7.1: type = pattern_type %impl.elem0.11fef0.1 [symbolic]
  177. // CHECK:STDOUT: %Simple1.type: type = fn_type @Simple1 [concrete]
  178. // CHECK:STDOUT: %Simple1: %Simple1.type = struct_value () [concrete]
  179. // CHECK:STDOUT: %V: %J.type = bind_symbolic_name V, 0 [symbolic]
  180. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic]
  181. // CHECK:STDOUT: %J.lookup_impl_witness.64628e.2: <witness> = lookup_impl_witness %V, @J [symbolic]
  182. // CHECK:STDOUT: %J.facet.5210a7.2: %J.type = facet_value %V.as_type, (%J.lookup_impl_witness.64628e.2) [symbolic]
  183. // CHECK:STDOUT: %impl.elem0.11fef0.2: type = impl_witness_access %J.lookup_impl_witness.64628e.2, element0 [symbolic]
  184. // CHECK:STDOUT: %W: %impl.elem0.11fef0.2 = bind_symbolic_name W, 1 [symbolic]
  185. // CHECK:STDOUT: %pattern_type.b984e7.2: type = pattern_type %impl.elem0.11fef0.2 [symbolic]
  186. // CHECK:STDOUT: %Compound1.type: type = fn_type @Compound1 [concrete]
  187. // CHECK:STDOUT: %Compound1: %Compound1.type = struct_value () [concrete]
  188. // CHECK:STDOUT: }
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: imports {
  191. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  192. // CHECK:STDOUT: import Core//prelude
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: file {
  197. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  198. // CHECK:STDOUT: .Core = imports.%Core
  199. // CHECK:STDOUT: .J = %J.decl
  200. // CHECK:STDOUT: .Simple1 = %Simple1.decl
  201. // CHECK:STDOUT: .Compound1 = %Compound1.decl
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT: %Core.import = import Core
  204. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  205. // CHECK:STDOUT: %Simple1.decl: %Simple1.type = fn_decl @Simple1 [concrete = constants.%Simple1] {
  206. // CHECK:STDOUT: %T.patt: %pattern_type.28e = symbolic_binding_pattern T, 0 [concrete]
  207. // CHECK:STDOUT: %S.patt: @Simple1.%pattern_type (%pattern_type.b984e7.1) = symbolic_binding_pattern S, 1 [concrete]
  208. // CHECK:STDOUT: } {
  209. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  210. // CHECK:STDOUT: %T.loc8_12.1: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T)]
  211. // CHECK:STDOUT: %.loc8_24.1: type = splice_block %impl.elem0.loc8_24.1 [symbolic = %impl.elem0.loc8_24.2 (constants.%impl.elem0.11fef0.1)] {
  212. // CHECK:STDOUT: %T.ref: %J.type = name_ref T, %T.loc8_12.1 [symbolic = %T.loc8_12.2 (constants.%T)]
  213. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  214. // 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)]
  215. // 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)]
  216. // CHECK:STDOUT: %impl.elem0.loc8_24.1: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.1, element0 [symbolic = %impl.elem0.loc8_24.2 (constants.%impl.elem0.11fef0.1)]
  217. // CHECK:STDOUT: }
  218. // CHECK:STDOUT: %S.loc8_19.1: @Simple1.%impl.elem0.loc8_24.2 (%impl.elem0.11fef0.1) = bind_symbolic_name S, 1 [symbolic = %S.loc8_19.2 (constants.%S)]
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT: %Compound1.decl: %Compound1.type = fn_decl @Compound1 [concrete = constants.%Compound1] {
  221. // CHECK:STDOUT: %V.patt: %pattern_type.28e = symbolic_binding_pattern V, 0 [concrete]
  222. // CHECK:STDOUT: %W.patt: @Compound1.%pattern_type (%pattern_type.b984e7.2) = symbolic_binding_pattern W, 1 [concrete]
  223. // CHECK:STDOUT: } {
  224. // CHECK:STDOUT: %J.ref.loc11_18: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  225. // CHECK:STDOUT: %V.loc11_14.1: %J.type = bind_symbolic_name V, 0 [symbolic = %V.loc11_14.2 (constants.%V)]
  226. // CHECK:STDOUT: %.loc11: type = splice_block %impl.elem0.loc11_26.1 [symbolic = %impl.elem0.loc11_26.2 (constants.%impl.elem0.11fef0.2)] {
  227. // CHECK:STDOUT: %V.ref: %J.type = name_ref V, %V.loc11_14.1 [symbolic = %V.loc11_14.2 (constants.%V)]
  228. // CHECK:STDOUT: %J.ref.loc11_28: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  229. // CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0]
  230. // CHECK:STDOUT: %impl.elem0.loc11_26.1: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc11_26.2 (constants.%impl.elem0.11fef0.2)]
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT: %W.loc11_21.1: @Compound1.%impl.elem0.loc11_26.2 (%impl.elem0.11fef0.2) = bind_symbolic_name W, 1 [symbolic = %W.loc11_21.2 (constants.%W)]
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: interface @J {
  237. // CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  238. // CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] {
  239. // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0]
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT:
  242. // CHECK:STDOUT: !members:
  243. // CHECK:STDOUT: .Self = %Self
  244. // CHECK:STDOUT: .U = @U.%assoc0
  245. // CHECK:STDOUT: witness = (%U)
  246. // CHECK:STDOUT: }
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) {
  249. // CHECK:STDOUT: assoc_const U:! type;
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: generic fn @Simple1(%T.loc8_12.1: %J.type, %S.loc8_19.1: @Simple1.%impl.elem0.loc8_24.2 (%impl.elem0.11fef0.1)) {
  253. // CHECK:STDOUT: %T.loc8_12.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T)]
  254. // 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)]
  255. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_12.2, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.1)]
  256. // CHECK:STDOUT: %impl.elem0.loc8_24.2: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_24.2 (constants.%impl.elem0.11fef0.1)]
  257. // CHECK:STDOUT: %S.loc8_19.2: @Simple1.%impl.elem0.loc8_24.2 (%impl.elem0.11fef0.1) = bind_symbolic_name S, 1 [symbolic = %S.loc8_19.2 (constants.%S)]
  258. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc8_24.2 [symbolic = %pattern_type (constants.%pattern_type.b984e7.1)]
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: !definition:
  261. // CHECK:STDOUT:
  262. // CHECK:STDOUT: fn() {
  263. // CHECK:STDOUT: !entry:
  264. // CHECK:STDOUT: return
  265. // CHECK:STDOUT: }
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: generic fn @Compound1(%V.loc11_14.1: %J.type, %W.loc11_21.1: @Compound1.%impl.elem0.loc11_26.2 (%impl.elem0.11fef0.2)) {
  269. // CHECK:STDOUT: %V.loc11_14.2: %J.type = bind_symbolic_name V, 0 [symbolic = %V.loc11_14.2 (constants.%V)]
  270. // CHECK:STDOUT: %J.lookup_impl_witness: <witness> = lookup_impl_witness %V.loc11_14.2, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.2)]
  271. // CHECK:STDOUT: %impl.elem0.loc11_26.2: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_26.2 (constants.%impl.elem0.11fef0.2)]
  272. // CHECK:STDOUT: %W.loc11_21.2: @Compound1.%impl.elem0.loc11_26.2 (%impl.elem0.11fef0.2) = bind_symbolic_name W, 1 [symbolic = %W.loc11_21.2 (constants.%W)]
  273. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc11_26.2 [symbolic = %pattern_type (constants.%pattern_type.b984e7.2)]
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: !definition:
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: fn() {
  278. // CHECK:STDOUT: !entry:
  279. // CHECK:STDOUT: return
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: specific @U(constants.%Self) {}
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: specific @U(constants.%J.facet.5210a7.1) {}
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: specific @Simple1(constants.%T, constants.%S) {
  288. // CHECK:STDOUT: %T.loc8_12.2 => constants.%T
  289. // CHECK:STDOUT: %T.as_type.loc8_24.2 => constants.%T.as_type
  290. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.1
  291. // CHECK:STDOUT: %impl.elem0.loc8_24.2 => constants.%impl.elem0.11fef0.1
  292. // CHECK:STDOUT: %S.loc8_19.2 => constants.%S
  293. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b984e7.1
  294. // CHECK:STDOUT: }
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: specific @U(constants.%J.facet.5210a7.2) {}
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: specific @Compound1(constants.%V, constants.%W) {
  299. // CHECK:STDOUT: %V.loc11_14.2 => constants.%V
  300. // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.2
  301. // CHECK:STDOUT: %impl.elem0.loc11_26.2 => constants.%impl.elem0.11fef0.2
  302. // CHECK:STDOUT: %W.loc11_21.2 => constants.%W
  303. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b984e7.2
  304. // CHECK:STDOUT: }
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: --- non_instance.carbon
  307. // CHECK:STDOUT:
  308. // CHECK:STDOUT: constants {
  309. // CHECK:STDOUT: %K1.type: type = facet_type <@K1> [concrete]
  310. // CHECK:STDOUT: %Self: %K1.type = bind_symbolic_name Self, 0 [symbolic]
  311. // CHECK:STDOUT: %Q1.type: type = fn_type @Q1 [concrete]
  312. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  313. // CHECK:STDOUT: %Q1: %Q1.type = struct_value () [concrete]
  314. // CHECK:STDOUT: %K1.assoc_type: type = assoc_entity_type @K1 [concrete]
  315. // CHECK:STDOUT: %assoc0: %K1.assoc_type = assoc_entity element0, @K1.%Q1.decl [concrete]
  316. // CHECK:STDOUT: %T: %K1.type = bind_symbolic_name T, 0 [symbolic]
  317. // CHECK:STDOUT: %pattern_type: type = pattern_type %K1.type [concrete]
  318. // CHECK:STDOUT: %Simple2.type: type = fn_type @Simple2 [concrete]
  319. // CHECK:STDOUT: %Simple2: %Simple2.type = struct_value () [concrete]
  320. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  321. // CHECK:STDOUT: %K1.lookup_impl_witness.d8ae08.1: <witness> = lookup_impl_witness %T, @K1 [symbolic]
  322. // CHECK:STDOUT: %K1.facet.9e06af.1: %K1.type = facet_value %T.as_type, (%K1.lookup_impl_witness.d8ae08.1) [symbolic]
  323. // CHECK:STDOUT: %.484362.1: type = fn_type_with_self_type %Q1.type, %K1.facet.9e06af.1 [symbolic]
  324. // CHECK:STDOUT: %impl.elem0.9661c0.1: %.484362.1 = impl_witness_access %K1.lookup_impl_witness.d8ae08.1, element0 [symbolic]
  325. // CHECK:STDOUT: %specific_impl_fn.54474d.1: <specific function> = specific_impl_function %impl.elem0.9661c0.1, @Q1(%K1.facet.9e06af.1) [symbolic]
  326. // CHECK:STDOUT: %V: %K1.type = bind_symbolic_name V, 0 [symbolic]
  327. // CHECK:STDOUT: %Compound2.type: type = fn_type @Compound2 [concrete]
  328. // CHECK:STDOUT: %Compound2: %Compound2.type = struct_value () [concrete]
  329. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic]
  330. // CHECK:STDOUT: %K1.lookup_impl_witness.d8ae08.2: <witness> = lookup_impl_witness %V, @K1 [symbolic]
  331. // CHECK:STDOUT: %K1.facet.9e06af.2: %K1.type = facet_value %V.as_type, (%K1.lookup_impl_witness.d8ae08.2) [symbolic]
  332. // CHECK:STDOUT: %.484362.2: type = fn_type_with_self_type %Q1.type, %K1.facet.9e06af.2 [symbolic]
  333. // CHECK:STDOUT: %impl.elem0.9661c0.2: %.484362.2 = impl_witness_access %K1.lookup_impl_witness.d8ae08.2, element0 [symbolic]
  334. // CHECK:STDOUT: %specific_impl_fn.54474d.2: <specific function> = specific_impl_function %impl.elem0.9661c0.2, @Q1(%K1.facet.9e06af.2) [symbolic]
  335. // CHECK:STDOUT: }
  336. // CHECK:STDOUT:
  337. // CHECK:STDOUT: imports {
  338. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  339. // CHECK:STDOUT: import Core//prelude
  340. // CHECK:STDOUT: }
  341. // CHECK:STDOUT: }
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: file {
  344. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  345. // CHECK:STDOUT: .Core = imports.%Core
  346. // CHECK:STDOUT: .K1 = %K1.decl
  347. // CHECK:STDOUT: .Simple2 = %Simple2.decl
  348. // CHECK:STDOUT: .Compound2 = %Compound2.decl
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT: %Core.import = import Core
  351. // CHECK:STDOUT: %K1.decl: type = interface_decl @K1 [concrete = constants.%K1.type] {} {}
  352. // CHECK:STDOUT: %Simple2.decl: %Simple2.type = fn_decl @Simple2 [concrete = constants.%Simple2] {
  353. // CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
  354. // CHECK:STDOUT: } {
  355. // CHECK:STDOUT: %K1.ref: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type]
  356. // CHECK:STDOUT: %T.loc8_12.1: %K1.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T)]
  357. // CHECK:STDOUT: }
  358. // CHECK:STDOUT: %Compound2.decl: %Compound2.type = fn_decl @Compound2 [concrete = constants.%Compound2] {
  359. // CHECK:STDOUT: %V.patt: %pattern_type = symbolic_binding_pattern V, 0 [concrete]
  360. // CHECK:STDOUT: } {
  361. // CHECK:STDOUT: %K1.ref.loc13: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type]
  362. // CHECK:STDOUT: %V.loc13_14.1: %K1.type = bind_symbolic_name V, 0 [symbolic = %V.loc13_14.2 (constants.%V)]
  363. // CHECK:STDOUT: }
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: interface @K1 {
  367. // CHECK:STDOUT: %Self: %K1.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  368. // CHECK:STDOUT: %Q1.decl: %Q1.type = fn_decl @Q1 [concrete = constants.%Q1] {} {}
  369. // CHECK:STDOUT: %assoc0: %K1.assoc_type = assoc_entity element0, %Q1.decl [concrete = constants.%assoc0]
  370. // CHECK:STDOUT:
  371. // CHECK:STDOUT: !members:
  372. // CHECK:STDOUT: .Self = %Self
  373. // CHECK:STDOUT: .Q1 = %assoc0
  374. // CHECK:STDOUT: witness = (%Q1.decl)
  375. // CHECK:STDOUT: }
  376. // CHECK:STDOUT:
  377. // CHECK:STDOUT: generic fn @Q1(@K1.%Self: %K1.type) {
  378. // CHECK:STDOUT: fn();
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT:
  381. // CHECK:STDOUT: generic fn @Simple2(%T.loc8_12.1: %K1.type) {
  382. // CHECK:STDOUT: %T.loc8_12.2: %K1.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T)]
  383. // CHECK:STDOUT:
  384. // CHECK:STDOUT: !definition:
  385. // 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)]
  386. // CHECK:STDOUT: %K1.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_12.2, @K1 [symbolic = %K1.lookup_impl_witness (constants.%K1.lookup_impl_witness.d8ae08.1)]
  387. // CHECK:STDOUT: %K1.facet: %K1.type = facet_value %T.as_type.loc9_4.2, (%K1.lookup_impl_witness) [symbolic = %K1.facet (constants.%K1.facet.9e06af.1)]
  388. // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%Q1.type, %K1.facet [symbolic = %.loc9_4.2 (constants.%.484362.1)]
  389. // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Simple2.%.loc9_4.2 (%.484362.1) = impl_witness_access %K1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0.9661c0.1)]
  390. // 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.54474d.1)]
  391. // CHECK:STDOUT:
  392. // CHECK:STDOUT: fn() {
  393. // CHECK:STDOUT: !entry:
  394. // CHECK:STDOUT: %T.ref: %K1.type = name_ref T, %T.loc8_12.1 [symbolic = %T.loc8_12.2 (constants.%T)]
  395. // CHECK:STDOUT: %Q1.ref: %K1.assoc_type = name_ref Q1, @K1.%assoc0 [concrete = constants.%assoc0]
  396. // 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)]
  397. // 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)]
  398. // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Simple2.%.loc9_4.2 (%.484362.1) = impl_witness_access constants.%K1.lookup_impl_witness.d8ae08.1, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0.9661c0.1)]
  399. // CHECK:STDOUT: %specific_impl_fn.loc9_4.1: <specific function> = specific_impl_function %impl.elem0.loc9_4.1, @Q1(constants.%K1.facet.9e06af.1) [symbolic = %specific_impl_fn.loc9_4.2 (constants.%specific_impl_fn.54474d.1)]
  400. // CHECK:STDOUT: %.loc9_8: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1()
  401. // CHECK:STDOUT: return
  402. // CHECK:STDOUT: }
  403. // CHECK:STDOUT: }
  404. // CHECK:STDOUT:
  405. // CHECK:STDOUT: generic fn @Compound2(%V.loc13_14.1: %K1.type) {
  406. // CHECK:STDOUT: %V.loc13_14.2: %K1.type = bind_symbolic_name V, 0 [symbolic = %V.loc13_14.2 (constants.%V)]
  407. // CHECK:STDOUT:
  408. // CHECK:STDOUT: !definition:
  409. // CHECK:STDOUT: %K1.lookup_impl_witness: <witness> = lookup_impl_witness %V.loc13_14.2, @K1 [symbolic = %K1.lookup_impl_witness (constants.%K1.lookup_impl_witness.d8ae08.2)]
  410. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V.loc13_14.2 [symbolic = %V.as_type (constants.%V.as_type)]
  411. // CHECK:STDOUT: %K1.facet: %K1.type = facet_value %V.as_type, (%K1.lookup_impl_witness) [symbolic = %K1.facet (constants.%K1.facet.9e06af.2)]
  412. // CHECK:STDOUT: %.loc14_4: type = fn_type_with_self_type constants.%Q1.type, %K1.facet [symbolic = %.loc14_4 (constants.%.484362.2)]
  413. // CHECK:STDOUT: %impl.elem0.loc14_4.2: @Compound2.%.loc14_4 (%.484362.2) = impl_witness_access %K1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.9661c0.2)]
  414. // 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.54474d.2)]
  415. // CHECK:STDOUT:
  416. // CHECK:STDOUT: fn() {
  417. // CHECK:STDOUT: !entry:
  418. // CHECK:STDOUT: %V.ref: %K1.type = name_ref V, %V.loc13_14.1 [symbolic = %V.loc13_14.2 (constants.%V)]
  419. // CHECK:STDOUT: %K1.ref.loc14: type = name_ref K1, file.%K1.decl [concrete = constants.%K1.type]
  420. // CHECK:STDOUT: %Q1.ref: %K1.assoc_type = name_ref Q1, @K1.%assoc0 [concrete = constants.%assoc0]
  421. // CHECK:STDOUT: %impl.elem0.loc14_4.1: @Compound2.%.loc14_4 (%.484362.2) = impl_witness_access constants.%K1.lookup_impl_witness.d8ae08.2, element0 [symbolic = %impl.elem0.loc14_4.2 (constants.%impl.elem0.9661c0.2)]
  422. // CHECK:STDOUT: %specific_impl_fn.loc14_4.1: <specific function> = specific_impl_function %impl.elem0.loc14_4.1, @Q1(constants.%K1.facet.9e06af.2) [symbolic = %specific_impl_fn.loc14_4.2 (constants.%specific_impl_fn.54474d.2)]
  423. // CHECK:STDOUT: %.loc14_13: init %empty_tuple.type = call %specific_impl_fn.loc14_4.1()
  424. // CHECK:STDOUT: return
  425. // CHECK:STDOUT: }
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: specific @Q1(constants.%Self) {}
  429. // CHECK:STDOUT:
  430. // CHECK:STDOUT: specific @Simple2(constants.%T) {
  431. // CHECK:STDOUT: %T.loc8_12.2 => constants.%T
  432. // CHECK:STDOUT: }
  433. // CHECK:STDOUT:
  434. // CHECK:STDOUT: specific @Q1(constants.%K1.facet.9e06af.1) {}
  435. // CHECK:STDOUT:
  436. // CHECK:STDOUT: specific @Compound2(constants.%V) {
  437. // CHECK:STDOUT: %V.loc13_14.2 => constants.%V
  438. // CHECK:STDOUT: }
  439. // CHECK:STDOUT:
  440. // CHECK:STDOUT: specific @Q1(constants.%K1.facet.9e06af.2) {}
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: --- fail_caller_instance_interface_not.carbon
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: constants {
  445. // CHECK:STDOUT: %K2.type: type = facet_type <@K2> [concrete]
  446. // CHECK:STDOUT: %Self.0ce: %K2.type = bind_symbolic_name Self, 0 [symbolic]
  447. // CHECK:STDOUT: %Q2.type: type = fn_type @Q2 [concrete]
  448. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  449. // CHECK:STDOUT: %Q2: %Q2.type = struct_value () [concrete]
  450. // CHECK:STDOUT: %K2.assoc_type: type = assoc_entity_type @K2 [concrete]
  451. // CHECK:STDOUT: %assoc0.d67: %K2.assoc_type = assoc_entity element0, @K2.%Q2.decl [concrete]
  452. // CHECK:STDOUT: %T.0ce: %K2.type = bind_symbolic_name T, 0 [symbolic]
  453. // CHECK:STDOUT: %pattern_type.fda: type = pattern_type %K2.type [concrete]
  454. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.0ce [symbolic]
  455. // CHECK:STDOUT: %pattern_type.466ee6.1: type = pattern_type %T.as_type [symbolic]
  456. // CHECK:STDOUT: %Simple3.type: type = fn_type @Simple3 [concrete]
  457. // CHECK:STDOUT: %Simple3: %Simple3.type = struct_value () [concrete]
  458. // CHECK:STDOUT: %require_complete.022e81.1: <witness> = require_complete_type %T.as_type [symbolic]
  459. // CHECK:STDOUT: %K2.lookup_impl_witness: <witness> = lookup_impl_witness %T.0ce, @K2 [symbolic]
  460. // CHECK:STDOUT: %K2.facet: %K2.type = facet_value %T.as_type, (%K2.lookup_impl_witness) [symbolic]
  461. // CHECK:STDOUT: %.8de: type = fn_type_with_self_type %Q2.type, %K2.facet [symbolic]
  462. // CHECK:STDOUT: %impl.elem0: %.8de = impl_witness_access %K2.lookup_impl_witness, element0 [symbolic]
  463. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @Q2(%K2.facet) [symbolic]
  464. // CHECK:STDOUT: %V: %K2.type = bind_symbolic_name V, 0 [symbolic]
  465. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic]
  466. // CHECK:STDOUT: %pattern_type.466ee6.2: type = pattern_type %V.as_type [symbolic]
  467. // CHECK:STDOUT: %Compound3.type: type = fn_type @Compound3 [concrete]
  468. // CHECK:STDOUT: %Compound3: %Compound3.type = struct_value () [concrete]
  469. // CHECK:STDOUT: %require_complete.022e81.2: <witness> = require_complete_type %V.as_type [symbolic]
  470. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  471. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  472. // CHECK:STDOUT: }
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: imports {
  475. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  476. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  477. // CHECK:STDOUT: import Core//prelude
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  480. // CHECK:STDOUT: }
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: file {
  483. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  484. // CHECK:STDOUT: .Core = imports.%Core
  485. // CHECK:STDOUT: .K2 = %K2.decl
  486. // CHECK:STDOUT: .Simple3 = %Simple3.decl
  487. // CHECK:STDOUT: .Compound3 = %Compound3.decl
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT: %Core.import = import Core
  490. // CHECK:STDOUT: %K2.decl: type = interface_decl @K2 [concrete = constants.%K2.type] {} {}
  491. // CHECK:STDOUT: %Simple3.decl: %Simple3.type = fn_decl @Simple3 [concrete = constants.%Simple3] {
  492. // CHECK:STDOUT: %T.patt: %pattern_type.fda = symbolic_binding_pattern T, 0 [concrete]
  493. // CHECK:STDOUT: %x.patt: @Simple3.%pattern_type (%pattern_type.466ee6.1) = binding_pattern x [concrete]
  494. // CHECK:STDOUT: %x.param_patt: @Simple3.%pattern_type (%pattern_type.466ee6.1) = value_param_pattern %x.patt, call_param0 [concrete]
  495. // CHECK:STDOUT: } {
  496. // CHECK:STDOUT: %K2.ref: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type]
  497. // CHECK:STDOUT: %T.loc8_12.1: %K2.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T.0ce)]
  498. // CHECK:STDOUT: %x.param: @Simple3.%T.as_type.loc8_23.2 (%T.as_type) = value_param call_param0
  499. // CHECK:STDOUT: %.loc8_23.1: type = splice_block %.loc8_23.2 [symbolic = %T.as_type.loc8_23.2 (constants.%T.as_type)] {
  500. // CHECK:STDOUT: %T.ref: %K2.type = name_ref T, %T.loc8_12.1 [symbolic = %T.loc8_12.2 (constants.%T.0ce)]
  501. // 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)]
  502. // 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)]
  503. // CHECK:STDOUT: }
  504. // CHECK:STDOUT: %x: @Simple3.%T.as_type.loc8_23.2 (%T.as_type) = bind_name x, %x.param
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT: %Compound3.decl: %Compound3.type = fn_decl @Compound3 [concrete = constants.%Compound3] {
  507. // CHECK:STDOUT: %V.patt: %pattern_type.fda = symbolic_binding_pattern V, 0 [concrete]
  508. // CHECK:STDOUT: %y.patt: @Compound3.%pattern_type (%pattern_type.466ee6.2) = binding_pattern y [concrete]
  509. // CHECK:STDOUT: %y.param_patt: @Compound3.%pattern_type (%pattern_type.466ee6.2) = value_param_pattern %y.patt, call_param0 [concrete]
  510. // CHECK:STDOUT: } {
  511. // CHECK:STDOUT: %K2.ref.loc14: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type]
  512. // CHECK:STDOUT: %V.loc14_14.1: %K2.type = bind_symbolic_name V, 0 [symbolic = %V.loc14_14.2 (constants.%V)]
  513. // CHECK:STDOUT: %y.param: @Compound3.%V.as_type.loc14_25.2 (%V.as_type) = value_param call_param0
  514. // CHECK:STDOUT: %.loc14_25.1: type = splice_block %.loc14_25.2 [symbolic = %V.as_type.loc14_25.2 (constants.%V.as_type)] {
  515. // CHECK:STDOUT: %V.ref: %K2.type = name_ref V, %V.loc14_14.1 [symbolic = %V.loc14_14.2 (constants.%V)]
  516. // 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)]
  517. // 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)]
  518. // CHECK:STDOUT: }
  519. // CHECK:STDOUT: %y: @Compound3.%V.as_type.loc14_25.2 (%V.as_type) = bind_name y, %y.param
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT: }
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: interface @K2 {
  524. // CHECK:STDOUT: %Self: %K2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.0ce]
  525. // CHECK:STDOUT: %Q2.decl: %Q2.type = fn_decl @Q2 [concrete = constants.%Q2] {} {}
  526. // CHECK:STDOUT: %assoc0: %K2.assoc_type = assoc_entity element0, %Q2.decl [concrete = constants.%assoc0.d67]
  527. // CHECK:STDOUT:
  528. // CHECK:STDOUT: !members:
  529. // CHECK:STDOUT: .Self = %Self
  530. // CHECK:STDOUT: .Q2 = %assoc0
  531. // CHECK:STDOUT: witness = (%Q2.decl)
  532. // CHECK:STDOUT: }
  533. // CHECK:STDOUT:
  534. // CHECK:STDOUT: generic fn @Q2(@K2.%Self: %K2.type) {
  535. // CHECK:STDOUT: fn();
  536. // CHECK:STDOUT: }
  537. // CHECK:STDOUT:
  538. // CHECK:STDOUT: generic fn @Simple3(%T.loc8_12.1: %K2.type) {
  539. // CHECK:STDOUT: %T.loc8_12.2: %K2.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_12.2 (constants.%T.0ce)]
  540. // 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)]
  541. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc8_23.2 [symbolic = %pattern_type (constants.%pattern_type.466ee6.1)]
  542. // CHECK:STDOUT:
  543. // CHECK:STDOUT: !definition:
  544. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc8_23.2 [symbolic = %require_complete (constants.%require_complete.022e81.1)]
  545. // CHECK:STDOUT: %K2.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_12.2, @K2 [symbolic = %K2.lookup_impl_witness (constants.%K2.lookup_impl_witness)]
  546. // CHECK:STDOUT: %K2.facet: %K2.type = facet_value %T.as_type.loc8_23.2, (%K2.lookup_impl_witness) [symbolic = %K2.facet (constants.%K2.facet)]
  547. // CHECK:STDOUT: %.loc9_4.2: type = fn_type_with_self_type constants.%Q2.type, %K2.facet [symbolic = %.loc9_4.2 (constants.%.8de)]
  548. // CHECK:STDOUT: %impl.elem0.loc9_4.2: @Simple3.%.loc9_4.2 (%.8de) = impl_witness_access %K2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)]
  549. // 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)]
  550. // CHECK:STDOUT:
  551. // CHECK:STDOUT: fn(%x.param: @Simple3.%T.as_type.loc8_23.2 (%T.as_type)) {
  552. // CHECK:STDOUT: !entry:
  553. // CHECK:STDOUT: %x.ref: @Simple3.%T.as_type.loc8_23.2 (%T.as_type) = name_ref x, %x
  554. // CHECK:STDOUT: %Q2.ref: %K2.assoc_type = name_ref Q2, @K2.%assoc0 [concrete = constants.%assoc0.d67]
  555. // CHECK:STDOUT: %T.as_type.loc9: type = facet_access_type constants.%T.0ce [symbolic = %T.as_type.loc8_23.2 (constants.%T.as_type)]
  556. // 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)]
  557. // CHECK:STDOUT: %impl.elem0.loc9_4.1: @Simple3.%.loc9_4.2 (%.8de) = impl_witness_access constants.%K2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_4.2 (constants.%impl.elem0)]
  558. // 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)]
  559. // CHECK:STDOUT: %.loc9_8: init %empty_tuple.type = call %specific_impl_fn.loc9_4.1()
  560. // CHECK:STDOUT: return
  561. // CHECK:STDOUT: }
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: generic fn @Compound3(%V.loc14_14.1: %K2.type) {
  565. // CHECK:STDOUT: %V.loc14_14.2: %K2.type = bind_symbolic_name V, 0 [symbolic = %V.loc14_14.2 (constants.%V)]
  566. // 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)]
  567. // CHECK:STDOUT: %pattern_type: type = pattern_type %V.as_type.loc14_25.2 [symbolic = %pattern_type (constants.%pattern_type.466ee6.2)]
  568. // CHECK:STDOUT:
  569. // CHECK:STDOUT: !definition:
  570. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %V.as_type.loc14_25.2 [symbolic = %require_complete (constants.%require_complete.022e81.2)]
  571. // CHECK:STDOUT:
  572. // CHECK:STDOUT: fn(%y.param: @Compound3.%V.as_type.loc14_25.2 (%V.as_type)) {
  573. // CHECK:STDOUT: !entry:
  574. // CHECK:STDOUT: %y.ref: @Compound3.%V.as_type.loc14_25.2 (%V.as_type) = name_ref y, %y
  575. // CHECK:STDOUT: %K2.ref.loc22: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type]
  576. // CHECK:STDOUT: %Q2.ref: %K2.assoc_type = name_ref Q2, @K2.%assoc0 [concrete = constants.%assoc0.d67]
  577. // CHECK:STDOUT: %.loc22: %K2.type = converted %y.ref, <error> [concrete = <error>]
  578. // CHECK:STDOUT: return
  579. // CHECK:STDOUT: }
  580. // CHECK:STDOUT: }
  581. // CHECK:STDOUT:
  582. // CHECK:STDOUT: specific @Q2(constants.%Self.0ce) {}
  583. // CHECK:STDOUT:
  584. // CHECK:STDOUT: specific @Simple3(constants.%T.0ce) {
  585. // CHECK:STDOUT: %T.loc8_12.2 => constants.%T.0ce
  586. // CHECK:STDOUT: %T.as_type.loc8_23.2 => constants.%T.as_type
  587. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.466ee6.1
  588. // CHECK:STDOUT: }
  589. // CHECK:STDOUT:
  590. // CHECK:STDOUT: specific @Q2(constants.%K2.facet) {}
  591. // CHECK:STDOUT:
  592. // CHECK:STDOUT: specific @Compound3(constants.%V) {
  593. // CHECK:STDOUT: %V.loc14_14.2 => constants.%V
  594. // CHECK:STDOUT: %V.as_type.loc14_25.2 => constants.%V.as_type
  595. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.466ee6.2
  596. // CHECK:STDOUT: }
  597. // CHECK:STDOUT:
  598. // CHECK:STDOUT: --- instance.carbon
  599. // CHECK:STDOUT:
  600. // CHECK:STDOUT: constants {
  601. // CHECK:STDOUT: %L1.type: type = facet_type <@L1> [concrete]
  602. // CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic]
  603. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  604. // CHECK:STDOUT: %pattern_type.ad3e89.1: type = pattern_type %Self.as_type [symbolic]
  605. // CHECK:STDOUT: %R1.type: type = fn_type @R1 [concrete]
  606. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  607. // CHECK:STDOUT: %R1: %R1.type = struct_value () [concrete]
  608. // CHECK:STDOUT: %L1.assoc_type: type = assoc_entity_type @L1 [concrete]
  609. // CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, @L1.%R1.decl [concrete]
  610. // CHECK:STDOUT: %ptr.72f01d.1: type = ptr_type %Self.as_type [symbolic]
  611. // CHECK:STDOUT: %pattern_type.53384b.1: type = pattern_type %ptr.72f01d.1 [symbolic]
  612. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  613. // CHECK:STDOUT: %S1.type: type = fn_type @S1 [concrete]
  614. // CHECK:STDOUT: %S1: %S1.type = struct_value () [concrete]
  615. // CHECK:STDOUT: %assoc1: %L1.assoc_type = assoc_entity element1, @L1.%S1.decl [concrete]
  616. // CHECK:STDOUT: %T: %L1.type = bind_symbolic_name T, 0 [symbolic]
  617. // CHECK:STDOUT: %pattern_type.5da: type = pattern_type %L1.type [concrete]
  618. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  619. // CHECK:STDOUT: %pattern_type.ad3e89.2: type = pattern_type %T.as_type [symbolic]
  620. // CHECK:STDOUT: %Simple4.type: type = fn_type @Simple4 [concrete]
  621. // CHECK:STDOUT: %Simple4: %Simple4.type = struct_value () [concrete]
  622. // CHECK:STDOUT: %require_complete.97cd40.1: <witness> = require_complete_type %T.as_type [symbolic]
  623. // CHECK:STDOUT: %L1.lookup_impl_witness.0a136b.1: <witness> = lookup_impl_witness %T, @L1 [symbolic]
  624. // CHECK:STDOUT: %L1.facet.ed78cc.1: %L1.type = facet_value %T.as_type, (%L1.lookup_impl_witness.0a136b.1) [symbolic]
  625. // CHECK:STDOUT: %.3b7304.1: type = fn_type_with_self_type %R1.type, %L1.facet.ed78cc.1 [symbolic]
  626. // CHECK:STDOUT: %impl.elem0.a7f881.1: %.3b7304.1 = impl_witness_access %L1.lookup_impl_witness.0a136b.1, element0 [symbolic]
  627. // CHECK:STDOUT: %specific_impl_fn.f11365.1: <specific function> = specific_impl_function %impl.elem0.a7f881.1, @R1(%L1.facet.ed78cc.1) [symbolic]
  628. // CHECK:STDOUT: %.e9a411.1: type = fn_type_with_self_type %S1.type, %L1.facet.ed78cc.1 [symbolic]
  629. // CHECK:STDOUT: %impl.elem1.a8c6e3.1: %.e9a411.1 = impl_witness_access %L1.lookup_impl_witness.0a136b.1, element1 [symbolic]
  630. // CHECK:STDOUT: %ptr.72f01d.2: type = ptr_type %T.as_type [symbolic]
  631. // CHECK:STDOUT: %pattern_type.53384b.2: type = pattern_type %ptr.72f01d.2 [symbolic]
  632. // CHECK:STDOUT: %specific_impl_fn.bbb82e.1: <specific function> = specific_impl_function %impl.elem1.a8c6e3.1, @S1(%L1.facet.ed78cc.1) [symbolic]
  633. // CHECK:STDOUT: %require_complete.9326df.1: <witness> = require_complete_type %ptr.72f01d.2 [symbolic]
  634. // CHECK:STDOUT: %V: %L1.type = bind_symbolic_name V, 0 [symbolic]
  635. // CHECK:STDOUT: %V.as_type: type = facet_access_type %V [symbolic]
  636. // CHECK:STDOUT: %pattern_type.ad3e89.3: type = pattern_type %V.as_type [symbolic]
  637. // CHECK:STDOUT: %Compound4.type: type = fn_type @Compound4 [concrete]
  638. // CHECK:STDOUT: %Compound4: %Compound4.type = struct_value () [concrete]
  639. // CHECK:STDOUT: %require_complete.97cd40.2: <witness> = require_complete_type %V.as_type [symbolic]
  640. // CHECK:STDOUT: %L1.lookup_impl_witness.0a136b.2: <witness> = lookup_impl_witness %V, @L1 [symbolic]
  641. // CHECK:STDOUT: %L1.facet.ed78cc.2: %L1.type = facet_value %V.as_type, (%L1.lookup_impl_witness.0a136b.2) [symbolic]
  642. // CHECK:STDOUT: %.3b7304.2: type = fn_type_with_self_type %R1.type, %L1.facet.ed78cc.2 [symbolic]
  643. // CHECK:STDOUT: %impl.elem0.a7f881.2: %.3b7304.2 = impl_witness_access %L1.lookup_impl_witness.0a136b.2, element0 [symbolic]
  644. // CHECK:STDOUT: %specific_impl_fn.f11365.2: <specific function> = specific_impl_function %impl.elem0.a7f881.2, @R1(%L1.facet.ed78cc.2) [symbolic]
  645. // CHECK:STDOUT: %.e9a411.2: type = fn_type_with_self_type %S1.type, %L1.facet.ed78cc.2 [symbolic]
  646. // CHECK:STDOUT: %impl.elem1.a8c6e3.2: %.e9a411.2 = impl_witness_access %L1.lookup_impl_witness.0a136b.2, element1 [symbolic]
  647. // CHECK:STDOUT: %ptr.72f01d.3: type = ptr_type %V.as_type [symbolic]
  648. // CHECK:STDOUT: %pattern_type.53384b.3: type = pattern_type %ptr.72f01d.3 [symbolic]
  649. // CHECK:STDOUT: %specific_impl_fn.bbb82e.2: <specific function> = specific_impl_function %impl.elem1.a8c6e3.2, @S1(%L1.facet.ed78cc.2) [symbolic]
  650. // CHECK:STDOUT: %require_complete.9326df.2: <witness> = require_complete_type %ptr.72f01d.3 [symbolic]
  651. // CHECK:STDOUT: }
  652. // CHECK:STDOUT:
  653. // CHECK:STDOUT: imports {
  654. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  655. // CHECK:STDOUT: import Core//prelude
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT: }
  658. // CHECK:STDOUT:
  659. // CHECK:STDOUT: file {
  660. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  661. // CHECK:STDOUT: .Core = imports.%Core
  662. // CHECK:STDOUT: .L1 = %L1.decl
  663. // CHECK:STDOUT: .Simple4 = %Simple4.decl
  664. // CHECK:STDOUT: .Compound4 = %Compound4.decl
  665. // CHECK:STDOUT: }
  666. // CHECK:STDOUT: %Core.import = import Core
  667. // CHECK:STDOUT: %L1.decl: type = interface_decl @L1 [concrete = constants.%L1.type] {} {}
  668. // CHECK:STDOUT: %Simple4.decl: %Simple4.type = fn_decl @Simple4 [concrete = constants.%Simple4] {
  669. // CHECK:STDOUT: %T.patt: %pattern_type.5da = symbolic_binding_pattern T, 0 [concrete]
  670. // CHECK:STDOUT: %x.patt: @Simple4.%pattern_type (%pattern_type.ad3e89.2) = binding_pattern x [concrete]
  671. // CHECK:STDOUT: %x.param_patt: @Simple4.%pattern_type (%pattern_type.ad3e89.2) = value_param_pattern %x.patt, call_param0 [concrete]
  672. // CHECK:STDOUT: } {
  673. // CHECK:STDOUT: %L1.ref: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  674. // CHECK:STDOUT: %T.loc9_12.1: %L1.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.2 (constants.%T)]
  675. // CHECK:STDOUT: %x.param: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = value_param call_param0
  676. // CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] {
  677. // CHECK:STDOUT: %T.ref.loc9: %L1.type = name_ref T, %T.loc9_12.1 [symbolic = %T.loc9_12.2 (constants.%T)]
  678. // 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)]
  679. // 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)]
  680. // CHECK:STDOUT: }
  681. // CHECK:STDOUT: %x: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = bind_name x, %x.param
  682. // CHECK:STDOUT: }
  683. // CHECK:STDOUT: %Compound4.decl: %Compound4.type = fn_decl @Compound4 [concrete = constants.%Compound4] {
  684. // CHECK:STDOUT: %V.patt: %pattern_type.5da = symbolic_binding_pattern V, 0 [concrete]
  685. // CHECK:STDOUT: %y.patt: @Compound4.%pattern_type (%pattern_type.ad3e89.3) = binding_pattern y [concrete]
  686. // CHECK:STDOUT: %y.param_patt: @Compound4.%pattern_type (%pattern_type.ad3e89.3) = value_param_pattern %y.patt, call_param0 [concrete]
  687. // CHECK:STDOUT: } {
  688. // CHECK:STDOUT: %L1.ref.loc16: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  689. // CHECK:STDOUT: %V.loc16_14.1: %L1.type = bind_symbolic_name V, 0 [symbolic = %V.loc16_14.2 (constants.%V)]
  690. // CHECK:STDOUT: %y.param: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = value_param call_param0
  691. // CHECK:STDOUT: %.loc16_25.1: type = splice_block %.loc16_25.2 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)] {
  692. // CHECK:STDOUT: %V.ref.loc16: %L1.type = name_ref V, %V.loc16_14.1 [symbolic = %V.loc16_14.2 (constants.%V)]
  693. // 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)]
  694. // 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)]
  695. // CHECK:STDOUT: }
  696. // CHECK:STDOUT: %y: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = bind_name y, %y.param
  697. // CHECK:STDOUT: }
  698. // CHECK:STDOUT: }
  699. // CHECK:STDOUT:
  700. // CHECK:STDOUT: interface @L1 {
  701. // CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  702. // CHECK:STDOUT: %R1.decl: %R1.type = fn_decl @R1 [concrete = constants.%R1] {
  703. // CHECK:STDOUT: %self.patt: @R1.%pattern_type (%pattern_type.ad3e89.1) = binding_pattern self [concrete]
  704. // CHECK:STDOUT: %self.param_patt: @R1.%pattern_type (%pattern_type.ad3e89.1) = value_param_pattern %self.patt, call_param0 [concrete]
  705. // CHECK:STDOUT: } {
  706. // CHECK:STDOUT: %self.param: @R1.%Self.as_type.loc4_15.1 (%Self.as_type) = value_param call_param0
  707. // CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] {
  708. // CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self)]
  709. // 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)]
  710. // 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)]
  711. // CHECK:STDOUT: }
  712. // CHECK:STDOUT: %self: @R1.%Self.as_type.loc4_15.1 (%Self.as_type) = bind_name self, %self.param
  713. // CHECK:STDOUT: }
  714. // CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, %R1.decl [concrete = constants.%assoc0]
  715. // CHECK:STDOUT: %S1.decl: %S1.type = fn_decl @S1 [concrete = constants.%S1] {
  716. // CHECK:STDOUT: %self.patt: @S1.%pattern_type (%pattern_type.53384b.1) = binding_pattern self [concrete]
  717. // CHECK:STDOUT: %self.param_patt: @S1.%pattern_type (%pattern_type.53384b.1) = value_param_pattern %self.patt, call_param0 [concrete]
  718. // CHECK:STDOUT: %.loc5_9: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  719. // CHECK:STDOUT: } {
  720. // CHECK:STDOUT: %self.param: @S1.%ptr.loc5_24.1 (%ptr.72f01d.1) = value_param call_param0
  721. // CHECK:STDOUT: %.loc5_24.1: type = splice_block %ptr.loc5_24.2 [symbolic = %ptr.loc5_24.1 (constants.%ptr.72f01d.1)] {
  722. // CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self)]
  723. // 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)]
  724. // 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)]
  725. // CHECK:STDOUT: %ptr.loc5_24.2: type = ptr_type %.loc5_24.2 [symbolic = %ptr.loc5_24.1 (constants.%ptr.72f01d.1)]
  726. // CHECK:STDOUT: }
  727. // CHECK:STDOUT: %self: @S1.%ptr.loc5_24.1 (%ptr.72f01d.1) = bind_name self, %self.param
  728. // CHECK:STDOUT: }
  729. // CHECK:STDOUT: %assoc1: %L1.assoc_type = assoc_entity element1, %S1.decl [concrete = constants.%assoc1]
  730. // CHECK:STDOUT:
  731. // CHECK:STDOUT: !members:
  732. // CHECK:STDOUT: .Self = %Self
  733. // CHECK:STDOUT: .R1 = %assoc0
  734. // CHECK:STDOUT: .S1 = %assoc1
  735. // CHECK:STDOUT: witness = (%R1.decl, %S1.decl)
  736. // CHECK:STDOUT: }
  737. // CHECK:STDOUT:
  738. // CHECK:STDOUT: generic fn @R1(@L1.%Self: %L1.type) {
  739. // CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  740. // CHECK:STDOUT: %Self.as_type.loc4_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)]
  741. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_15.1 [symbolic = %pattern_type (constants.%pattern_type.ad3e89.1)]
  742. // CHECK:STDOUT:
  743. // CHECK:STDOUT: fn(%self.param: @R1.%Self.as_type.loc4_15.1 (%Self.as_type));
  744. // CHECK:STDOUT: }
  745. // CHECK:STDOUT:
  746. // CHECK:STDOUT: generic fn @S1(@L1.%Self: %L1.type) {
  747. // CHECK:STDOUT: %Self: %L1.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  748. // CHECK:STDOUT: %Self.as_type.loc5_24.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_24.1 (constants.%Self.as_type)]
  749. // CHECK:STDOUT: %ptr.loc5_24.1: type = ptr_type %Self.as_type.loc5_24.1 [symbolic = %ptr.loc5_24.1 (constants.%ptr.72f01d.1)]
  750. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc5_24.1 [symbolic = %pattern_type (constants.%pattern_type.53384b.1)]
  751. // CHECK:STDOUT:
  752. // CHECK:STDOUT: fn(%self.param: @S1.%ptr.loc5_24.1 (%ptr.72f01d.1));
  753. // CHECK:STDOUT: }
  754. // CHECK:STDOUT:
  755. // CHECK:STDOUT: generic fn @Simple4(%T.loc9_12.1: %L1.type) {
  756. // CHECK:STDOUT: %T.loc9_12.2: %L1.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.2 (constants.%T)]
  757. // 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)]
  758. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc9_23.2 [symbolic = %pattern_type (constants.%pattern_type.ad3e89.2)]
  759. // CHECK:STDOUT:
  760. // CHECK:STDOUT: !definition:
  761. // CHECK:STDOUT: %require_complete.loc9: <witness> = require_complete_type %T.as_type.loc9_23.2 [symbolic = %require_complete.loc9 (constants.%require_complete.97cd40.1)]
  762. // CHECK:STDOUT: %L1.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc9_12.2, @L1 [symbolic = %L1.lookup_impl_witness (constants.%L1.lookup_impl_witness.0a136b.1)]
  763. // CHECK:STDOUT: %L1.facet: %L1.type = facet_value %T.as_type.loc9_23.2, (%L1.lookup_impl_witness) [symbolic = %L1.facet (constants.%L1.facet.ed78cc.1)]
  764. // CHECK:STDOUT: %.loc10_4.2: type = fn_type_with_self_type constants.%R1.type, %L1.facet [symbolic = %.loc10_4.2 (constants.%.3b7304.1)]
  765. // CHECK:STDOUT: %impl.elem0.loc10_4.2: @Simple4.%.loc10_4.2 (%.3b7304.1) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.a7f881.1)]
  766. // 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.f11365.1)]
  767. // CHECK:STDOUT: %.loc12_8.2: type = fn_type_with_self_type constants.%S1.type, %L1.facet [symbolic = %.loc12_8.2 (constants.%.e9a411.1)]
  768. // CHECK:STDOUT: %impl.elem1.loc12_8.2: @Simple4.%.loc12_8.2 (%.e9a411.1) = impl_witness_access %L1.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc12_8.2 (constants.%impl.elem1.a8c6e3.1)]
  769. // 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.bbb82e.1)]
  770. // CHECK:STDOUT: %ptr: type = ptr_type %T.as_type.loc9_23.2 [symbolic = %ptr (constants.%ptr.72f01d.2)]
  771. // CHECK:STDOUT: %require_complete.loc12: <witness> = require_complete_type %ptr [symbolic = %require_complete.loc12 (constants.%require_complete.9326df.1)]
  772. // CHECK:STDOUT:
  773. // CHECK:STDOUT: fn(%x.param: @Simple4.%T.as_type.loc9_23.2 (%T.as_type)) {
  774. // CHECK:STDOUT: !entry:
  775. // CHECK:STDOUT: %x.ref.loc10: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = name_ref x, %x
  776. // CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0]
  777. // CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type constants.%T [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  778. // CHECK:STDOUT: %.loc10_4.1: type = converted constants.%T, %T.as_type.loc10 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  779. // CHECK:STDOUT: %impl.elem0.loc10_4.1: @Simple4.%.loc10_4.2 (%.3b7304.1) = impl_witness_access constants.%L1.lookup_impl_witness.0a136b.1, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.a7f881.1)]
  780. // CHECK:STDOUT: %bound_method.loc10_4: <bound method> = bound_method %x.ref.loc10, %impl.elem0.loc10_4.1
  781. // CHECK:STDOUT: %specific_impl_fn.loc10_4.1: <specific function> = specific_impl_function %impl.elem0.loc10_4.1, @R1(constants.%L1.facet.ed78cc.1) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.f11365.1)]
  782. // CHECK:STDOUT: %bound_method.loc10_8: <bound method> = bound_method %x.ref.loc10, %specific_impl_fn.loc10_4.1
  783. // CHECK:STDOUT: %.loc10_8: init %empty_tuple.type = call %bound_method.loc10_8(%x.ref.loc10)
  784. // CHECK:STDOUT: name_binding_decl {
  785. // CHECK:STDOUT: %xcopy.patt: @Simple4.%pattern_type (%pattern_type.ad3e89.2) = binding_pattern xcopy [concrete]
  786. // CHECK:STDOUT: %xcopy.var_patt: @Simple4.%pattern_type (%pattern_type.ad3e89.2) = var_pattern %xcopy.patt [concrete]
  787. // CHECK:STDOUT: }
  788. // CHECK:STDOUT: %xcopy.var: ref @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = var %xcopy.var_patt
  789. // CHECK:STDOUT: %x.ref.loc11: @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = name_ref x, %x
  790. // CHECK:STDOUT: assign %xcopy.var, %x.ref.loc11
  791. // CHECK:STDOUT: %.loc11_14.1: type = splice_block %.loc11_14.2 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] {
  792. // CHECK:STDOUT: %T.ref.loc11: %L1.type = name_ref T, %T.loc9_12.1 [symbolic = %T.loc9_12.2 (constants.%T)]
  793. // CHECK:STDOUT: %T.as_type.loc11: type = facet_access_type %T.ref.loc11 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  794. // 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)]
  795. // CHECK:STDOUT: }
  796. // CHECK:STDOUT: %xcopy: ref @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = bind_name xcopy, %xcopy.var
  797. // CHECK:STDOUT: %xcopy.ref: ref @Simple4.%T.as_type.loc9_23.2 (%T.as_type) = name_ref xcopy, %xcopy
  798. // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.%assoc1 [concrete = constants.%assoc1]
  799. // CHECK:STDOUT: %T.as_type.loc12: type = facet_access_type constants.%T [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  800. // CHECK:STDOUT: %.loc12_8.1: type = converted constants.%T, %T.as_type.loc12 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)]
  801. // CHECK:STDOUT: %impl.elem1.loc12_8.1: @Simple4.%.loc12_8.2 (%.e9a411.1) = impl_witness_access constants.%L1.lookup_impl_witness.0a136b.1, element1 [symbolic = %impl.elem1.loc12_8.2 (constants.%impl.elem1.a8c6e3.1)]
  802. // CHECK:STDOUT: %bound_method.loc12_8: <bound method> = bound_method %xcopy.ref, %impl.elem1.loc12_8.1
  803. // CHECK:STDOUT: %specific_impl_fn.loc12_8.1: <specific function> = specific_impl_function %impl.elem1.loc12_8.1, @S1(constants.%L1.facet.ed78cc.1) [symbolic = %specific_impl_fn.loc12_8.2 (constants.%specific_impl_fn.bbb82e.1)]
  804. // CHECK:STDOUT: %bound_method.loc12_12: <bound method> = bound_method %xcopy.ref, %specific_impl_fn.loc12_8.1
  805. // CHECK:STDOUT: %addr: @Simple4.%ptr (%ptr.72f01d.2) = addr_of %xcopy.ref
  806. // CHECK:STDOUT: %.loc12_12: init %empty_tuple.type = call %bound_method.loc12_12(%addr)
  807. // CHECK:STDOUT: return
  808. // CHECK:STDOUT: }
  809. // CHECK:STDOUT: }
  810. // CHECK:STDOUT:
  811. // CHECK:STDOUT: generic fn @Compound4(%V.loc16_14.1: %L1.type) {
  812. // CHECK:STDOUT: %V.loc16_14.2: %L1.type = bind_symbolic_name V, 0 [symbolic = %V.loc16_14.2 (constants.%V)]
  813. // 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)]
  814. // CHECK:STDOUT: %pattern_type: type = pattern_type %V.as_type.loc16_25.2 [symbolic = %pattern_type (constants.%pattern_type.ad3e89.3)]
  815. // CHECK:STDOUT:
  816. // CHECK:STDOUT: !definition:
  817. // CHECK:STDOUT: %require_complete.loc16: <witness> = require_complete_type %V.as_type.loc16_25.2 [symbolic = %require_complete.loc16 (constants.%require_complete.97cd40.2)]
  818. // CHECK:STDOUT: %L1.lookup_impl_witness: <witness> = lookup_impl_witness %V.loc16_14.2, @L1 [symbolic = %L1.lookup_impl_witness (constants.%L1.lookup_impl_witness.0a136b.2)]
  819. // CHECK:STDOUT: %L1.facet: %L1.type = facet_value %V.as_type.loc16_25.2, (%L1.lookup_impl_witness) [symbolic = %L1.facet (constants.%L1.facet.ed78cc.2)]
  820. // CHECK:STDOUT: %.loc17_4: type = fn_type_with_self_type constants.%R1.type, %L1.facet [symbolic = %.loc17_4 (constants.%.3b7304.2)]
  821. // CHECK:STDOUT: %impl.elem0.loc17_4.2: @Compound4.%.loc17_4 (%.3b7304.2) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.a7f881.2)]
  822. // 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.f11365.2)]
  823. // CHECK:STDOUT: %.loc19_8: type = fn_type_with_self_type constants.%S1.type, %L1.facet [symbolic = %.loc19_8 (constants.%.e9a411.2)]
  824. // CHECK:STDOUT: %impl.elem1.loc19_8.2: @Compound4.%.loc19_8 (%.e9a411.2) = impl_witness_access %L1.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.a8c6e3.2)]
  825. // 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.bbb82e.2)]
  826. // CHECK:STDOUT: %ptr: type = ptr_type %V.as_type.loc16_25.2 [symbolic = %ptr (constants.%ptr.72f01d.3)]
  827. // CHECK:STDOUT: %require_complete.loc19: <witness> = require_complete_type %ptr [symbolic = %require_complete.loc19 (constants.%require_complete.9326df.2)]
  828. // CHECK:STDOUT:
  829. // CHECK:STDOUT: fn(%y.param: @Compound4.%V.as_type.loc16_25.2 (%V.as_type)) {
  830. // CHECK:STDOUT: !entry:
  831. // CHECK:STDOUT: %y.ref.loc17: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = name_ref y, %y
  832. // CHECK:STDOUT: %L1.ref.loc17: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  833. // CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.%assoc0 [concrete = constants.%assoc0]
  834. // CHECK:STDOUT: %impl.elem0.loc17_4.1: @Compound4.%.loc17_4 (%.3b7304.2) = impl_witness_access constants.%L1.lookup_impl_witness.0a136b.2, element0 [symbolic = %impl.elem0.loc17_4.2 (constants.%impl.elem0.a7f881.2)]
  835. // CHECK:STDOUT: %bound_method.loc17_4: <bound method> = bound_method %y.ref.loc17, %impl.elem0.loc17_4.1
  836. // CHECK:STDOUT: %specific_impl_fn.loc17_4.1: <specific function> = specific_impl_function %impl.elem0.loc17_4.1, @R1(constants.%L1.facet.ed78cc.2) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.f11365.2)]
  837. // CHECK:STDOUT: %bound_method.loc17_13: <bound method> = bound_method %y.ref.loc17, %specific_impl_fn.loc17_4.1
  838. // CHECK:STDOUT: %.loc17_13: init %empty_tuple.type = call %bound_method.loc17_13(%y.ref.loc17)
  839. // CHECK:STDOUT: name_binding_decl {
  840. // CHECK:STDOUT: %ycopy.patt: @Compound4.%pattern_type (%pattern_type.ad3e89.3) = binding_pattern ycopy [concrete]
  841. // CHECK:STDOUT: %ycopy.var_patt: @Compound4.%pattern_type (%pattern_type.ad3e89.3) = var_pattern %ycopy.patt [concrete]
  842. // CHECK:STDOUT: }
  843. // CHECK:STDOUT: %ycopy.var: ref @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = var %ycopy.var_patt
  844. // CHECK:STDOUT: %y.ref.loc18: @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = name_ref y, %y
  845. // CHECK:STDOUT: assign %ycopy.var, %y.ref.loc18
  846. // CHECK:STDOUT: %.loc18_14.1: type = splice_block %.loc18_14.2 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)] {
  847. // CHECK:STDOUT: %V.ref.loc18: %L1.type = name_ref V, %V.loc16_14.1 [symbolic = %V.loc16_14.2 (constants.%V)]
  848. // CHECK:STDOUT: %V.as_type.loc18: type = facet_access_type %V.ref.loc18 [symbolic = %V.as_type.loc16_25.2 (constants.%V.as_type)]
  849. // 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)]
  850. // CHECK:STDOUT: }
  851. // CHECK:STDOUT: %ycopy: ref @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = bind_name ycopy, %ycopy.var
  852. // CHECK:STDOUT: %ycopy.ref: ref @Compound4.%V.as_type.loc16_25.2 (%V.as_type) = name_ref ycopy, %ycopy
  853. // CHECK:STDOUT: %L1.ref.loc19: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type]
  854. // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.%assoc1 [concrete = constants.%assoc1]
  855. // CHECK:STDOUT: %impl.elem1.loc19_8.1: @Compound4.%.loc19_8 (%.e9a411.2) = impl_witness_access constants.%L1.lookup_impl_witness.0a136b.2, element1 [symbolic = %impl.elem1.loc19_8.2 (constants.%impl.elem1.a8c6e3.2)]
  856. // CHECK:STDOUT: %bound_method.loc19_8: <bound method> = bound_method %ycopy.ref, %impl.elem1.loc19_8.1
  857. // CHECK:STDOUT: %specific_impl_fn.loc19_8.1: <specific function> = specific_impl_function %impl.elem1.loc19_8.1, @S1(constants.%L1.facet.ed78cc.2) [symbolic = %specific_impl_fn.loc19_8.2 (constants.%specific_impl_fn.bbb82e.2)]
  858. // CHECK:STDOUT: %bound_method.loc19_17: <bound method> = bound_method %ycopy.ref, %specific_impl_fn.loc19_8.1
  859. // CHECK:STDOUT: %addr: @Compound4.%ptr (%ptr.72f01d.3) = addr_of %ycopy.ref
  860. // CHECK:STDOUT: %.loc19_17: init %empty_tuple.type = call %bound_method.loc19_17(%addr)
  861. // CHECK:STDOUT: return
  862. // CHECK:STDOUT: }
  863. // CHECK:STDOUT: }
  864. // CHECK:STDOUT:
  865. // CHECK:STDOUT: specific @R1(constants.%Self) {
  866. // CHECK:STDOUT: %Self => constants.%Self
  867. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%Self.as_type
  868. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad3e89.1
  869. // CHECK:STDOUT: }
  870. // CHECK:STDOUT:
  871. // CHECK:STDOUT: specific @S1(constants.%Self) {
  872. // CHECK:STDOUT: %Self => constants.%Self
  873. // CHECK:STDOUT: %Self.as_type.loc5_24.1 => constants.%Self.as_type
  874. // CHECK:STDOUT: %ptr.loc5_24.1 => constants.%ptr.72f01d.1
  875. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.53384b.1
  876. // CHECK:STDOUT: }
  877. // CHECK:STDOUT:
  878. // CHECK:STDOUT: specific @Simple4(constants.%T) {
  879. // CHECK:STDOUT: %T.loc9_12.2 => constants.%T
  880. // CHECK:STDOUT: %T.as_type.loc9_23.2 => constants.%T.as_type
  881. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad3e89.2
  882. // CHECK:STDOUT: }
  883. // CHECK:STDOUT:
  884. // CHECK:STDOUT: specific @R1(constants.%L1.facet.ed78cc.1) {
  885. // CHECK:STDOUT: %Self => constants.%L1.facet.ed78cc.1
  886. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%T.as_type
  887. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad3e89.2
  888. // CHECK:STDOUT: }
  889. // CHECK:STDOUT:
  890. // CHECK:STDOUT: specific @S1(constants.%L1.facet.ed78cc.1) {
  891. // CHECK:STDOUT: %Self => constants.%L1.facet.ed78cc.1
  892. // CHECK:STDOUT: %Self.as_type.loc5_24.1 => constants.%T.as_type
  893. // CHECK:STDOUT: %ptr.loc5_24.1 => constants.%ptr.72f01d.2
  894. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.53384b.2
  895. // CHECK:STDOUT: }
  896. // CHECK:STDOUT:
  897. // CHECK:STDOUT: specific @Compound4(constants.%V) {
  898. // CHECK:STDOUT: %V.loc16_14.2 => constants.%V
  899. // CHECK:STDOUT: %V.as_type.loc16_25.2 => constants.%V.as_type
  900. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad3e89.3
  901. // CHECK:STDOUT: }
  902. // CHECK:STDOUT:
  903. // CHECK:STDOUT: specific @R1(constants.%L1.facet.ed78cc.2) {
  904. // CHECK:STDOUT: %Self => constants.%L1.facet.ed78cc.2
  905. // CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%V.as_type
  906. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ad3e89.3
  907. // CHECK:STDOUT: }
  908. // CHECK:STDOUT:
  909. // CHECK:STDOUT: specific @S1(constants.%L1.facet.ed78cc.2) {
  910. // CHECK:STDOUT: %Self => constants.%L1.facet.ed78cc.2
  911. // CHECK:STDOUT: %Self.as_type.loc5_24.1 => constants.%V.as_type
  912. // CHECK:STDOUT: %ptr.loc5_24.1 => constants.%ptr.72f01d.3
  913. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.53384b.3
  914. // CHECK:STDOUT: }
  915. // CHECK:STDOUT:
  916. // CHECK:STDOUT: --- fail_interface_instance_caller_not.carbon
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: constants {
  919. // CHECK:STDOUT: %L2.type: type = facet_type <@L2> [concrete]
  920. // CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic]
  921. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  922. // CHECK:STDOUT: %pattern_type.47b45b.1: type = pattern_type %Self.as_type [symbolic]
  923. // CHECK:STDOUT: %R2.type: type = fn_type @R2 [concrete]
  924. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  925. // CHECK:STDOUT: %R2: %R2.type = struct_value () [concrete]
  926. // CHECK:STDOUT: %L2.assoc_type: type = assoc_entity_type @L2 [concrete]
  927. // CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, @L2.%R2.decl [concrete]
  928. // CHECK:STDOUT: %ptr.f3e54b.1: type = ptr_type %Self.as_type [symbolic]
  929. // CHECK:STDOUT: %pattern_type.696b36.1: type = pattern_type %ptr.f3e54b.1 [symbolic]
  930. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  931. // CHECK:STDOUT: %S2.type: type = fn_type @S2 [concrete]
  932. // CHECK:STDOUT: %S2: %S2.type = struct_value () [concrete]
  933. // CHECK:STDOUT: %assoc1: %L2.assoc_type = assoc_entity element1, @L2.%S2.decl [concrete]
  934. // CHECK:STDOUT: %T: %L2.type = bind_symbolic_name T, 0 [symbolic]
  935. // CHECK:STDOUT: %pattern_type.1c0: type = pattern_type %L2.type [concrete]
  936. // CHECK:STDOUT: %Simple5.type: type = fn_type @Simple5 [concrete]
  937. // CHECK:STDOUT: %Simple5: %Simple5.type = struct_value () [concrete]
  938. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  939. // CHECK:STDOUT: %L2.lookup_impl_witness: <witness> = lookup_impl_witness %T, @L2 [symbolic]
  940. // CHECK:STDOUT: %L2.facet: %L2.type = facet_value %T.as_type, (%L2.lookup_impl_witness) [symbolic]
  941. // CHECK:STDOUT: %.c42: type = fn_type_with_self_type %R2.type, %L2.facet [symbolic]
  942. // CHECK:STDOUT: %impl.elem0: %.c42 = impl_witness_access %L2.lookup_impl_witness, element0 [symbolic]
  943. // CHECK:STDOUT: %pattern_type.47b45b.2: type = pattern_type %T.as_type [symbolic]
  944. // CHECK:STDOUT: %specific_impl_fn.7ee: <specific function> = specific_impl_function %impl.elem0, @R2(%L2.facet) [symbolic]
  945. // CHECK:STDOUT: %.7f6: type = fn_type_with_self_type %S2.type, %L2.facet [symbolic]
  946. // CHECK:STDOUT: %impl.elem1: %.7f6 = impl_witness_access %L2.lookup_impl_witness, element1 [symbolic]
  947. // CHECK:STDOUT: %ptr.f3e54b.2: type = ptr_type %T.as_type [symbolic]
  948. // CHECK:STDOUT: %pattern_type.696b36.2: type = pattern_type %ptr.f3e54b.2 [symbolic]
  949. // CHECK:STDOUT: %specific_impl_fn.b69: <specific function> = specific_impl_function %impl.elem1, @S2(%L2.facet) [symbolic]
  950. // CHECK:STDOUT: %V: %L2.type = bind_symbolic_name V, 0 [symbolic]
  951. // CHECK:STDOUT: %Compound5.type: type = fn_type @Compound5 [concrete]
  952. // CHECK:STDOUT: %Compound5: %Compound5.type = struct_value () [concrete]
  953. // CHECK:STDOUT: }
  954. // CHECK:STDOUT:
  955. // CHECK:STDOUT: imports {
  956. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  957. // CHECK:STDOUT: import Core//prelude
  958. // CHECK:STDOUT: }
  959. // CHECK:STDOUT: }
  960. // CHECK:STDOUT:
  961. // CHECK:STDOUT: file {
  962. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  963. // CHECK:STDOUT: .Core = imports.%Core
  964. // CHECK:STDOUT: .L2 = %L2.decl
  965. // CHECK:STDOUT: .Simple5 = %Simple5.decl
  966. // CHECK:STDOUT: .Compound5 = %Compound5.decl
  967. // CHECK:STDOUT: }
  968. // CHECK:STDOUT: %Core.import = import Core
  969. // CHECK:STDOUT: %L2.decl: type = interface_decl @L2 [concrete = constants.%L2.type] {} {}
  970. // CHECK:STDOUT: %Simple5.decl: %Simple5.type = fn_decl @Simple5 [concrete = constants.%Simple5] {
  971. // CHECK:STDOUT: %T.patt: %pattern_type.1c0 = symbolic_binding_pattern T, 0 [concrete]
  972. // CHECK:STDOUT: } {
  973. // CHECK:STDOUT: %L2.ref: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  974. // CHECK:STDOUT: %T.loc10_12.1: %L2.type = bind_symbolic_name T, 0 [symbolic = %T.loc10_12.2 (constants.%T)]
  975. // CHECK:STDOUT: }
  976. // CHECK:STDOUT: %Compound5.decl: %Compound5.type = fn_decl @Compound5 [concrete = constants.%Compound5] {
  977. // CHECK:STDOUT: %V.patt: %pattern_type.1c0 = symbolic_binding_pattern V, 0 [concrete]
  978. // CHECK:STDOUT: } {
  979. // CHECK:STDOUT: %L2.ref.loc30: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  980. // CHECK:STDOUT: %V.loc30_14.1: %L2.type = bind_symbolic_name V, 0 [symbolic = %V.loc30_14.2 (constants.%V)]
  981. // CHECK:STDOUT: }
  982. // CHECK:STDOUT: }
  983. // CHECK:STDOUT:
  984. // CHECK:STDOUT: interface @L2 {
  985. // CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  986. // CHECK:STDOUT: %R2.decl: %R2.type = fn_decl @R2 [concrete = constants.%R2] {
  987. // CHECK:STDOUT: %self.patt: @R2.%pattern_type (%pattern_type.47b45b.1) = binding_pattern self [concrete]
  988. // CHECK:STDOUT: %self.param_patt: @R2.%pattern_type (%pattern_type.47b45b.1) = value_param_pattern %self.patt, call_param0 [concrete]
  989. // CHECK:STDOUT: } {
  990. // CHECK:STDOUT: %self.param: @R2.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0
  991. // CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] {
  992. // CHECK:STDOUT: %Self.ref: %L2.type = name_ref Self, @L2.%Self [symbolic = %Self (constants.%Self)]
  993. // 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)]
  994. // 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)]
  995. // CHECK:STDOUT: }
  996. // CHECK:STDOUT: %self: @R2.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name self, %self.param
  997. // CHECK:STDOUT: }
  998. // CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, %R2.decl [concrete = constants.%assoc0]
  999. // CHECK:STDOUT: %S2.decl: %S2.type = fn_decl @S2 [concrete = constants.%S2] {
  1000. // CHECK:STDOUT: %self.patt: @S2.%pattern_type (%pattern_type.696b36.1) = binding_pattern self [concrete]
  1001. // CHECK:STDOUT: %self.param_patt: @S2.%pattern_type (%pattern_type.696b36.1) = value_param_pattern %self.patt, call_param0 [concrete]
  1002. // CHECK:STDOUT: %.loc6_9: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1003. // CHECK:STDOUT: } {
  1004. // CHECK:STDOUT: %self.param: @S2.%ptr.loc6_24.1 (%ptr.f3e54b.1) = value_param call_param0
  1005. // CHECK:STDOUT: %.loc6_24.1: type = splice_block %ptr.loc6_24.2 [symbolic = %ptr.loc6_24.1 (constants.%ptr.f3e54b.1)] {
  1006. // CHECK:STDOUT: %Self.ref: %L2.type = name_ref Self, @L2.%Self [symbolic = %Self (constants.%Self)]
  1007. // 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)]
  1008. // 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)]
  1009. // CHECK:STDOUT: %ptr.loc6_24.2: type = ptr_type %.loc6_24.2 [symbolic = %ptr.loc6_24.1 (constants.%ptr.f3e54b.1)]
  1010. // CHECK:STDOUT: }
  1011. // CHECK:STDOUT: %self: @S2.%ptr.loc6_24.1 (%ptr.f3e54b.1) = bind_name self, %self.param
  1012. // CHECK:STDOUT: }
  1013. // CHECK:STDOUT: %assoc1: %L2.assoc_type = assoc_entity element1, %S2.decl [concrete = constants.%assoc1]
  1014. // CHECK:STDOUT:
  1015. // CHECK:STDOUT: !members:
  1016. // CHECK:STDOUT: .Self = %Self
  1017. // CHECK:STDOUT: .R2 = %assoc0
  1018. // CHECK:STDOUT: .S2 = %assoc1
  1019. // CHECK:STDOUT: witness = (%R2.decl, %S2.decl)
  1020. // CHECK:STDOUT: }
  1021. // CHECK:STDOUT:
  1022. // CHECK:STDOUT: generic fn @R2(@L2.%Self: %L2.type) {
  1023. // CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1024. // CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  1025. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type (constants.%pattern_type.47b45b.1)]
  1026. // CHECK:STDOUT:
  1027. // CHECK:STDOUT: fn(%self.param: @R2.%Self.as_type.loc5_15.1 (%Self.as_type));
  1028. // CHECK:STDOUT: }
  1029. // CHECK:STDOUT:
  1030. // CHECK:STDOUT: generic fn @S2(@L2.%Self: %L2.type) {
  1031. // CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1032. // CHECK:STDOUT: %Self.as_type.loc6_24.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_24.1 (constants.%Self.as_type)]
  1033. // CHECK:STDOUT: %ptr.loc6_24.1: type = ptr_type %Self.as_type.loc6_24.1 [symbolic = %ptr.loc6_24.1 (constants.%ptr.f3e54b.1)]
  1034. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc6_24.1 [symbolic = %pattern_type (constants.%pattern_type.696b36.1)]
  1035. // CHECK:STDOUT:
  1036. // CHECK:STDOUT: fn(%self.param: @S2.%ptr.loc6_24.1 (%ptr.f3e54b.1));
  1037. // CHECK:STDOUT: }
  1038. // CHECK:STDOUT:
  1039. // CHECK:STDOUT: generic fn @Simple5(%T.loc10_12.1: %L2.type) {
  1040. // CHECK:STDOUT: %T.loc10_12.2: %L2.type = bind_symbolic_name T, 0 [symbolic = %T.loc10_12.2 (constants.%T)]
  1041. // CHECK:STDOUT:
  1042. // CHECK:STDOUT: !definition:
  1043. // 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)]
  1044. // CHECK:STDOUT: %L2.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc10_12.2, @L2 [symbolic = %L2.lookup_impl_witness (constants.%L2.lookup_impl_witness)]
  1045. // CHECK:STDOUT: %L2.facet: %L2.type = facet_value %T.as_type.loc18_4.2, (%L2.lookup_impl_witness) [symbolic = %L2.facet (constants.%L2.facet)]
  1046. // CHECK:STDOUT: %.loc18_4.2: type = fn_type_with_self_type constants.%R2.type, %L2.facet [symbolic = %.loc18_4.2 (constants.%.c42)]
  1047. // CHECK:STDOUT: %impl.elem0.loc18_4.2: @Simple5.%.loc18_4.2 (%.c42) = impl_witness_access %L2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)]
  1048. // 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.7ee)]
  1049. // CHECK:STDOUT: %.loc26_4.2: type = fn_type_with_self_type constants.%S2.type, %L2.facet [symbolic = %.loc26_4.2 (constants.%.7f6)]
  1050. // CHECK:STDOUT: %impl.elem1.loc26_4.2: @Simple5.%.loc26_4.2 (%.7f6) = impl_witness_access %L2.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)]
  1051. // 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.b69)]
  1052. // CHECK:STDOUT:
  1053. // CHECK:STDOUT: fn() {
  1054. // CHECK:STDOUT: !entry:
  1055. // CHECK:STDOUT: %T.ref.loc18: %L2.type = name_ref T, %T.loc10_12.1 [symbolic = %T.loc10_12.2 (constants.%T)]
  1056. // CHECK:STDOUT: %R2.ref: %L2.assoc_type = name_ref R2, @L2.%assoc0 [concrete = constants.%assoc0]
  1057. // 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)]
  1058. // 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)]
  1059. // CHECK:STDOUT: %impl.elem0.loc18_4.1: @Simple5.%.loc18_4.2 (%.c42) = impl_witness_access constants.%L2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)]
  1060. // 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.7ee)]
  1061. // CHECK:STDOUT: %.loc18_8: init %empty_tuple.type = call %specific_impl_fn.loc18_4.1(<error>) [concrete = <error>]
  1062. // CHECK:STDOUT: %T.ref.loc26: %L2.type = name_ref T, %T.loc10_12.1 [symbolic = %T.loc10_12.2 (constants.%T)]
  1063. // CHECK:STDOUT: %S2.ref: %L2.assoc_type = name_ref S2, @L2.%assoc1 [concrete = constants.%assoc1]
  1064. // CHECK:STDOUT: %T.as_type.loc26: type = facet_access_type %T.ref.loc26 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)]
  1065. // 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)]
  1066. // CHECK:STDOUT: %impl.elem1.loc26_4.1: @Simple5.%.loc26_4.2 (%.7f6) = impl_witness_access constants.%L2.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)]
  1067. // 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.b69)]
  1068. // CHECK:STDOUT: %addr: <error> = addr_of <error> [concrete = <error>]
  1069. // CHECK:STDOUT: %.loc26_8: init %empty_tuple.type = call %specific_impl_fn.loc26_4.1(<error>) [concrete = <error>]
  1070. // CHECK:STDOUT: return
  1071. // CHECK:STDOUT: }
  1072. // CHECK:STDOUT: }
  1073. // CHECK:STDOUT:
  1074. // CHECK:STDOUT: generic fn @Compound5(%V.loc30_14.1: %L2.type) {
  1075. // CHECK:STDOUT: %V.loc30_14.2: %L2.type = bind_symbolic_name V, 0 [symbolic = %V.loc30_14.2 (constants.%V)]
  1076. // CHECK:STDOUT:
  1077. // CHECK:STDOUT: !definition:
  1078. // CHECK:STDOUT:
  1079. // CHECK:STDOUT: fn() {
  1080. // CHECK:STDOUT: !entry:
  1081. // CHECK:STDOUT: %V.ref.loc35: %L2.type = name_ref V, %V.loc30_14.1 [symbolic = %V.loc30_14.2 (constants.%V)]
  1082. // CHECK:STDOUT: %L2.ref.loc35: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1083. // CHECK:STDOUT: %R2.ref: %L2.assoc_type = name_ref R2, @L2.%assoc0 [concrete = constants.%assoc0]
  1084. // CHECK:STDOUT: %V.ref.loc40: %L2.type = name_ref V, %V.loc30_14.1 [symbolic = %V.loc30_14.2 (constants.%V)]
  1085. // CHECK:STDOUT: %L2.ref.loc40: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type]
  1086. // CHECK:STDOUT: %S2.ref: %L2.assoc_type = name_ref S2, @L2.%assoc1 [concrete = constants.%assoc1]
  1087. // CHECK:STDOUT: return
  1088. // CHECK:STDOUT: }
  1089. // CHECK:STDOUT: }
  1090. // CHECK:STDOUT:
  1091. // CHECK:STDOUT: specific @R2(constants.%Self) {
  1092. // CHECK:STDOUT: %Self => constants.%Self
  1093. // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type
  1094. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.47b45b.1
  1095. // CHECK:STDOUT: }
  1096. // CHECK:STDOUT:
  1097. // CHECK:STDOUT: specific @S2(constants.%Self) {
  1098. // CHECK:STDOUT: %Self => constants.%Self
  1099. // CHECK:STDOUT: %Self.as_type.loc6_24.1 => constants.%Self.as_type
  1100. // CHECK:STDOUT: %ptr.loc6_24.1 => constants.%ptr.f3e54b.1
  1101. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.696b36.1
  1102. // CHECK:STDOUT: }
  1103. // CHECK:STDOUT:
  1104. // CHECK:STDOUT: specific @Simple5(constants.%T) {
  1105. // CHECK:STDOUT: %T.loc10_12.2 => constants.%T
  1106. // CHECK:STDOUT: }
  1107. // CHECK:STDOUT:
  1108. // CHECK:STDOUT: specific @R2(constants.%L2.facet) {
  1109. // CHECK:STDOUT: %Self => constants.%L2.facet
  1110. // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%T.as_type
  1111. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.47b45b.2
  1112. // CHECK:STDOUT: }
  1113. // CHECK:STDOUT:
  1114. // CHECK:STDOUT: specific @S2(constants.%L2.facet) {
  1115. // CHECK:STDOUT: %Self => constants.%L2.facet
  1116. // CHECK:STDOUT: %Self.as_type.loc6_24.1 => constants.%T.as_type
  1117. // CHECK:STDOUT: %ptr.loc6_24.1 => constants.%ptr.f3e54b.2
  1118. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.696b36.2
  1119. // CHECK:STDOUT: }
  1120. // CHECK:STDOUT:
  1121. // CHECK:STDOUT: specific @Compound5(constants.%V) {
  1122. // CHECK:STDOUT: %V.loc30_14.2 => constants.%V
  1123. // CHECK:STDOUT: }
  1124. // CHECK:STDOUT:
  1125. // CHECK:STDOUT: --- fail_combine_non_instance.carbon
  1126. // CHECK:STDOUT:
  1127. // CHECK:STDOUT: constants {
  1128. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  1129. // CHECK:STDOUT: %Self.31d: %A.type = bind_symbolic_name Self, 0 [symbolic]
  1130. // CHECK:STDOUT: %G.type.c3a: type = fn_type @G.1 [concrete]
  1131. // CHECK:STDOUT: %G.11a: %G.type.c3a = struct_value () [concrete]
  1132. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete]
  1133. // CHECK:STDOUT: %assoc0.d52: %A.assoc_type = assoc_entity element0, @A.%G.decl [concrete]
  1134. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1135. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1136. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1137. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness file.%A.impl_witness_table [concrete]
  1138. // CHECK:STDOUT: %G.type.486: type = fn_type @G.2 [concrete]
  1139. // CHECK:STDOUT: %G.001: %G.type.486 = struct_value () [concrete]
  1140. // CHECK:STDOUT: %A.facet: %A.type = facet_value %C, (%A.impl_witness) [concrete]
  1141. // CHECK:STDOUT: %Fails.type: type = fn_type @Fails [concrete]
  1142. // CHECK:STDOUT: %Fails: %Fails.type = struct_value () [concrete]
  1143. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  1144. // CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
  1145. // CHECK:STDOUT: %Op.type.27a: type = fn_type @Op.1 [concrete]
  1146. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1147. // CHECK:STDOUT: %Op.type.f99: type = fn_type @Op.2, @impl.f92(%T) [symbolic]
  1148. // CHECK:STDOUT: %Op.05a: %Op.type.f99 = struct_value () [symbolic]
  1149. // CHECK:STDOUT: %BitAnd.impl_witness.0e5: <witness> = impl_witness imports.%BitAnd.impl_witness_table, @impl.f92(type) [concrete]
  1150. // CHECK:STDOUT: %Op.type.eb8: type = fn_type @Op.2, @impl.f92(type) [concrete]
  1151. // CHECK:STDOUT: %Op.444: %Op.type.eb8 = struct_value () [concrete]
  1152. // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, (%BitAnd.impl_witness.0e5) [concrete]
  1153. // CHECK:STDOUT: %.518: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete]
  1154. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %A.type, %Op.444 [concrete]
  1155. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.444, @Op.2(type) [concrete]
  1156. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %A.type, %Op.specific_fn [concrete]
  1157. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1158. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1159. // CHECK:STDOUT: }
  1160. // CHECK:STDOUT:
  1161. // CHECK:STDOUT: imports {
  1162. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1163. // CHECK:STDOUT: .BitAnd = %Core.BitAnd
  1164. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1165. // CHECK:STDOUT: import Core//prelude
  1166. // CHECK:STDOUT: }
  1167. // CHECK:STDOUT: %Core.BitAnd: type = import_ref Core//prelude, BitAnd, loaded [concrete = constants.%BitAnd.type]
  1168. // 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)]
  1169. // CHECK:STDOUT: %BitAnd.impl_witness_table = impl_witness_table (%Core.import_ref.1e6), @impl.f92 [concrete]
  1170. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1171. // CHECK:STDOUT: }
  1172. // CHECK:STDOUT:
  1173. // CHECK:STDOUT: file {
  1174. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1175. // CHECK:STDOUT: .Core = imports.%Core
  1176. // CHECK:STDOUT: .A = %A.decl
  1177. // CHECK:STDOUT: .C = %C.decl
  1178. // CHECK:STDOUT: .Fails = %Fails.decl
  1179. // CHECK:STDOUT: }
  1180. // CHECK:STDOUT: %Core.import = import Core
  1181. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  1182. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1183. // CHECK:STDOUT: impl_decl @impl.77d [concrete] {} {
  1184. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1185. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1186. // CHECK:STDOUT: }
  1187. // CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@impl.77d.%G.decl), @impl.77d [concrete]
  1188. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness]
  1189. // CHECK:STDOUT: %Fails.decl: %Fails.type = fn_decl @Fails [concrete = constants.%Fails] {} {}
  1190. // CHECK:STDOUT: }
  1191. // CHECK:STDOUT:
  1192. // CHECK:STDOUT: interface @A {
  1193. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.31d]
  1194. // CHECK:STDOUT: %G.decl: %G.type.c3a = fn_decl @G.1 [concrete = constants.%G.11a] {} {}
  1195. // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, %G.decl [concrete = constants.%assoc0.d52]
  1196. // CHECK:STDOUT:
  1197. // CHECK:STDOUT: !members:
  1198. // CHECK:STDOUT: .Self = %Self
  1199. // CHECK:STDOUT: .G = %assoc0
  1200. // CHECK:STDOUT: witness = (%G.decl)
  1201. // CHECK:STDOUT: }
  1202. // CHECK:STDOUT:
  1203. // CHECK:STDOUT: impl @impl.77d: %C.ref as %A.ref {
  1204. // CHECK:STDOUT: %G.decl: %G.type.486 = fn_decl @G.2 [concrete = constants.%G.001] {} {}
  1205. // CHECK:STDOUT:
  1206. // CHECK:STDOUT: !members:
  1207. // CHECK:STDOUT: .G = %G.decl
  1208. // CHECK:STDOUT: witness = file.%A.impl_witness
  1209. // CHECK:STDOUT: }
  1210. // CHECK:STDOUT:
  1211. // CHECK:STDOUT: class @C {
  1212. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1213. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  1214. // CHECK:STDOUT: complete_type_witness = %complete_type
  1215. // CHECK:STDOUT:
  1216. // CHECK:STDOUT: !members:
  1217. // CHECK:STDOUT: .Self = constants.%C
  1218. // CHECK:STDOUT: }
  1219. // CHECK:STDOUT:
  1220. // CHECK:STDOUT: generic fn @G.1(@A.%Self: %A.type) {
  1221. // CHECK:STDOUT: fn();
  1222. // CHECK:STDOUT: }
  1223. // CHECK:STDOUT:
  1224. // CHECK:STDOUT: fn @G.2() {
  1225. // CHECK:STDOUT: !entry:
  1226. // CHECK:STDOUT: return
  1227. // CHECK:STDOUT: }
  1228. // CHECK:STDOUT:
  1229. // CHECK:STDOUT: fn @Fails() {
  1230. // CHECK:STDOUT: !entry:
  1231. // CHECK:STDOUT: %.loc22_5.1: %empty_struct_type = struct_literal ()
  1232. // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1233. // CHECK:STDOUT: %.loc22_5.2: ref %C = temporary_storage
  1234. // CHECK:STDOUT: %.loc22_5.3: init %C = class_init (), %.loc22_5.2 [concrete = constants.%C.val]
  1235. // CHECK:STDOUT: %.loc22_5.4: ref %C = temporary %.loc22_5.2, %.loc22_5.3
  1236. // CHECK:STDOUT: %.loc22_7: ref %C = converted %.loc22_5.1, %.loc22_5.4
  1237. // CHECK:STDOUT: %A.ref.loc22_15: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1238. // CHECK:STDOUT: %A.ref.loc22_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1239. // CHECK:STDOUT: %impl.elem0.loc22: %.518 = impl_witness_access constants.%BitAnd.impl_witness.0e5, element0 [concrete = constants.%Op.444]
  1240. // CHECK:STDOUT: %bound_method.loc22_17.1: <bound method> = bound_method %A.ref.loc22_15, %impl.elem0.loc22 [concrete = constants.%Op.bound]
  1241. // CHECK:STDOUT: %specific_fn.loc22: <specific function> = specific_function %impl.elem0.loc22, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1242. // CHECK:STDOUT: %bound_method.loc22_17.2: <bound method> = bound_method %A.ref.loc22_15, %specific_fn.loc22 [concrete = constants.%bound_method]
  1243. // 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]
  1244. // CHECK:STDOUT: %G.ref.loc22: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1245. // CHECK:STDOUT: %.loc22_12: %A.type = converted %.loc22_7, <error> [concrete = <error>]
  1246. // CHECK:STDOUT: %.loc30_6.1: %empty_struct_type = struct_literal ()
  1247. // CHECK:STDOUT: %C.ref.loc30_11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1248. // CHECK:STDOUT: %.loc30_6.2: ref %C = temporary_storage
  1249. // CHECK:STDOUT: %.loc30_6.3: init %C = class_init (), %.loc30_6.2 [concrete = constants.%C.val]
  1250. // CHECK:STDOUT: %.loc30_6.4: ref %C = temporary %.loc30_6.2, %.loc30_6.3
  1251. // CHECK:STDOUT: %.loc30_8: ref %C = converted %.loc30_6.1, %.loc30_6.4
  1252. // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1253. // CHECK:STDOUT: %A.ref.loc30_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1254. // CHECK:STDOUT: %A.ref.loc30_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1255. // CHECK:STDOUT: %impl.elem0.loc30_26: %.518 = impl_witness_access constants.%BitAnd.impl_witness.0e5, element0 [concrete = constants.%Op.444]
  1256. // CHECK:STDOUT: %bound_method.loc30_26.1: <bound method> = bound_method %A.ref.loc30_24, %impl.elem0.loc30_26 [concrete = constants.%Op.bound]
  1257. // CHECK:STDOUT: %specific_fn.loc30_26: <specific function> = specific_function %impl.elem0.loc30_26, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1258. // CHECK:STDOUT: %bound_method.loc30_26.2: <bound method> = bound_method %A.ref.loc30_24, %specific_fn.loc30_26 [concrete = constants.%bound_method]
  1259. // 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]
  1260. // CHECK:STDOUT: %.loc30_29.1: type = value_of_initializer %type.and.loc30_26 [concrete = constants.%A.type]
  1261. // CHECK:STDOUT: %.loc30_29.2: type = converted %type.and.loc30_26, %.loc30_29.1 [concrete = constants.%A.type]
  1262. // CHECK:STDOUT: %A.facet.loc30: %A.type = facet_value constants.%C, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1263. // CHECK:STDOUT: %.loc30_20: %A.type = converted %C.ref.loc30_18, %A.facet.loc30 [concrete = constants.%A.facet]
  1264. // CHECK:STDOUT: %as_type.loc30: type = facet_access_type %.loc30_20 [concrete = constants.%C]
  1265. // CHECK:STDOUT: %.loc30_30: type = converted %.loc30_20, %as_type.loc30 [concrete = constants.%C]
  1266. // CHECK:STDOUT: %A.ref.loc30_35: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1267. // CHECK:STDOUT: %A.ref.loc30_39: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1268. // CHECK:STDOUT: %impl.elem0.loc30_37: %.518 = impl_witness_access constants.%BitAnd.impl_witness.0e5, element0 [concrete = constants.%Op.444]
  1269. // CHECK:STDOUT: %bound_method.loc30_37.1: <bound method> = bound_method %A.ref.loc30_35, %impl.elem0.loc30_37 [concrete = constants.%Op.bound]
  1270. // CHECK:STDOUT: %specific_fn.loc30_37: <specific function> = specific_function %impl.elem0.loc30_37, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1271. // CHECK:STDOUT: %bound_method.loc30_37.2: <bound method> = bound_method %A.ref.loc30_35, %specific_fn.loc30_37 [concrete = constants.%bound_method]
  1272. // 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]
  1273. // CHECK:STDOUT: %G.ref.loc30: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1274. // CHECK:STDOUT: %.loc30_32: %A.type = converted %.loc30_8, <error> [concrete = <error>]
  1275. // CHECK:STDOUT: %.loc38_6.1: %empty_struct_type = struct_literal ()
  1276. // CHECK:STDOUT: %C.ref.loc38_11: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1277. // CHECK:STDOUT: %.loc38_6.2: ref %C = temporary_storage
  1278. // CHECK:STDOUT: %.loc38_6.3: init %C = class_init (), %.loc38_6.2 [concrete = constants.%C.val]
  1279. // CHECK:STDOUT: %.loc38_6.4: ref %C = temporary %.loc38_6.2, %.loc38_6.3
  1280. // CHECK:STDOUT: %.loc38_8: ref %C = converted %.loc38_6.1, %.loc38_6.4
  1281. // CHECK:STDOUT: %C.ref.loc38_18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1282. // CHECK:STDOUT: %A.ref.loc38_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1283. // CHECK:STDOUT: %A.ref.loc38_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1284. // CHECK:STDOUT: %impl.elem0.loc38: %.518 = impl_witness_access constants.%BitAnd.impl_witness.0e5, element0 [concrete = constants.%Op.444]
  1285. // CHECK:STDOUT: %bound_method.loc38_26.1: <bound method> = bound_method %A.ref.loc38_24, %impl.elem0.loc38 [concrete = constants.%Op.bound]
  1286. // CHECK:STDOUT: %specific_fn.loc38: <specific function> = specific_function %impl.elem0.loc38, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1287. // CHECK:STDOUT: %bound_method.loc38_26.2: <bound method> = bound_method %A.ref.loc38_24, %specific_fn.loc38 [concrete = constants.%bound_method]
  1288. // 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]
  1289. // CHECK:STDOUT: %.loc38_29.1: type = value_of_initializer %type.and.loc38 [concrete = constants.%A.type]
  1290. // CHECK:STDOUT: %.loc38_29.2: type = converted %type.and.loc38, %.loc38_29.1 [concrete = constants.%A.type]
  1291. // CHECK:STDOUT: %A.facet.loc38: %A.type = facet_value constants.%C, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1292. // CHECK:STDOUT: %.loc38_20: %A.type = converted %C.ref.loc38_18, %A.facet.loc38 [concrete = constants.%A.facet]
  1293. // CHECK:STDOUT: %as_type.loc38: type = facet_access_type %.loc38_20 [concrete = constants.%C]
  1294. // CHECK:STDOUT: %.loc38_30: type = converted %.loc38_20, %as_type.loc38 [concrete = constants.%C]
  1295. // CHECK:STDOUT: %A.ref.loc38_34: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1296. // CHECK:STDOUT: %G.ref.loc38: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1297. // CHECK:STDOUT: %.loc38_32: %A.type = converted %.loc38_8, <error> [concrete = <error>]
  1298. // CHECK:STDOUT: return
  1299. // CHECK:STDOUT: }
  1300. // CHECK:STDOUT:
  1301. // CHECK:STDOUT: specific @G.1(constants.%Self.31d) {}
  1302. // CHECK:STDOUT:
  1303. // CHECK:STDOUT: specific @G.1(constants.%A.facet) {}
  1304. // CHECK:STDOUT:
  1305. // CHECK:STDOUT: --- allowed_combine_non_instance.carbon
  1306. // CHECK:STDOUT:
  1307. // CHECK:STDOUT: constants {
  1308. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  1309. // CHECK:STDOUT: %Self.31d: %A.type = bind_symbolic_name Self, 0 [symbolic]
  1310. // CHECK:STDOUT: %G.type.c3a: type = fn_type @G.1 [concrete]
  1311. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1312. // CHECK:STDOUT: %G.11a: %G.type.c3a = struct_value () [concrete]
  1313. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete]
  1314. // CHECK:STDOUT: %assoc0.d52: %A.assoc_type = assoc_entity element0, @A.%G.decl [concrete]
  1315. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1316. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1317. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1318. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness file.%A.impl_witness_table [concrete]
  1319. // CHECK:STDOUT: %G.type.486: type = fn_type @G.2 [concrete]
  1320. // CHECK:STDOUT: %G.001: %G.type.486 = struct_value () [concrete]
  1321. // CHECK:STDOUT: %A.facet: %A.type = facet_value %C, (%A.impl_witness) [concrete]
  1322. // CHECK:STDOUT: %Works.type: type = fn_type @Works [concrete]
  1323. // CHECK:STDOUT: %Works: %Works.type = struct_value () [concrete]
  1324. // CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
  1325. // CHECK:STDOUT: %Op.type.27a: type = fn_type @Op.1 [concrete]
  1326. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1327. // CHECK:STDOUT: %Op.type.f99: type = fn_type @Op.2, @impl.f92(%T) [symbolic]
  1328. // CHECK:STDOUT: %Op.05a: %Op.type.f99 = struct_value () [symbolic]
  1329. // CHECK:STDOUT: %BitAnd.impl_witness.0e5: <witness> = impl_witness imports.%BitAnd.impl_witness_table, @impl.f92(type) [concrete]
  1330. // CHECK:STDOUT: %Op.type.eb8: type = fn_type @Op.2, @impl.f92(type) [concrete]
  1331. // CHECK:STDOUT: %Op.444: %Op.type.eb8 = struct_value () [concrete]
  1332. // CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, (%BitAnd.impl_witness.0e5) [concrete]
  1333. // CHECK:STDOUT: %.518: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete]
  1334. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %A.type, %Op.444 [concrete]
  1335. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.444, @Op.2(type) [concrete]
  1336. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %A.type, %Op.specific_fn [concrete]
  1337. // CHECK:STDOUT: %.e63: type = fn_type_with_self_type %G.type.c3a, %A.facet [concrete]
  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: import Core//prelude
  1344. // CHECK:STDOUT: }
  1345. // CHECK:STDOUT: %Core.BitAnd: type = import_ref Core//prelude, BitAnd, loaded [concrete = constants.%BitAnd.type]
  1346. // 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)]
  1347. // CHECK:STDOUT: %BitAnd.impl_witness_table = impl_witness_table (%Core.import_ref.1e6), @impl.f92 [concrete]
  1348. // CHECK:STDOUT: }
  1349. // CHECK:STDOUT:
  1350. // CHECK:STDOUT: file {
  1351. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1352. // CHECK:STDOUT: .Core = imports.%Core
  1353. // CHECK:STDOUT: .A = %A.decl
  1354. // CHECK:STDOUT: .C = %C.decl
  1355. // CHECK:STDOUT: .Works = %Works.decl
  1356. // CHECK:STDOUT: }
  1357. // CHECK:STDOUT: %Core.import = import Core
  1358. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  1359. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1360. // CHECK:STDOUT: impl_decl @impl.77d [concrete] {} {
  1361. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1362. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1363. // CHECK:STDOUT: }
  1364. // CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@impl.77d.%G.decl), @impl.77d [concrete]
  1365. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness]
  1366. // CHECK:STDOUT: %Works.decl: %Works.type = fn_decl @Works [concrete = constants.%Works] {} {}
  1367. // CHECK:STDOUT: }
  1368. // CHECK:STDOUT:
  1369. // CHECK:STDOUT: interface @A {
  1370. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.31d]
  1371. // CHECK:STDOUT: %G.decl: %G.type.c3a = fn_decl @G.1 [concrete = constants.%G.11a] {} {}
  1372. // CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, %G.decl [concrete = constants.%assoc0.d52]
  1373. // CHECK:STDOUT:
  1374. // CHECK:STDOUT: !members:
  1375. // CHECK:STDOUT: .Self = %Self
  1376. // CHECK:STDOUT: .G = %assoc0
  1377. // CHECK:STDOUT: witness = (%G.decl)
  1378. // CHECK:STDOUT: }
  1379. // CHECK:STDOUT:
  1380. // CHECK:STDOUT: impl @impl.77d: %C.ref as %A.ref {
  1381. // CHECK:STDOUT: %G.decl: %G.type.486 = fn_decl @G.2 [concrete = constants.%G.001] {} {}
  1382. // CHECK:STDOUT:
  1383. // CHECK:STDOUT: !members:
  1384. // CHECK:STDOUT: .G = %G.decl
  1385. // CHECK:STDOUT: witness = file.%A.impl_witness
  1386. // CHECK:STDOUT: }
  1387. // CHECK:STDOUT:
  1388. // CHECK:STDOUT: class @C {
  1389. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1390. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  1391. // CHECK:STDOUT: complete_type_witness = %complete_type
  1392. // CHECK:STDOUT:
  1393. // CHECK:STDOUT: !members:
  1394. // CHECK:STDOUT: .Self = constants.%C
  1395. // CHECK:STDOUT: }
  1396. // CHECK:STDOUT:
  1397. // CHECK:STDOUT: generic fn @G.1(@A.%Self: %A.type) {
  1398. // CHECK:STDOUT: fn();
  1399. // CHECK:STDOUT: }
  1400. // CHECK:STDOUT:
  1401. // CHECK:STDOUT: fn @G.2() {
  1402. // CHECK:STDOUT: !entry:
  1403. // CHECK:STDOUT: return
  1404. // CHECK:STDOUT: }
  1405. // CHECK:STDOUT:
  1406. // CHECK:STDOUT: fn @Works() {
  1407. // CHECK:STDOUT: !entry:
  1408. // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1409. // CHECK:STDOUT: %A.ref.loc13_7: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1410. // CHECK:STDOUT: %A.ref.loc13_11: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1411. // CHECK:STDOUT: %impl.elem0.loc13_9: %.518 = impl_witness_access constants.%BitAnd.impl_witness.0e5, element0 [concrete = constants.%Op.444]
  1412. // CHECK:STDOUT: %bound_method.loc13_9.1: <bound method> = bound_method %A.ref.loc13_7, %impl.elem0.loc13_9 [concrete = constants.%Op.bound]
  1413. // CHECK:STDOUT: %specific_fn.loc13: <specific function> = specific_function %impl.elem0.loc13_9, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1414. // CHECK:STDOUT: %bound_method.loc13_9.2: <bound method> = bound_method %A.ref.loc13_7, %specific_fn.loc13 [concrete = constants.%bound_method]
  1415. // 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]
  1416. // CHECK:STDOUT: %G.ref.loc13: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1417. // CHECK:STDOUT: %A.facet.loc13: %A.type = facet_value constants.%C, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1418. // CHECK:STDOUT: %.loc13: %A.type = converted %C.ref.loc13, %A.facet.loc13 [concrete = constants.%A.facet]
  1419. // CHECK:STDOUT: %impl.elem0.loc13_4: %.e63 = impl_witness_access constants.%A.impl_witness, element0 [concrete = constants.%G.001]
  1420. // CHECK:STDOUT: %G.call.loc13: init %empty_tuple.type = call %impl.elem0.loc13_4()
  1421. // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1422. // CHECK:STDOUT: %A.ref.loc14_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1423. // CHECK:STDOUT: %A.ref.loc14_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1424. // CHECK:STDOUT: %impl.elem0.loc14_12: %.518 = impl_witness_access constants.%BitAnd.impl_witness.0e5, element0 [concrete = constants.%Op.444]
  1425. // CHECK:STDOUT: %bound_method.loc14_12.1: <bound method> = bound_method %A.ref.loc14_10, %impl.elem0.loc14_12 [concrete = constants.%Op.bound]
  1426. // CHECK:STDOUT: %specific_fn.loc14_12: <specific function> = specific_function %impl.elem0.loc14_12, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1427. // CHECK:STDOUT: %bound_method.loc14_12.2: <bound method> = bound_method %A.ref.loc14_10, %specific_fn.loc14_12 [concrete = constants.%bound_method]
  1428. // 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]
  1429. // CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %type.and.loc14_12 [concrete = constants.%A.type]
  1430. // CHECK:STDOUT: %.loc14_15.2: type = converted %type.and.loc14_12, %.loc14_15.1 [concrete = constants.%A.type]
  1431. // CHECK:STDOUT: %A.facet.loc14: %A.type = facet_value constants.%C, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1432. // CHECK:STDOUT: %.loc14_6: %A.type = converted %C.ref.loc14, %A.facet.loc14 [concrete = constants.%A.facet]
  1433. // CHECK:STDOUT: %A.ref.loc14_20: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1434. // CHECK:STDOUT: %A.ref.loc14_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1435. // CHECK:STDOUT: %impl.elem0.loc14_22: %.518 = impl_witness_access constants.%BitAnd.impl_witness.0e5, element0 [concrete = constants.%Op.444]
  1436. // CHECK:STDOUT: %bound_method.loc14_22.1: <bound method> = bound_method %A.ref.loc14_20, %impl.elem0.loc14_22 [concrete = constants.%Op.bound]
  1437. // CHECK:STDOUT: %specific_fn.loc14_22: <specific function> = specific_function %impl.elem0.loc14_22, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1438. // CHECK:STDOUT: %bound_method.loc14_22.2: <bound method> = bound_method %A.ref.loc14_20, %specific_fn.loc14_22 [concrete = constants.%bound_method]
  1439. // 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]
  1440. // CHECK:STDOUT: %G.ref.loc14: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1441. // CHECK:STDOUT: %impl.elem0.loc14_17: %.e63 = impl_witness_access constants.%A.impl_witness, element0 [concrete = constants.%G.001]
  1442. // CHECK:STDOUT: %G.call.loc14: init %empty_tuple.type = call %impl.elem0.loc14_17()
  1443. // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1444. // CHECK:STDOUT: %A.ref.loc15_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1445. // CHECK:STDOUT: %A.ref.loc15_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1446. // CHECK:STDOUT: %impl.elem0.loc15_12: %.518 = impl_witness_access constants.%BitAnd.impl_witness.0e5, element0 [concrete = constants.%Op.444]
  1447. // CHECK:STDOUT: %bound_method.loc15_12.1: <bound method> = bound_method %A.ref.loc15_10, %impl.elem0.loc15_12 [concrete = constants.%Op.bound]
  1448. // CHECK:STDOUT: %specific_fn.loc15: <specific function> = specific_function %impl.elem0.loc15_12, @Op.2(type) [concrete = constants.%Op.specific_fn]
  1449. // CHECK:STDOUT: %bound_method.loc15_12.2: <bound method> = bound_method %A.ref.loc15_10, %specific_fn.loc15 [concrete = constants.%bound_method]
  1450. // 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]
  1451. // CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %type.and.loc15 [concrete = constants.%A.type]
  1452. // CHECK:STDOUT: %.loc15_15.2: type = converted %type.and.loc15, %.loc15_15.1 [concrete = constants.%A.type]
  1453. // CHECK:STDOUT: %A.facet.loc15: %A.type = facet_value constants.%C, (constants.%A.impl_witness) [concrete = constants.%A.facet]
  1454. // CHECK:STDOUT: %.loc15_6: %A.type = converted %C.ref.loc15, %A.facet.loc15 [concrete = constants.%A.facet]
  1455. // CHECK:STDOUT: %A.ref.loc15_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  1456. // CHECK:STDOUT: %G.ref.loc15: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.d52]
  1457. // CHECK:STDOUT: %impl.elem0.loc15_17: %.e63 = impl_witness_access constants.%A.impl_witness, element0 [concrete = constants.%G.001]
  1458. // CHECK:STDOUT: %G.call.loc15: init %empty_tuple.type = call %impl.elem0.loc15_17()
  1459. // CHECK:STDOUT: return
  1460. // CHECK:STDOUT: }
  1461. // CHECK:STDOUT:
  1462. // CHECK:STDOUT: specific @G.1(constants.%Self.31d) {}
  1463. // CHECK:STDOUT:
  1464. // CHECK:STDOUT: specific @G.1(constants.%A.facet) {}
  1465. // CHECK:STDOUT: