impl_thunk.carbon 117 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/impl_thunk.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/impl_thunk.carbon
  10. // --- no_thunk_param_name_differs.carbon
  11. library "[[@TEST_NAME]]";
  12. interface I { fn F(x: Self); }
  13. // This is OK, and does not require a thunk despite the parameter name differing.
  14. class C {
  15. impl as I {
  16. fn F(not_x: C);
  17. }
  18. }
  19. // --- struct_conversion.carbon
  20. library "[[@TEST_NAME]]";
  21. interface I {
  22. fn F(x: {.a: (), .b: {}}) -> {.c: (), .d: {}};
  23. }
  24. impl () as I {
  25. fn F(y: {.b: {}, .a: ()}) -> {.d: {}, .c: ()};
  26. }
  27. // --- inheritance_conversion.carbon
  28. library "[[@TEST_NAME]]";
  29. base class A {}
  30. base class B { extend base: A; }
  31. class C { extend base: B; }
  32. interface X {
  33. fn F[addr self: Self*](other: Self*) -> Self*;
  34. }
  35. impl B as X {
  36. fn F[addr self: A*](other: A*) -> C*;
  37. }
  38. // --- inheritance_value_conversion.carbon
  39. library "[[@TEST_NAME]]";
  40. base class A {}
  41. class B { extend base: A; }
  42. interface X {
  43. fn F[self: Self](other: Self);
  44. }
  45. impl B as X {
  46. fn F[self: A](other: A);
  47. }
  48. // --- inheritance_value_conversion_pointer.carbon
  49. library "[[@TEST_NAME]]";
  50. base class A {}
  51. base class B { extend base: A; }
  52. class C { extend base: B; }
  53. interface X {
  54. fn F[addr self: Self*](other: Self*) -> Self*;
  55. }
  56. impl B as X {
  57. fn F[addr self: A*](other: A*) -> C*;
  58. }
  59. // --- fail_inheritance_value_conversion_copy_return.carbon
  60. library "[[@TEST_NAME]]";
  61. base class A {}
  62. class B { extend base: A; }
  63. interface X {
  64. fn F() -> Self;
  65. }
  66. impl A as X {
  67. // CHECK:STDERR: fail_inheritance_value_conversion_copy_return.carbon:[[@LINE+7]]:3: error: cannot copy value of type `A` [CopyOfUncopyableType]
  68. // CHECK:STDERR: fn F() -> B;
  69. // CHECK:STDERR: ^~~~~~~~~~~~
  70. // CHECK:STDERR: fail_inheritance_value_conversion_copy_return.carbon:[[@LINE-7]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
  71. // CHECK:STDERR: fn F() -> Self;
  72. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  73. // CHECK:STDERR:
  74. fn F() -> B;
  75. }
  76. // --- fail_param_type_mismatch.carbon
  77. library "[[@TEST_NAME]]";
  78. interface I {
  79. // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE+3]]:8: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
  80. // CHECK:STDERR: fn F(a: Self);
  81. // CHECK:STDERR: ^~~~~~~
  82. fn F(a: Self);
  83. }
  84. class A {}
  85. class B {}
  86. impl A as I {
  87. // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE+7]]:8: note: initializing function parameter [InCallToFunctionParam]
  88. // CHECK:STDERR: fn F(a: B);
  89. // CHECK:STDERR: ^~~~
  90. // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE-10]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
  91. // CHECK:STDERR: fn F(a: Self);
  92. // CHECK:STDERR: ^~~~~~~~~~~~~~
  93. // CHECK:STDERR:
  94. fn F(a: B);
  95. }
  96. // --- fail_return_mismatch.carbon
  97. library "[[@TEST_NAME]]";
  98. interface I {
  99. fn F() -> Self;
  100. }
  101. class A {}
  102. class B {}
  103. impl A as I {
  104. // CHECK:STDERR: fail_return_mismatch.carbon:[[@LINE+7]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
  105. // CHECK:STDERR: fn F() -> B;
  106. // CHECK:STDERR: ^~~~~~~~~~~~
  107. // CHECK:STDERR: fail_return_mismatch.carbon:[[@LINE-10]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
  108. // CHECK:STDERR: fn F() -> Self;
  109. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  110. // CHECK:STDERR:
  111. fn F() -> B;
  112. }
  113. // --- return_empty_tuple_mismatch_allowed.carbon
  114. library "[[@TEST_NAME]]";
  115. interface I {
  116. fn HasReturn() -> Self;
  117. fn NoReturn();
  118. fn EmptyTupleReturn() -> ();
  119. }
  120. impl () as I {
  121. // OK, can `return HasReturn();` in thunk.
  122. fn HasReturn();
  123. // OK, exact match.
  124. fn NoReturn();
  125. // OK, same as `HasReturn`.
  126. fn EmptyTupleReturn();
  127. }
  128. // --- fail_return_empty_tuple_mismatch.carbon
  129. library "[[@TEST_NAME]]";
  130. interface I {
  131. fn NoReturn();
  132. }
  133. impl () as I {
  134. // TODO: The proposal says to reject this. But should we really do so?
  135. // CHECK:STDERR: fail_return_empty_tuple_mismatch.carbon:[[@LINE+7]]:3: error: function redeclaration differs because return type is `()` [FunctionRedeclReturnTypeDiffers]
  136. // CHECK:STDERR: fn NoReturn() -> ();
  137. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  138. // CHECK:STDERR: fail_return_empty_tuple_mismatch.carbon:[[@LINE-8]]:3: note: previously declared with no return type [FunctionRedeclReturnTypePreviousNoReturn]
  139. // CHECK:STDERR: fn NoReturn();
  140. // CHECK:STDERR: ^~~~~~~~~~~~~~
  141. // CHECK:STDERR:
  142. fn NoReturn() -> ();
  143. }
  144. class C {}
  145. impl C as I {
  146. // CHECK:STDERR: fail_return_empty_tuple_mismatch.carbon:[[@LINE+7]]:3: error: function redeclaration differs because return type is `C` [FunctionRedeclReturnTypeDiffers]
  147. // CHECK:STDERR: fn NoReturn() -> C;
  148. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
  149. // CHECK:STDERR: fail_return_empty_tuple_mismatch.carbon:[[@LINE-21]]:3: note: previously declared with no return type [FunctionRedeclReturnTypePreviousNoReturn]
  150. // CHECK:STDERR: fn NoReturn();
  151. // CHECK:STDERR: ^~~~~~~~~~~~~~
  152. // CHECK:STDERR:
  153. fn NoReturn() -> C;
  154. }
  155. // --- fail_param_type_incomplete.carbon
  156. library "[[@TEST_NAME]]";
  157. interface I(T:! type) {
  158. // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+3]]:8: error: parameter has incomplete type `B` in function definition [IncompleteTypeInFunctionParam]
  159. // CHECK:STDERR: fn F(a: T);
  160. // CHECK:STDERR: ^~~~
  161. fn F(a: T);
  162. }
  163. // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+3]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
  164. // CHECK:STDERR: class B;
  165. // CHECK:STDERR: ^~~~~~~~
  166. class B;
  167. class C {
  168. impl as I(B) {
  169. // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+14]]:5: note: while building thunk calling this function [ThunkCallee]
  170. // CHECK:STDERR: fn F(c: C);
  171. // CHECK:STDERR: ^~~~~~~~~~~
  172. // CHECK:STDERR:
  173. // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE-14]]:8: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
  174. // CHECK:STDERR: fn F(a: T);
  175. // CHECK:STDERR: ^~~~
  176. // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+7]]:10: note: initializing function parameter [InCallToFunctionParam]
  177. // CHECK:STDERR: fn F(c: C);
  178. // CHECK:STDERR: ^~~~
  179. // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE-20]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
  180. // CHECK:STDERR: fn F(a: T);
  181. // CHECK:STDERR: ^~~~~~~~~~~
  182. // CHECK:STDERR:
  183. fn F(c: C);
  184. }
  185. }
  186. // CHECK:STDOUT: --- no_thunk_param_name_differs.carbon
  187. // CHECK:STDOUT:
  188. // CHECK:STDOUT: constants {
  189. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  190. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  191. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  192. // CHECK:STDOUT: %pattern_type.6de: type = pattern_type %Self.as_type [symbolic]
  193. // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
  194. // CHECK:STDOUT: %F.bc6: %F.type.cf0 = struct_value () [concrete]
  195. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  196. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%F.decl [concrete]
  197. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  198. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.%I.impl_witness_table [concrete]
  199. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  200. // CHECK:STDOUT: %F.type.f36: type = fn_type @F.2 [concrete]
  201. // CHECK:STDOUT: %F.4c3: %F.type.f36 = struct_value () [concrete]
  202. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
  203. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  204. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT:
  207. // CHECK:STDOUT: file {
  208. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  209. // CHECK:STDOUT: .I = %I.decl
  210. // CHECK:STDOUT: .C = %C.decl
  211. // CHECK:STDOUT: }
  212. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  213. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  214. // CHECK:STDOUT: }
  215. // CHECK:STDOUT:
  216. // CHECK:STDOUT: interface @I {
  217. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  218. // CHECK:STDOUT: %F.decl: %F.type.cf0 = fn_decl @F.1 [concrete = constants.%F.bc6] {
  219. // CHECK:STDOUT: %x.patt: @F.1.%pattern_type (%pattern_type.6de) = binding_pattern x [concrete]
  220. // CHECK:STDOUT: %x.param_patt: @F.1.%pattern_type (%pattern_type.6de) = value_param_pattern %x.patt, call_param0 [concrete]
  221. // CHECK:STDOUT: } {
  222. // CHECK:STDOUT: %x.param: @F.1.%Self.as_type.loc4_23.1 (%Self.as_type) = value_param call_param0
  223. // CHECK:STDOUT: %.loc4_23.1: type = splice_block %.loc4_23.2 [symbolic = %Self.as_type.loc4_23.1 (constants.%Self.as_type)] {
  224. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
  225. // CHECK:STDOUT: %Self.as_type.loc4_23.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_23.1 (constants.%Self.as_type)]
  226. // CHECK:STDOUT: %.loc4_23.2: type = converted %Self.ref, %Self.as_type.loc4_23.2 [symbolic = %Self.as_type.loc4_23.1 (constants.%Self.as_type)]
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT: %x: @F.1.%Self.as_type.loc4_23.1 (%Self.as_type) = bind_name x, %x.param
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: !members:
  233. // CHECK:STDOUT: .Self = %Self
  234. // CHECK:STDOUT: .F = %assoc0
  235. // CHECK:STDOUT: witness = (%F.decl)
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: impl @impl: %Self.ref as %I.ref {
  239. // CHECK:STDOUT: %F.decl: %F.type.f36 = fn_decl @F.2 [concrete = constants.%F.4c3] {
  240. // CHECK:STDOUT: %not_x.patt: %pattern_type.c48 = binding_pattern not_x [concrete]
  241. // CHECK:STDOUT: %not_x.param_patt: %pattern_type.c48 = value_param_pattern %not_x.patt, call_param0 [concrete]
  242. // CHECK:STDOUT: } {
  243. // CHECK:STDOUT: %not_x.param: %C = value_param call_param0
  244. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  245. // CHECK:STDOUT: %not_x: %C = bind_name not_x, %not_x.param
  246. // CHECK:STDOUT: }
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: !members:
  249. // CHECK:STDOUT: .C = <poisoned>
  250. // CHECK:STDOUT: .F = %F.decl
  251. // CHECK:STDOUT: witness = @C.%I.impl_witness
  252. // CHECK:STDOUT: }
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: class @C {
  255. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  256. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  257. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.%F.decl), @impl [concrete]
  260. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  261. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  262. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  263. // CHECK:STDOUT: complete_type_witness = %complete_type
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: !members:
  266. // CHECK:STDOUT: .Self = constants.%C
  267. // CHECK:STDOUT: .I = <poisoned>
  268. // CHECK:STDOUT: .C = <poisoned>
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT:
  271. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  272. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  273. // CHECK:STDOUT: %Self.as_type.loc4_23.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_23.1 (constants.%Self.as_type)]
  274. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_23.1 [symbolic = %pattern_type (constants.%pattern_type.6de)]
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: fn(%x.param: @F.1.%Self.as_type.loc4_23.1 (%Self.as_type));
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: fn @F.2(%not_x.param: %C);
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  282. // CHECK:STDOUT: %Self => constants.%Self
  283. // CHECK:STDOUT: %Self.as_type.loc4_23.1 => constants.%Self.as_type
  284. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6de
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: specific @F.1(constants.%I.facet) {
  288. // CHECK:STDOUT: %Self => constants.%I.facet
  289. // CHECK:STDOUT: %Self.as_type.loc4_23.1 => constants.%C
  290. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c48
  291. // CHECK:STDOUT: }
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: --- struct_conversion.carbon
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: constants {
  296. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  297. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  298. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  299. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  300. // CHECK:STDOUT: %struct_type.a.b.391: type = struct_type {.a: %empty_tuple.type, .b: %empty_struct_type} [concrete]
  301. // CHECK:STDOUT: %pattern_type.bec: type = pattern_type %struct_type.a.b.391 [concrete]
  302. // CHECK:STDOUT: %struct_type.c.d.15a: type = struct_type {.c: %empty_tuple.type, .d: %empty_struct_type} [concrete]
  303. // CHECK:STDOUT: %pattern_type.d63: type = pattern_type %struct_type.c.d.15a [concrete]
  304. // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
  305. // CHECK:STDOUT: %F.bc6: %F.type.cf0 = struct_value () [concrete]
  306. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  307. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%F.decl [concrete]
  308. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  309. // CHECK:STDOUT: %struct_type.b.a.40c: type = struct_type {.b: %empty_struct_type, .a: %empty_tuple.type} [concrete]
  310. // CHECK:STDOUT: %pattern_type.231: type = pattern_type %struct_type.b.a.40c [concrete]
  311. // CHECK:STDOUT: %struct_type.d.c.b36: type = struct_type {.d: %empty_struct_type, .c: %empty_tuple.type} [concrete]
  312. // CHECK:STDOUT: %pattern_type.844: type = pattern_type %struct_type.d.c.b36 [concrete]
  313. // CHECK:STDOUT: %F.type.39e918.1: type = fn_type @F.2 [concrete]
  314. // CHECK:STDOUT: %F.c04b92.1: %F.type.39e918.1 = struct_value () [concrete]
  315. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_tuple.type, (%I.impl_witness) [concrete]
  316. // CHECK:STDOUT: %F.type.39e918.2: type = fn_type @F.3 [concrete]
  317. // CHECK:STDOUT: %F.c04b92.2: %F.type.39e918.2 = struct_value () [concrete]
  318. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  319. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  320. // CHECK:STDOUT: %struct: %struct_type.c.d.15a = struct_value (%empty_tuple, %empty_struct) [concrete]
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: file {
  324. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  325. // CHECK:STDOUT: .I = %I.decl
  326. // CHECK:STDOUT: }
  327. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  328. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  329. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  330. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  331. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.%F.decl.loc9_48.2), @impl [concrete]
  334. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  335. // CHECK:STDOUT: }
  336. // CHECK:STDOUT:
  337. // CHECK:STDOUT: interface @I {
  338. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  339. // CHECK:STDOUT: %F.decl: %F.type.cf0 = fn_decl @F.1 [concrete = constants.%F.bc6] {
  340. // CHECK:STDOUT: %x.patt: %pattern_type.bec = binding_pattern x [concrete]
  341. // CHECK:STDOUT: %x.param_patt: %pattern_type.bec = value_param_pattern %x.patt, call_param0 [concrete]
  342. // CHECK:STDOUT: %return.patt: %pattern_type.d63 = return_slot_pattern [concrete]
  343. // CHECK:STDOUT: %return.param_patt: %pattern_type.d63 = out_param_pattern %return.patt, call_param1 [concrete]
  344. // CHECK:STDOUT: } {
  345. // CHECK:STDOUT: %.loc5_38.1: %empty_tuple.type = tuple_literal ()
  346. // CHECK:STDOUT: %.loc5_38.2: type = converted %.loc5_38.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  347. // CHECK:STDOUT: %.loc5_46.1: %empty_struct_type = struct_literal ()
  348. // CHECK:STDOUT: %.loc5_46.2: type = converted %.loc5_46.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  349. // CHECK:STDOUT: %struct_type.c.d: type = struct_type {.c: %empty_tuple.type, .d: %empty_struct_type} [concrete = constants.%struct_type.c.d.15a]
  350. // CHECK:STDOUT: %x.param: %struct_type.a.b.391 = value_param call_param0
  351. // CHECK:STDOUT: %.loc5_26: type = splice_block %struct_type.a.b [concrete = constants.%struct_type.a.b.391] {
  352. // CHECK:STDOUT: %.loc5_17.1: %empty_tuple.type = tuple_literal ()
  353. // CHECK:STDOUT: %.loc5_17.2: type = converted %.loc5_17.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  354. // CHECK:STDOUT: %.loc5_25.1: %empty_struct_type = struct_literal ()
  355. // CHECK:STDOUT: %.loc5_25.2: type = converted %.loc5_25.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  356. // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %empty_tuple.type, .b: %empty_struct_type} [concrete = constants.%struct_type.a.b.391]
  357. // CHECK:STDOUT: }
  358. // CHECK:STDOUT: %x: %struct_type.a.b.391 = bind_name x, %x.param
  359. // CHECK:STDOUT: %return.param: ref %struct_type.c.d.15a = out_param call_param1
  360. // CHECK:STDOUT: %return: ref %struct_type.c.d.15a = return_slot %return.param
  361. // CHECK:STDOUT: }
  362. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  363. // CHECK:STDOUT:
  364. // CHECK:STDOUT: !members:
  365. // CHECK:STDOUT: .Self = %Self
  366. // CHECK:STDOUT: .F = %assoc0
  367. // CHECK:STDOUT: witness = (%F.decl)
  368. // CHECK:STDOUT: }
  369. // CHECK:STDOUT:
  370. // CHECK:STDOUT: impl @impl: %.loc8_7.2 as %I.ref {
  371. // CHECK:STDOUT: %F.decl.loc9_48.1: %F.type.39e918.1 = fn_decl @F.2 [concrete = constants.%F.c04b92.1] {
  372. // CHECK:STDOUT: %y.patt: %pattern_type.231 = binding_pattern y [concrete]
  373. // CHECK:STDOUT: %y.param_patt: %pattern_type.231 = value_param_pattern %y.patt, call_param0 [concrete]
  374. // CHECK:STDOUT: %return.patt: %pattern_type.844 = return_slot_pattern [concrete]
  375. // CHECK:STDOUT: %return.param_patt: %pattern_type.844 = out_param_pattern %return.patt, call_param1 [concrete]
  376. // CHECK:STDOUT: } {
  377. // CHECK:STDOUT: %.loc9_38.1: %empty_struct_type = struct_literal ()
  378. // CHECK:STDOUT: %.loc9_38.2: type = converted %.loc9_38.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  379. // CHECK:STDOUT: %.loc9_46.1: %empty_tuple.type = tuple_literal ()
  380. // CHECK:STDOUT: %.loc9_46.2: type = converted %.loc9_46.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  381. // CHECK:STDOUT: %struct_type.d.c: type = struct_type {.d: %empty_struct_type, .c: %empty_tuple.type} [concrete = constants.%struct_type.d.c.b36]
  382. // CHECK:STDOUT: %y.param: %struct_type.b.a.40c = value_param call_param0
  383. // CHECK:STDOUT: %.loc9_26: type = splice_block %struct_type.b.a [concrete = constants.%struct_type.b.a.40c] {
  384. // CHECK:STDOUT: %.loc9_17.1: %empty_struct_type = struct_literal ()
  385. // CHECK:STDOUT: %.loc9_17.2: type = converted %.loc9_17.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  386. // CHECK:STDOUT: %.loc9_25.1: %empty_tuple.type = tuple_literal ()
  387. // CHECK:STDOUT: %.loc9_25.2: type = converted %.loc9_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  388. // CHECK:STDOUT: %struct_type.b.a: type = struct_type {.b: %empty_struct_type, .a: %empty_tuple.type} [concrete = constants.%struct_type.b.a.40c]
  389. // CHECK:STDOUT: }
  390. // CHECK:STDOUT: %y: %struct_type.b.a.40c = bind_name y, %y.param
  391. // CHECK:STDOUT: %return.param: ref %struct_type.d.c.b36 = out_param call_param1
  392. // CHECK:STDOUT: %return: ref %struct_type.d.c.b36 = return_slot %return.param
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT: %F.decl.loc9_48.2: %F.type.39e918.2 = fn_decl @F.3 [concrete = constants.%F.c04b92.2] {
  395. // CHECK:STDOUT: %x.patt: %pattern_type.bec = binding_pattern x [concrete]
  396. // CHECK:STDOUT: %x.param_patt: %pattern_type.bec = value_param_pattern %x.patt, call_param0 [concrete]
  397. // CHECK:STDOUT: %return.patt: %pattern_type.d63 = return_slot_pattern [concrete]
  398. // CHECK:STDOUT: %return.param_patt: %pattern_type.d63 = out_param_pattern %return.patt, call_param1 [concrete]
  399. // CHECK:STDOUT: } {
  400. // CHECK:STDOUT: %x.param: %struct_type.a.b.391 = value_param call_param0
  401. // CHECK:STDOUT: %x: %struct_type.a.b.391 = bind_name x, %x.param
  402. // CHECK:STDOUT: %return.param: ref %struct_type.c.d.15a = out_param call_param1
  403. // CHECK:STDOUT: %return: ref %struct_type.c.d.15a = return_slot %return.param
  404. // CHECK:STDOUT: }
  405. // CHECK:STDOUT:
  406. // CHECK:STDOUT: !members:
  407. // CHECK:STDOUT: .F = %F.decl.loc9_48.1
  408. // CHECK:STDOUT: witness = file.%I.impl_witness
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT:
  411. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  412. // CHECK:STDOUT: fn(%x.param: %struct_type.a.b.391) -> %return.param: %struct_type.c.d.15a;
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT:
  415. // CHECK:STDOUT: fn @F.2(%y.param: %struct_type.b.a.40c) -> %return.param: %struct_type.d.c.b36;
  416. // CHECK:STDOUT:
  417. // CHECK:STDOUT: fn @F.3(%x.param: %struct_type.a.b.391) -> %return.param: %struct_type.c.d.15a {
  418. // CHECK:STDOUT: !entry:
  419. // CHECK:STDOUT: %x.ref: %struct_type.a.b.391 = name_ref x, %x.param
  420. // CHECK:STDOUT: %.loc9_48.1: ref %struct_type.d.c.b36 = temporary_storage
  421. // CHECK:STDOUT: %.loc5_9.1: %empty_struct_type = struct_access %x.ref, element1
  422. // CHECK:STDOUT: %.loc5_9.2: %empty_tuple.type = struct_access %x.ref, element0
  423. // CHECK:STDOUT: %struct: %struct_type.b.a.40c = struct_value (%.loc5_9.1, %.loc5_9.2)
  424. // CHECK:STDOUT: %.loc5_9.3: %struct_type.b.a.40c = converted %x.ref, %struct
  425. // CHECK:STDOUT: %F.call: init %struct_type.d.c.b36 = call @impl.%F.decl.loc9_48.1(%.loc5_9.3) to %.loc9_48.1
  426. // CHECK:STDOUT: %.loc9_48.2: ref %struct_type.d.c.b36 = temporary %.loc9_48.1, %F.call
  427. // CHECK:STDOUT: %.loc9_48.3: ref %empty_tuple.type = struct_access %.loc9_48.2, element1
  428. // CHECK:STDOUT: %.loc9_48.4: ref %empty_tuple.type = struct_access %return, element1
  429. // CHECK:STDOUT: %.loc9_48.5: init %empty_tuple.type = tuple_init () to %.loc9_48.4 [concrete = constants.%empty_tuple]
  430. // CHECK:STDOUT: %.loc9_48.6: init %empty_tuple.type = converted %.loc9_48.3, %.loc9_48.5 [concrete = constants.%empty_tuple]
  431. // CHECK:STDOUT: %.loc9_48.7: ref %empty_struct_type = struct_access %.loc9_48.2, element0
  432. // CHECK:STDOUT: %.loc9_48.8: ref %empty_struct_type = struct_access %return, element0
  433. // CHECK:STDOUT: %.loc9_48.9: init %empty_struct_type = struct_init () to %.loc9_48.8 [concrete = constants.%empty_struct]
  434. // CHECK:STDOUT: %.loc9_48.10: init %empty_struct_type = converted %.loc9_48.7, %.loc9_48.9 [concrete = constants.%empty_struct]
  435. // CHECK:STDOUT: %.loc9_48.11: init %struct_type.c.d.15a = struct_init (%.loc9_48.6, %.loc9_48.10) to %return [concrete = constants.%struct]
  436. // CHECK:STDOUT: %.loc9_48.12: init %struct_type.c.d.15a = converted %F.call, %.loc9_48.11 [concrete = constants.%struct]
  437. // CHECK:STDOUT: return %.loc9_48.12 to %return
  438. // CHECK:STDOUT: }
  439. // CHECK:STDOUT:
  440. // CHECK:STDOUT: specific @F.1(constants.%Self) {}
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: specific @F.1(constants.%I.facet) {}
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: --- inheritance_conversion.carbon
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: constants {
  447. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  448. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  449. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  450. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  451. // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [concrete]
  452. // CHECK:STDOUT: %struct_type.base.953: type = struct_type {.base: %A} [concrete]
  453. // CHECK:STDOUT: %complete_type.020: <witness> = complete_type_witness %struct_type.base.953 [concrete]
  454. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  455. // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %B [concrete]
  456. // CHECK:STDOUT: %struct_type.base.0ff: type = struct_type {.base: %B} [concrete]
  457. // CHECK:STDOUT: %complete_type.98e: <witness> = complete_type_witness %struct_type.base.0ff [concrete]
  458. // CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
  459. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic]
  460. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  461. // CHECK:STDOUT: %ptr.d06: type = ptr_type %Self.as_type [symbolic]
  462. // CHECK:STDOUT: %pattern_type.4c5: type = pattern_type %ptr.d06 [symbolic]
  463. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  464. // CHECK:STDOUT: %F.type.594: type = fn_type @F.1 [concrete]
  465. // CHECK:STDOUT: %F.b69: %F.type.594 = struct_value () [concrete]
  466. // CHECK:STDOUT: %X.assoc_type: type = assoc_entity_type @X [concrete]
  467. // CHECK:STDOUT: %assoc0: %X.assoc_type = assoc_entity element0, @X.%F.decl [concrete]
  468. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness file.%X.impl_witness_table [concrete]
  469. // CHECK:STDOUT: %ptr.6db: type = ptr_type %A [concrete]
  470. // CHECK:STDOUT: %pattern_type.5f8: type = pattern_type %ptr.6db [concrete]
  471. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  472. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  473. // CHECK:STDOUT: %F.type.f1b0b1.1: type = fn_type @F.2 [concrete]
  474. // CHECK:STDOUT: %F.5161e9.1: %F.type.f1b0b1.1 = struct_value () [concrete]
  475. // CHECK:STDOUT: %X.facet: %X.type = facet_value %B, (%X.impl_witness) [concrete]
  476. // CHECK:STDOUT: %ptr.e79: type = ptr_type %B [concrete]
  477. // CHECK:STDOUT: %pattern_type.960: type = pattern_type %ptr.e79 [concrete]
  478. // CHECK:STDOUT: %F.type.f1b0b1.2: type = fn_type @F.3 [concrete]
  479. // CHECK:STDOUT: %F.5161e9.2: %F.type.f1b0b1.2 = struct_value () [concrete]
  480. // CHECK:STDOUT: }
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: file {
  483. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  484. // CHECK:STDOUT: .A = %A.decl
  485. // CHECK:STDOUT: .B = %B.decl
  486. // CHECK:STDOUT: .C = %C.decl
  487. // CHECK:STDOUT: .X = %X.decl
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  490. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  491. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  492. // CHECK:STDOUT: %X.decl: type = interface_decl @X [concrete = constants.%X.type] {} {}
  493. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  494. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  495. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X.type]
  496. // CHECK:STDOUT: }
  497. // CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (@impl.%F.decl.loc13_39.2), @impl [concrete]
  498. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness]
  499. // CHECK:STDOUT: }
  500. // CHECK:STDOUT:
  501. // CHECK:STDOUT: interface @X {
  502. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  503. // CHECK:STDOUT: %F.decl: %F.type.594 = fn_decl @F.1 [concrete = constants.%F.b69] {
  504. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type (%pattern_type.4c5) = binding_pattern self [concrete]
  505. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type (%pattern_type.4c5) = value_param_pattern %self.patt, call_param0 [concrete]
  506. // CHECK:STDOUT: %.loc9_8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  507. // CHECK:STDOUT: %other.patt: @F.1.%pattern_type (%pattern_type.4c5) = binding_pattern other [concrete]
  508. // CHECK:STDOUT: %other.param_patt: @F.1.%pattern_type (%pattern_type.4c5) = value_param_pattern %other.patt, call_param1 [concrete]
  509. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.4c5) = return_slot_pattern [concrete]
  510. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.4c5) = out_param_pattern %return.patt, call_param2 [concrete]
  511. // CHECK:STDOUT: } {
  512. // CHECK:STDOUT: %Self.ref.loc9_43: %X.type = name_ref Self, @X.%Self [symbolic = %Self (constants.%Self)]
  513. // CHECK:STDOUT: %Self.as_type.loc9_47: type = facet_access_type %Self.ref.loc9_43 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  514. // CHECK:STDOUT: %.loc9_47: type = converted %Self.ref.loc9_43, %Self.as_type.loc9_47 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  515. // CHECK:STDOUT: %ptr.loc9_47: type = ptr_type %.loc9_47 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)]
  516. // CHECK:STDOUT: %self.param: @F.1.%ptr.loc9_23.1 (%ptr.d06) = value_param call_param0
  517. // CHECK:STDOUT: %.loc9_23.1: type = splice_block %ptr.loc9_23.2 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)] {
  518. // CHECK:STDOUT: %Self.ref.loc9_19: %X.type = name_ref Self, @X.%Self [symbolic = %Self (constants.%Self)]
  519. // CHECK:STDOUT: %Self.as_type.loc9_23.2: type = facet_access_type %Self.ref.loc9_19 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  520. // CHECK:STDOUT: %.loc9_23.2: type = converted %Self.ref.loc9_19, %Self.as_type.loc9_23.2 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  521. // CHECK:STDOUT: %ptr.loc9_23.2: type = ptr_type %.loc9_23.2 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)]
  522. // CHECK:STDOUT: }
  523. // CHECK:STDOUT: %self: @F.1.%ptr.loc9_23.1 (%ptr.d06) = bind_name self, %self.param
  524. // CHECK:STDOUT: %other.param: @F.1.%ptr.loc9_23.1 (%ptr.d06) = value_param call_param1
  525. // CHECK:STDOUT: %.loc9_37.1: type = splice_block %ptr.loc9_37 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)] {
  526. // CHECK:STDOUT: %Self.ref.loc9_33: %X.type = name_ref Self, @X.%Self [symbolic = %Self (constants.%Self)]
  527. // CHECK:STDOUT: %Self.as_type.loc9_37: type = facet_access_type %Self.ref.loc9_33 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  528. // CHECK:STDOUT: %.loc9_37.2: type = converted %Self.ref.loc9_33, %Self.as_type.loc9_37 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  529. // CHECK:STDOUT: %ptr.loc9_37: type = ptr_type %.loc9_37.2 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)]
  530. // CHECK:STDOUT: }
  531. // CHECK:STDOUT: %other: @F.1.%ptr.loc9_23.1 (%ptr.d06) = bind_name other, %other.param
  532. // CHECK:STDOUT: %return.param: ref @F.1.%ptr.loc9_23.1 (%ptr.d06) = out_param call_param2
  533. // CHECK:STDOUT: %return: ref @F.1.%ptr.loc9_23.1 (%ptr.d06) = return_slot %return.param
  534. // CHECK:STDOUT: }
  535. // CHECK:STDOUT: %assoc0: %X.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: !members:
  538. // CHECK:STDOUT: .Self = %Self
  539. // CHECK:STDOUT: .F = %assoc0
  540. // CHECK:STDOUT: witness = (%F.decl)
  541. // CHECK:STDOUT: }
  542. // CHECK:STDOUT:
  543. // CHECK:STDOUT: impl @impl: %B.ref as %X.ref {
  544. // CHECK:STDOUT: %F.decl.loc13_39.1: %F.type.f1b0b1.1 = fn_decl @F.2 [concrete = constants.%F.5161e9.1] {
  545. // CHECK:STDOUT: %self.patt: %pattern_type.5f8 = binding_pattern self [concrete]
  546. // CHECK:STDOUT: %self.param_patt: %pattern_type.5f8 = value_param_pattern %self.patt, call_param0 [concrete]
  547. // CHECK:STDOUT: %.loc13_8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  548. // CHECK:STDOUT: %other.patt: %pattern_type.5f8 = binding_pattern other [concrete]
  549. // CHECK:STDOUT: %other.param_patt: %pattern_type.5f8 = value_param_pattern %other.patt, call_param1 [concrete]
  550. // CHECK:STDOUT: %return.patt: %pattern_type.44a = return_slot_pattern [concrete]
  551. // CHECK:STDOUT: %return.param_patt: %pattern_type.44a = out_param_pattern %return.patt, call_param2 [concrete]
  552. // CHECK:STDOUT: } {
  553. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  554. // CHECK:STDOUT: %ptr.loc13_38: type = ptr_type %C.ref [concrete = constants.%ptr.019]
  555. // CHECK:STDOUT: %self.param: %ptr.6db = value_param call_param0
  556. // CHECK:STDOUT: %.loc13_20: type = splice_block %ptr.loc13_20 [concrete = constants.%ptr.6db] {
  557. // CHECK:STDOUT: %A.ref.loc13_19: type = name_ref A, file.%A.decl [concrete = constants.%A]
  558. // CHECK:STDOUT: %ptr.loc13_20: type = ptr_type %A.ref.loc13_19 [concrete = constants.%ptr.6db]
  559. // CHECK:STDOUT: }
  560. // CHECK:STDOUT: %self: %ptr.6db = bind_name self, %self.param
  561. // CHECK:STDOUT: %other.param: %ptr.6db = value_param call_param1
  562. // CHECK:STDOUT: %.loc13_31: type = splice_block %ptr.loc13_31 [concrete = constants.%ptr.6db] {
  563. // CHECK:STDOUT: %A.ref.loc13_30: type = name_ref A, file.%A.decl [concrete = constants.%A]
  564. // CHECK:STDOUT: %ptr.loc13_31: type = ptr_type %A.ref.loc13_30 [concrete = constants.%ptr.6db]
  565. // CHECK:STDOUT: }
  566. // CHECK:STDOUT: %other: %ptr.6db = bind_name other, %other.param
  567. // CHECK:STDOUT: %return.param: ref %ptr.019 = out_param call_param2
  568. // CHECK:STDOUT: %return: ref %ptr.019 = return_slot %return.param
  569. // CHECK:STDOUT: }
  570. // CHECK:STDOUT: %F.decl.loc13_39.2: %F.type.f1b0b1.2 = fn_decl @F.3 [concrete = constants.%F.5161e9.2] {
  571. // CHECK:STDOUT: %self.patt: %pattern_type.960 = binding_pattern self [concrete]
  572. // CHECK:STDOUT: %self.param_patt: %pattern_type.960 = value_param_pattern %self.patt, call_param0 [concrete]
  573. // CHECK:STDOUT: %.loc9_8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  574. // CHECK:STDOUT: %other.patt: %pattern_type.960 = binding_pattern other [concrete]
  575. // CHECK:STDOUT: %other.param_patt: %pattern_type.960 = value_param_pattern %other.patt, call_param1 [concrete]
  576. // CHECK:STDOUT: %return.patt: %pattern_type.960 = return_slot_pattern [concrete]
  577. // CHECK:STDOUT: %return.param_patt: %pattern_type.960 = out_param_pattern %return.patt, call_param2 [concrete]
  578. // CHECK:STDOUT: } {
  579. // CHECK:STDOUT: %self.param: %ptr.e79 = value_param call_param0
  580. // CHECK:STDOUT: %self: %ptr.e79 = bind_name self, %self.param
  581. // CHECK:STDOUT: %other.param: %ptr.e79 = value_param call_param1
  582. // CHECK:STDOUT: %other: %ptr.e79 = bind_name other, %other.param
  583. // CHECK:STDOUT: %return.param: ref %ptr.e79 = out_param call_param2
  584. // CHECK:STDOUT: %return: ref %ptr.e79 = return_slot %return.param
  585. // CHECK:STDOUT: }
  586. // CHECK:STDOUT:
  587. // CHECK:STDOUT: !members:
  588. // CHECK:STDOUT: .A = <poisoned>
  589. // CHECK:STDOUT: .C = <poisoned>
  590. // CHECK:STDOUT: .F = %F.decl.loc13_39.1
  591. // CHECK:STDOUT: witness = file.%X.impl_witness
  592. // CHECK:STDOUT: }
  593. // CHECK:STDOUT:
  594. // CHECK:STDOUT: class @A {
  595. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  596. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  597. // CHECK:STDOUT: complete_type_witness = %complete_type
  598. // CHECK:STDOUT:
  599. // CHECK:STDOUT: !members:
  600. // CHECK:STDOUT: .Self = constants.%A
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT:
  603. // CHECK:STDOUT: class @B {
  604. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  605. // CHECK:STDOUT: %.loc5: %B.elem = base_decl %A.ref, element0 [concrete]
  606. // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %A} [concrete = constants.%struct_type.base.953]
  607. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base [concrete = constants.%complete_type.020]
  608. // CHECK:STDOUT: complete_type_witness = %complete_type
  609. // CHECK:STDOUT:
  610. // CHECK:STDOUT: !members:
  611. // CHECK:STDOUT: .Self = constants.%B
  612. // CHECK:STDOUT: .A = <poisoned>
  613. // CHECK:STDOUT: .base = %.loc5
  614. // CHECK:STDOUT: extend %A.ref
  615. // CHECK:STDOUT: }
  616. // CHECK:STDOUT:
  617. // CHECK:STDOUT: class @C {
  618. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  619. // CHECK:STDOUT: %.loc6: %C.elem = base_decl %B.ref, element0 [concrete]
  620. // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %B} [concrete = constants.%struct_type.base.0ff]
  621. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base [concrete = constants.%complete_type.98e]
  622. // CHECK:STDOUT: complete_type_witness = %complete_type
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: !members:
  625. // CHECK:STDOUT: .Self = constants.%C
  626. // CHECK:STDOUT: .B = <poisoned>
  627. // CHECK:STDOUT: .base = %.loc6
  628. // CHECK:STDOUT: extend %B.ref
  629. // CHECK:STDOUT: }
  630. // CHECK:STDOUT:
  631. // CHECK:STDOUT: generic fn @F.1(@X.%Self: %X.type) {
  632. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  633. // CHECK:STDOUT: %Self.as_type.loc9_23.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  634. // CHECK:STDOUT: %ptr.loc9_23.1: type = ptr_type %Self.as_type.loc9_23.1 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)]
  635. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc9_23.1 [symbolic = %pattern_type (constants.%pattern_type.4c5)]
  636. // CHECK:STDOUT:
  637. // CHECK:STDOUT: fn(%self.param: @F.1.%ptr.loc9_23.1 (%ptr.d06), %other.param: @F.1.%ptr.loc9_23.1 (%ptr.d06)) -> @F.1.%ptr.loc9_23.1 (%ptr.d06);
  638. // CHECK:STDOUT: }
  639. // CHECK:STDOUT:
  640. // CHECK:STDOUT: fn @F.2(%self.param: %ptr.6db, %other.param: %ptr.6db) -> %ptr.019;
  641. // CHECK:STDOUT:
  642. // CHECK:STDOUT: fn @F.3(%self.param: %ptr.e79, %other.param: %ptr.e79) -> %ptr.e79 {
  643. // CHECK:STDOUT: !entry:
  644. // CHECK:STDOUT: %self.ref: %ptr.e79 = name_ref self, %self.param
  645. // CHECK:STDOUT: %.loc9_17.1: ref %B = deref %self.ref
  646. // CHECK:STDOUT: %F.bound: <bound method> = bound_method %.loc9_17.1, @impl.%F.decl.loc13_39.1
  647. // CHECK:STDOUT: %other.ref: %ptr.e79 = name_ref other, %other.param
  648. // CHECK:STDOUT: %addr.loc9_17.1: %ptr.e79 = addr_of %.loc9_17.1
  649. // CHECK:STDOUT: %.loc9_17.2: ref %B = deref %addr.loc9_17.1
  650. // CHECK:STDOUT: %.loc9_17.3: ref %A = class_element_access %.loc9_17.2, element0
  651. // CHECK:STDOUT: %addr.loc9_17.2: %ptr.6db = addr_of %.loc9_17.3
  652. // CHECK:STDOUT: %.loc9_17.4: %ptr.6db = converted %addr.loc9_17.1, %addr.loc9_17.2
  653. // CHECK:STDOUT: %.loc9_31.1: ref %B = deref %other.ref
  654. // CHECK:STDOUT: %.loc9_31.2: ref %A = class_element_access %.loc9_31.1, element0
  655. // CHECK:STDOUT: %addr.loc9_31: %ptr.6db = addr_of %.loc9_31.2
  656. // CHECK:STDOUT: %.loc9_31.3: %ptr.6db = converted %other.ref, %addr.loc9_31
  657. // CHECK:STDOUT: %F.call: init %ptr.019 = call %F.bound(%.loc9_17.4, %.loc9_31.3)
  658. // CHECK:STDOUT: %.loc13_39.1: %ptr.019 = value_of_initializer %F.call
  659. // CHECK:STDOUT: %.loc13_39.2: %ptr.019 = converted %F.call, %.loc13_39.1
  660. // CHECK:STDOUT: %.loc13_39.3: ref %C = deref %.loc13_39.2
  661. // CHECK:STDOUT: %.loc13_39.4: ref %B = class_element_access %.loc13_39.3, element0
  662. // CHECK:STDOUT: %addr.loc13: %ptr.e79 = addr_of %.loc13_39.4
  663. // CHECK:STDOUT: %.loc13_39.5: %ptr.e79 = converted %F.call, %addr.loc13
  664. // CHECK:STDOUT: return %.loc13_39.5
  665. // CHECK:STDOUT: }
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  668. // CHECK:STDOUT: %Self => constants.%Self
  669. // CHECK:STDOUT: %Self.as_type.loc9_23.1 => constants.%Self.as_type
  670. // CHECK:STDOUT: %ptr.loc9_23.1 => constants.%ptr.d06
  671. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4c5
  672. // CHECK:STDOUT: }
  673. // CHECK:STDOUT:
  674. // CHECK:STDOUT: specific @F.1(constants.%X.facet) {
  675. // CHECK:STDOUT: %Self => constants.%X.facet
  676. // CHECK:STDOUT: %Self.as_type.loc9_23.1 => constants.%B
  677. // CHECK:STDOUT: %ptr.loc9_23.1 => constants.%ptr.e79
  678. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.960
  679. // CHECK:STDOUT: }
  680. // CHECK:STDOUT:
  681. // CHECK:STDOUT: --- inheritance_value_conversion.carbon
  682. // CHECK:STDOUT:
  683. // CHECK:STDOUT: constants {
  684. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  685. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  686. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  687. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  688. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  689. // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [concrete]
  690. // CHECK:STDOUT: %struct_type.base.953: type = struct_type {.base: %A} [concrete]
  691. // CHECK:STDOUT: %complete_type.020: <witness> = complete_type_witness %struct_type.base.953 [concrete]
  692. // CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
  693. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic]
  694. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  695. // CHECK:STDOUT: %pattern_type.331: type = pattern_type %Self.as_type [symbolic]
  696. // CHECK:STDOUT: %F.type.594: type = fn_type @F.1 [concrete]
  697. // CHECK:STDOUT: %F.b69: %F.type.594 = struct_value () [concrete]
  698. // CHECK:STDOUT: %X.assoc_type: type = assoc_entity_type @X [concrete]
  699. // CHECK:STDOUT: %assoc0: %X.assoc_type = assoc_entity element0, @X.%F.decl [concrete]
  700. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness file.%X.impl_witness_table [concrete]
  701. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  702. // CHECK:STDOUT: %F.type.f1b0b1.1: type = fn_type @F.2 [concrete]
  703. // CHECK:STDOUT: %F.5161e9.1: %F.type.f1b0b1.1 = struct_value () [concrete]
  704. // CHECK:STDOUT: %X.facet: %X.type = facet_value %B, (%X.impl_witness) [concrete]
  705. // CHECK:STDOUT: %pattern_type.049: type = pattern_type %B [concrete]
  706. // CHECK:STDOUT: %F.type.f1b0b1.2: type = fn_type @F.3 [concrete]
  707. // CHECK:STDOUT: %F.5161e9.2: %F.type.f1b0b1.2 = struct_value () [concrete]
  708. // CHECK:STDOUT: }
  709. // CHECK:STDOUT:
  710. // CHECK:STDOUT: file {
  711. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  712. // CHECK:STDOUT: .A = %A.decl
  713. // CHECK:STDOUT: .B = %B.decl
  714. // CHECK:STDOUT: .X = %X.decl
  715. // CHECK:STDOUT: }
  716. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  717. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  718. // CHECK:STDOUT: %X.decl: type = interface_decl @X [concrete = constants.%X.type] {} {}
  719. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  720. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  721. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X.type]
  722. // CHECK:STDOUT: }
  723. // CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (@impl.%F.decl.loc12_26.2), @impl [concrete]
  724. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness]
  725. // CHECK:STDOUT: }
  726. // CHECK:STDOUT:
  727. // CHECK:STDOUT: interface @X {
  728. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  729. // CHECK:STDOUT: %F.decl: %F.type.594 = fn_decl @F.1 [concrete = constants.%F.b69] {
  730. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type (%pattern_type.331) = binding_pattern self [concrete]
  731. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type (%pattern_type.331) = value_param_pattern %self.patt, call_param0 [concrete]
  732. // CHECK:STDOUT: %other.patt: @F.1.%pattern_type (%pattern_type.331) = binding_pattern other [concrete]
  733. // CHECK:STDOUT: %other.param_patt: @F.1.%pattern_type (%pattern_type.331) = value_param_pattern %other.patt, call_param1 [concrete]
  734. // CHECK:STDOUT: } {
  735. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc8_14.1 (%Self.as_type) = value_param call_param0
  736. // CHECK:STDOUT: %.loc8_14.1: type = splice_block %.loc8_14.2 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type)] {
  737. // CHECK:STDOUT: %Self.ref.loc8_14: %X.type = name_ref Self, @X.%Self [symbolic = %Self (constants.%Self)]
  738. // CHECK:STDOUT: %Self.as_type.loc8_14.2: type = facet_access_type %Self.ref.loc8_14 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type)]
  739. // CHECK:STDOUT: %.loc8_14.2: type = converted %Self.ref.loc8_14, %Self.as_type.loc8_14.2 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type)]
  740. // CHECK:STDOUT: }
  741. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc8_14.1 (%Self.as_type) = bind_name self, %self.param
  742. // CHECK:STDOUT: %other.param: @F.1.%Self.as_type.loc8_14.1 (%Self.as_type) = value_param call_param1
  743. // CHECK:STDOUT: %.loc8_27.1: type = splice_block %.loc8_27.2 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type)] {
  744. // CHECK:STDOUT: %Self.ref.loc8_27: %X.type = name_ref Self, @X.%Self [symbolic = %Self (constants.%Self)]
  745. // CHECK:STDOUT: %Self.as_type.loc8_27: type = facet_access_type %Self.ref.loc8_27 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type)]
  746. // CHECK:STDOUT: %.loc8_27.2: type = converted %Self.ref.loc8_27, %Self.as_type.loc8_27 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type)]
  747. // CHECK:STDOUT: }
  748. // CHECK:STDOUT: %other: @F.1.%Self.as_type.loc8_14.1 (%Self.as_type) = bind_name other, %other.param
  749. // CHECK:STDOUT: }
  750. // CHECK:STDOUT: %assoc0: %X.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  751. // CHECK:STDOUT:
  752. // CHECK:STDOUT: !members:
  753. // CHECK:STDOUT: .Self = %Self
  754. // CHECK:STDOUT: .F = %assoc0
  755. // CHECK:STDOUT: witness = (%F.decl)
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: impl @impl: %B.ref as %X.ref {
  759. // CHECK:STDOUT: %F.decl.loc12_26.1: %F.type.f1b0b1.1 = fn_decl @F.2 [concrete = constants.%F.5161e9.1] {
  760. // CHECK:STDOUT: %self.patt: %pattern_type.c10 = binding_pattern self [concrete]
  761. // CHECK:STDOUT: %self.param_patt: %pattern_type.c10 = value_param_pattern %self.patt, call_param0 [concrete]
  762. // CHECK:STDOUT: %other.patt: %pattern_type.c10 = binding_pattern other [concrete]
  763. // CHECK:STDOUT: %other.param_patt: %pattern_type.c10 = value_param_pattern %other.patt, call_param1 [concrete]
  764. // CHECK:STDOUT: } {
  765. // CHECK:STDOUT: %self.param: %A = value_param call_param0
  766. // CHECK:STDOUT: %A.ref.loc12_14: type = name_ref A, file.%A.decl [concrete = constants.%A]
  767. // CHECK:STDOUT: %self: %A = bind_name self, %self.param
  768. // CHECK:STDOUT: %other.param: %A = value_param call_param1
  769. // CHECK:STDOUT: %A.ref.loc12_24: type = name_ref A, file.%A.decl [concrete = constants.%A]
  770. // CHECK:STDOUT: %other: %A = bind_name other, %other.param
  771. // CHECK:STDOUT: }
  772. // CHECK:STDOUT: %F.decl.loc12_26.2: %F.type.f1b0b1.2 = fn_decl @F.3 [concrete = constants.%F.5161e9.2] {
  773. // CHECK:STDOUT: %self.patt: %pattern_type.049 = binding_pattern self [concrete]
  774. // CHECK:STDOUT: %self.param_patt: %pattern_type.049 = value_param_pattern %self.patt, call_param0 [concrete]
  775. // CHECK:STDOUT: %other.patt: %pattern_type.049 = binding_pattern other [concrete]
  776. // CHECK:STDOUT: %other.param_patt: %pattern_type.049 = value_param_pattern %other.patt, call_param1 [concrete]
  777. // CHECK:STDOUT: } {
  778. // CHECK:STDOUT: %self.param: %B = value_param call_param0
  779. // CHECK:STDOUT: %self: %B = bind_name self, %self.param
  780. // CHECK:STDOUT: %other.param: %B = value_param call_param1
  781. // CHECK:STDOUT: %other: %B = bind_name other, %other.param
  782. // CHECK:STDOUT: }
  783. // CHECK:STDOUT:
  784. // CHECK:STDOUT: !members:
  785. // CHECK:STDOUT: .A = <poisoned>
  786. // CHECK:STDOUT: .F = %F.decl.loc12_26.1
  787. // CHECK:STDOUT: witness = file.%X.impl_witness
  788. // CHECK:STDOUT: }
  789. // CHECK:STDOUT:
  790. // CHECK:STDOUT: class @A {
  791. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  792. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  793. // CHECK:STDOUT: complete_type_witness = %complete_type
  794. // CHECK:STDOUT:
  795. // CHECK:STDOUT: !members:
  796. // CHECK:STDOUT: .Self = constants.%A
  797. // CHECK:STDOUT: }
  798. // CHECK:STDOUT:
  799. // CHECK:STDOUT: class @B {
  800. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  801. // CHECK:STDOUT: %.loc5: %B.elem = base_decl %A.ref, element0 [concrete]
  802. // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %A} [concrete = constants.%struct_type.base.953]
  803. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base [concrete = constants.%complete_type.020]
  804. // CHECK:STDOUT: complete_type_witness = %complete_type
  805. // CHECK:STDOUT:
  806. // CHECK:STDOUT: !members:
  807. // CHECK:STDOUT: .Self = constants.%B
  808. // CHECK:STDOUT: .A = <poisoned>
  809. // CHECK:STDOUT: .base = %.loc5
  810. // CHECK:STDOUT: extend %A.ref
  811. // CHECK:STDOUT: }
  812. // CHECK:STDOUT:
  813. // CHECK:STDOUT: generic fn @F.1(@X.%Self: %X.type) {
  814. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  815. // CHECK:STDOUT: %Self.as_type.loc8_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type)]
  816. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc8_14.1 [symbolic = %pattern_type (constants.%pattern_type.331)]
  817. // CHECK:STDOUT:
  818. // CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc8_14.1 (%Self.as_type), %other.param: @F.1.%Self.as_type.loc8_14.1 (%Self.as_type));
  819. // CHECK:STDOUT: }
  820. // CHECK:STDOUT:
  821. // CHECK:STDOUT: fn @F.2(%self.param: %A, %other.param: %A);
  822. // CHECK:STDOUT:
  823. // CHECK:STDOUT: fn @F.3(%self.param: %B, %other.param: %B) {
  824. // CHECK:STDOUT: !entry:
  825. // CHECK:STDOUT: %self.ref: %B = name_ref self, %self.param
  826. // CHECK:STDOUT: %F.bound: <bound method> = bound_method %self.ref, @impl.%F.decl.loc12_26.1
  827. // CHECK:STDOUT: %other.ref: %B = name_ref other, %other.param
  828. // CHECK:STDOUT: %.loc8_12.1: ref %A = class_element_access %self.ref, element0
  829. // CHECK:STDOUT: %.loc8_12.2: ref %A = converted %self.ref, %.loc8_12.1
  830. // CHECK:STDOUT: %.loc8_12.3: %A = bind_value %.loc8_12.2
  831. // CHECK:STDOUT: %.loc8_25.1: ref %A = class_element_access %other.ref, element0
  832. // CHECK:STDOUT: %.loc8_25.2: ref %A = converted %other.ref, %.loc8_25.1
  833. // CHECK:STDOUT: %.loc8_25.3: %A = bind_value %.loc8_25.2
  834. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.bound(%.loc8_12.3, %.loc8_25.3)
  835. // CHECK:STDOUT: return
  836. // CHECK:STDOUT: }
  837. // CHECK:STDOUT:
  838. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  839. // CHECK:STDOUT: %Self => constants.%Self
  840. // CHECK:STDOUT: %Self.as_type.loc8_14.1 => constants.%Self.as_type
  841. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.331
  842. // CHECK:STDOUT: }
  843. // CHECK:STDOUT:
  844. // CHECK:STDOUT: specific @F.1(constants.%X.facet) {
  845. // CHECK:STDOUT: %Self => constants.%X.facet
  846. // CHECK:STDOUT: %Self.as_type.loc8_14.1 => constants.%B
  847. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.049
  848. // CHECK:STDOUT: }
  849. // CHECK:STDOUT:
  850. // CHECK:STDOUT: --- inheritance_value_conversion_pointer.carbon
  851. // CHECK:STDOUT:
  852. // CHECK:STDOUT: constants {
  853. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  854. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  855. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  856. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  857. // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [concrete]
  858. // CHECK:STDOUT: %struct_type.base.953: type = struct_type {.base: %A} [concrete]
  859. // CHECK:STDOUT: %complete_type.020: <witness> = complete_type_witness %struct_type.base.953 [concrete]
  860. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  861. // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %B [concrete]
  862. // CHECK:STDOUT: %struct_type.base.0ff: type = struct_type {.base: %B} [concrete]
  863. // CHECK:STDOUT: %complete_type.98e: <witness> = complete_type_witness %struct_type.base.0ff [concrete]
  864. // CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
  865. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic]
  866. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  867. // CHECK:STDOUT: %ptr.d06: type = ptr_type %Self.as_type [symbolic]
  868. // CHECK:STDOUT: %pattern_type.4c5: type = pattern_type %ptr.d06 [symbolic]
  869. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  870. // CHECK:STDOUT: %F.type.594: type = fn_type @F.1 [concrete]
  871. // CHECK:STDOUT: %F.b69: %F.type.594 = struct_value () [concrete]
  872. // CHECK:STDOUT: %X.assoc_type: type = assoc_entity_type @X [concrete]
  873. // CHECK:STDOUT: %assoc0: %X.assoc_type = assoc_entity element0, @X.%F.decl [concrete]
  874. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness file.%X.impl_witness_table [concrete]
  875. // CHECK:STDOUT: %ptr.6db: type = ptr_type %A [concrete]
  876. // CHECK:STDOUT: %pattern_type.5f8: type = pattern_type %ptr.6db [concrete]
  877. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  878. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  879. // CHECK:STDOUT: %F.type.f1b0b1.1: type = fn_type @F.2 [concrete]
  880. // CHECK:STDOUT: %F.5161e9.1: %F.type.f1b0b1.1 = struct_value () [concrete]
  881. // CHECK:STDOUT: %X.facet: %X.type = facet_value %B, (%X.impl_witness) [concrete]
  882. // CHECK:STDOUT: %ptr.e79: type = ptr_type %B [concrete]
  883. // CHECK:STDOUT: %pattern_type.960: type = pattern_type %ptr.e79 [concrete]
  884. // CHECK:STDOUT: %F.type.f1b0b1.2: type = fn_type @F.3 [concrete]
  885. // CHECK:STDOUT: %F.5161e9.2: %F.type.f1b0b1.2 = struct_value () [concrete]
  886. // CHECK:STDOUT: }
  887. // CHECK:STDOUT:
  888. // CHECK:STDOUT: file {
  889. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  890. // CHECK:STDOUT: .A = %A.decl
  891. // CHECK:STDOUT: .B = %B.decl
  892. // CHECK:STDOUT: .C = %C.decl
  893. // CHECK:STDOUT: .X = %X.decl
  894. // CHECK:STDOUT: }
  895. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  896. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  897. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  898. // CHECK:STDOUT: %X.decl: type = interface_decl @X [concrete = constants.%X.type] {} {}
  899. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  900. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  901. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X.type]
  902. // CHECK:STDOUT: }
  903. // CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (@impl.%F.decl.loc13_39.2), @impl [concrete]
  904. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness]
  905. // CHECK:STDOUT: }
  906. // CHECK:STDOUT:
  907. // CHECK:STDOUT: interface @X {
  908. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  909. // CHECK:STDOUT: %F.decl: %F.type.594 = fn_decl @F.1 [concrete = constants.%F.b69] {
  910. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type (%pattern_type.4c5) = binding_pattern self [concrete]
  911. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type (%pattern_type.4c5) = value_param_pattern %self.patt, call_param0 [concrete]
  912. // CHECK:STDOUT: %.loc9_8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  913. // CHECK:STDOUT: %other.patt: @F.1.%pattern_type (%pattern_type.4c5) = binding_pattern other [concrete]
  914. // CHECK:STDOUT: %other.param_patt: @F.1.%pattern_type (%pattern_type.4c5) = value_param_pattern %other.patt, call_param1 [concrete]
  915. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.4c5) = return_slot_pattern [concrete]
  916. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.4c5) = out_param_pattern %return.patt, call_param2 [concrete]
  917. // CHECK:STDOUT: } {
  918. // CHECK:STDOUT: %Self.ref.loc9_43: %X.type = name_ref Self, @X.%Self [symbolic = %Self (constants.%Self)]
  919. // CHECK:STDOUT: %Self.as_type.loc9_47: type = facet_access_type %Self.ref.loc9_43 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  920. // CHECK:STDOUT: %.loc9_47: type = converted %Self.ref.loc9_43, %Self.as_type.loc9_47 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  921. // CHECK:STDOUT: %ptr.loc9_47: type = ptr_type %.loc9_47 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)]
  922. // CHECK:STDOUT: %self.param: @F.1.%ptr.loc9_23.1 (%ptr.d06) = value_param call_param0
  923. // CHECK:STDOUT: %.loc9_23.1: type = splice_block %ptr.loc9_23.2 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)] {
  924. // CHECK:STDOUT: %Self.ref.loc9_19: %X.type = name_ref Self, @X.%Self [symbolic = %Self (constants.%Self)]
  925. // CHECK:STDOUT: %Self.as_type.loc9_23.2: type = facet_access_type %Self.ref.loc9_19 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  926. // CHECK:STDOUT: %.loc9_23.2: type = converted %Self.ref.loc9_19, %Self.as_type.loc9_23.2 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  927. // CHECK:STDOUT: %ptr.loc9_23.2: type = ptr_type %.loc9_23.2 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)]
  928. // CHECK:STDOUT: }
  929. // CHECK:STDOUT: %self: @F.1.%ptr.loc9_23.1 (%ptr.d06) = bind_name self, %self.param
  930. // CHECK:STDOUT: %other.param: @F.1.%ptr.loc9_23.1 (%ptr.d06) = value_param call_param1
  931. // CHECK:STDOUT: %.loc9_37.1: type = splice_block %ptr.loc9_37 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)] {
  932. // CHECK:STDOUT: %Self.ref.loc9_33: %X.type = name_ref Self, @X.%Self [symbolic = %Self (constants.%Self)]
  933. // CHECK:STDOUT: %Self.as_type.loc9_37: type = facet_access_type %Self.ref.loc9_33 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  934. // CHECK:STDOUT: %.loc9_37.2: type = converted %Self.ref.loc9_33, %Self.as_type.loc9_37 [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  935. // CHECK:STDOUT: %ptr.loc9_37: type = ptr_type %.loc9_37.2 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)]
  936. // CHECK:STDOUT: }
  937. // CHECK:STDOUT: %other: @F.1.%ptr.loc9_23.1 (%ptr.d06) = bind_name other, %other.param
  938. // CHECK:STDOUT: %return.param: ref @F.1.%ptr.loc9_23.1 (%ptr.d06) = out_param call_param2
  939. // CHECK:STDOUT: %return: ref @F.1.%ptr.loc9_23.1 (%ptr.d06) = return_slot %return.param
  940. // CHECK:STDOUT: }
  941. // CHECK:STDOUT: %assoc0: %X.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: !members:
  944. // CHECK:STDOUT: .Self = %Self
  945. // CHECK:STDOUT: .F = %assoc0
  946. // CHECK:STDOUT: witness = (%F.decl)
  947. // CHECK:STDOUT: }
  948. // CHECK:STDOUT:
  949. // CHECK:STDOUT: impl @impl: %B.ref as %X.ref {
  950. // CHECK:STDOUT: %F.decl.loc13_39.1: %F.type.f1b0b1.1 = fn_decl @F.2 [concrete = constants.%F.5161e9.1] {
  951. // CHECK:STDOUT: %self.patt: %pattern_type.5f8 = binding_pattern self [concrete]
  952. // CHECK:STDOUT: %self.param_patt: %pattern_type.5f8 = value_param_pattern %self.patt, call_param0 [concrete]
  953. // CHECK:STDOUT: %.loc13_8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  954. // CHECK:STDOUT: %other.patt: %pattern_type.5f8 = binding_pattern other [concrete]
  955. // CHECK:STDOUT: %other.param_patt: %pattern_type.5f8 = value_param_pattern %other.patt, call_param1 [concrete]
  956. // CHECK:STDOUT: %return.patt: %pattern_type.44a = return_slot_pattern [concrete]
  957. // CHECK:STDOUT: %return.param_patt: %pattern_type.44a = out_param_pattern %return.patt, call_param2 [concrete]
  958. // CHECK:STDOUT: } {
  959. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  960. // CHECK:STDOUT: %ptr.loc13_38: type = ptr_type %C.ref [concrete = constants.%ptr.019]
  961. // CHECK:STDOUT: %self.param: %ptr.6db = value_param call_param0
  962. // CHECK:STDOUT: %.loc13_20: type = splice_block %ptr.loc13_20 [concrete = constants.%ptr.6db] {
  963. // CHECK:STDOUT: %A.ref.loc13_19: type = name_ref A, file.%A.decl [concrete = constants.%A]
  964. // CHECK:STDOUT: %ptr.loc13_20: type = ptr_type %A.ref.loc13_19 [concrete = constants.%ptr.6db]
  965. // CHECK:STDOUT: }
  966. // CHECK:STDOUT: %self: %ptr.6db = bind_name self, %self.param
  967. // CHECK:STDOUT: %other.param: %ptr.6db = value_param call_param1
  968. // CHECK:STDOUT: %.loc13_31: type = splice_block %ptr.loc13_31 [concrete = constants.%ptr.6db] {
  969. // CHECK:STDOUT: %A.ref.loc13_30: type = name_ref A, file.%A.decl [concrete = constants.%A]
  970. // CHECK:STDOUT: %ptr.loc13_31: type = ptr_type %A.ref.loc13_30 [concrete = constants.%ptr.6db]
  971. // CHECK:STDOUT: }
  972. // CHECK:STDOUT: %other: %ptr.6db = bind_name other, %other.param
  973. // CHECK:STDOUT: %return.param: ref %ptr.019 = out_param call_param2
  974. // CHECK:STDOUT: %return: ref %ptr.019 = return_slot %return.param
  975. // CHECK:STDOUT: }
  976. // CHECK:STDOUT: %F.decl.loc13_39.2: %F.type.f1b0b1.2 = fn_decl @F.3 [concrete = constants.%F.5161e9.2] {
  977. // CHECK:STDOUT: %self.patt: %pattern_type.960 = binding_pattern self [concrete]
  978. // CHECK:STDOUT: %self.param_patt: %pattern_type.960 = value_param_pattern %self.patt, call_param0 [concrete]
  979. // CHECK:STDOUT: %.loc9_8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  980. // CHECK:STDOUT: %other.patt: %pattern_type.960 = binding_pattern other [concrete]
  981. // CHECK:STDOUT: %other.param_patt: %pattern_type.960 = value_param_pattern %other.patt, call_param1 [concrete]
  982. // CHECK:STDOUT: %return.patt: %pattern_type.960 = return_slot_pattern [concrete]
  983. // CHECK:STDOUT: %return.param_patt: %pattern_type.960 = out_param_pattern %return.patt, call_param2 [concrete]
  984. // CHECK:STDOUT: } {
  985. // CHECK:STDOUT: %self.param: %ptr.e79 = value_param call_param0
  986. // CHECK:STDOUT: %self: %ptr.e79 = bind_name self, %self.param
  987. // CHECK:STDOUT: %other.param: %ptr.e79 = value_param call_param1
  988. // CHECK:STDOUT: %other: %ptr.e79 = bind_name other, %other.param
  989. // CHECK:STDOUT: %return.param: ref %ptr.e79 = out_param call_param2
  990. // CHECK:STDOUT: %return: ref %ptr.e79 = return_slot %return.param
  991. // CHECK:STDOUT: }
  992. // CHECK:STDOUT:
  993. // CHECK:STDOUT: !members:
  994. // CHECK:STDOUT: .A = <poisoned>
  995. // CHECK:STDOUT: .C = <poisoned>
  996. // CHECK:STDOUT: .F = %F.decl.loc13_39.1
  997. // CHECK:STDOUT: witness = file.%X.impl_witness
  998. // CHECK:STDOUT: }
  999. // CHECK:STDOUT:
  1000. // CHECK:STDOUT: class @A {
  1001. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1002. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  1003. // CHECK:STDOUT: complete_type_witness = %complete_type
  1004. // CHECK:STDOUT:
  1005. // CHECK:STDOUT: !members:
  1006. // CHECK:STDOUT: .Self = constants.%A
  1007. // CHECK:STDOUT: }
  1008. // CHECK:STDOUT:
  1009. // CHECK:STDOUT: class @B {
  1010. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  1011. // CHECK:STDOUT: %.loc5: %B.elem = base_decl %A.ref, element0 [concrete]
  1012. // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %A} [concrete = constants.%struct_type.base.953]
  1013. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base [concrete = constants.%complete_type.020]
  1014. // CHECK:STDOUT: complete_type_witness = %complete_type
  1015. // CHECK:STDOUT:
  1016. // CHECK:STDOUT: !members:
  1017. // CHECK:STDOUT: .Self = constants.%B
  1018. // CHECK:STDOUT: .A = <poisoned>
  1019. // CHECK:STDOUT: .base = %.loc5
  1020. // CHECK:STDOUT: extend %A.ref
  1021. // CHECK:STDOUT: }
  1022. // CHECK:STDOUT:
  1023. // CHECK:STDOUT: class @C {
  1024. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  1025. // CHECK:STDOUT: %.loc6: %C.elem = base_decl %B.ref, element0 [concrete]
  1026. // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %B} [concrete = constants.%struct_type.base.0ff]
  1027. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base [concrete = constants.%complete_type.98e]
  1028. // CHECK:STDOUT: complete_type_witness = %complete_type
  1029. // CHECK:STDOUT:
  1030. // CHECK:STDOUT: !members:
  1031. // CHECK:STDOUT: .Self = constants.%C
  1032. // CHECK:STDOUT: .B = <poisoned>
  1033. // CHECK:STDOUT: .base = %.loc6
  1034. // CHECK:STDOUT: extend %B.ref
  1035. // CHECK:STDOUT: }
  1036. // CHECK:STDOUT:
  1037. // CHECK:STDOUT: generic fn @F.1(@X.%Self: %X.type) {
  1038. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1039. // CHECK:STDOUT: %Self.as_type.loc9_23.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_23.1 (constants.%Self.as_type)]
  1040. // CHECK:STDOUT: %ptr.loc9_23.1: type = ptr_type %Self.as_type.loc9_23.1 [symbolic = %ptr.loc9_23.1 (constants.%ptr.d06)]
  1041. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc9_23.1 [symbolic = %pattern_type (constants.%pattern_type.4c5)]
  1042. // CHECK:STDOUT:
  1043. // CHECK:STDOUT: fn(%self.param: @F.1.%ptr.loc9_23.1 (%ptr.d06), %other.param: @F.1.%ptr.loc9_23.1 (%ptr.d06)) -> @F.1.%ptr.loc9_23.1 (%ptr.d06);
  1044. // CHECK:STDOUT: }
  1045. // CHECK:STDOUT:
  1046. // CHECK:STDOUT: fn @F.2(%self.param: %ptr.6db, %other.param: %ptr.6db) -> %ptr.019;
  1047. // CHECK:STDOUT:
  1048. // CHECK:STDOUT: fn @F.3(%self.param: %ptr.e79, %other.param: %ptr.e79) -> %ptr.e79 {
  1049. // CHECK:STDOUT: !entry:
  1050. // CHECK:STDOUT: %self.ref: %ptr.e79 = name_ref self, %self.param
  1051. // CHECK:STDOUT: %.loc9_17.1: ref %B = deref %self.ref
  1052. // CHECK:STDOUT: %F.bound: <bound method> = bound_method %.loc9_17.1, @impl.%F.decl.loc13_39.1
  1053. // CHECK:STDOUT: %other.ref: %ptr.e79 = name_ref other, %other.param
  1054. // CHECK:STDOUT: %addr.loc9_17.1: %ptr.e79 = addr_of %.loc9_17.1
  1055. // CHECK:STDOUT: %.loc9_17.2: ref %B = deref %addr.loc9_17.1
  1056. // CHECK:STDOUT: %.loc9_17.3: ref %A = class_element_access %.loc9_17.2, element0
  1057. // CHECK:STDOUT: %addr.loc9_17.2: %ptr.6db = addr_of %.loc9_17.3
  1058. // CHECK:STDOUT: %.loc9_17.4: %ptr.6db = converted %addr.loc9_17.1, %addr.loc9_17.2
  1059. // CHECK:STDOUT: %.loc9_31.1: ref %B = deref %other.ref
  1060. // CHECK:STDOUT: %.loc9_31.2: ref %A = class_element_access %.loc9_31.1, element0
  1061. // CHECK:STDOUT: %addr.loc9_31: %ptr.6db = addr_of %.loc9_31.2
  1062. // CHECK:STDOUT: %.loc9_31.3: %ptr.6db = converted %other.ref, %addr.loc9_31
  1063. // CHECK:STDOUT: %F.call: init %ptr.019 = call %F.bound(%.loc9_17.4, %.loc9_31.3)
  1064. // CHECK:STDOUT: %.loc13_39.1: %ptr.019 = value_of_initializer %F.call
  1065. // CHECK:STDOUT: %.loc13_39.2: %ptr.019 = converted %F.call, %.loc13_39.1
  1066. // CHECK:STDOUT: %.loc13_39.3: ref %C = deref %.loc13_39.2
  1067. // CHECK:STDOUT: %.loc13_39.4: ref %B = class_element_access %.loc13_39.3, element0
  1068. // CHECK:STDOUT: %addr.loc13: %ptr.e79 = addr_of %.loc13_39.4
  1069. // CHECK:STDOUT: %.loc13_39.5: %ptr.e79 = converted %F.call, %addr.loc13
  1070. // CHECK:STDOUT: return %.loc13_39.5
  1071. // CHECK:STDOUT: }
  1072. // CHECK:STDOUT:
  1073. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  1074. // CHECK:STDOUT: %Self => constants.%Self
  1075. // CHECK:STDOUT: %Self.as_type.loc9_23.1 => constants.%Self.as_type
  1076. // CHECK:STDOUT: %ptr.loc9_23.1 => constants.%ptr.d06
  1077. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4c5
  1078. // CHECK:STDOUT: }
  1079. // CHECK:STDOUT:
  1080. // CHECK:STDOUT: specific @F.1(constants.%X.facet) {
  1081. // CHECK:STDOUT: %Self => constants.%X.facet
  1082. // CHECK:STDOUT: %Self.as_type.loc9_23.1 => constants.%B
  1083. // CHECK:STDOUT: %ptr.loc9_23.1 => constants.%ptr.e79
  1084. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.960
  1085. // CHECK:STDOUT: }
  1086. // CHECK:STDOUT:
  1087. // CHECK:STDOUT: --- fail_inheritance_value_conversion_copy_return.carbon
  1088. // CHECK:STDOUT:
  1089. // CHECK:STDOUT: constants {
  1090. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  1091. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1092. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1093. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  1094. // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %A [concrete]
  1095. // CHECK:STDOUT: %struct_type.base.953: type = struct_type {.base: %A} [concrete]
  1096. // CHECK:STDOUT: %complete_type.020: <witness> = complete_type_witness %struct_type.base.953 [concrete]
  1097. // CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
  1098. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic]
  1099. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1100. // CHECK:STDOUT: %pattern_type.331: type = pattern_type %Self.as_type [symbolic]
  1101. // CHECK:STDOUT: %F.type.594: type = fn_type @F.1 [concrete]
  1102. // CHECK:STDOUT: %F.b69: %F.type.594 = struct_value () [concrete]
  1103. // CHECK:STDOUT: %X.assoc_type: type = assoc_entity_type @X [concrete]
  1104. // CHECK:STDOUT: %assoc0: %X.assoc_type = assoc_entity element0, @X.%F.decl [concrete]
  1105. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness file.%X.impl_witness_table [concrete]
  1106. // CHECK:STDOUT: %pattern_type.049: type = pattern_type %B [concrete]
  1107. // CHECK:STDOUT: %F.type.b24d6f.1: type = fn_type @F.2 [concrete]
  1108. // CHECK:STDOUT: %F.77e9d5.1: %F.type.b24d6f.1 = struct_value () [concrete]
  1109. // CHECK:STDOUT: %X.facet: %X.type = facet_value %A, (%X.impl_witness) [concrete]
  1110. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  1111. // CHECK:STDOUT: %F.type.b24d6f.2: type = fn_type @F.3 [concrete]
  1112. // CHECK:STDOUT: %F.77e9d5.2: %F.type.b24d6f.2 = struct_value () [concrete]
  1113. // CHECK:STDOUT: }
  1114. // CHECK:STDOUT:
  1115. // CHECK:STDOUT: file {
  1116. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1117. // CHECK:STDOUT: .A = %A.decl
  1118. // CHECK:STDOUT: .B = %B.decl
  1119. // CHECK:STDOUT: .X = %X.decl
  1120. // CHECK:STDOUT: }
  1121. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  1122. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  1123. // CHECK:STDOUT: %X.decl: type = interface_decl @X [concrete = constants.%X.type] {} {}
  1124. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1125. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  1126. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X.type]
  1127. // CHECK:STDOUT: }
  1128. // CHECK:STDOUT: %X.impl_witness_table = impl_witness_table (@impl.%F.decl.loc19_14.2), @impl [concrete]
  1129. // CHECK:STDOUT: %X.impl_witness: <witness> = impl_witness %X.impl_witness_table [concrete = constants.%X.impl_witness]
  1130. // CHECK:STDOUT: }
  1131. // CHECK:STDOUT:
  1132. // CHECK:STDOUT: interface @X {
  1133. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1134. // CHECK:STDOUT: %F.decl: %F.type.594 = fn_decl @F.1 [concrete = constants.%F.b69] {
  1135. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.331) = return_slot_pattern [concrete]
  1136. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.331) = out_param_pattern %return.patt, call_param0 [concrete]
  1137. // CHECK:STDOUT: } {
  1138. // CHECK:STDOUT: %Self.ref: %X.type = name_ref Self, @X.%Self [symbolic = %Self (constants.%Self)]
  1139. // CHECK:STDOUT: %Self.as_type.loc8_13.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_13.1 (constants.%Self.as_type)]
  1140. // CHECK:STDOUT: %.loc8: type = converted %Self.ref, %Self.as_type.loc8_13.2 [symbolic = %Self.as_type.loc8_13.1 (constants.%Self.as_type)]
  1141. // CHECK:STDOUT: %return.param: ref @F.1.%Self.as_type.loc8_13.1 (%Self.as_type) = out_param call_param0
  1142. // CHECK:STDOUT: %return: ref @F.1.%Self.as_type.loc8_13.1 (%Self.as_type) = return_slot %return.param
  1143. // CHECK:STDOUT: }
  1144. // CHECK:STDOUT: %assoc0: %X.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  1145. // CHECK:STDOUT:
  1146. // CHECK:STDOUT: !members:
  1147. // CHECK:STDOUT: .Self = %Self
  1148. // CHECK:STDOUT: .F = %assoc0
  1149. // CHECK:STDOUT: witness = (%F.decl)
  1150. // CHECK:STDOUT: }
  1151. // CHECK:STDOUT:
  1152. // CHECK:STDOUT: impl @impl: %A.ref as %X.ref {
  1153. // CHECK:STDOUT: %F.decl.loc19_14.1: %F.type.b24d6f.1 = fn_decl @F.2 [concrete = constants.%F.77e9d5.1] {
  1154. // CHECK:STDOUT: %return.patt: %pattern_type.049 = return_slot_pattern [concrete]
  1155. // CHECK:STDOUT: %return.param_patt: %pattern_type.049 = out_param_pattern %return.patt, call_param0 [concrete]
  1156. // CHECK:STDOUT: } {
  1157. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  1158. // CHECK:STDOUT: %return.param: ref %B = out_param call_param0
  1159. // CHECK:STDOUT: %return: ref %B = return_slot %return.param
  1160. // CHECK:STDOUT: }
  1161. // CHECK:STDOUT: %F.decl.loc19_14.2: %F.type.b24d6f.2 = fn_decl @F.3 [concrete = constants.%F.77e9d5.2] {
  1162. // CHECK:STDOUT: %return.patt: %pattern_type.c10 = return_slot_pattern [concrete]
  1163. // CHECK:STDOUT: %return.param_patt: %pattern_type.c10 = out_param_pattern %return.patt, call_param0 [concrete]
  1164. // CHECK:STDOUT: } {
  1165. // CHECK:STDOUT: %return.param: ref %A = out_param call_param0
  1166. // CHECK:STDOUT: %return: ref %A = return_slot %return.param
  1167. // CHECK:STDOUT: }
  1168. // CHECK:STDOUT:
  1169. // CHECK:STDOUT: !members:
  1170. // CHECK:STDOUT: .B = <poisoned>
  1171. // CHECK:STDOUT: .F = %F.decl.loc19_14.1
  1172. // CHECK:STDOUT: witness = file.%X.impl_witness
  1173. // CHECK:STDOUT: }
  1174. // CHECK:STDOUT:
  1175. // CHECK:STDOUT: class @A {
  1176. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1177. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  1178. // CHECK:STDOUT: complete_type_witness = %complete_type
  1179. // CHECK:STDOUT:
  1180. // CHECK:STDOUT: !members:
  1181. // CHECK:STDOUT: .Self = constants.%A
  1182. // CHECK:STDOUT: }
  1183. // CHECK:STDOUT:
  1184. // CHECK:STDOUT: class @B {
  1185. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  1186. // CHECK:STDOUT: %.loc5: %B.elem = base_decl %A.ref, element0 [concrete]
  1187. // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %A} [concrete = constants.%struct_type.base.953]
  1188. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base [concrete = constants.%complete_type.020]
  1189. // CHECK:STDOUT: complete_type_witness = %complete_type
  1190. // CHECK:STDOUT:
  1191. // CHECK:STDOUT: !members:
  1192. // CHECK:STDOUT: .Self = constants.%B
  1193. // CHECK:STDOUT: .A = <poisoned>
  1194. // CHECK:STDOUT: .base = %.loc5
  1195. // CHECK:STDOUT: extend %A.ref
  1196. // CHECK:STDOUT: }
  1197. // CHECK:STDOUT:
  1198. // CHECK:STDOUT: generic fn @F.1(@X.%Self: %X.type) {
  1199. // CHECK:STDOUT: %Self: %X.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1200. // CHECK:STDOUT: %Self.as_type.loc8_13.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_13.1 (constants.%Self.as_type)]
  1201. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc8_13.1 [symbolic = %pattern_type (constants.%pattern_type.331)]
  1202. // CHECK:STDOUT:
  1203. // CHECK:STDOUT: fn() -> @F.1.%Self.as_type.loc8_13.1 (%Self.as_type);
  1204. // CHECK:STDOUT: }
  1205. // CHECK:STDOUT:
  1206. // CHECK:STDOUT: fn @F.2() -> %return.param: %B;
  1207. // CHECK:STDOUT:
  1208. // CHECK:STDOUT: fn @F.3() -> %return.param: %A {
  1209. // CHECK:STDOUT: !entry:
  1210. // CHECK:STDOUT: %.loc19_14.1: ref %B = temporary_storage
  1211. // CHECK:STDOUT: %F.call: init %B = call @impl.%F.decl.loc19_14.1() to %.loc19_14.1
  1212. // CHECK:STDOUT: %.loc19_14.2: ref %B = temporary %.loc19_14.1, %F.call
  1213. // CHECK:STDOUT: %.loc19_14.3: ref %A = class_element_access %.loc19_14.2, element0
  1214. // CHECK:STDOUT: %.loc19_14.4: ref %A = converted %F.call, %.loc19_14.3
  1215. // CHECK:STDOUT: %.loc19_14.5: %A = bind_value %.loc19_14.4
  1216. // CHECK:STDOUT: return <error> to %return
  1217. // CHECK:STDOUT: }
  1218. // CHECK:STDOUT:
  1219. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  1220. // CHECK:STDOUT: %Self => constants.%Self
  1221. // CHECK:STDOUT: %Self.as_type.loc8_13.1 => constants.%Self.as_type
  1222. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.331
  1223. // CHECK:STDOUT: }
  1224. // CHECK:STDOUT:
  1225. // CHECK:STDOUT: specific @F.1(constants.%X.facet) {
  1226. // CHECK:STDOUT: %Self => constants.%X.facet
  1227. // CHECK:STDOUT: %Self.as_type.loc8_13.1 => constants.%A
  1228. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c10
  1229. // CHECK:STDOUT: }
  1230. // CHECK:STDOUT:
  1231. // CHECK:STDOUT: --- fail_param_type_mismatch.carbon
  1232. // CHECK:STDOUT:
  1233. // CHECK:STDOUT: constants {
  1234. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1235. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1236. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1237. // CHECK:STDOUT: %pattern_type.6de: type = pattern_type %Self.as_type [symbolic]
  1238. // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
  1239. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1240. // CHECK:STDOUT: %F.bc6: %F.type.cf0 = struct_value () [concrete]
  1241. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1242. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%F.decl [concrete]
  1243. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  1244. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1245. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1246. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  1247. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  1248. // CHECK:STDOUT: %pattern_type.049: type = pattern_type %B [concrete]
  1249. // CHECK:STDOUT: %F.type.2ae1ef.1: type = fn_type @F.2 [concrete]
  1250. // CHECK:STDOUT: %F.2a7aab.1: %F.type.2ae1ef.1 = struct_value () [concrete]
  1251. // CHECK:STDOUT: %I.facet: %I.type = facet_value %A, (%I.impl_witness) [concrete]
  1252. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  1253. // CHECK:STDOUT: %F.type.2ae1ef.2: type = fn_type @F.3 [concrete]
  1254. // CHECK:STDOUT: %F.2a7aab.2: %F.type.2ae1ef.2 = struct_value () [concrete]
  1255. // CHECK:STDOUT: }
  1256. // CHECK:STDOUT:
  1257. // CHECK:STDOUT: file {
  1258. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1259. // CHECK:STDOUT: .I = %I.decl
  1260. // CHECK:STDOUT: .A = %A.decl
  1261. // CHECK:STDOUT: .B = %B.decl
  1262. // CHECK:STDOUT: }
  1263. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1264. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  1265. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  1266. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1267. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  1268. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1269. // CHECK:STDOUT: }
  1270. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.%F.decl.loc22_13.2), @impl [concrete]
  1271. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1272. // CHECK:STDOUT: }
  1273. // CHECK:STDOUT:
  1274. // CHECK:STDOUT: interface @I {
  1275. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1276. // CHECK:STDOUT: %F.decl: %F.type.cf0 = fn_decl @F.1 [concrete = constants.%F.bc6] {
  1277. // CHECK:STDOUT: %a.patt: @F.1.%pattern_type (%pattern_type.6de) = binding_pattern a [concrete]
  1278. // CHECK:STDOUT: %a.param_patt: @F.1.%pattern_type (%pattern_type.6de) = value_param_pattern %a.patt, call_param0 [concrete]
  1279. // CHECK:STDOUT: } {
  1280. // CHECK:STDOUT: %a.param: @F.1.%Self.as_type.loc8_11.1 (%Self.as_type) = value_param call_param0
  1281. // CHECK:STDOUT: %.loc8_11.1: type = splice_block %.loc8_11.2 [symbolic = %Self.as_type.loc8_11.1 (constants.%Self.as_type)] {
  1282. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
  1283. // CHECK:STDOUT: %Self.as_type.loc8_11.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_11.1 (constants.%Self.as_type)]
  1284. // CHECK:STDOUT: %.loc8_11.2: type = converted %Self.ref, %Self.as_type.loc8_11.2 [symbolic = %Self.as_type.loc8_11.1 (constants.%Self.as_type)]
  1285. // CHECK:STDOUT: }
  1286. // CHECK:STDOUT: %a: @F.1.%Self.as_type.loc8_11.1 (%Self.as_type) = bind_name a, %a.param
  1287. // CHECK:STDOUT: }
  1288. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  1289. // CHECK:STDOUT:
  1290. // CHECK:STDOUT: !members:
  1291. // CHECK:STDOUT: .Self = %Self
  1292. // CHECK:STDOUT: .F = %assoc0
  1293. // CHECK:STDOUT: witness = (%F.decl)
  1294. // CHECK:STDOUT: }
  1295. // CHECK:STDOUT:
  1296. // CHECK:STDOUT: impl @impl: %A.ref as %I.ref {
  1297. // CHECK:STDOUT: %F.decl.loc22_13.1: %F.type.2ae1ef.1 = fn_decl @F.2 [concrete = constants.%F.2a7aab.1] {
  1298. // CHECK:STDOUT: %a.patt: %pattern_type.049 = binding_pattern a [concrete]
  1299. // CHECK:STDOUT: %a.param_patt: %pattern_type.049 = value_param_pattern %a.patt, call_param0 [concrete]
  1300. // CHECK:STDOUT: } {
  1301. // CHECK:STDOUT: %a.param: %B = value_param call_param0
  1302. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  1303. // CHECK:STDOUT: %a: %B = bind_name a, %a.param
  1304. // CHECK:STDOUT: }
  1305. // CHECK:STDOUT: %F.decl.loc22_13.2: %F.type.2ae1ef.2 = fn_decl @F.3 [concrete = constants.%F.2a7aab.2] {
  1306. // CHECK:STDOUT: %a.patt: %pattern_type.c10 = binding_pattern a [concrete]
  1307. // CHECK:STDOUT: %a.param_patt: %pattern_type.c10 = value_param_pattern %a.patt, call_param0 [concrete]
  1308. // CHECK:STDOUT: } {
  1309. // CHECK:STDOUT: %a.param: %A = value_param call_param0
  1310. // CHECK:STDOUT: %a: %A = bind_name a, %a.param
  1311. // CHECK:STDOUT: }
  1312. // CHECK:STDOUT:
  1313. // CHECK:STDOUT: !members:
  1314. // CHECK:STDOUT: .B = <poisoned>
  1315. // CHECK:STDOUT: .F = %F.decl.loc22_13.1
  1316. // CHECK:STDOUT: witness = file.%I.impl_witness
  1317. // CHECK:STDOUT: }
  1318. // CHECK:STDOUT:
  1319. // CHECK:STDOUT: class @A {
  1320. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1321. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1322. // CHECK:STDOUT: complete_type_witness = %complete_type
  1323. // CHECK:STDOUT:
  1324. // CHECK:STDOUT: !members:
  1325. // CHECK:STDOUT: .Self = constants.%A
  1326. // CHECK:STDOUT: }
  1327. // CHECK:STDOUT:
  1328. // CHECK:STDOUT: class @B {
  1329. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1330. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1331. // CHECK:STDOUT: complete_type_witness = %complete_type
  1332. // CHECK:STDOUT:
  1333. // CHECK:STDOUT: !members:
  1334. // CHECK:STDOUT: .Self = constants.%B
  1335. // CHECK:STDOUT: }
  1336. // CHECK:STDOUT:
  1337. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  1338. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1339. // CHECK:STDOUT: %Self.as_type.loc8_11.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_11.1 (constants.%Self.as_type)]
  1340. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc8_11.1 [symbolic = %pattern_type (constants.%pattern_type.6de)]
  1341. // CHECK:STDOUT:
  1342. // CHECK:STDOUT: fn(%a.param: @F.1.%Self.as_type.loc8_11.1 (%Self.as_type));
  1343. // CHECK:STDOUT: }
  1344. // CHECK:STDOUT:
  1345. // CHECK:STDOUT: fn @F.2(%a.param: %B);
  1346. // CHECK:STDOUT:
  1347. // CHECK:STDOUT: fn @F.3(%a.param: %A) {
  1348. // CHECK:STDOUT: !entry:
  1349. // CHECK:STDOUT: %a.ref: %A = name_ref a, %a.param
  1350. // CHECK:STDOUT: %.loc8: %B = converted %a.ref, <error> [concrete = <error>]
  1351. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call @impl.%F.decl.loc22_13.1(<error>)
  1352. // CHECK:STDOUT: return
  1353. // CHECK:STDOUT: }
  1354. // CHECK:STDOUT:
  1355. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  1356. // CHECK:STDOUT: %Self => constants.%Self
  1357. // CHECK:STDOUT: %Self.as_type.loc8_11.1 => constants.%Self.as_type
  1358. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6de
  1359. // CHECK:STDOUT: }
  1360. // CHECK:STDOUT:
  1361. // CHECK:STDOUT: specific @F.1(constants.%I.facet) {
  1362. // CHECK:STDOUT: %Self => constants.%I.facet
  1363. // CHECK:STDOUT: %Self.as_type.loc8_11.1 => constants.%A
  1364. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c10
  1365. // CHECK:STDOUT: }
  1366. // CHECK:STDOUT:
  1367. // CHECK:STDOUT: --- fail_return_mismatch.carbon
  1368. // CHECK:STDOUT:
  1369. // CHECK:STDOUT: constants {
  1370. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1371. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1372. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1373. // CHECK:STDOUT: %pattern_type.6de: type = pattern_type %Self.as_type [symbolic]
  1374. // CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
  1375. // CHECK:STDOUT: %F.bc6: %F.type.cf0 = struct_value () [concrete]
  1376. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1377. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%F.decl [concrete]
  1378. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  1379. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1380. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1381. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  1382. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  1383. // CHECK:STDOUT: %pattern_type.049: type = pattern_type %B [concrete]
  1384. // CHECK:STDOUT: %F.type.2ae1ef.1: type = fn_type @F.2 [concrete]
  1385. // CHECK:STDOUT: %F.2a7aab.1: %F.type.2ae1ef.1 = struct_value () [concrete]
  1386. // CHECK:STDOUT: %I.facet: %I.type = facet_value %A, (%I.impl_witness) [concrete]
  1387. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  1388. // CHECK:STDOUT: %F.type.2ae1ef.2: type = fn_type @F.3 [concrete]
  1389. // CHECK:STDOUT: %F.2a7aab.2: %F.type.2ae1ef.2 = struct_value () [concrete]
  1390. // CHECK:STDOUT: }
  1391. // CHECK:STDOUT:
  1392. // CHECK:STDOUT: file {
  1393. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1394. // CHECK:STDOUT: .I = %I.decl
  1395. // CHECK:STDOUT: .A = %A.decl
  1396. // CHECK:STDOUT: .B = %B.decl
  1397. // CHECK:STDOUT: }
  1398. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1399. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  1400. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  1401. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1402. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
  1403. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1404. // CHECK:STDOUT: }
  1405. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.%F.decl.loc19_14.2), @impl [concrete]
  1406. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1407. // CHECK:STDOUT: }
  1408. // CHECK:STDOUT:
  1409. // CHECK:STDOUT: interface @I {
  1410. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1411. // CHECK:STDOUT: %F.decl: %F.type.cf0 = fn_decl @F.1 [concrete = constants.%F.bc6] {
  1412. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type (%pattern_type.6de) = return_slot_pattern [concrete]
  1413. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type (%pattern_type.6de) = out_param_pattern %return.patt, call_param0 [concrete]
  1414. // CHECK:STDOUT: } {
  1415. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
  1416. // CHECK:STDOUT: %Self.as_type.loc5_13.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type)]
  1417. // CHECK:STDOUT: %.loc5: type = converted %Self.ref, %Self.as_type.loc5_13.2 [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type)]
  1418. // CHECK:STDOUT: %return.param: ref @F.1.%Self.as_type.loc5_13.1 (%Self.as_type) = out_param call_param0
  1419. // CHECK:STDOUT: %return: ref @F.1.%Self.as_type.loc5_13.1 (%Self.as_type) = return_slot %return.param
  1420. // CHECK:STDOUT: }
  1421. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
  1422. // CHECK:STDOUT:
  1423. // CHECK:STDOUT: !members:
  1424. // CHECK:STDOUT: .Self = %Self
  1425. // CHECK:STDOUT: .F = %assoc0
  1426. // CHECK:STDOUT: witness = (%F.decl)
  1427. // CHECK:STDOUT: }
  1428. // CHECK:STDOUT:
  1429. // CHECK:STDOUT: impl @impl: %A.ref as %I.ref {
  1430. // CHECK:STDOUT: %F.decl.loc19_14.1: %F.type.2ae1ef.1 = fn_decl @F.2 [concrete = constants.%F.2a7aab.1] {
  1431. // CHECK:STDOUT: %return.patt: %pattern_type.049 = return_slot_pattern [concrete]
  1432. // CHECK:STDOUT: %return.param_patt: %pattern_type.049 = out_param_pattern %return.patt, call_param0 [concrete]
  1433. // CHECK:STDOUT: } {
  1434. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  1435. // CHECK:STDOUT: %return.param: ref %B = out_param call_param0
  1436. // CHECK:STDOUT: %return: ref %B = return_slot %return.param
  1437. // CHECK:STDOUT: }
  1438. // CHECK:STDOUT: %F.decl.loc19_14.2: %F.type.2ae1ef.2 = fn_decl @F.3 [concrete = constants.%F.2a7aab.2] {
  1439. // CHECK:STDOUT: %return.patt: %pattern_type.c10 = return_slot_pattern [concrete]
  1440. // CHECK:STDOUT: %return.param_patt: %pattern_type.c10 = out_param_pattern %return.patt, call_param0 [concrete]
  1441. // CHECK:STDOUT: } {
  1442. // CHECK:STDOUT: %return.param: ref %A = out_param call_param0
  1443. // CHECK:STDOUT: %return: ref %A = return_slot %return.param
  1444. // CHECK:STDOUT: }
  1445. // CHECK:STDOUT:
  1446. // CHECK:STDOUT: !members:
  1447. // CHECK:STDOUT: .B = <poisoned>
  1448. // CHECK:STDOUT: .F = %F.decl.loc19_14.1
  1449. // CHECK:STDOUT: witness = file.%I.impl_witness
  1450. // CHECK:STDOUT: }
  1451. // CHECK:STDOUT:
  1452. // CHECK:STDOUT: class @A {
  1453. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1454. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1455. // CHECK:STDOUT: complete_type_witness = %complete_type
  1456. // CHECK:STDOUT:
  1457. // CHECK:STDOUT: !members:
  1458. // CHECK:STDOUT: .Self = constants.%A
  1459. // CHECK:STDOUT: }
  1460. // CHECK:STDOUT:
  1461. // CHECK:STDOUT: class @B {
  1462. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1463. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1464. // CHECK:STDOUT: complete_type_witness = %complete_type
  1465. // CHECK:STDOUT:
  1466. // CHECK:STDOUT: !members:
  1467. // CHECK:STDOUT: .Self = constants.%B
  1468. // CHECK:STDOUT: }
  1469. // CHECK:STDOUT:
  1470. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  1471. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1472. // CHECK:STDOUT: %Self.as_type.loc5_13.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type)]
  1473. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_13.1 [symbolic = %pattern_type (constants.%pattern_type.6de)]
  1474. // CHECK:STDOUT:
  1475. // CHECK:STDOUT: fn() -> @F.1.%Self.as_type.loc5_13.1 (%Self.as_type);
  1476. // CHECK:STDOUT: }
  1477. // CHECK:STDOUT:
  1478. // CHECK:STDOUT: fn @F.2() -> %return.param: %B;
  1479. // CHECK:STDOUT:
  1480. // CHECK:STDOUT: fn @F.3() -> %return.param: %A {
  1481. // CHECK:STDOUT: !entry:
  1482. // CHECK:STDOUT: %.loc19_14.1: ref %B = temporary_storage
  1483. // CHECK:STDOUT: %F.call: init %B = call @impl.%F.decl.loc19_14.1() to %.loc19_14.1
  1484. // CHECK:STDOUT: %.loc19_14.2: %A = converted %F.call, <error> [concrete = <error>]
  1485. // CHECK:STDOUT: return <error> to %return
  1486. // CHECK:STDOUT: }
  1487. // CHECK:STDOUT:
  1488. // CHECK:STDOUT: specific @F.1(constants.%Self) {
  1489. // CHECK:STDOUT: %Self => constants.%Self
  1490. // CHECK:STDOUT: %Self.as_type.loc5_13.1 => constants.%Self.as_type
  1491. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6de
  1492. // CHECK:STDOUT: }
  1493. // CHECK:STDOUT:
  1494. // CHECK:STDOUT: specific @F.1(constants.%I.facet) {
  1495. // CHECK:STDOUT: %Self => constants.%I.facet
  1496. // CHECK:STDOUT: %Self.as_type.loc5_13.1 => constants.%A
  1497. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c10
  1498. // CHECK:STDOUT: }
  1499. // CHECK:STDOUT:
  1500. // CHECK:STDOUT: --- return_empty_tuple_mismatch_allowed.carbon
  1501. // CHECK:STDOUT:
  1502. // CHECK:STDOUT: constants {
  1503. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1504. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1505. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  1506. // CHECK:STDOUT: %pattern_type.6de: type = pattern_type %Self.as_type [symbolic]
  1507. // CHECK:STDOUT: %HasReturn.type.bf9: type = fn_type @HasReturn.1 [concrete]
  1508. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1509. // CHECK:STDOUT: %HasReturn.dcf: %HasReturn.type.bf9 = struct_value () [concrete]
  1510. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1511. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%HasReturn.decl [concrete]
  1512. // CHECK:STDOUT: %NoReturn.type.7ff: type = fn_type @NoReturn.1 [concrete]
  1513. // CHECK:STDOUT: %NoReturn.7fd: %NoReturn.type.7ff = struct_value () [concrete]
  1514. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%NoReturn.decl [concrete]
  1515. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  1516. // CHECK:STDOUT: %EmptyTupleReturn.type.1cb: type = fn_type @EmptyTupleReturn.1 [concrete]
  1517. // CHECK:STDOUT: %EmptyTupleReturn.c56: %EmptyTupleReturn.type.1cb = struct_value () [concrete]
  1518. // CHECK:STDOUT: %assoc2: %I.assoc_type = assoc_entity element2, @I.%EmptyTupleReturn.decl [concrete]
  1519. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  1520. // CHECK:STDOUT: %HasReturn.type.c73908.1: type = fn_type @HasReturn.2 [concrete]
  1521. // CHECK:STDOUT: %HasReturn.424378.1: %HasReturn.type.c73908.1 = struct_value () [concrete]
  1522. // CHECK:STDOUT: %NoReturn.type.948: type = fn_type @NoReturn.2 [concrete]
  1523. // CHECK:STDOUT: %NoReturn.9fa: %NoReturn.type.948 = struct_value () [concrete]
  1524. // CHECK:STDOUT: %EmptyTupleReturn.type.9ea74f.1: type = fn_type @EmptyTupleReturn.2 [concrete]
  1525. // CHECK:STDOUT: %EmptyTupleReturn.282179.1: %EmptyTupleReturn.type.9ea74f.1 = struct_value () [concrete]
  1526. // CHECK:STDOUT: %I.facet: %I.type = facet_value %empty_tuple.type, (%I.impl_witness) [concrete]
  1527. // CHECK:STDOUT: %HasReturn.type.c73908.2: type = fn_type @HasReturn.3 [concrete]
  1528. // CHECK:STDOUT: %HasReturn.424378.2: %HasReturn.type.c73908.2 = struct_value () [concrete]
  1529. // CHECK:STDOUT: %EmptyTupleReturn.type.9ea74f.2: type = fn_type @EmptyTupleReturn.3 [concrete]
  1530. // CHECK:STDOUT: %EmptyTupleReturn.282179.2: %EmptyTupleReturn.type.9ea74f.2 = struct_value () [concrete]
  1531. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  1532. // CHECK:STDOUT: }
  1533. // CHECK:STDOUT:
  1534. // CHECK:STDOUT: file {
  1535. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1536. // CHECK:STDOUT: .I = %I.decl
  1537. // CHECK:STDOUT: }
  1538. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1539. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1540. // CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal ()
  1541. // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1542. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1543. // CHECK:STDOUT: }
  1544. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.%HasReturn.decl.loc12_17.2, @impl.%NoReturn.decl, @impl.%EmptyTupleReturn.decl.loc18_24.2), @impl [concrete]
  1545. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1546. // CHECK:STDOUT: }
  1547. // CHECK:STDOUT:
  1548. // CHECK:STDOUT: interface @I {
  1549. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1550. // CHECK:STDOUT: %HasReturn.decl: %HasReturn.type.bf9 = fn_decl @HasReturn.1 [concrete = constants.%HasReturn.dcf] {
  1551. // CHECK:STDOUT: %return.patt: @HasReturn.1.%pattern_type (%pattern_type.6de) = return_slot_pattern [concrete]
  1552. // CHECK:STDOUT: %return.param_patt: @HasReturn.1.%pattern_type (%pattern_type.6de) = out_param_pattern %return.patt, call_param0 [concrete]
  1553. // CHECK:STDOUT: } {
  1554. // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
  1555. // CHECK:STDOUT: %Self.as_type.loc5_21.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_21.1 (constants.%Self.as_type)]
  1556. // CHECK:STDOUT: %.loc5: type = converted %Self.ref, %Self.as_type.loc5_21.2 [symbolic = %Self.as_type.loc5_21.1 (constants.%Self.as_type)]
  1557. // CHECK:STDOUT: %return.param: ref @HasReturn.1.%Self.as_type.loc5_21.1 (%Self.as_type) = out_param call_param0
  1558. // CHECK:STDOUT: %return: ref @HasReturn.1.%Self.as_type.loc5_21.1 (%Self.as_type) = return_slot %return.param
  1559. // CHECK:STDOUT: }
  1560. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %HasReturn.decl [concrete = constants.%assoc0]
  1561. // CHECK:STDOUT: %NoReturn.decl: %NoReturn.type.7ff = fn_decl @NoReturn.1 [concrete = constants.%NoReturn.7fd] {} {}
  1562. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %NoReturn.decl [concrete = constants.%assoc1]
  1563. // CHECK:STDOUT: %EmptyTupleReturn.decl: %EmptyTupleReturn.type.1cb = fn_decl @EmptyTupleReturn.1 [concrete = constants.%EmptyTupleReturn.c56] {
  1564. // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete]
  1565. // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param0 [concrete]
  1566. // CHECK:STDOUT: } {
  1567. // CHECK:STDOUT: %.loc7_29.1: %empty_tuple.type = tuple_literal ()
  1568. // CHECK:STDOUT: %.loc7_29.2: type = converted %.loc7_29.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1569. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
  1570. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  1571. // CHECK:STDOUT: }
  1572. // CHECK:STDOUT: %assoc2: %I.assoc_type = assoc_entity element2, %EmptyTupleReturn.decl [concrete = constants.%assoc2]
  1573. // CHECK:STDOUT:
  1574. // CHECK:STDOUT: !members:
  1575. // CHECK:STDOUT: .Self = %Self
  1576. // CHECK:STDOUT: .HasReturn = %assoc0
  1577. // CHECK:STDOUT: .NoReturn = %assoc1
  1578. // CHECK:STDOUT: .EmptyTupleReturn = %assoc2
  1579. // CHECK:STDOUT: witness = (%HasReturn.decl, %NoReturn.decl, %EmptyTupleReturn.decl)
  1580. // CHECK:STDOUT: }
  1581. // CHECK:STDOUT:
  1582. // CHECK:STDOUT: impl @impl: %.loc10_7.2 as %I.ref {
  1583. // CHECK:STDOUT: %HasReturn.decl.loc12_17.1: %HasReturn.type.c73908.1 = fn_decl @HasReturn.2 [concrete = constants.%HasReturn.424378.1] {} {}
  1584. // CHECK:STDOUT: %NoReturn.decl: %NoReturn.type.948 = fn_decl @NoReturn.2 [concrete = constants.%NoReturn.9fa] {} {}
  1585. // CHECK:STDOUT: %EmptyTupleReturn.decl.loc18_24.1: %EmptyTupleReturn.type.9ea74f.1 = fn_decl @EmptyTupleReturn.2 [concrete = constants.%EmptyTupleReturn.282179.1] {} {}
  1586. // CHECK:STDOUT: %HasReturn.decl.loc12_17.2: %HasReturn.type.c73908.2 = fn_decl @HasReturn.3 [concrete = constants.%HasReturn.424378.2] {
  1587. // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete]
  1588. // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param0 [concrete]
  1589. // CHECK:STDOUT: } {
  1590. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
  1591. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  1592. // CHECK:STDOUT: }
  1593. // CHECK:STDOUT: %EmptyTupleReturn.decl.loc18_24.2: %EmptyTupleReturn.type.9ea74f.2 = fn_decl @EmptyTupleReturn.3 [concrete = constants.%EmptyTupleReturn.282179.2] {
  1594. // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete]
  1595. // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param0 [concrete]
  1596. // CHECK:STDOUT: } {
  1597. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
  1598. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  1599. // CHECK:STDOUT: }
  1600. // CHECK:STDOUT:
  1601. // CHECK:STDOUT: !members:
  1602. // CHECK:STDOUT: .HasReturn = %HasReturn.decl.loc12_17.1
  1603. // CHECK:STDOUT: .NoReturn = %NoReturn.decl
  1604. // CHECK:STDOUT: .EmptyTupleReturn = %EmptyTupleReturn.decl.loc18_24.1
  1605. // CHECK:STDOUT: witness = file.%I.impl_witness
  1606. // CHECK:STDOUT: }
  1607. // CHECK:STDOUT:
  1608. // CHECK:STDOUT: generic fn @HasReturn.1(@I.%Self: %I.type) {
  1609. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  1610. // CHECK:STDOUT: %Self.as_type.loc5_21.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_21.1 (constants.%Self.as_type)]
  1611. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_21.1 [symbolic = %pattern_type (constants.%pattern_type.6de)]
  1612. // CHECK:STDOUT:
  1613. // CHECK:STDOUT: fn() -> @HasReturn.1.%Self.as_type.loc5_21.1 (%Self.as_type);
  1614. // CHECK:STDOUT: }
  1615. // CHECK:STDOUT:
  1616. // CHECK:STDOUT: generic fn @NoReturn.1(@I.%Self: %I.type) {
  1617. // CHECK:STDOUT: fn();
  1618. // CHECK:STDOUT: }
  1619. // CHECK:STDOUT:
  1620. // CHECK:STDOUT: generic fn @EmptyTupleReturn.1(@I.%Self: %I.type) {
  1621. // CHECK:STDOUT: fn() -> %empty_tuple.type;
  1622. // CHECK:STDOUT: }
  1623. // CHECK:STDOUT:
  1624. // CHECK:STDOUT: fn @HasReturn.2();
  1625. // CHECK:STDOUT:
  1626. // CHECK:STDOUT: fn @NoReturn.2();
  1627. // CHECK:STDOUT:
  1628. // CHECK:STDOUT: fn @EmptyTupleReturn.2();
  1629. // CHECK:STDOUT:
  1630. // CHECK:STDOUT: fn @HasReturn.3() -> %empty_tuple.type {
  1631. // CHECK:STDOUT: !entry:
  1632. // CHECK:STDOUT: %HasReturn.call: init %empty_tuple.type = call @impl.%HasReturn.decl.loc12_17.1()
  1633. // CHECK:STDOUT: %.loc12_17.1: ref %empty_tuple.type = temporary_storage
  1634. // CHECK:STDOUT: %.loc12_17.2: ref %empty_tuple.type = temporary %.loc12_17.1, %HasReturn.call
  1635. // CHECK:STDOUT: %tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  1636. // CHECK:STDOUT: %.loc12_17.3: %empty_tuple.type = converted %HasReturn.call, %tuple [concrete = constants.%empty_tuple]
  1637. // CHECK:STDOUT: return %.loc12_17.3
  1638. // CHECK:STDOUT: }
  1639. // CHECK:STDOUT:
  1640. // CHECK:STDOUT: fn @EmptyTupleReturn.3() -> %empty_tuple.type {
  1641. // CHECK:STDOUT: !entry:
  1642. // CHECK:STDOUT: %EmptyTupleReturn.call: init %empty_tuple.type = call @impl.%EmptyTupleReturn.decl.loc18_24.1()
  1643. // CHECK:STDOUT: %.loc18_24.1: ref %empty_tuple.type = temporary_storage
  1644. // CHECK:STDOUT: %.loc18_24.2: ref %empty_tuple.type = temporary %.loc18_24.1, %EmptyTupleReturn.call
  1645. // CHECK:STDOUT: %tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  1646. // CHECK:STDOUT: %.loc18_24.3: %empty_tuple.type = converted %EmptyTupleReturn.call, %tuple [concrete = constants.%empty_tuple]
  1647. // CHECK:STDOUT: return %.loc18_24.3
  1648. // CHECK:STDOUT: }
  1649. // CHECK:STDOUT:
  1650. // CHECK:STDOUT: specific @HasReturn.1(constants.%Self) {
  1651. // CHECK:STDOUT: %Self => constants.%Self
  1652. // CHECK:STDOUT: %Self.as_type.loc5_21.1 => constants.%Self.as_type
  1653. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6de
  1654. // CHECK:STDOUT: }
  1655. // CHECK:STDOUT:
  1656. // CHECK:STDOUT: specific @NoReturn.1(constants.%Self) {}
  1657. // CHECK:STDOUT:
  1658. // CHECK:STDOUT: specific @EmptyTupleReturn.1(constants.%Self) {}
  1659. // CHECK:STDOUT:
  1660. // CHECK:STDOUT: specific @HasReturn.1(constants.%I.facet) {
  1661. // CHECK:STDOUT: %Self => constants.%I.facet
  1662. // CHECK:STDOUT: %Self.as_type.loc5_21.1 => constants.%empty_tuple.type
  1663. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb1
  1664. // CHECK:STDOUT: }
  1665. // CHECK:STDOUT:
  1666. // CHECK:STDOUT: specific @NoReturn.1(constants.%I.facet) {}
  1667. // CHECK:STDOUT:
  1668. // CHECK:STDOUT: specific @EmptyTupleReturn.1(constants.%I.facet) {}
  1669. // CHECK:STDOUT:
  1670. // CHECK:STDOUT: --- fail_return_empty_tuple_mismatch.carbon
  1671. // CHECK:STDOUT:
  1672. // CHECK:STDOUT: constants {
  1673. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  1674. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  1675. // CHECK:STDOUT: %NoReturn.type.7ff: type = fn_type @NoReturn.1 [concrete]
  1676. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1677. // CHECK:STDOUT: %NoReturn.7fd: %NoReturn.type.7ff = struct_value () [concrete]
  1678. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  1679. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%NoReturn.decl [concrete]
  1680. // CHECK:STDOUT: %I.impl_witness.c4e: <witness> = impl_witness file.%I.impl_witness_table.loc8 [concrete]
  1681. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  1682. // CHECK:STDOUT: %NoReturn.type.948: type = fn_type @NoReturn.2 [concrete]
  1683. // CHECK:STDOUT: %NoReturn.9fa: %NoReturn.type.948 = struct_value () [concrete]
  1684. // CHECK:STDOUT: %I.facet.372: %I.type = facet_value %empty_tuple.type, (%I.impl_witness.c4e) [concrete]
  1685. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1686. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1687. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1688. // CHECK:STDOUT: %I.impl_witness.464: <witness> = impl_witness file.%I.impl_witness_table.loc22 [concrete]
  1689. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  1690. // CHECK:STDOUT: %NoReturn.type.930: type = fn_type @NoReturn.3 [concrete]
  1691. // CHECK:STDOUT: %NoReturn.ac0: %NoReturn.type.930 = struct_value () [concrete]
  1692. // CHECK:STDOUT: %I.facet.be9: %I.type = facet_value %C, (%I.impl_witness.464) [concrete]
  1693. // CHECK:STDOUT: }
  1694. // CHECK:STDOUT:
  1695. // CHECK:STDOUT: file {
  1696. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1697. // CHECK:STDOUT: .I = %I.decl
  1698. // CHECK:STDOUT: .C = %C.decl
  1699. // CHECK:STDOUT: }
  1700. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  1701. // CHECK:STDOUT: impl_decl @impl.4ab [concrete] {} {
  1702. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal ()
  1703. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1704. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1705. // CHECK:STDOUT: }
  1706. // CHECK:STDOUT: %I.impl_witness_table.loc8 = impl_witness_table (<error>), @impl.4ab [concrete]
  1707. // CHECK:STDOUT: %I.impl_witness.loc8: <witness> = impl_witness %I.impl_witness_table.loc8 [concrete = constants.%I.impl_witness.c4e]
  1708. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1709. // CHECK:STDOUT: impl_decl @impl.770 [concrete] {} {
  1710. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1711. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  1712. // CHECK:STDOUT: }
  1713. // CHECK:STDOUT: %I.impl_witness_table.loc22 = impl_witness_table (<error>), @impl.770 [concrete]
  1714. // CHECK:STDOUT: %I.impl_witness.loc22: <witness> = impl_witness %I.impl_witness_table.loc22 [concrete = constants.%I.impl_witness.464]
  1715. // CHECK:STDOUT: }
  1716. // CHECK:STDOUT:
  1717. // CHECK:STDOUT: interface @I {
  1718. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1719. // CHECK:STDOUT: %NoReturn.decl: %NoReturn.type.7ff = fn_decl @NoReturn.1 [concrete = constants.%NoReturn.7fd] {} {}
  1720. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %NoReturn.decl [concrete = constants.%assoc0]
  1721. // CHECK:STDOUT:
  1722. // CHECK:STDOUT: !members:
  1723. // CHECK:STDOUT: .Self = %Self
  1724. // CHECK:STDOUT: .NoReturn = %assoc0
  1725. // CHECK:STDOUT: witness = (%NoReturn.decl)
  1726. // CHECK:STDOUT: }
  1727. // CHECK:STDOUT:
  1728. // CHECK:STDOUT: impl @impl.4ab: %.loc8_7.2 as %I.ref {
  1729. // CHECK:STDOUT: %NoReturn.decl: %NoReturn.type.948 = fn_decl @NoReturn.2 [concrete = constants.%NoReturn.9fa] {
  1730. // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete]
  1731. // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param0 [concrete]
  1732. // CHECK:STDOUT: } {
  1733. // CHECK:STDOUT: %.loc17_21.1: %empty_tuple.type = tuple_literal ()
  1734. // CHECK:STDOUT: %.loc17_21.2: type = converted %.loc17_21.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1735. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
  1736. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  1737. // CHECK:STDOUT: }
  1738. // CHECK:STDOUT:
  1739. // CHECK:STDOUT: !members:
  1740. // CHECK:STDOUT: .NoReturn = %NoReturn.decl
  1741. // CHECK:STDOUT: witness = file.%I.impl_witness.loc8
  1742. // CHECK:STDOUT: }
  1743. // CHECK:STDOUT:
  1744. // CHECK:STDOUT: impl @impl.770: %C.ref as %I.ref {
  1745. // CHECK:STDOUT: %NoReturn.decl: %NoReturn.type.930 = fn_decl @NoReturn.3 [concrete = constants.%NoReturn.ac0] {
  1746. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  1747. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param0 [concrete]
  1748. // CHECK:STDOUT: } {
  1749. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1750. // CHECK:STDOUT: %return.param: ref %C = out_param call_param0
  1751. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  1752. // CHECK:STDOUT: }
  1753. // CHECK:STDOUT:
  1754. // CHECK:STDOUT: !members:
  1755. // CHECK:STDOUT: .C = <poisoned>
  1756. // CHECK:STDOUT: .NoReturn = %NoReturn.decl
  1757. // CHECK:STDOUT: witness = file.%I.impl_witness.loc22
  1758. // CHECK:STDOUT: }
  1759. // CHECK:STDOUT:
  1760. // CHECK:STDOUT: class @C {
  1761. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1762. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1763. // CHECK:STDOUT: complete_type_witness = %complete_type
  1764. // CHECK:STDOUT:
  1765. // CHECK:STDOUT: !members:
  1766. // CHECK:STDOUT: .Self = constants.%C
  1767. // CHECK:STDOUT: }
  1768. // CHECK:STDOUT:
  1769. // CHECK:STDOUT: generic fn @NoReturn.1(@I.%Self: %I.type) {
  1770. // CHECK:STDOUT: fn();
  1771. // CHECK:STDOUT: }
  1772. // CHECK:STDOUT:
  1773. // CHECK:STDOUT: fn @NoReturn.2() -> %empty_tuple.type;
  1774. // CHECK:STDOUT:
  1775. // CHECK:STDOUT: fn @NoReturn.3() -> %C;
  1776. // CHECK:STDOUT:
  1777. // CHECK:STDOUT: specific @NoReturn.1(constants.%Self) {}
  1778. // CHECK:STDOUT:
  1779. // CHECK:STDOUT: specific @NoReturn.1(constants.%I.facet.372) {}
  1780. // CHECK:STDOUT:
  1781. // CHECK:STDOUT: specific @NoReturn.1(constants.%I.facet.be9) {}
  1782. // CHECK:STDOUT:
  1783. // CHECK:STDOUT: --- fail_param_type_incomplete.carbon
  1784. // CHECK:STDOUT:
  1785. // CHECK:STDOUT: constants {
  1786. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1787. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1788. // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [concrete]
  1789. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1790. // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [concrete]
  1791. // CHECK:STDOUT: %I.type.325: type = facet_type <@I, @I(%T)> [symbolic]
  1792. // CHECK:STDOUT: %Self.209: %I.type.325 = bind_symbolic_name Self, 1 [symbolic]
  1793. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1794. // CHECK:STDOUT: %F.type.2ae: type = fn_type @F.1, @I(%T) [symbolic]
  1795. // CHECK:STDOUT: %F.bb2: %F.type.2ae = struct_value () [symbolic]
  1796. // CHECK:STDOUT: %I.assoc_type.1e5: type = assoc_entity_type @I, @I(%T) [symbolic]
  1797. // CHECK:STDOUT: %assoc0.8f0: %I.assoc_type.1e5 = assoc_entity element0, @I.%F.decl [symbolic]
  1798. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  1799. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1800. // CHECK:STDOUT: %I.type.a79: type = facet_type <@I, @I(%B)> [concrete]
  1801. // CHECK:STDOUT: %Self.fe1: %I.type.a79 = bind_symbolic_name Self, 1 [symbolic]
  1802. // CHECK:STDOUT: %F.type.7f2: type = fn_type @F.1, @I(%B) [concrete]
  1803. // CHECK:STDOUT: %F.e0a: %F.type.7f2 = struct_value () [concrete]
  1804. // CHECK:STDOUT: %I.assoc_type.5ff: type = assoc_entity_type @I, @I(%B) [concrete]
  1805. // CHECK:STDOUT: %assoc0.470: %I.assoc_type.5ff = assoc_entity element0, @I.%F.decl [concrete]
  1806. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.%I.impl_witness_table [concrete]
  1807. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  1808. // CHECK:STDOUT: %F.type.17e183.1: type = fn_type @F.2 [concrete]
  1809. // CHECK:STDOUT: %F.4f1533.1: %F.type.17e183.1 = struct_value () [concrete]
  1810. // CHECK:STDOUT: %I.facet: %I.type.a79 = facet_value %C, (%I.impl_witness) [concrete]
  1811. // CHECK:STDOUT: %pattern_type.049: type = pattern_type %B [concrete]
  1812. // CHECK:STDOUT: %F.type.17e183.2: type = fn_type @F.3 [concrete]
  1813. // CHECK:STDOUT: %F.4f1533.2: %F.type.17e183.2 = struct_value () [concrete]
  1814. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1815. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1816. // CHECK:STDOUT: }
  1817. // CHECK:STDOUT:
  1818. // CHECK:STDOUT: file {
  1819. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1820. // CHECK:STDOUT: .I = %I.decl
  1821. // CHECK:STDOUT: .B = %B.decl
  1822. // CHECK:STDOUT: .C = %C.decl
  1823. // CHECK:STDOUT: }
  1824. // CHECK:STDOUT: %I.decl: %I.type.dac = interface_decl @I [concrete = constants.%I.generic] {
  1825. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1826. // CHECK:STDOUT: } {
  1827. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  1828. // CHECK:STDOUT: }
  1829. // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
  1830. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1831. // CHECK:STDOUT: }
  1832. // CHECK:STDOUT:
  1833. // CHECK:STDOUT: generic interface @I(%T.loc4_13.1: type) {
  1834. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  1835. // CHECK:STDOUT:
  1836. // CHECK:STDOUT: !definition:
  1837. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T.loc4_13.2)> [symbolic = %I.type (constants.%I.type.325)]
  1838. // CHECK:STDOUT: %Self.2: @I.%I.type (%I.type.325) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209)]
  1839. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @I(%T.loc4_13.2) [symbolic = %F.type (constants.%F.type.2ae)]
  1840. // CHECK:STDOUT: %F: @I.%F.type (%F.type.2ae) = struct_value () [symbolic = %F (constants.%F.bb2)]
  1841. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%T.loc4_13.2) [symbolic = %I.assoc_type (constants.%I.assoc_type.1e5)]
  1842. // CHECK:STDOUT: %assoc0.loc8_13.2: @I.%I.assoc_type (%I.assoc_type.1e5) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc8_13.2 (constants.%assoc0.8f0)]
  1843. // CHECK:STDOUT:
  1844. // CHECK:STDOUT: interface {
  1845. // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.325) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209)]
  1846. // CHECK:STDOUT: %F.decl: @I.%F.type (%F.type.2ae) = fn_decl @F.1 [symbolic = @I.%F (constants.%F.bb2)] {
  1847. // CHECK:STDOUT: %a.patt: @F.1.%pattern_type (%pattern_type.7dc) = binding_pattern a [concrete]
  1848. // CHECK:STDOUT: %a.param_patt: @F.1.%pattern_type (%pattern_type.7dc) = value_param_pattern %a.patt, call_param0 [concrete]
  1849. // CHECK:STDOUT: } {
  1850. // CHECK:STDOUT: %a.param: @F.1.%T (%T) = value_param call_param0
  1851. // CHECK:STDOUT: %T.ref: type = name_ref T, @I.%T.loc4_13.1 [symbolic = %T (constants.%T)]
  1852. // CHECK:STDOUT: %a: @F.1.%T (%T) = bind_name a, %a.param
  1853. // CHECK:STDOUT: }
  1854. // CHECK:STDOUT: %assoc0.loc8_13.1: @I.%I.assoc_type (%I.assoc_type.1e5) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc8_13.2 (constants.%assoc0.8f0)]
  1855. // CHECK:STDOUT:
  1856. // CHECK:STDOUT: !members:
  1857. // CHECK:STDOUT: .Self = %Self.1
  1858. // CHECK:STDOUT: .T = <poisoned>
  1859. // CHECK:STDOUT: .F = %assoc0.loc8_13.1
  1860. // CHECK:STDOUT: witness = (%F.decl)
  1861. // CHECK:STDOUT: }
  1862. // CHECK:STDOUT: }
  1863. // CHECK:STDOUT:
  1864. // CHECK:STDOUT: impl @impl: %Self.ref as %I.type {
  1865. // CHECK:STDOUT: %F.decl.loc32_15.1: %F.type.17e183.1 = fn_decl @F.2 [concrete = constants.%F.4f1533.1] {
  1866. // CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete]
  1867. // CHECK:STDOUT: %c.param_patt: %pattern_type.c48 = value_param_pattern %c.patt, call_param0 [concrete]
  1868. // CHECK:STDOUT: } {
  1869. // CHECK:STDOUT: %c.param: %C = value_param call_param0
  1870. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1871. // CHECK:STDOUT: %c: %C = bind_name c, %c.param
  1872. // CHECK:STDOUT: }
  1873. // CHECK:STDOUT: %F.decl.loc32_15.2: %F.type.17e183.2 = fn_decl @F.3 [concrete = constants.%F.4f1533.2] {
  1874. // CHECK:STDOUT: %a.patt: %pattern_type.049 = binding_pattern a [concrete]
  1875. // CHECK:STDOUT: %a.param_patt: %pattern_type.049 = value_param_pattern %a.patt, call_param0 [concrete]
  1876. // CHECK:STDOUT: } {
  1877. // CHECK:STDOUT: %a.param: %B = value_param call_param0
  1878. // CHECK:STDOUT: %a: %B = bind_name a, %a.param
  1879. // CHECK:STDOUT: }
  1880. // CHECK:STDOUT:
  1881. // CHECK:STDOUT: !members:
  1882. // CHECK:STDOUT: .C = <poisoned>
  1883. // CHECK:STDOUT: .F = %F.decl.loc32_15.1
  1884. // CHECK:STDOUT: witness = @C.%I.impl_witness
  1885. // CHECK:STDOUT: }
  1886. // CHECK:STDOUT:
  1887. // CHECK:STDOUT: class @B;
  1888. // CHECK:STDOUT:
  1889. // CHECK:STDOUT: class @C {
  1890. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  1891. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1892. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  1893. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
  1894. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%B)> [concrete = constants.%I.type.a79]
  1895. // CHECK:STDOUT: }
  1896. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.%F.decl.loc32_15.2), @impl [concrete]
  1897. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  1898. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1899. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1900. // CHECK:STDOUT: complete_type_witness = %complete_type
  1901. // CHECK:STDOUT:
  1902. // CHECK:STDOUT: !members:
  1903. // CHECK:STDOUT: .Self = constants.%C
  1904. // CHECK:STDOUT: .I = <poisoned>
  1905. // CHECK:STDOUT: .B = <poisoned>
  1906. // CHECK:STDOUT: .C = <poisoned>
  1907. // CHECK:STDOUT: }
  1908. // CHECK:STDOUT:
  1909. // CHECK:STDOUT: generic fn @F.1(@I.%T.loc4_13.1: type, @I.%Self.1: @I.%I.type (%I.type.325)) {
  1910. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  1911. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1912. // CHECK:STDOUT:
  1913. // CHECK:STDOUT: fn(%a.param: @F.1.%T (%T));
  1914. // CHECK:STDOUT: }
  1915. // CHECK:STDOUT:
  1916. // CHECK:STDOUT: fn @F.2(%c.param: %C);
  1917. // CHECK:STDOUT:
  1918. // CHECK:STDOUT: fn @F.3(%a.param: %B) {
  1919. // CHECK:STDOUT: !entry:
  1920. // CHECK:STDOUT: %a.ref: %B = name_ref a, %a.param
  1921. // CHECK:STDOUT: %.loc8: %C = converted %a.ref, <error> [concrete = <error>]
  1922. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call @impl.%F.decl.loc32_15.1(<error>)
  1923. // CHECK:STDOUT: return
  1924. // CHECK:STDOUT: }
  1925. // CHECK:STDOUT:
  1926. // CHECK:STDOUT: specific @I(constants.%T) {
  1927. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  1928. // CHECK:STDOUT: }
  1929. // CHECK:STDOUT:
  1930. // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self.209) {
  1931. // CHECK:STDOUT: %T => constants.%T
  1932. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1933. // CHECK:STDOUT: }
  1934. // CHECK:STDOUT:
  1935. // CHECK:STDOUT: specific @I(constants.%B) {
  1936. // CHECK:STDOUT: %T.loc4_13.2 => constants.%B
  1937. // CHECK:STDOUT:
  1938. // CHECK:STDOUT: !definition:
  1939. // CHECK:STDOUT: %I.type => constants.%I.type.a79
  1940. // CHECK:STDOUT: %Self.2 => constants.%Self.fe1
  1941. // CHECK:STDOUT: %F.type => constants.%F.type.7f2
  1942. // CHECK:STDOUT: %F => constants.%F.e0a
  1943. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.5ff
  1944. // CHECK:STDOUT: %assoc0.loc8_13.2 => constants.%assoc0.470
  1945. // CHECK:STDOUT: }
  1946. // CHECK:STDOUT:
  1947. // CHECK:STDOUT: specific @F.1(constants.%B, constants.%I.facet) {
  1948. // CHECK:STDOUT: %T => constants.%B
  1949. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.049
  1950. // CHECK:STDOUT: }
  1951. // CHECK:STDOUT: