compound_member_access.carbon 156 KB

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