compound_member_access.carbon 111 KB

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