deduce.carbon 120 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785
  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. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/deduce.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/deduce.carbon
  13. // --- deduce_explicit.carbon
  14. library "[[@TEST_NAME]]";
  15. fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); }
  16. fn CallExplicitGenericParam() -> i32* {
  17. return ExplicitGenericParam(i32);
  18. }
  19. fn CallExplicitGenericParamWithGenericArg(T:! type) -> {.a: T}* {
  20. return ExplicitGenericParam({.a: T});
  21. }
  22. // --- fail_deduce_explicit_non_constant.carbon
  23. library "[[@TEST_NAME]]";
  24. fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); }
  25. fn CallExplicitGenericParamConst(T:! type) {
  26. ExplicitGenericParam(T);
  27. }
  28. fn CallExplicitGenericParamNonConst(T: type) {
  29. // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE+7]]:3: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant]
  30. // CHECK:STDERR: ExplicitGenericParam(T);
  31. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
  32. // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE-10]]:25: note: initializing generic parameter `T` declared here [InitializingGenericParam]
  33. // CHECK:STDERR: fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); }
  34. // CHECK:STDERR: ^
  35. // CHECK:STDERR:
  36. ExplicitGenericParam(T);
  37. }
  38. // --- explicit_vs_deduced.carbon
  39. library "[[@TEST_NAME]]";
  40. class A {}
  41. fn ExplicitAndAlsoDeduced(T:! type, x: T) -> T* {
  42. return ExplicitAndAlsoDeduced(T, x);
  43. }
  44. fn CallExplicitAndAlsoDeduced() -> A* {
  45. return ExplicitAndAlsoDeduced(A, {});
  46. }
  47. // --- deduce_implicit.carbon
  48. library "[[@TEST_NAME]]";
  49. fn ImplicitGenericParam[T:! type](x: T) -> T* { return ImplicitGenericParam(x); }
  50. fn CallImplicitGenericParam(n: i32) -> i32* {
  51. return ImplicitGenericParam(n);
  52. }
  53. // --- deduce_nested_tuple.carbon
  54. library "[[@TEST_NAME]]";
  55. fn TupleParam[T:! type](x: (T, i32)) {}
  56. fn CallTupleParam() {
  57. TupleParam((1, 2));
  58. }
  59. // --- deduce_nested_struct.carbon
  60. library "[[@TEST_NAME]]";
  61. fn StructParam[T:! type](x: {.a: T, .b: i32}) {}
  62. fn CallStructParam() {
  63. StructParam({.a = 1, .b = 2});
  64. }
  65. // --- fail_deduce_bigger_struct.carbon
  66. library "[[@TEST_NAME]]";
  67. fn BigStructParam[T:! type](x: {.c: T, .d: i32, .e: i32}) {}
  68. fn CallBigStructParam() {
  69. // CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  70. // CHECK:STDERR: BigStructParam({.c = 3, .d = 4});
  71. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  72. // CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  73. // CHECK:STDERR: fn BigStructParam[T:! type](x: {.c: T, .d: i32, .e: i32}) {}
  74. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  75. // CHECK:STDERR:
  76. BigStructParam({.c = 3, .d = 4});
  77. }
  78. // --- fail_deduce_smaller_struct.carbon
  79. library "[[@TEST_NAME]]";
  80. fn SmallStructParam[T:! type](x: {.f: T, .g: i32}) {}
  81. fn CallSmallStructParam() {
  82. // CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  83. // CHECK:STDERR: SmallStructParam({.f = 5, .g = 6, .h = 7});
  84. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85. // CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  86. // CHECK:STDERR: fn SmallStructParam[T:! type](x: {.f: T, .g: i32}) {}
  87. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  88. // CHECK:STDERR:
  89. SmallStructParam({.f = 5, .g = 6, .h = 7});
  90. }
  91. // --- fail_deduce_struct_wrong_name.carbon
  92. library "[[@TEST_NAME]]";
  93. fn WrongNameStructParam[T:! type](x: {.i: T, .different: i32}) {}
  94. fn CallWrongNameStructParam() {
  95. // CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  96. // CHECK:STDERR: WrongNameStructParam({.i = 8, .j = 9});
  97. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. // CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  99. // CHECK:STDERR: fn WrongNameStructParam[T:! type](x: {.i: T, .different: i32}) {}
  100. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101. // CHECK:STDERR:
  102. WrongNameStructParam({.i = 8, .j = 9});
  103. }
  104. // --- fail_todo_deduce_struct_wrong_order.carbon
  105. library "[[@TEST_NAME]]";
  106. fn WrongOrderStructParam[T:! type](x: {.first: T, .second: i32}) {}
  107. fn CallWrongOrderStructParam() {
  108. // CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  109. // CHECK:STDERR: WrongOrderStructParam({.second = 11, .first = 10});
  110. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  111. // CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  112. // CHECK:STDERR: fn WrongOrderStructParam[T:! type](x: {.first: T, .second: i32}) {}
  113. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  114. // CHECK:STDERR:
  115. WrongOrderStructParam({.second = 11, .first = 10});
  116. }
  117. // --- fail_deduce_incomplete.carbon
  118. library "[[@TEST_NAME]]";
  119. // TODO: It would be nice to diagnose this at its point of declaration, because
  120. // U is not deducible.
  121. fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U;
  122. fn CallImplicitNotDeducible() {
  123. // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `U` [DeductionIncomplete]
  124. // CHECK:STDERR: ImplicitNotDeducible(42);
  125. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
  126. // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  127. // CHECK:STDERR: fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U;
  128. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  129. // CHECK:STDERR:
  130. ImplicitNotDeducible(42);
  131. }
  132. // --- fail_deduce_inconsistent.carbon
  133. library "[[@TEST_NAME]]";
  134. fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T;
  135. fn CallImplicitNotDeducible() {
  136. // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+7]]:3: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent]
  137. // CHECK:STDERR: ImplicitNotDeducible(42, {.x = 12});
  138. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  139. // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  140. // CHECK:STDERR: fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T;
  141. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  142. // CHECK:STDERR:
  143. ImplicitNotDeducible(42, {.x = 12});
  144. }
  145. // --- deduce_nested_generic_class.carbon
  146. library "[[@TEST_NAME]]";
  147. interface Z {}
  148. class EE {}
  149. impl EE as Z {}
  150. class DD(E:! type) {}
  151. impl forall [E:! type] DD(E) as Z {}
  152. class CC(D:! Z) {}
  153. impl forall [E:! type] CC(DD(E)) as Z {}
  154. fn F() {
  155. CC(DD(EE)) as Z;
  156. }
  157. // CHECK:STDOUT: --- deduce_explicit.carbon
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: constants {
  160. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  161. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  162. // CHECK:STDOUT: %ptr.79f: type = ptr_type %T [symbolic]
  163. // CHECK:STDOUT: %pattern_type.afe: type = pattern_type %ptr.79f [symbolic]
  164. // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [concrete]
  165. // CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [concrete]
  166. // CHECK:STDOUT: %require_complete.6e5: <witness> = require_complete_type %ptr.79f [symbolic]
  167. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.c0a: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic]
  168. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  169. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  170. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  171. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  172. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
  173. // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete]
  174. // CHECK:STDOUT: %CallExplicitGenericParam.type: type = fn_type @CallExplicitGenericParam [concrete]
  175. // CHECK:STDOUT: %CallExplicitGenericParam: %CallExplicitGenericParam.type = struct_value () [concrete]
  176. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.74e: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%i32) [concrete]
  177. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic]
  178. // CHECK:STDOUT: %ptr.48a: type = ptr_type %struct_type.a [symbolic]
  179. // CHECK:STDOUT: %pattern_type.322: type = pattern_type %ptr.48a [symbolic]
  180. // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.type: type = fn_type @CallExplicitGenericParamWithGenericArg [concrete]
  181. // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg: %CallExplicitGenericParamWithGenericArg.type = struct_value () [concrete]
  182. // CHECK:STDOUT: %require_complete.86d: <witness> = require_complete_type %ptr.48a [symbolic]
  183. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.6ad: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a) [symbolic]
  184. // CHECK:STDOUT: %complete_type.3d0: <witness> = complete_type_witness %ptr.235 [concrete]
  185. // CHECK:STDOUT: }
  186. // CHECK:STDOUT:
  187. // CHECK:STDOUT: imports {
  188. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  189. // CHECK:STDOUT: .Int = %Core.Int
  190. // CHECK:STDOUT: import Core//prelude
  191. // CHECK:STDOUT: import Core//prelude/...
  192. // CHECK:STDOUT: }
  193. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: file {
  197. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  198. // CHECK:STDOUT: .Core = imports.%Core
  199. // CHECK:STDOUT: .ExplicitGenericParam = %ExplicitGenericParam.decl
  200. // CHECK:STDOUT: .CallExplicitGenericParam = %CallExplicitGenericParam.decl
  201. // CHECK:STDOUT: .CallExplicitGenericParamWithGenericArg = %CallExplicitGenericParamWithGenericArg.decl
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT: %Core.import = import Core
  204. // CHECK:STDOUT: %ExplicitGenericParam.decl: %ExplicitGenericParam.type = fn_decl @ExplicitGenericParam [concrete = constants.%ExplicitGenericParam] {
  205. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  206. // CHECK:STDOUT: %return.patt: @ExplicitGenericParam.%pattern_type (%pattern_type.afe) = return_slot_pattern [concrete]
  207. // CHECK:STDOUT: %return.param_patt: @ExplicitGenericParam.%pattern_type (%pattern_type.afe) = out_param_pattern %return.patt, call_param0 [concrete]
  208. // CHECK:STDOUT: } {
  209. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  210. // CHECK:STDOUT: %ptr.loc4_39.1: type = ptr_type %T.ref.loc4_38 [symbolic = %ptr.loc4_39.2 (constants.%ptr.79f)]
  211. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  212. // CHECK:STDOUT: %return.param: ref @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = out_param call_param0
  213. // CHECK:STDOUT: %return: ref @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = return_slot %return.param
  214. // CHECK:STDOUT: }
  215. // CHECK:STDOUT: %CallExplicitGenericParam.decl: %CallExplicitGenericParam.type = fn_decl @CallExplicitGenericParam [concrete = constants.%CallExplicitGenericParam] {
  216. // CHECK:STDOUT: %return.patt: %pattern_type.fe8 = return_slot_pattern [concrete]
  217. // CHECK:STDOUT: %return.param_patt: %pattern_type.fe8 = out_param_pattern %return.patt, call_param0 [concrete]
  218. // CHECK:STDOUT: } {
  219. // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  220. // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  221. // CHECK:STDOUT: %ptr: type = ptr_type %i32.loc6 [concrete = constants.%ptr.235]
  222. // CHECK:STDOUT: %return.param: ref %ptr.235 = out_param call_param0
  223. // CHECK:STDOUT: %return: ref %ptr.235 = return_slot %return.param
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.decl: %CallExplicitGenericParamWithGenericArg.type = fn_decl @CallExplicitGenericParamWithGenericArg [concrete = constants.%CallExplicitGenericParamWithGenericArg] {
  226. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  227. // CHECK:STDOUT: %return.patt: @CallExplicitGenericParamWithGenericArg.%pattern_type (%pattern_type.322) = return_slot_pattern [concrete]
  228. // CHECK:STDOUT: %return.param_patt: @CallExplicitGenericParamWithGenericArg.%pattern_type (%pattern_type.322) = out_param_pattern %return.patt, call_param0 [concrete]
  229. // CHECK:STDOUT: } {
  230. // CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc10_43.1 [symbolic = %T.loc10_43.2 (constants.%T)]
  231. // CHECK:STDOUT: %struct_type.a.loc10_62.1: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_43.2 (%T)} [symbolic = %struct_type.a.loc10_62.2 (constants.%struct_type.a)]
  232. // CHECK:STDOUT: %ptr.loc10_63.1: type = ptr_type %struct_type.a.loc10_62.1 [symbolic = %ptr.loc10_63.2 (constants.%ptr.48a)]
  233. // CHECK:STDOUT: %T.loc10_43.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_43.2 (constants.%T)]
  234. // CHECK:STDOUT: %return.param: ref @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = out_param call_param0
  235. // CHECK:STDOUT: %return: ref @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = return_slot %return.param
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT: }
  238. // CHECK:STDOUT:
  239. // CHECK:STDOUT: generic fn @ExplicitGenericParam(%T.loc4_25.1: type) {
  240. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  241. // CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type %T.loc4_25.2 [symbolic = %ptr.loc4_39.2 (constants.%ptr.79f)]
  242. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc4_39.2 [symbolic = %pattern_type (constants.%pattern_type.afe)]
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: !definition:
  245. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc4_39.2 [symbolic = %require_complete (constants.%require_complete.6e5)]
  246. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_25.2) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn.c0a)]
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: fn() -> @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) {
  249. // CHECK:STDOUT: !entry:
  250. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  251. // CHECK:STDOUT: %T.ref.loc4_71: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  252. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.1: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%T) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn.c0a)]
  253. // CHECK:STDOUT: %ExplicitGenericParam.call: init @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = call %ExplicitGenericParam.specific_fn.loc4_50.1()
  254. // CHECK:STDOUT: %.loc4_73.1: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = value_of_initializer %ExplicitGenericParam.call
  255. // CHECK:STDOUT: %.loc4_73.2: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = converted %ExplicitGenericParam.call, %.loc4_73.1
  256. // CHECK:STDOUT: return %.loc4_73.2
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: fn @CallExplicitGenericParam() -> %ptr.235 {
  261. // CHECK:STDOUT: !entry:
  262. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  263. // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  264. // CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  265. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%i32) [concrete = constants.%ExplicitGenericParam.specific_fn.74e]
  266. // CHECK:STDOUT: %ExplicitGenericParam.call: init %ptr.235 = call %ExplicitGenericParam.specific_fn()
  267. // CHECK:STDOUT: %.loc7_35.1: %ptr.235 = value_of_initializer %ExplicitGenericParam.call
  268. // CHECK:STDOUT: %.loc7_35.2: %ptr.235 = converted %ExplicitGenericParam.call, %.loc7_35.1
  269. // CHECK:STDOUT: return %.loc7_35.2
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: generic fn @CallExplicitGenericParamWithGenericArg(%T.loc10_43.1: type) {
  273. // CHECK:STDOUT: %T.loc10_43.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_43.2 (constants.%T)]
  274. // CHECK:STDOUT: %struct_type.a.loc10_62.2: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_43.2 (%T)} [symbolic = %struct_type.a.loc10_62.2 (constants.%struct_type.a)]
  275. // CHECK:STDOUT: %ptr.loc10_63.2: type = ptr_type %struct_type.a.loc10_62.2 [symbolic = %ptr.loc10_63.2 (constants.%ptr.48a)]
  276. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc10_63.2 [symbolic = %pattern_type (constants.%pattern_type.322)]
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: !definition:
  279. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc10_63.2 [symbolic = %require_complete (constants.%require_complete.86d)]
  280. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc11_10.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a.loc10_62.2) [symbolic = %ExplicitGenericParam.specific_fn.loc11_10.2 (constants.%ExplicitGenericParam.specific_fn.6ad)]
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: fn() -> @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) {
  283. // CHECK:STDOUT: !entry:
  284. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  285. // CHECK:STDOUT: %T.ref.loc11: type = name_ref T, %T.loc10_43.1 [symbolic = %T.loc10_43.2 (constants.%T)]
  286. // CHECK:STDOUT: %struct_type.a.loc11: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_43.2 (%T)} [symbolic = %struct_type.a.loc10_62.2 (constants.%struct_type.a)]
  287. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc11_10.1: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%struct_type.a) [symbolic = %ExplicitGenericParam.specific_fn.loc11_10.2 (constants.%ExplicitGenericParam.specific_fn.6ad)]
  288. // CHECK:STDOUT: %ExplicitGenericParam.call: init @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = call %ExplicitGenericParam.specific_fn.loc11_10.1()
  289. // CHECK:STDOUT: %.loc11_39.1: @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = value_of_initializer %ExplicitGenericParam.call
  290. // CHECK:STDOUT: %.loc11_39.2: @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = converted %ExplicitGenericParam.call, %.loc11_39.1
  291. // CHECK:STDOUT: return %.loc11_39.2
  292. // CHECK:STDOUT: }
  293. // CHECK:STDOUT: }
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%T) {
  296. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  297. // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.79f
  298. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: !definition:
  301. // CHECK:STDOUT: %require_complete => constants.%require_complete.6e5
  302. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.c0a
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%i32) {
  306. // CHECK:STDOUT: %T.loc4_25.2 => constants.%i32
  307. // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.235
  308. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fe8
  309. // CHECK:STDOUT:
  310. // CHECK:STDOUT: !definition:
  311. // CHECK:STDOUT: %require_complete => constants.%complete_type.3d0
  312. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.74e
  313. // CHECK:STDOUT: }
  314. // CHECK:STDOUT:
  315. // CHECK:STDOUT: specific @CallExplicitGenericParamWithGenericArg(constants.%T) {
  316. // CHECK:STDOUT: %T.loc10_43.2 => constants.%T
  317. // CHECK:STDOUT: %struct_type.a.loc10_62.2 => constants.%struct_type.a
  318. // CHECK:STDOUT: %ptr.loc10_63.2 => constants.%ptr.48a
  319. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.322
  320. // CHECK:STDOUT: }
  321. // CHECK:STDOUT:
  322. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%struct_type.a) {
  323. // CHECK:STDOUT: %T.loc4_25.2 => constants.%struct_type.a
  324. // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.48a
  325. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.322
  326. // CHECK:STDOUT:
  327. // CHECK:STDOUT: !definition:
  328. // CHECK:STDOUT: %require_complete => constants.%require_complete.86d
  329. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.6ad
  330. // CHECK:STDOUT: }
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: --- fail_deduce_explicit_non_constant.carbon
  333. // CHECK:STDOUT:
  334. // CHECK:STDOUT: constants {
  335. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  336. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  337. // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
  338. // CHECK:STDOUT: %pattern_type.afe: type = pattern_type %ptr [symbolic]
  339. // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [concrete]
  340. // CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [concrete]
  341. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr [symbolic]
  342. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic]
  343. // CHECK:STDOUT: %CallExplicitGenericParamConst.type: type = fn_type @CallExplicitGenericParamConst [concrete]
  344. // CHECK:STDOUT: %CallExplicitGenericParamConst: %CallExplicitGenericParamConst.type = struct_value () [concrete]
  345. // CHECK:STDOUT: %CallExplicitGenericParamNonConst.type: type = fn_type @CallExplicitGenericParamNonConst [concrete]
  346. // CHECK:STDOUT: %CallExplicitGenericParamNonConst: %CallExplicitGenericParamNonConst.type = struct_value () [concrete]
  347. // CHECK:STDOUT: }
  348. // CHECK:STDOUT:
  349. // CHECK:STDOUT: imports {
  350. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  351. // CHECK:STDOUT: import Core//prelude
  352. // CHECK:STDOUT: import Core//prelude/...
  353. // CHECK:STDOUT: }
  354. // CHECK:STDOUT: }
  355. // CHECK:STDOUT:
  356. // CHECK:STDOUT: file {
  357. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  358. // CHECK:STDOUT: .Core = imports.%Core
  359. // CHECK:STDOUT: .ExplicitGenericParam = %ExplicitGenericParam.decl
  360. // CHECK:STDOUT: .CallExplicitGenericParamConst = %CallExplicitGenericParamConst.decl
  361. // CHECK:STDOUT: .CallExplicitGenericParamNonConst = %CallExplicitGenericParamNonConst.decl
  362. // CHECK:STDOUT: }
  363. // CHECK:STDOUT: %Core.import = import Core
  364. // CHECK:STDOUT: %ExplicitGenericParam.decl: %ExplicitGenericParam.type = fn_decl @ExplicitGenericParam [concrete = constants.%ExplicitGenericParam] {
  365. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  366. // CHECK:STDOUT: %return.patt: @ExplicitGenericParam.%pattern_type (%pattern_type.afe) = return_slot_pattern [concrete]
  367. // CHECK:STDOUT: %return.param_patt: @ExplicitGenericParam.%pattern_type (%pattern_type.afe) = out_param_pattern %return.patt, call_param0 [concrete]
  368. // CHECK:STDOUT: } {
  369. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  370. // CHECK:STDOUT: %ptr.loc4_39.1: type = ptr_type %T.ref.loc4_38 [symbolic = %ptr.loc4_39.2 (constants.%ptr)]
  371. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  372. // CHECK:STDOUT: %return.param: ref @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = out_param call_param0
  373. // CHECK:STDOUT: %return: ref @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = return_slot %return.param
  374. // CHECK:STDOUT: }
  375. // CHECK:STDOUT: %CallExplicitGenericParamConst.decl: %CallExplicitGenericParamConst.type = fn_decl @CallExplicitGenericParamConst [concrete = constants.%CallExplicitGenericParamConst] {
  376. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  377. // CHECK:STDOUT: } {
  378. // CHECK:STDOUT: %T.loc6_34.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_34.2 (constants.%T)]
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT: %CallExplicitGenericParamNonConst.decl: %CallExplicitGenericParamNonConst.type = fn_decl @CallExplicitGenericParamNonConst [concrete = constants.%CallExplicitGenericParamNonConst] {
  381. // CHECK:STDOUT: %T.patt: %pattern_type.98f = binding_pattern T [concrete]
  382. // CHECK:STDOUT: %T.param_patt: %pattern_type.98f = value_param_pattern %T.patt, call_param0 [concrete]
  383. // CHECK:STDOUT: } {
  384. // CHECK:STDOUT: %T.param: type = value_param call_param0
  385. // CHECK:STDOUT: %T: type = bind_name T, %T.param
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT:
  389. // CHECK:STDOUT: generic fn @ExplicitGenericParam(%T.loc4_25.1: type) {
  390. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  391. // CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type %T.loc4_25.2 [symbolic = %ptr.loc4_39.2 (constants.%ptr)]
  392. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc4_39.2 [symbolic = %pattern_type (constants.%pattern_type.afe)]
  393. // CHECK:STDOUT:
  394. // CHECK:STDOUT: !definition:
  395. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc4_39.2 [symbolic = %require_complete (constants.%require_complete)]
  396. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_25.2) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn)]
  397. // CHECK:STDOUT:
  398. // CHECK:STDOUT: fn() -> @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) {
  399. // CHECK:STDOUT: !entry:
  400. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  401. // CHECK:STDOUT: %T.ref.loc4_71: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  402. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.1: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%T) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn)]
  403. // CHECK:STDOUT: %ExplicitGenericParam.call: init @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = call %ExplicitGenericParam.specific_fn.loc4_50.1()
  404. // CHECK:STDOUT: %.loc4_73.1: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = value_of_initializer %ExplicitGenericParam.call
  405. // CHECK:STDOUT: %.loc4_73.2: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = converted %ExplicitGenericParam.call, %.loc4_73.1
  406. // CHECK:STDOUT: return %.loc4_73.2
  407. // CHECK:STDOUT: }
  408. // CHECK:STDOUT: }
  409. // CHECK:STDOUT:
  410. // CHECK:STDOUT: generic fn @CallExplicitGenericParamConst(%T.loc6_34.1: type) {
  411. // CHECK:STDOUT: %T.loc6_34.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_34.2 (constants.%T)]
  412. // CHECK:STDOUT:
  413. // CHECK:STDOUT: !definition:
  414. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc7_3.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc6_34.2) [symbolic = %ExplicitGenericParam.specific_fn.loc7_3.2 (constants.%ExplicitGenericParam.specific_fn)]
  415. // CHECK:STDOUT: %ptr: type = ptr_type %T.loc6_34.2 [symbolic = %ptr (constants.%ptr)]
  416. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr [symbolic = %require_complete (constants.%require_complete)]
  417. // CHECK:STDOUT:
  418. // CHECK:STDOUT: fn() {
  419. // CHECK:STDOUT: !entry:
  420. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  421. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_34.1 [symbolic = %T.loc6_34.2 (constants.%T)]
  422. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc7_3.1: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%T) [symbolic = %ExplicitGenericParam.specific_fn.loc7_3.2 (constants.%ExplicitGenericParam.specific_fn)]
  423. // CHECK:STDOUT: %ExplicitGenericParam.call: init @CallExplicitGenericParamConst.%ptr (%ptr) = call %ExplicitGenericParam.specific_fn.loc7_3.1()
  424. // CHECK:STDOUT: return
  425. // CHECK:STDOUT: }
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: fn @CallExplicitGenericParamNonConst(%T.param: type) {
  429. // CHECK:STDOUT: !entry:
  430. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  431. // CHECK:STDOUT: %T.ref: type = name_ref T, %T
  432. // CHECK:STDOUT: return
  433. // CHECK:STDOUT: }
  434. // CHECK:STDOUT:
  435. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%T) {
  436. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  437. // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr
  438. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe
  439. // CHECK:STDOUT:
  440. // CHECK:STDOUT: !definition:
  441. // CHECK:STDOUT: %require_complete => constants.%require_complete
  442. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: specific @CallExplicitGenericParamConst(constants.%T) {
  446. // CHECK:STDOUT: %T.loc6_34.2 => constants.%T
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT:
  449. // CHECK:STDOUT: --- explicit_vs_deduced.carbon
  450. // CHECK:STDOUT:
  451. // CHECK:STDOUT: constants {
  452. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  453. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  454. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  455. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  456. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  457. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  458. // CHECK:STDOUT: %ptr.79f: type = ptr_type %T [symbolic]
  459. // CHECK:STDOUT: %pattern_type.afe: type = pattern_type %ptr.79f [symbolic]
  460. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.type: type = fn_type @ExplicitAndAlsoDeduced [concrete]
  461. // CHECK:STDOUT: %ExplicitAndAlsoDeduced: %ExplicitAndAlsoDeduced.type = struct_value () [concrete]
  462. // CHECK:STDOUT: %require_complete.6e5: <witness> = require_complete_type %ptr.79f [symbolic]
  463. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  464. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.41d: <specific function> = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T) [symbolic]
  465. // CHECK:STDOUT: %ptr.6db: type = ptr_type %A [concrete]
  466. // CHECK:STDOUT: %pattern_type.5f8: type = pattern_type %ptr.6db [concrete]
  467. // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.type: type = fn_type @CallExplicitAndAlsoDeduced [concrete]
  468. // CHECK:STDOUT: %CallExplicitAndAlsoDeduced: %CallExplicitAndAlsoDeduced.type = struct_value () [concrete]
  469. // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
  470. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.720: <specific function> = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%A) [concrete]
  471. // CHECK:STDOUT: %A.val: %A = struct_value () [concrete]
  472. // CHECK:STDOUT: %complete_type.7ea: <witness> = complete_type_witness %ptr.6db [concrete]
  473. // CHECK:STDOUT: }
  474. // CHECK:STDOUT:
  475. // CHECK:STDOUT: imports {
  476. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  477. // CHECK:STDOUT: import Core//prelude
  478. // CHECK:STDOUT: import Core//prelude/...
  479. // CHECK:STDOUT: }
  480. // CHECK:STDOUT: }
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: file {
  483. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  484. // CHECK:STDOUT: .Core = imports.%Core
  485. // CHECK:STDOUT: .A = %A.decl
  486. // CHECK:STDOUT: .ExplicitAndAlsoDeduced = %ExplicitAndAlsoDeduced.decl
  487. // CHECK:STDOUT: .CallExplicitAndAlsoDeduced = %CallExplicitAndAlsoDeduced.decl
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT: %Core.import = import Core
  490. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  491. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.decl: %ExplicitAndAlsoDeduced.type = fn_decl @ExplicitAndAlsoDeduced [concrete = constants.%ExplicitAndAlsoDeduced] {
  492. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  493. // CHECK:STDOUT: %x.patt: @ExplicitAndAlsoDeduced.%pattern_type.loc6_37 (%pattern_type.7dc) = binding_pattern x [concrete]
  494. // CHECK:STDOUT: %x.param_patt: @ExplicitAndAlsoDeduced.%pattern_type.loc6_37 (%pattern_type.7dc) = value_param_pattern %x.patt, call_param0 [concrete]
  495. // CHECK:STDOUT: %return.patt: @ExplicitAndAlsoDeduced.%pattern_type.loc6_43 (%pattern_type.afe) = return_slot_pattern [concrete]
  496. // CHECK:STDOUT: %return.param_patt: @ExplicitAndAlsoDeduced.%pattern_type.loc6_43 (%pattern_type.afe) = out_param_pattern %return.patt, call_param1 [concrete]
  497. // CHECK:STDOUT: } {
  498. // CHECK:STDOUT: %T.ref.loc6_46: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)]
  499. // CHECK:STDOUT: %ptr.loc6_47.1: type = ptr_type %T.ref.loc6_46 [symbolic = %ptr.loc6_47.2 (constants.%ptr.79f)]
  500. // CHECK:STDOUT: %T.loc6_27.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_27.2 (constants.%T)]
  501. // CHECK:STDOUT: %x.param: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = value_param call_param0
  502. // CHECK:STDOUT: %T.ref.loc6_40: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)]
  503. // CHECK:STDOUT: %x: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = bind_name x, %x.param
  504. // CHECK:STDOUT: %return.param: ref @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = out_param call_param1
  505. // CHECK:STDOUT: %return: ref @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = return_slot %return.param
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.decl: %CallExplicitAndAlsoDeduced.type = fn_decl @CallExplicitAndAlsoDeduced [concrete = constants.%CallExplicitAndAlsoDeduced] {
  508. // CHECK:STDOUT: %return.patt: %pattern_type.5f8 = return_slot_pattern [concrete]
  509. // CHECK:STDOUT: %return.param_patt: %pattern_type.5f8 = out_param_pattern %return.patt, call_param0 [concrete]
  510. // CHECK:STDOUT: } {
  511. // CHECK:STDOUT: %A.ref.loc10: type = name_ref A, file.%A.decl [concrete = constants.%A]
  512. // CHECK:STDOUT: %ptr: type = ptr_type %A.ref.loc10 [concrete = constants.%ptr.6db]
  513. // CHECK:STDOUT: %return.param: ref %ptr.6db = out_param call_param0
  514. // CHECK:STDOUT: %return: ref %ptr.6db = return_slot %return.param
  515. // CHECK:STDOUT: }
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT:
  518. // CHECK:STDOUT: class @A {
  519. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  520. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  521. // CHECK:STDOUT: complete_type_witness = %complete_type
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: !members:
  524. // CHECK:STDOUT: .Self = constants.%A
  525. // CHECK:STDOUT: }
  526. // CHECK:STDOUT:
  527. // CHECK:STDOUT: generic fn @ExplicitAndAlsoDeduced(%T.loc6_27.1: type) {
  528. // CHECK:STDOUT: %T.loc6_27.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_27.2 (constants.%T)]
  529. // CHECK:STDOUT: %pattern_type.loc6_37: type = pattern_type %T.loc6_27.2 [symbolic = %pattern_type.loc6_37 (constants.%pattern_type.7dc)]
  530. // CHECK:STDOUT: %ptr.loc6_47.2: type = ptr_type %T.loc6_27.2 [symbolic = %ptr.loc6_47.2 (constants.%ptr.79f)]
  531. // CHECK:STDOUT: %pattern_type.loc6_43: type = pattern_type %ptr.loc6_47.2 [symbolic = %pattern_type.loc6_43 (constants.%pattern_type.afe)]
  532. // CHECK:STDOUT:
  533. // CHECK:STDOUT: !definition:
  534. // CHECK:STDOUT: %require_complete.loc6_43: <witness> = require_complete_type %ptr.loc6_47.2 [symbolic = %require_complete.loc6_43 (constants.%require_complete.6e5)]
  535. // CHECK:STDOUT: %require_complete.loc6_38: <witness> = require_complete_type %T.loc6_27.2 [symbolic = %require_complete.loc6_38 (constants.%require_complete.4ae)]
  536. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2: <specific function> = specific_function constants.%ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T.loc6_27.2) [symbolic = %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 (constants.%ExplicitAndAlsoDeduced.specific_fn.41d)]
  537. // CHECK:STDOUT:
  538. // CHECK:STDOUT: fn(%x.param: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T)) -> @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) {
  539. // CHECK:STDOUT: !entry:
  540. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.ref: %ExplicitAndAlsoDeduced.type = name_ref ExplicitAndAlsoDeduced, file.%ExplicitAndAlsoDeduced.decl [concrete = constants.%ExplicitAndAlsoDeduced]
  541. // CHECK:STDOUT: %T.ref.loc7: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)]
  542. // CHECK:STDOUT: %x.ref: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = name_ref x, %x
  543. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.1: <specific function> = specific_function %ExplicitAndAlsoDeduced.ref, @ExplicitAndAlsoDeduced(constants.%T) [symbolic = %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 (constants.%ExplicitAndAlsoDeduced.specific_fn.41d)]
  544. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = call %ExplicitAndAlsoDeduced.specific_fn.loc7_10.1(%x.ref)
  545. // CHECK:STDOUT: %.loc7_38.1: @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = value_of_initializer %ExplicitAndAlsoDeduced.call
  546. // CHECK:STDOUT: %.loc7_38.2: @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = converted %ExplicitAndAlsoDeduced.call, %.loc7_38.1
  547. // CHECK:STDOUT: return %.loc7_38.2
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT: }
  550. // CHECK:STDOUT:
  551. // CHECK:STDOUT: fn @CallExplicitAndAlsoDeduced() -> %ptr.6db {
  552. // CHECK:STDOUT: !entry:
  553. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.ref: %ExplicitAndAlsoDeduced.type = name_ref ExplicitAndAlsoDeduced, file.%ExplicitAndAlsoDeduced.decl [concrete = constants.%ExplicitAndAlsoDeduced]
  554. // CHECK:STDOUT: %A.ref.loc11: type = name_ref A, file.%A.decl [concrete = constants.%A]
  555. // CHECK:STDOUT: %.loc11_37.1: %empty_struct_type = struct_literal ()
  556. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn: <specific function> = specific_function %ExplicitAndAlsoDeduced.ref, @ExplicitAndAlsoDeduced(constants.%A) [concrete = constants.%ExplicitAndAlsoDeduced.specific_fn.720]
  557. // CHECK:STDOUT: %.loc11_37.2: ref %A = temporary_storage
  558. // CHECK:STDOUT: %.loc11_37.3: init %A = class_init (), %.loc11_37.2 [concrete = constants.%A.val]
  559. // CHECK:STDOUT: %.loc11_37.4: ref %A = temporary %.loc11_37.2, %.loc11_37.3
  560. // CHECK:STDOUT: %.loc11_37.5: ref %A = converted %.loc11_37.1, %.loc11_37.4
  561. // CHECK:STDOUT: %.loc11_37.6: %A = bind_value %.loc11_37.5
  562. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init %ptr.6db = call %ExplicitAndAlsoDeduced.specific_fn(%.loc11_37.6)
  563. // CHECK:STDOUT: %.loc11_39.1: %ptr.6db = value_of_initializer %ExplicitAndAlsoDeduced.call
  564. // CHECK:STDOUT: %.loc11_39.2: %ptr.6db = converted %ExplicitAndAlsoDeduced.call, %.loc11_39.1
  565. // CHECK:STDOUT: return %.loc11_39.2
  566. // CHECK:STDOUT: }
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%T) {
  569. // CHECK:STDOUT: %T.loc6_27.2 => constants.%T
  570. // CHECK:STDOUT: %pattern_type.loc6_37 => constants.%pattern_type.7dc
  571. // CHECK:STDOUT: %ptr.loc6_47.2 => constants.%ptr.79f
  572. // CHECK:STDOUT: %pattern_type.loc6_43 => constants.%pattern_type.afe
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: !definition:
  575. // CHECK:STDOUT: %require_complete.loc6_43 => constants.%require_complete.6e5
  576. // CHECK:STDOUT: %require_complete.loc6_38 => constants.%require_complete.4ae
  577. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.41d
  578. // CHECK:STDOUT: }
  579. // CHECK:STDOUT:
  580. // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%A) {
  581. // CHECK:STDOUT: %T.loc6_27.2 => constants.%A
  582. // CHECK:STDOUT: %pattern_type.loc6_37 => constants.%pattern_type.c10
  583. // CHECK:STDOUT: %ptr.loc6_47.2 => constants.%ptr.6db
  584. // CHECK:STDOUT: %pattern_type.loc6_43 => constants.%pattern_type.5f8
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: !definition:
  587. // CHECK:STDOUT: %require_complete.loc6_43 => constants.%complete_type.7ea
  588. // CHECK:STDOUT: %require_complete.loc6_38 => constants.%complete_type.357
  589. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.720
  590. // CHECK:STDOUT: }
  591. // CHECK:STDOUT:
  592. // CHECK:STDOUT: --- deduce_implicit.carbon
  593. // CHECK:STDOUT:
  594. // CHECK:STDOUT: constants {
  595. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  596. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  597. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  598. // CHECK:STDOUT: %ptr.79f: type = ptr_type %T [symbolic]
  599. // CHECK:STDOUT: %pattern_type.afe: type = pattern_type %ptr.79f [symbolic]
  600. // CHECK:STDOUT: %ImplicitGenericParam.type: type = fn_type @ImplicitGenericParam [concrete]
  601. // CHECK:STDOUT: %ImplicitGenericParam: %ImplicitGenericParam.type = struct_value () [concrete]
  602. // CHECK:STDOUT: %require_complete.6e5: <witness> = require_complete_type %ptr.79f [symbolic]
  603. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  604. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.fc1: <specific function> = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%T) [symbolic]
  605. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  606. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  607. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  608. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  609. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  610. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
  611. // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete]
  612. // CHECK:STDOUT: %CallImplicitGenericParam.type: type = fn_type @CallImplicitGenericParam [concrete]
  613. // CHECK:STDOUT: %CallImplicitGenericParam: %CallImplicitGenericParam.type = struct_value () [concrete]
  614. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  615. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
  616. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.752: <specific function> = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%i32) [concrete]
  617. // CHECK:STDOUT: %complete_type.3d0: <witness> = complete_type_witness %ptr.235 [concrete]
  618. // CHECK:STDOUT: }
  619. // CHECK:STDOUT:
  620. // CHECK:STDOUT: imports {
  621. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  622. // CHECK:STDOUT: .Int = %Core.Int
  623. // CHECK:STDOUT: import Core//prelude
  624. // CHECK:STDOUT: import Core//prelude/...
  625. // CHECK:STDOUT: }
  626. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  627. // CHECK:STDOUT: }
  628. // CHECK:STDOUT:
  629. // CHECK:STDOUT: file {
  630. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  631. // CHECK:STDOUT: .Core = imports.%Core
  632. // CHECK:STDOUT: .ImplicitGenericParam = %ImplicitGenericParam.decl
  633. // CHECK:STDOUT: .CallImplicitGenericParam = %CallImplicitGenericParam.decl
  634. // CHECK:STDOUT: }
  635. // CHECK:STDOUT: %Core.import = import Core
  636. // CHECK:STDOUT: %ImplicitGenericParam.decl: %ImplicitGenericParam.type = fn_decl @ImplicitGenericParam [concrete = constants.%ImplicitGenericParam] {
  637. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  638. // CHECK:STDOUT: %x.patt: @ImplicitGenericParam.%pattern_type.loc4_35 (%pattern_type.7dc) = binding_pattern x [concrete]
  639. // CHECK:STDOUT: %x.param_patt: @ImplicitGenericParam.%pattern_type.loc4_35 (%pattern_type.7dc) = value_param_pattern %x.patt, call_param0 [concrete]
  640. // CHECK:STDOUT: %return.patt: @ImplicitGenericParam.%pattern_type.loc4_41 (%pattern_type.afe) = return_slot_pattern [concrete]
  641. // CHECK:STDOUT: %return.param_patt: @ImplicitGenericParam.%pattern_type.loc4_41 (%pattern_type.afe) = out_param_pattern %return.patt, call_param1 [concrete]
  642. // CHECK:STDOUT: } {
  643. // CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  644. // CHECK:STDOUT: %ptr.loc4_45.1: type = ptr_type %T.ref.loc4_44 [symbolic = %ptr.loc4_45.2 (constants.%ptr.79f)]
  645. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  646. // CHECK:STDOUT: %x.param: @ImplicitGenericParam.%T.loc4_25.2 (%T) = value_param call_param0
  647. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  648. // CHECK:STDOUT: %x: @ImplicitGenericParam.%T.loc4_25.2 (%T) = bind_name x, %x.param
  649. // CHECK:STDOUT: %return.param: ref @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = out_param call_param1
  650. // CHECK:STDOUT: %return: ref @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = return_slot %return.param
  651. // CHECK:STDOUT: }
  652. // CHECK:STDOUT: %CallImplicitGenericParam.decl: %CallImplicitGenericParam.type = fn_decl @CallImplicitGenericParam [concrete = constants.%CallImplicitGenericParam] {
  653. // CHECK:STDOUT: %n.patt: %pattern_type.7ce = binding_pattern n [concrete]
  654. // CHECK:STDOUT: %n.param_patt: %pattern_type.7ce = value_param_pattern %n.patt, call_param0 [concrete]
  655. // CHECK:STDOUT: %return.patt: %pattern_type.fe8 = return_slot_pattern [concrete]
  656. // CHECK:STDOUT: %return.param_patt: %pattern_type.fe8 = out_param_pattern %return.patt, call_param1 [concrete]
  657. // CHECK:STDOUT: } {
  658. // CHECK:STDOUT: %int_32.loc6_40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  659. // CHECK:STDOUT: %i32.loc6_40: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  660. // CHECK:STDOUT: %ptr: type = ptr_type %i32.loc6_40 [concrete = constants.%ptr.235]
  661. // CHECK:STDOUT: %n.param: %i32 = value_param call_param0
  662. // CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_32 [concrete = constants.%i32] {
  663. // CHECK:STDOUT: %int_32.loc6_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  664. // CHECK:STDOUT: %i32.loc6_32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  665. // CHECK:STDOUT: }
  666. // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param
  667. // CHECK:STDOUT: %return.param: ref %ptr.235 = out_param call_param1
  668. // CHECK:STDOUT: %return: ref %ptr.235 = return_slot %return.param
  669. // CHECK:STDOUT: }
  670. // CHECK:STDOUT: }
  671. // CHECK:STDOUT:
  672. // CHECK:STDOUT: generic fn @ImplicitGenericParam(%T.loc4_25.1: type) {
  673. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  674. // CHECK:STDOUT: %pattern_type.loc4_35: type = pattern_type %T.loc4_25.2 [symbolic = %pattern_type.loc4_35 (constants.%pattern_type.7dc)]
  675. // CHECK:STDOUT: %ptr.loc4_45.2: type = ptr_type %T.loc4_25.2 [symbolic = %ptr.loc4_45.2 (constants.%ptr.79f)]
  676. // CHECK:STDOUT: %pattern_type.loc4_41: type = pattern_type %ptr.loc4_45.2 [symbolic = %pattern_type.loc4_41 (constants.%pattern_type.afe)]
  677. // CHECK:STDOUT:
  678. // CHECK:STDOUT: !definition:
  679. // CHECK:STDOUT: %require_complete.loc4_41: <witness> = require_complete_type %ptr.loc4_45.2 [symbolic = %require_complete.loc4_41 (constants.%require_complete.6e5)]
  680. // CHECK:STDOUT: %require_complete.loc4_36: <witness> = require_complete_type %T.loc4_25.2 [symbolic = %require_complete.loc4_36 (constants.%require_complete.4ae)]
  681. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2: <specific function> = specific_function constants.%ImplicitGenericParam, @ImplicitGenericParam(%T.loc4_25.2) [symbolic = %ImplicitGenericParam.specific_fn.loc4_56.2 (constants.%ImplicitGenericParam.specific_fn.fc1)]
  682. // CHECK:STDOUT:
  683. // CHECK:STDOUT: fn(%x.param: @ImplicitGenericParam.%T.loc4_25.2 (%T)) -> @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) {
  684. // CHECK:STDOUT: !entry:
  685. // CHECK:STDOUT: %ImplicitGenericParam.ref: %ImplicitGenericParam.type = name_ref ImplicitGenericParam, file.%ImplicitGenericParam.decl [concrete = constants.%ImplicitGenericParam]
  686. // CHECK:STDOUT: %x.ref: @ImplicitGenericParam.%T.loc4_25.2 (%T) = name_ref x, %x
  687. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.1: <specific function> = specific_function %ImplicitGenericParam.ref, @ImplicitGenericParam(constants.%T) [symbolic = %ImplicitGenericParam.specific_fn.loc4_56.2 (constants.%ImplicitGenericParam.specific_fn.fc1)]
  688. // CHECK:STDOUT: %ImplicitGenericParam.call: init @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = call %ImplicitGenericParam.specific_fn.loc4_56.1(%x.ref)
  689. // CHECK:STDOUT: %.loc4_79.1: @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = value_of_initializer %ImplicitGenericParam.call
  690. // CHECK:STDOUT: %.loc4_79.2: @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = converted %ImplicitGenericParam.call, %.loc4_79.1
  691. // CHECK:STDOUT: return %.loc4_79.2
  692. // CHECK:STDOUT: }
  693. // CHECK:STDOUT: }
  694. // CHECK:STDOUT:
  695. // CHECK:STDOUT: fn @CallImplicitGenericParam(%n.param: %i32) -> %ptr.235 {
  696. // CHECK:STDOUT: !entry:
  697. // CHECK:STDOUT: %ImplicitGenericParam.ref: %ImplicitGenericParam.type = name_ref ImplicitGenericParam, file.%ImplicitGenericParam.decl [concrete = constants.%ImplicitGenericParam]
  698. // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
  699. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn: <specific function> = specific_function %ImplicitGenericParam.ref, @ImplicitGenericParam(constants.%i32) [concrete = constants.%ImplicitGenericParam.specific_fn.752]
  700. // CHECK:STDOUT: %ImplicitGenericParam.call: init %ptr.235 = call %ImplicitGenericParam.specific_fn(%n.ref)
  701. // CHECK:STDOUT: %.loc7_33.1: %ptr.235 = value_of_initializer %ImplicitGenericParam.call
  702. // CHECK:STDOUT: %.loc7_33.2: %ptr.235 = converted %ImplicitGenericParam.call, %.loc7_33.1
  703. // CHECK:STDOUT: return %.loc7_33.2
  704. // CHECK:STDOUT: }
  705. // CHECK:STDOUT:
  706. // CHECK:STDOUT: specific @ImplicitGenericParam(constants.%T) {
  707. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  708. // CHECK:STDOUT: %pattern_type.loc4_35 => constants.%pattern_type.7dc
  709. // CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.79f
  710. // CHECK:STDOUT: %pattern_type.loc4_41 => constants.%pattern_type.afe
  711. // CHECK:STDOUT:
  712. // CHECK:STDOUT: !definition:
  713. // CHECK:STDOUT: %require_complete.loc4_41 => constants.%require_complete.6e5
  714. // CHECK:STDOUT: %require_complete.loc4_36 => constants.%require_complete.4ae
  715. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.fc1
  716. // CHECK:STDOUT: }
  717. // CHECK:STDOUT:
  718. // CHECK:STDOUT: specific @ImplicitGenericParam(constants.%i32) {
  719. // CHECK:STDOUT: %T.loc4_25.2 => constants.%i32
  720. // CHECK:STDOUT: %pattern_type.loc4_35 => constants.%pattern_type.7ce
  721. // CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.235
  722. // CHECK:STDOUT: %pattern_type.loc4_41 => constants.%pattern_type.fe8
  723. // CHECK:STDOUT:
  724. // CHECK:STDOUT: !definition:
  725. // CHECK:STDOUT: %require_complete.loc4_41 => constants.%complete_type.3d0
  726. // CHECK:STDOUT: %require_complete.loc4_36 => constants.%complete_type.f8a
  727. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.752
  728. // CHECK:STDOUT: }
  729. // CHECK:STDOUT:
  730. // CHECK:STDOUT: --- deduce_nested_tuple.carbon
  731. // CHECK:STDOUT:
  732. // CHECK:STDOUT: constants {
  733. // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
  734. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  735. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  736. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  737. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  738. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  739. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  740. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
  741. // CHECK:STDOUT: %tuple.type.f83: type = tuple_type (%T.8b3, %i32) [symbolic]
  742. // CHECK:STDOUT: %pattern_type.ec8: type = pattern_type %tuple.type.f83 [symbolic]
  743. // CHECK:STDOUT: %TupleParam.type: type = fn_type @TupleParam [concrete]
  744. // CHECK:STDOUT: %TupleParam: %TupleParam.type = struct_value () [concrete]
  745. // CHECK:STDOUT: %require_complete.9c1: <witness> = require_complete_type %tuple.type.f83 [symbolic]
  746. // CHECK:STDOUT: %CallTupleParam.type: type = fn_type @CallTupleParam [concrete]
  747. // CHECK:STDOUT: %CallTupleParam: %CallTupleParam.type = struct_value () [concrete]
  748. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  749. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  750. // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
  751. // CHECK:STDOUT: %tuple.type.4c8: type = tuple_type (Core.IntLiteral, %i32) [concrete]
  752. // CHECK:STDOUT: %pattern_type.6f2: type = pattern_type %tuple.type.4c8 [concrete]
  753. // CHECK:STDOUT: %TupleParam.specific_fn: <specific function> = specific_function %TupleParam, @TupleParam(Core.IntLiteral) [concrete]
  754. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  755. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  756. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  757. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  758. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  759. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.3, @impl.4f9(%To.c80) [symbolic]
  760. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  761. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  762. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.4f9(%int_32) [concrete]
  763. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  764. // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  765. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
  766. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
  767. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.3(%int_32) [concrete]
  768. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
  769. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  770. // CHECK:STDOUT: %tuple: %tuple.type.4c8 = tuple_value (%int_1, %int_2.ef8) [concrete]
  771. // CHECK:STDOUT: %complete_type.c49: <witness> = complete_type_witness %tuple.type.4c8 [concrete]
  772. // CHECK:STDOUT: }
  773. // CHECK:STDOUT:
  774. // CHECK:STDOUT: imports {
  775. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  776. // CHECK:STDOUT: .Int = %Core.Int
  777. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  778. // CHECK:STDOUT: import Core//prelude
  779. // CHECK:STDOUT: import Core//prelude/...
  780. // CHECK:STDOUT: }
  781. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  782. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  783. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  784. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  785. // CHECK:STDOUT: }
  786. // CHECK:STDOUT:
  787. // CHECK:STDOUT: file {
  788. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  789. // CHECK:STDOUT: .Core = imports.%Core
  790. // CHECK:STDOUT: .TupleParam = %TupleParam.decl
  791. // CHECK:STDOUT: .CallTupleParam = %CallTupleParam.decl
  792. // CHECK:STDOUT: }
  793. // CHECK:STDOUT: %Core.import = import Core
  794. // CHECK:STDOUT: %TupleParam.decl: %TupleParam.type = fn_decl @TupleParam [concrete = constants.%TupleParam] {
  795. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  796. // CHECK:STDOUT: %x.patt: @TupleParam.%pattern_type (%pattern_type.ec8) = binding_pattern x [concrete]
  797. // CHECK:STDOUT: %x.param_patt: @TupleParam.%pattern_type (%pattern_type.ec8) = value_param_pattern %x.patt, call_param0 [concrete]
  798. // CHECK:STDOUT: } {
  799. // CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_15.2 (constants.%T.8b3)]
  800. // CHECK:STDOUT: %x.param: @TupleParam.%tuple.type (%tuple.type.f83) = value_param call_param0
  801. // CHECK:STDOUT: %.loc4_35.1: type = splice_block %.loc4_35.3 [symbolic = %tuple.type (constants.%tuple.type.f83)] {
  802. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_15.1 [symbolic = %T.loc4_15.2 (constants.%T.8b3)]
  803. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  804. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  805. // CHECK:STDOUT: %.loc4_35.2: %tuple.type.24b = tuple_literal (%T.ref, %i32)
  806. // CHECK:STDOUT: %.loc4_35.3: type = converted %.loc4_35.2, constants.%tuple.type.f83 [symbolic = %tuple.type (constants.%tuple.type.f83)]
  807. // CHECK:STDOUT: }
  808. // CHECK:STDOUT: %x: @TupleParam.%tuple.type (%tuple.type.f83) = bind_name x, %x.param
  809. // CHECK:STDOUT: }
  810. // CHECK:STDOUT: %CallTupleParam.decl: %CallTupleParam.type = fn_decl @CallTupleParam [concrete = constants.%CallTupleParam] {} {}
  811. // CHECK:STDOUT: }
  812. // CHECK:STDOUT:
  813. // CHECK:STDOUT: generic fn @TupleParam(%T.loc4_15.1: type) {
  814. // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_15.2 (constants.%T.8b3)]
  815. // CHECK:STDOUT: %tuple.type: type = tuple_type (%T.loc4_15.2, constants.%i32) [symbolic = %tuple.type (constants.%tuple.type.f83)]
  816. // CHECK:STDOUT: %pattern_type: type = pattern_type %tuple.type [symbolic = %pattern_type (constants.%pattern_type.ec8)]
  817. // CHECK:STDOUT:
  818. // CHECK:STDOUT: !definition:
  819. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.9c1)]
  820. // CHECK:STDOUT:
  821. // CHECK:STDOUT: fn(%x.param: @TupleParam.%tuple.type (%tuple.type.f83)) {
  822. // CHECK:STDOUT: !entry:
  823. // CHECK:STDOUT: return
  824. // CHECK:STDOUT: }
  825. // CHECK:STDOUT: }
  826. // CHECK:STDOUT:
  827. // CHECK:STDOUT: fn @CallTupleParam() {
  828. // CHECK:STDOUT: !entry:
  829. // CHECK:STDOUT: %TupleParam.ref: %TupleParam.type = name_ref TupleParam, file.%TupleParam.decl [concrete = constants.%TupleParam]
  830. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  831. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  832. // CHECK:STDOUT: %.loc7_19.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
  833. // CHECK:STDOUT: %TupleParam.specific_fn: <specific function> = specific_function %TupleParam.ref, @TupleParam(Core.IntLiteral) [concrete = constants.%TupleParam.specific_fn]
  834. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  835. // CHECK:STDOUT: %bound_method.loc7_19.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound]
  836. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  837. // CHECK:STDOUT: %bound_method.loc7_19.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
  838. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc7_19.2(%int_2) [concrete = constants.%int_2.ef8]
  839. // CHECK:STDOUT: %.loc7_19.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8]
  840. // CHECK:STDOUT: %.loc7_19.3: %i32 = converted %int_2, %.loc7_19.2 [concrete = constants.%int_2.ef8]
  841. // CHECK:STDOUT: %tuple: %tuple.type.4c8 = tuple_value (%int_1, %.loc7_19.3) [concrete = constants.%tuple]
  842. // CHECK:STDOUT: %.loc7_19.4: %tuple.type.4c8 = converted %.loc7_19.1, %tuple [concrete = constants.%tuple]
  843. // CHECK:STDOUT: %TupleParam.call: init %empty_tuple.type = call %TupleParam.specific_fn(%.loc7_19.4)
  844. // CHECK:STDOUT: return
  845. // CHECK:STDOUT: }
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: specific @TupleParam(constants.%T.8b3) {
  848. // CHECK:STDOUT: %T.loc4_15.2 => constants.%T.8b3
  849. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.f83
  850. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ec8
  851. // CHECK:STDOUT: }
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: specific @TupleParam(Core.IntLiteral) {
  854. // CHECK:STDOUT: %T.loc4_15.2 => Core.IntLiteral
  855. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.4c8
  856. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6f2
  857. // CHECK:STDOUT:
  858. // CHECK:STDOUT: !definition:
  859. // CHECK:STDOUT: %require_complete => constants.%complete_type.c49
  860. // CHECK:STDOUT: }
  861. // CHECK:STDOUT:
  862. // CHECK:STDOUT: --- deduce_nested_struct.carbon
  863. // CHECK:STDOUT:
  864. // CHECK:STDOUT: constants {
  865. // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
  866. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  867. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  868. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  869. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  870. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  871. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  872. // CHECK:STDOUT: %struct_type.a.b.46e: type = struct_type {.a: %T.8b3, .b: %i32} [symbolic]
  873. // CHECK:STDOUT: %pattern_type.e94: type = pattern_type %struct_type.a.b.46e [symbolic]
  874. // CHECK:STDOUT: %StructParam.type: type = fn_type @StructParam [concrete]
  875. // CHECK:STDOUT: %StructParam: %StructParam.type = struct_value () [concrete]
  876. // CHECK:STDOUT: %require_complete.23a: <witness> = require_complete_type %struct_type.a.b.46e [symbolic]
  877. // CHECK:STDOUT: %CallStructParam.type: type = fn_type @CallStructParam [concrete]
  878. // CHECK:STDOUT: %CallStructParam: %CallStructParam.type = struct_value () [concrete]
  879. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  880. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  881. // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [concrete]
  882. // CHECK:STDOUT: %struct_type.a.b.a13: type = struct_type {.a: Core.IntLiteral, .b: %i32} [concrete]
  883. // CHECK:STDOUT: %pattern_type.cfa: type = pattern_type %struct_type.a.b.a13 [concrete]
  884. // CHECK:STDOUT: %StructParam.specific_fn: <specific function> = specific_function %StructParam, @StructParam(Core.IntLiteral) [concrete]
  885. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  886. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  887. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  888. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  889. // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  890. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.3, @impl.4f9(%To.c80) [symbolic]
  891. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  892. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  893. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.4f9(%int_32) [concrete]
  894. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  895. // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  896. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
  897. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
  898. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.3(%int_32) [concrete]
  899. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
  900. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  901. // CHECK:STDOUT: %struct: %struct_type.a.b.a13 = struct_value (%int_1, %int_2.ef8) [concrete]
  902. // CHECK:STDOUT: %complete_type.a4a: <witness> = complete_type_witness %struct_type.a.b.a13 [concrete]
  903. // CHECK:STDOUT: }
  904. // CHECK:STDOUT:
  905. // CHECK:STDOUT: imports {
  906. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  907. // CHECK:STDOUT: .Int = %Core.Int
  908. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  909. // CHECK:STDOUT: import Core//prelude
  910. // CHECK:STDOUT: import Core//prelude/...
  911. // CHECK:STDOUT: }
  912. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  913. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  914. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  915. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  916. // CHECK:STDOUT: }
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: file {
  919. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  920. // CHECK:STDOUT: .Core = imports.%Core
  921. // CHECK:STDOUT: .StructParam = %StructParam.decl
  922. // CHECK:STDOUT: .CallStructParam = %CallStructParam.decl
  923. // CHECK:STDOUT: }
  924. // CHECK:STDOUT: %Core.import = import Core
  925. // CHECK:STDOUT: %StructParam.decl: %StructParam.type = fn_decl @StructParam [concrete = constants.%StructParam] {
  926. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  927. // CHECK:STDOUT: %x.patt: @StructParam.%pattern_type (%pattern_type.e94) = binding_pattern x [concrete]
  928. // CHECK:STDOUT: %x.param_patt: @StructParam.%pattern_type (%pattern_type.e94) = value_param_pattern %x.patt, call_param0 [concrete]
  929. // CHECK:STDOUT: } {
  930. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T.8b3)]
  931. // CHECK:STDOUT: %x.param: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.46e) = value_param call_param0
  932. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.a.b.loc4_44.1 [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.46e)] {
  933. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T.8b3)]
  934. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  935. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  936. // CHECK:STDOUT: %struct_type.a.b.loc4_44.1: type = struct_type {.a: @StructParam.%T.loc4_16.2 (%T.8b3), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.46e)]
  937. // CHECK:STDOUT: }
  938. // CHECK:STDOUT: %x: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.46e) = bind_name x, %x.param
  939. // CHECK:STDOUT: }
  940. // CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [concrete = constants.%CallStructParam] {} {}
  941. // CHECK:STDOUT: }
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: generic fn @StructParam(%T.loc4_16.1: type) {
  944. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T.8b3)]
  945. // CHECK:STDOUT: %struct_type.a.b.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.2 (%T.8b3), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.46e)]
  946. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.b.loc4_44.2 [symbolic = %pattern_type (constants.%pattern_type.e94)]
  947. // CHECK:STDOUT:
  948. // CHECK:STDOUT: !definition:
  949. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.a.b.loc4_44.2 [symbolic = %require_complete (constants.%require_complete.23a)]
  950. // CHECK:STDOUT:
  951. // CHECK:STDOUT: fn(%x.param: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.46e)) {
  952. // CHECK:STDOUT: !entry:
  953. // CHECK:STDOUT: return
  954. // CHECK:STDOUT: }
  955. // CHECK:STDOUT: }
  956. // CHECK:STDOUT:
  957. // CHECK:STDOUT: fn @CallStructParam() {
  958. // CHECK:STDOUT: !entry:
  959. // CHECK:STDOUT: %StructParam.ref: %StructParam.type = name_ref StructParam, file.%StructParam.decl [concrete = constants.%StructParam]
  960. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  961. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  962. // CHECK:STDOUT: %.loc7_30.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2)
  963. // CHECK:STDOUT: %StructParam.specific_fn: <specific function> = specific_function %StructParam.ref, @StructParam(Core.IntLiteral) [concrete = constants.%StructParam.specific_fn]
  964. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  965. // CHECK:STDOUT: %bound_method.loc7_30.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound]
  966. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  967. // CHECK:STDOUT: %bound_method.loc7_30.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
  968. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc7_30.2(%int_2) [concrete = constants.%int_2.ef8]
  969. // CHECK:STDOUT: %.loc7_30.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8]
  970. // CHECK:STDOUT: %.loc7_30.3: %i32 = converted %int_2, %.loc7_30.2 [concrete = constants.%int_2.ef8]
  971. // CHECK:STDOUT: %struct: %struct_type.a.b.a13 = struct_value (%int_1, %.loc7_30.3) [concrete = constants.%struct]
  972. // CHECK:STDOUT: %.loc7_30.4: %struct_type.a.b.a13 = converted %.loc7_30.1, %struct [concrete = constants.%struct]
  973. // CHECK:STDOUT: %StructParam.call: init %empty_tuple.type = call %StructParam.specific_fn(%.loc7_30.4)
  974. // CHECK:STDOUT: return
  975. // CHECK:STDOUT: }
  976. // CHECK:STDOUT:
  977. // CHECK:STDOUT: specific @StructParam(constants.%T.8b3) {
  978. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T.8b3
  979. // CHECK:STDOUT: %struct_type.a.b.loc4_44.2 => constants.%struct_type.a.b.46e
  980. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e94
  981. // CHECK:STDOUT: }
  982. // CHECK:STDOUT:
  983. // CHECK:STDOUT: specific @StructParam(Core.IntLiteral) {
  984. // CHECK:STDOUT: %T.loc4_16.2 => Core.IntLiteral
  985. // CHECK:STDOUT: %struct_type.a.b.loc4_44.2 => constants.%struct_type.a.b.a13
  986. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cfa
  987. // CHECK:STDOUT:
  988. // CHECK:STDOUT: !definition:
  989. // CHECK:STDOUT: %require_complete => constants.%complete_type.a4a
  990. // CHECK:STDOUT: }
  991. // CHECK:STDOUT:
  992. // CHECK:STDOUT: --- fail_deduce_bigger_struct.carbon
  993. // CHECK:STDOUT:
  994. // CHECK:STDOUT: constants {
  995. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  996. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  997. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  998. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  999. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1000. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1001. // CHECK:STDOUT: %struct_type.c.d.e: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic]
  1002. // CHECK:STDOUT: %pattern_type.c31: type = pattern_type %struct_type.c.d.e [symbolic]
  1003. // CHECK:STDOUT: %BigStructParam.type: type = fn_type @BigStructParam [concrete]
  1004. // CHECK:STDOUT: %BigStructParam: %BigStructParam.type = struct_value () [concrete]
  1005. // CHECK:STDOUT: %require_complete.694: <witness> = require_complete_type %struct_type.c.d.e [symbolic]
  1006. // CHECK:STDOUT: %CallBigStructParam.type: type = fn_type @CallBigStructParam [concrete]
  1007. // CHECK:STDOUT: %CallBigStructParam: %CallBigStructParam.type = struct_value () [concrete]
  1008. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  1009. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete]
  1010. // CHECK:STDOUT: %struct_type.c.d: type = struct_type {.c: Core.IntLiteral, .d: Core.IntLiteral} [concrete]
  1011. // CHECK:STDOUT: }
  1012. // CHECK:STDOUT:
  1013. // CHECK:STDOUT: imports {
  1014. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1015. // CHECK:STDOUT: .Int = %Core.Int
  1016. // CHECK:STDOUT: import Core//prelude
  1017. // CHECK:STDOUT: import Core//prelude/...
  1018. // CHECK:STDOUT: }
  1019. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  1020. // CHECK:STDOUT: }
  1021. // CHECK:STDOUT:
  1022. // CHECK:STDOUT: file {
  1023. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1024. // CHECK:STDOUT: .Core = imports.%Core
  1025. // CHECK:STDOUT: .BigStructParam = %BigStructParam.decl
  1026. // CHECK:STDOUT: .CallBigStructParam = %CallBigStructParam.decl
  1027. // CHECK:STDOUT: }
  1028. // CHECK:STDOUT: %Core.import = import Core
  1029. // CHECK:STDOUT: %BigStructParam.decl: %BigStructParam.type = fn_decl @BigStructParam [concrete = constants.%BigStructParam] {
  1030. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1031. // CHECK:STDOUT: %x.patt: @BigStructParam.%pattern_type (%pattern_type.c31) = binding_pattern x [concrete]
  1032. // CHECK:STDOUT: %x.param_patt: @BigStructParam.%pattern_type (%pattern_type.c31) = value_param_pattern %x.patt, call_param0 [concrete]
  1033. // CHECK:STDOUT: } {
  1034. // CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T)]
  1035. // CHECK:STDOUT: %x.param: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = value_param call_param0
  1036. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.c.d.e.loc4_56.1 [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)] {
  1037. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_19.1 [symbolic = %T.loc4_19.2 (constants.%T)]
  1038. // CHECK:STDOUT: %int_32.loc4_44: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1039. // CHECK:STDOUT: %i32.loc4_44: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1040. // CHECK:STDOUT: %int_32.loc4_53: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1041. // CHECK:STDOUT: %i32.loc4_53: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1042. // CHECK:STDOUT: %struct_type.c.d.e.loc4_56.1: type = struct_type {.c: @BigStructParam.%T.loc4_19.2 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)]
  1043. // CHECK:STDOUT: }
  1044. // CHECK:STDOUT: %x: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = bind_name x, %x.param
  1045. // CHECK:STDOUT: }
  1046. // CHECK:STDOUT: %CallBigStructParam.decl: %CallBigStructParam.type = fn_decl @CallBigStructParam [concrete = constants.%CallBigStructParam] {} {}
  1047. // CHECK:STDOUT: }
  1048. // CHECK:STDOUT:
  1049. // CHECK:STDOUT: generic fn @BigStructParam(%T.loc4_19.1: type) {
  1050. // CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T)]
  1051. // CHECK:STDOUT: %struct_type.c.d.e.loc4_56.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.2 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)]
  1052. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.c.d.e.loc4_56.2 [symbolic = %pattern_type (constants.%pattern_type.c31)]
  1053. // CHECK:STDOUT:
  1054. // CHECK:STDOUT: !definition:
  1055. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.c.d.e.loc4_56.2 [symbolic = %require_complete (constants.%require_complete.694)]
  1056. // CHECK:STDOUT:
  1057. // CHECK:STDOUT: fn(%x.param: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e)) {
  1058. // CHECK:STDOUT: !entry:
  1059. // CHECK:STDOUT: return
  1060. // CHECK:STDOUT: }
  1061. // CHECK:STDOUT: }
  1062. // CHECK:STDOUT:
  1063. // CHECK:STDOUT: fn @CallBigStructParam() {
  1064. // CHECK:STDOUT: !entry:
  1065. // CHECK:STDOUT: %BigStructParam.ref: %BigStructParam.type = name_ref BigStructParam, file.%BigStructParam.decl [concrete = constants.%BigStructParam]
  1066. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  1067. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4]
  1068. // CHECK:STDOUT: %.loc14: %struct_type.c.d = struct_literal (%int_3, %int_4)
  1069. // CHECK:STDOUT: return
  1070. // CHECK:STDOUT: }
  1071. // CHECK:STDOUT:
  1072. // CHECK:STDOUT: specific @BigStructParam(constants.%T) {
  1073. // CHECK:STDOUT: %T.loc4_19.2 => constants.%T
  1074. // CHECK:STDOUT: %struct_type.c.d.e.loc4_56.2 => constants.%struct_type.c.d.e
  1075. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c31
  1076. // CHECK:STDOUT: }
  1077. // CHECK:STDOUT:
  1078. // CHECK:STDOUT: --- fail_deduce_smaller_struct.carbon
  1079. // CHECK:STDOUT:
  1080. // CHECK:STDOUT: constants {
  1081. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1082. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1083. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1084. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1085. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1086. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1087. // CHECK:STDOUT: %struct_type.f.g: type = struct_type {.f: %T, .g: %i32} [symbolic]
  1088. // CHECK:STDOUT: %pattern_type.5b8: type = pattern_type %struct_type.f.g [symbolic]
  1089. // CHECK:STDOUT: %SmallStructParam.type: type = fn_type @SmallStructParam [concrete]
  1090. // CHECK:STDOUT: %SmallStructParam: %SmallStructParam.type = struct_value () [concrete]
  1091. // CHECK:STDOUT: %require_complete.dad: <witness> = require_complete_type %struct_type.f.g [symbolic]
  1092. // CHECK:STDOUT: %CallSmallStructParam.type: type = fn_type @CallSmallStructParam [concrete]
  1093. // CHECK:STDOUT: %CallSmallStructParam: %CallSmallStructParam.type = struct_value () [concrete]
  1094. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete]
  1095. // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete]
  1096. // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete]
  1097. // CHECK:STDOUT: %struct_type.f.g.h: type = struct_type {.f: Core.IntLiteral, .g: Core.IntLiteral, .h: Core.IntLiteral} [concrete]
  1098. // CHECK:STDOUT: }
  1099. // CHECK:STDOUT:
  1100. // CHECK:STDOUT: imports {
  1101. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1102. // CHECK:STDOUT: .Int = %Core.Int
  1103. // CHECK:STDOUT: import Core//prelude
  1104. // CHECK:STDOUT: import Core//prelude/...
  1105. // CHECK:STDOUT: }
  1106. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  1107. // CHECK:STDOUT: }
  1108. // CHECK:STDOUT:
  1109. // CHECK:STDOUT: file {
  1110. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1111. // CHECK:STDOUT: .Core = imports.%Core
  1112. // CHECK:STDOUT: .SmallStructParam = %SmallStructParam.decl
  1113. // CHECK:STDOUT: .CallSmallStructParam = %CallSmallStructParam.decl
  1114. // CHECK:STDOUT: }
  1115. // CHECK:STDOUT: %Core.import = import Core
  1116. // CHECK:STDOUT: %SmallStructParam.decl: %SmallStructParam.type = fn_decl @SmallStructParam [concrete = constants.%SmallStructParam] {
  1117. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1118. // CHECK:STDOUT: %x.patt: @SmallStructParam.%pattern_type (%pattern_type.5b8) = binding_pattern x [concrete]
  1119. // CHECK:STDOUT: %x.param_patt: @SmallStructParam.%pattern_type (%pattern_type.5b8) = value_param_pattern %x.patt, call_param0 [concrete]
  1120. // CHECK:STDOUT: } {
  1121. // CHECK:STDOUT: %T.loc4_21.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_21.2 (constants.%T)]
  1122. // CHECK:STDOUT: %x.param: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = value_param call_param0
  1123. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.f.g.loc4_49.1 [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)] {
  1124. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)]
  1125. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1126. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1127. // CHECK:STDOUT: %struct_type.f.g.loc4_49.1: type = struct_type {.f: @SmallStructParam.%T.loc4_21.2 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)]
  1128. // CHECK:STDOUT: }
  1129. // CHECK:STDOUT: %x: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = bind_name x, %x.param
  1130. // CHECK:STDOUT: }
  1131. // CHECK:STDOUT: %CallSmallStructParam.decl: %CallSmallStructParam.type = fn_decl @CallSmallStructParam [concrete = constants.%CallSmallStructParam] {} {}
  1132. // CHECK:STDOUT: }
  1133. // CHECK:STDOUT:
  1134. // CHECK:STDOUT: generic fn @SmallStructParam(%T.loc4_21.1: type) {
  1135. // CHECK:STDOUT: %T.loc4_21.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_21.2 (constants.%T)]
  1136. // CHECK:STDOUT: %struct_type.f.g.loc4_49.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.2 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)]
  1137. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.f.g.loc4_49.2 [symbolic = %pattern_type (constants.%pattern_type.5b8)]
  1138. // CHECK:STDOUT:
  1139. // CHECK:STDOUT: !definition:
  1140. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.f.g.loc4_49.2 [symbolic = %require_complete (constants.%require_complete.dad)]
  1141. // CHECK:STDOUT:
  1142. // CHECK:STDOUT: fn(%x.param: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g)) {
  1143. // CHECK:STDOUT: !entry:
  1144. // CHECK:STDOUT: return
  1145. // CHECK:STDOUT: }
  1146. // CHECK:STDOUT: }
  1147. // CHECK:STDOUT:
  1148. // CHECK:STDOUT: fn @CallSmallStructParam() {
  1149. // CHECK:STDOUT: !entry:
  1150. // CHECK:STDOUT: %SmallStructParam.ref: %SmallStructParam.type = name_ref SmallStructParam, file.%SmallStructParam.decl [concrete = constants.%SmallStructParam]
  1151. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5]
  1152. // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6]
  1153. // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7]
  1154. // CHECK:STDOUT: %.loc14: %struct_type.f.g.h = struct_literal (%int_5, %int_6, %int_7)
  1155. // CHECK:STDOUT: return
  1156. // CHECK:STDOUT: }
  1157. // CHECK:STDOUT:
  1158. // CHECK:STDOUT: specific @SmallStructParam(constants.%T) {
  1159. // CHECK:STDOUT: %T.loc4_21.2 => constants.%T
  1160. // CHECK:STDOUT: %struct_type.f.g.loc4_49.2 => constants.%struct_type.f.g
  1161. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.5b8
  1162. // CHECK:STDOUT: }
  1163. // CHECK:STDOUT:
  1164. // CHECK:STDOUT: --- fail_deduce_struct_wrong_name.carbon
  1165. // CHECK:STDOUT:
  1166. // CHECK:STDOUT: constants {
  1167. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1168. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1169. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1170. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1171. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1172. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1173. // CHECK:STDOUT: %struct_type.i.different: type = struct_type {.i: %T, .different: %i32} [symbolic]
  1174. // CHECK:STDOUT: %pattern_type.685: type = pattern_type %struct_type.i.different [symbolic]
  1175. // CHECK:STDOUT: %WrongNameStructParam.type: type = fn_type @WrongNameStructParam [concrete]
  1176. // CHECK:STDOUT: %WrongNameStructParam: %WrongNameStructParam.type = struct_value () [concrete]
  1177. // CHECK:STDOUT: %require_complete.411: <witness> = require_complete_type %struct_type.i.different [symbolic]
  1178. // CHECK:STDOUT: %CallWrongNameStructParam.type: type = fn_type @CallWrongNameStructParam [concrete]
  1179. // CHECK:STDOUT: %CallWrongNameStructParam: %CallWrongNameStructParam.type = struct_value () [concrete]
  1180. // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete]
  1181. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete]
  1182. // CHECK:STDOUT: %struct_type.i.j: type = struct_type {.i: Core.IntLiteral, .j: Core.IntLiteral} [concrete]
  1183. // CHECK:STDOUT: }
  1184. // CHECK:STDOUT:
  1185. // CHECK:STDOUT: imports {
  1186. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1187. // CHECK:STDOUT: .Int = %Core.Int
  1188. // CHECK:STDOUT: import Core//prelude
  1189. // CHECK:STDOUT: import Core//prelude/...
  1190. // CHECK:STDOUT: }
  1191. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  1192. // CHECK:STDOUT: }
  1193. // CHECK:STDOUT:
  1194. // CHECK:STDOUT: file {
  1195. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1196. // CHECK:STDOUT: .Core = imports.%Core
  1197. // CHECK:STDOUT: .WrongNameStructParam = %WrongNameStructParam.decl
  1198. // CHECK:STDOUT: .CallWrongNameStructParam = %CallWrongNameStructParam.decl
  1199. // CHECK:STDOUT: }
  1200. // CHECK:STDOUT: %Core.import = import Core
  1201. // CHECK:STDOUT: %WrongNameStructParam.decl: %WrongNameStructParam.type = fn_decl @WrongNameStructParam [concrete = constants.%WrongNameStructParam] {
  1202. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1203. // CHECK:STDOUT: %x.patt: @WrongNameStructParam.%pattern_type (%pattern_type.685) = binding_pattern x [concrete]
  1204. // CHECK:STDOUT: %x.param_patt: @WrongNameStructParam.%pattern_type (%pattern_type.685) = value_param_pattern %x.patt, call_param0 [concrete]
  1205. // CHECK:STDOUT: } {
  1206. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  1207. // CHECK:STDOUT: %x.param: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = value_param call_param0
  1208. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.i.different.loc4_61.1 [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)] {
  1209. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  1210. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1211. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1212. // CHECK:STDOUT: %struct_type.i.different.loc4_61.1: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.2 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)]
  1213. // CHECK:STDOUT: }
  1214. // CHECK:STDOUT: %x: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = bind_name x, %x.param
  1215. // CHECK:STDOUT: }
  1216. // CHECK:STDOUT: %CallWrongNameStructParam.decl: %CallWrongNameStructParam.type = fn_decl @CallWrongNameStructParam [concrete = constants.%CallWrongNameStructParam] {} {}
  1217. // CHECK:STDOUT: }
  1218. // CHECK:STDOUT:
  1219. // CHECK:STDOUT: generic fn @WrongNameStructParam(%T.loc4_25.1: type) {
  1220. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  1221. // CHECK:STDOUT: %struct_type.i.different.loc4_61.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.2 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)]
  1222. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.i.different.loc4_61.2 [symbolic = %pattern_type (constants.%pattern_type.685)]
  1223. // CHECK:STDOUT:
  1224. // CHECK:STDOUT: !definition:
  1225. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.i.different.loc4_61.2 [symbolic = %require_complete (constants.%require_complete.411)]
  1226. // CHECK:STDOUT:
  1227. // CHECK:STDOUT: fn(%x.param: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different)) {
  1228. // CHECK:STDOUT: !entry:
  1229. // CHECK:STDOUT: return
  1230. // CHECK:STDOUT: }
  1231. // CHECK:STDOUT: }
  1232. // CHECK:STDOUT:
  1233. // CHECK:STDOUT: fn @CallWrongNameStructParam() {
  1234. // CHECK:STDOUT: !entry:
  1235. // CHECK:STDOUT: %WrongNameStructParam.ref: %WrongNameStructParam.type = name_ref WrongNameStructParam, file.%WrongNameStructParam.decl [concrete = constants.%WrongNameStructParam]
  1236. // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8]
  1237. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9]
  1238. // CHECK:STDOUT: %.loc14: %struct_type.i.j = struct_literal (%int_8, %int_9)
  1239. // CHECK:STDOUT: return
  1240. // CHECK:STDOUT: }
  1241. // CHECK:STDOUT:
  1242. // CHECK:STDOUT: specific @WrongNameStructParam(constants.%T) {
  1243. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  1244. // CHECK:STDOUT: %struct_type.i.different.loc4_61.2 => constants.%struct_type.i.different
  1245. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.685
  1246. // CHECK:STDOUT: }
  1247. // CHECK:STDOUT:
  1248. // CHECK:STDOUT: --- fail_todo_deduce_struct_wrong_order.carbon
  1249. // CHECK:STDOUT:
  1250. // CHECK:STDOUT: constants {
  1251. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1252. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1253. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1254. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1255. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1256. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1257. // CHECK:STDOUT: %struct_type.first.second: type = struct_type {.first: %T, .second: %i32} [symbolic]
  1258. // CHECK:STDOUT: %pattern_type.422: type = pattern_type %struct_type.first.second [symbolic]
  1259. // CHECK:STDOUT: %WrongOrderStructParam.type: type = fn_type @WrongOrderStructParam [concrete]
  1260. // CHECK:STDOUT: %WrongOrderStructParam: %WrongOrderStructParam.type = struct_value () [concrete]
  1261. // CHECK:STDOUT: %require_complete.d6e: <witness> = require_complete_type %struct_type.first.second [symbolic]
  1262. // CHECK:STDOUT: %CallWrongOrderStructParam.type: type = fn_type @CallWrongOrderStructParam [concrete]
  1263. // CHECK:STDOUT: %CallWrongOrderStructParam: %CallWrongOrderStructParam.type = struct_value () [concrete]
  1264. // CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [concrete]
  1265. // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete]
  1266. // CHECK:STDOUT: %struct_type.second.first: type = struct_type {.second: Core.IntLiteral, .first: Core.IntLiteral} [concrete]
  1267. // CHECK:STDOUT: }
  1268. // CHECK:STDOUT:
  1269. // CHECK:STDOUT: imports {
  1270. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1271. // CHECK:STDOUT: .Int = %Core.Int
  1272. // CHECK:STDOUT: import Core//prelude
  1273. // CHECK:STDOUT: import Core//prelude/...
  1274. // CHECK:STDOUT: }
  1275. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  1276. // CHECK:STDOUT: }
  1277. // CHECK:STDOUT:
  1278. // CHECK:STDOUT: file {
  1279. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1280. // CHECK:STDOUT: .Core = imports.%Core
  1281. // CHECK:STDOUT: .WrongOrderStructParam = %WrongOrderStructParam.decl
  1282. // CHECK:STDOUT: .CallWrongOrderStructParam = %CallWrongOrderStructParam.decl
  1283. // CHECK:STDOUT: }
  1284. // CHECK:STDOUT: %Core.import = import Core
  1285. // CHECK:STDOUT: %WrongOrderStructParam.decl: %WrongOrderStructParam.type = fn_decl @WrongOrderStructParam [concrete = constants.%WrongOrderStructParam] {
  1286. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1287. // CHECK:STDOUT: %x.patt: @WrongOrderStructParam.%pattern_type (%pattern_type.422) = binding_pattern x [concrete]
  1288. // CHECK:STDOUT: %x.param_patt: @WrongOrderStructParam.%pattern_type (%pattern_type.422) = value_param_pattern %x.patt, call_param0 [concrete]
  1289. // CHECK:STDOUT: } {
  1290. // CHECK:STDOUT: %T.loc4_26.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_26.2 (constants.%T)]
  1291. // CHECK:STDOUT: %x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = value_param call_param0
  1292. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.first.second.loc4_63.1 [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)] {
  1293. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_26.1 [symbolic = %T.loc4_26.2 (constants.%T)]
  1294. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1295. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1296. // CHECK:STDOUT: %struct_type.first.second.loc4_63.1: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.2 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)]
  1297. // CHECK:STDOUT: }
  1298. // CHECK:STDOUT: %x: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = bind_name x, %x.param
  1299. // CHECK:STDOUT: }
  1300. // CHECK:STDOUT: %CallWrongOrderStructParam.decl: %CallWrongOrderStructParam.type = fn_decl @CallWrongOrderStructParam [concrete = constants.%CallWrongOrderStructParam] {} {}
  1301. // CHECK:STDOUT: }
  1302. // CHECK:STDOUT:
  1303. // CHECK:STDOUT: generic fn @WrongOrderStructParam(%T.loc4_26.1: type) {
  1304. // CHECK:STDOUT: %T.loc4_26.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_26.2 (constants.%T)]
  1305. // CHECK:STDOUT: %struct_type.first.second.loc4_63.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.2 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)]
  1306. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.first.second.loc4_63.2 [symbolic = %pattern_type (constants.%pattern_type.422)]
  1307. // CHECK:STDOUT:
  1308. // CHECK:STDOUT: !definition:
  1309. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.first.second.loc4_63.2 [symbolic = %require_complete (constants.%require_complete.d6e)]
  1310. // CHECK:STDOUT:
  1311. // CHECK:STDOUT: fn(%x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second)) {
  1312. // CHECK:STDOUT: !entry:
  1313. // CHECK:STDOUT: return
  1314. // CHECK:STDOUT: }
  1315. // CHECK:STDOUT: }
  1316. // CHECK:STDOUT:
  1317. // CHECK:STDOUT: fn @CallWrongOrderStructParam() {
  1318. // CHECK:STDOUT: !entry:
  1319. // CHECK:STDOUT: %WrongOrderStructParam.ref: %WrongOrderStructParam.type = name_ref WrongOrderStructParam, file.%WrongOrderStructParam.decl [concrete = constants.%WrongOrderStructParam]
  1320. // CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [concrete = constants.%int_11]
  1321. // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete = constants.%int_10]
  1322. // CHECK:STDOUT: %.loc14: %struct_type.second.first = struct_literal (%int_11, %int_10)
  1323. // CHECK:STDOUT: return
  1324. // CHECK:STDOUT: }
  1325. // CHECK:STDOUT:
  1326. // CHECK:STDOUT: specific @WrongOrderStructParam(constants.%T) {
  1327. // CHECK:STDOUT: %T.loc4_26.2 => constants.%T
  1328. // CHECK:STDOUT: %struct_type.first.second.loc4_63.2 => constants.%struct_type.first.second
  1329. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.422
  1330. // CHECK:STDOUT: }
  1331. // CHECK:STDOUT:
  1332. // CHECK:STDOUT: --- fail_deduce_incomplete.carbon
  1333. // CHECK:STDOUT:
  1334. // CHECK:STDOUT: constants {
  1335. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1336. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1337. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic]
  1338. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1339. // CHECK:STDOUT: %pattern_type.a32: type = pattern_type %U [symbolic]
  1340. // CHECK:STDOUT: %ImplicitNotDeducible.type: type = fn_type @ImplicitNotDeducible [concrete]
  1341. // CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [concrete]
  1342. // CHECK:STDOUT: %CallImplicitNotDeducible.type: type = fn_type @CallImplicitNotDeducible [concrete]
  1343. // CHECK:STDOUT: %CallImplicitNotDeducible: %CallImplicitNotDeducible.type = struct_value () [concrete]
  1344. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete]
  1345. // CHECK:STDOUT: }
  1346. // CHECK:STDOUT:
  1347. // CHECK:STDOUT: imports {
  1348. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1349. // CHECK:STDOUT: import Core//prelude
  1350. // CHECK:STDOUT: import Core//prelude/...
  1351. // CHECK:STDOUT: }
  1352. // CHECK:STDOUT: }
  1353. // CHECK:STDOUT:
  1354. // CHECK:STDOUT: file {
  1355. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1356. // CHECK:STDOUT: .Core = imports.%Core
  1357. // CHECK:STDOUT: .ImplicitNotDeducible = %ImplicitNotDeducible.decl
  1358. // CHECK:STDOUT: .CallImplicitNotDeducible = %CallImplicitNotDeducible.decl
  1359. // CHECK:STDOUT: }
  1360. // CHECK:STDOUT: %Core.import = import Core
  1361. // CHECK:STDOUT: %ImplicitNotDeducible.decl: %ImplicitNotDeducible.type = fn_decl @ImplicitNotDeducible [concrete = constants.%ImplicitNotDeducible] {
  1362. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1363. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 1 [concrete]
  1364. // CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%pattern_type.loc6_45 (%pattern_type.7dc) = binding_pattern x [concrete]
  1365. // CHECK:STDOUT: %x.param_patt: @ImplicitNotDeducible.%pattern_type.loc6_45 (%pattern_type.7dc) = value_param_pattern %x.patt, call_param0 [concrete]
  1366. // CHECK:STDOUT: %return.patt: @ImplicitNotDeducible.%pattern_type.loc6_51 (%pattern_type.a32) = return_slot_pattern [concrete]
  1367. // CHECK:STDOUT: %return.param_patt: @ImplicitNotDeducible.%pattern_type.loc6_51 (%pattern_type.a32) = out_param_pattern %return.patt, call_param1 [concrete]
  1368. // CHECK:STDOUT: } {
  1369. // CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc6_35.1 [symbolic = %U.loc6_35.2 (constants.%U)]
  1370. // CHECK:STDOUT: %T.loc6_25.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_25.2 (constants.%T)]
  1371. // CHECK:STDOUT: %U.loc6_35.1: type = bind_symbolic_name U, 1 [symbolic = %U.loc6_35.2 (constants.%U)]
  1372. // CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = value_param call_param0
  1373. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_25.1 [symbolic = %T.loc6_25.2 (constants.%T)]
  1374. // CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = bind_name x, %x.param
  1375. // CHECK:STDOUT: %return.param: ref @ImplicitNotDeducible.%U.loc6_35.2 (%U) = out_param call_param1
  1376. // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%U.loc6_35.2 (%U) = return_slot %return.param
  1377. // CHECK:STDOUT: }
  1378. // CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [concrete = constants.%CallImplicitNotDeducible] {} {}
  1379. // CHECK:STDOUT: }
  1380. // CHECK:STDOUT:
  1381. // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc6_25.1: type, %U.loc6_35.1: type) {
  1382. // CHECK:STDOUT: %T.loc6_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_25.2 (constants.%T)]
  1383. // CHECK:STDOUT: %U.loc6_35.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc6_35.2 (constants.%U)]
  1384. // CHECK:STDOUT: %pattern_type.loc6_45: type = pattern_type %T.loc6_25.2 [symbolic = %pattern_type.loc6_45 (constants.%pattern_type.7dc)]
  1385. // CHECK:STDOUT: %pattern_type.loc6_51: type = pattern_type %U.loc6_35.2 [symbolic = %pattern_type.loc6_51 (constants.%pattern_type.a32)]
  1386. // CHECK:STDOUT:
  1387. // CHECK:STDOUT: fn(%x.param: @ImplicitNotDeducible.%T.loc6_25.2 (%T)) -> @ImplicitNotDeducible.%U.loc6_35.2 (%U);
  1388. // CHECK:STDOUT: }
  1389. // CHECK:STDOUT:
  1390. // CHECK:STDOUT: fn @CallImplicitNotDeducible() {
  1391. // CHECK:STDOUT: !entry:
  1392. // CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [concrete = constants.%ImplicitNotDeducible]
  1393. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42]
  1394. // CHECK:STDOUT: return
  1395. // CHECK:STDOUT: }
  1396. // CHECK:STDOUT:
  1397. // CHECK:STDOUT: specific @ImplicitNotDeducible(constants.%T, constants.%U) {
  1398. // CHECK:STDOUT: %T.loc6_25.2 => constants.%T
  1399. // CHECK:STDOUT: %U.loc6_35.2 => constants.%U
  1400. // CHECK:STDOUT: %pattern_type.loc6_45 => constants.%pattern_type.7dc
  1401. // CHECK:STDOUT: %pattern_type.loc6_51 => constants.%pattern_type.a32
  1402. // CHECK:STDOUT: }
  1403. // CHECK:STDOUT:
  1404. // CHECK:STDOUT: --- fail_deduce_inconsistent.carbon
  1405. // CHECK:STDOUT:
  1406. // CHECK:STDOUT: constants {
  1407. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1408. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1409. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  1410. // CHECK:STDOUT: %ImplicitNotDeducible.type: type = fn_type @ImplicitNotDeducible [concrete]
  1411. // CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [concrete]
  1412. // CHECK:STDOUT: %CallImplicitNotDeducible.type: type = fn_type @CallImplicitNotDeducible [concrete]
  1413. // CHECK:STDOUT: %CallImplicitNotDeducible: %CallImplicitNotDeducible.type = struct_value () [concrete]
  1414. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete]
  1415. // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete]
  1416. // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: Core.IntLiteral} [concrete]
  1417. // CHECK:STDOUT: }
  1418. // CHECK:STDOUT:
  1419. // CHECK:STDOUT: imports {
  1420. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1421. // CHECK:STDOUT: import Core//prelude
  1422. // CHECK:STDOUT: import Core//prelude/...
  1423. // CHECK:STDOUT: }
  1424. // CHECK:STDOUT: }
  1425. // CHECK:STDOUT:
  1426. // CHECK:STDOUT: file {
  1427. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1428. // CHECK:STDOUT: .Core = imports.%Core
  1429. // CHECK:STDOUT: .ImplicitNotDeducible = %ImplicitNotDeducible.decl
  1430. // CHECK:STDOUT: .CallImplicitNotDeducible = %CallImplicitNotDeducible.decl
  1431. // CHECK:STDOUT: }
  1432. // CHECK:STDOUT: %Core.import = import Core
  1433. // CHECK:STDOUT: %ImplicitNotDeducible.decl: %ImplicitNotDeducible.type = fn_decl @ImplicitNotDeducible [concrete = constants.%ImplicitNotDeducible] {
  1434. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1435. // CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.7dc) = binding_pattern x [concrete]
  1436. // CHECK:STDOUT: %x.param_patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.7dc) = value_param_pattern %x.patt, call_param0 [concrete]
  1437. // CHECK:STDOUT: %y.patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.7dc) = binding_pattern y [concrete]
  1438. // CHECK:STDOUT: %y.param_patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.7dc) = value_param_pattern %y.patt, call_param1 [concrete]
  1439. // CHECK:STDOUT: %return.patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.7dc) = return_slot_pattern [concrete]
  1440. // CHECK:STDOUT: %return.param_patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.7dc) = out_param_pattern %return.patt, call_param2 [concrete]
  1441. // CHECK:STDOUT: } {
  1442. // CHECK:STDOUT: %T.ref.loc4_50: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  1443. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  1444. // CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = value_param call_param0
  1445. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  1446. // CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name x, %x.param
  1447. // CHECK:STDOUT: %y.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = value_param call_param1
  1448. // CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  1449. // CHECK:STDOUT: %y: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name y, %y.param
  1450. // CHECK:STDOUT: %return.param: ref @ImplicitNotDeducible.%T.loc4_25.2 (%T) = out_param call_param2
  1451. // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%T.loc4_25.2 (%T) = return_slot %return.param
  1452. // CHECK:STDOUT: }
  1453. // CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [concrete = constants.%CallImplicitNotDeducible] {} {}
  1454. // CHECK:STDOUT: }
  1455. // CHECK:STDOUT:
  1456. // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc4_25.1: type) {
  1457. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  1458. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_25.2 [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  1459. // CHECK:STDOUT:
  1460. // CHECK:STDOUT: fn(%x.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T), %y.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T)) -> @ImplicitNotDeducible.%T.loc4_25.2 (%T);
  1461. // CHECK:STDOUT: }
  1462. // CHECK:STDOUT:
  1463. // CHECK:STDOUT: fn @CallImplicitNotDeducible() {
  1464. // CHECK:STDOUT: !entry:
  1465. // CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [concrete = constants.%ImplicitNotDeducible]
  1466. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42]
  1467. // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12]
  1468. // CHECK:STDOUT: %.loc14: %struct_type.x = struct_literal (%int_12)
  1469. // CHECK:STDOUT: return
  1470. // CHECK:STDOUT: }
  1471. // CHECK:STDOUT:
  1472. // CHECK:STDOUT: specific @ImplicitNotDeducible(constants.%T) {
  1473. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  1474. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  1475. // CHECK:STDOUT: }
  1476. // CHECK:STDOUT:
  1477. // CHECK:STDOUT: --- deduce_nested_generic_class.carbon
  1478. // CHECK:STDOUT:
  1479. // CHECK:STDOUT: constants {
  1480. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  1481. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic]
  1482. // CHECK:STDOUT: %EE: type = class_type @EE [concrete]
  1483. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1484. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1485. // CHECK:STDOUT: %Z.impl_witness.354: <witness> = impl_witness file.%Z.impl_witness_table.loc6 [concrete]
  1486. // CHECK:STDOUT: %E: type = bind_symbolic_name E, 0 [symbolic]
  1487. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1488. // CHECK:STDOUT: %DD.type: type = generic_class_type @DD [concrete]
  1489. // CHECK:STDOUT: %DD.generic: %DD.type = struct_value () [concrete]
  1490. // CHECK:STDOUT: %DD.296: type = class_type @DD, @DD(%E) [symbolic]
  1491. // CHECK:STDOUT: %Z.impl_witness.c98: <witness> = impl_witness file.%Z.impl_witness_table.loc9, @impl.266(%E) [symbolic]
  1492. // CHECK:STDOUT: %D: %Z.type = bind_symbolic_name D, 0 [symbolic]
  1493. // CHECK:STDOUT: %pattern_type.5af: type = pattern_type %Z.type [concrete]
  1494. // CHECK:STDOUT: %CC.type: type = generic_class_type @CC [concrete]
  1495. // CHECK:STDOUT: %CC.generic: %CC.type = struct_value () [concrete]
  1496. // CHECK:STDOUT: %CC.a2f: type = class_type @CC, @CC(%D) [symbolic]
  1497. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %DD.296, @Z [symbolic]
  1498. // CHECK:STDOUT: %Z.facet.aae: %Z.type = facet_value %DD.296, (%Z.lookup_impl_witness) [symbolic]
  1499. // CHECK:STDOUT: %CC.23e: type = class_type @CC, @CC(%Z.facet.aae) [symbolic]
  1500. // CHECK:STDOUT: %Z.impl_witness.b58: <witness> = impl_witness file.%Z.impl_witness_table.loc12, @impl.497(%E) [symbolic]
  1501. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1502. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1503. // CHECK:STDOUT: %DD.689: type = class_type @DD, @DD(%EE) [concrete]
  1504. // CHECK:STDOUT: %Z.impl_witness.0e8: <witness> = impl_witness file.%Z.impl_witness_table.loc9, @impl.266(%EE) [concrete]
  1505. // CHECK:STDOUT: %Z.facet.a96: %Z.type = facet_value %DD.689, (%Z.impl_witness.0e8) [concrete]
  1506. // CHECK:STDOUT: %CC.402: type = class_type @CC, @CC(%Z.facet.a96) [concrete]
  1507. // CHECK:STDOUT: %Z.impl_witness.db1: <witness> = impl_witness file.%Z.impl_witness_table.loc12, @impl.497(%EE) [concrete]
  1508. // CHECK:STDOUT: %Z.facet.49b: %Z.type = facet_value %CC.402, (%Z.impl_witness.db1) [concrete]
  1509. // CHECK:STDOUT: }
  1510. // CHECK:STDOUT:
  1511. // CHECK:STDOUT: imports {
  1512. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1513. // CHECK:STDOUT: import Core//prelude
  1514. // CHECK:STDOUT: import Core//prelude/...
  1515. // CHECK:STDOUT: }
  1516. // CHECK:STDOUT: }
  1517. // CHECK:STDOUT:
  1518. // CHECK:STDOUT: file {
  1519. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1520. // CHECK:STDOUT: .Core = imports.%Core
  1521. // CHECK:STDOUT: .Z = %Z.decl
  1522. // CHECK:STDOUT: .EE = %EE.decl
  1523. // CHECK:STDOUT: .DD = %DD.decl
  1524. // CHECK:STDOUT: .CC = %CC.decl
  1525. // CHECK:STDOUT: .F = %F.decl
  1526. // CHECK:STDOUT: }
  1527. // CHECK:STDOUT: %Core.import = import Core
  1528. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  1529. // CHECK:STDOUT: %EE.decl: type = class_decl @EE [concrete = constants.%EE] {} {}
  1530. // CHECK:STDOUT: impl_decl @impl.a6b [concrete] {} {
  1531. // CHECK:STDOUT: %EE.ref: type = name_ref EE, file.%EE.decl [concrete = constants.%EE]
  1532. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1533. // CHECK:STDOUT: }
  1534. // CHECK:STDOUT: %Z.impl_witness_table.loc6 = impl_witness_table (), @impl.a6b [concrete]
  1535. // CHECK:STDOUT: %Z.impl_witness.loc6: <witness> = impl_witness %Z.impl_witness_table.loc6 [concrete = constants.%Z.impl_witness.354]
  1536. // CHECK:STDOUT: %DD.decl: %DD.type = class_decl @DD [concrete = constants.%DD.generic] {
  1537. // CHECK:STDOUT: %E.patt: %pattern_type.98f = symbolic_binding_pattern E, 0 [concrete]
  1538. // CHECK:STDOUT: } {
  1539. // CHECK:STDOUT: %E.loc8_10.1: type = bind_symbolic_name E, 0 [symbolic = %E.loc8_10.2 (constants.%E)]
  1540. // CHECK:STDOUT: }
  1541. // CHECK:STDOUT: impl_decl @impl.266 [concrete] {
  1542. // CHECK:STDOUT: %E.patt: %pattern_type.98f = symbolic_binding_pattern E, 0 [concrete]
  1543. // CHECK:STDOUT: } {
  1544. // CHECK:STDOUT: %DD.ref: %DD.type = name_ref DD, file.%DD.decl [concrete = constants.%DD.generic]
  1545. // CHECK:STDOUT: %E.ref: type = name_ref E, %E.loc9_14.1 [symbolic = %E.loc9_14.2 (constants.%E)]
  1546. // CHECK:STDOUT: %DD.loc9_28.1: type = class_type @DD, @DD(constants.%E) [symbolic = %DD.loc9_28.2 (constants.%DD.296)]
  1547. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1548. // CHECK:STDOUT: %E.loc9_14.1: type = bind_symbolic_name E, 0 [symbolic = %E.loc9_14.2 (constants.%E)]
  1549. // CHECK:STDOUT: }
  1550. // CHECK:STDOUT: %Z.impl_witness_table.loc9 = impl_witness_table (), @impl.266 [concrete]
  1551. // CHECK:STDOUT: %Z.impl_witness.loc9: <witness> = impl_witness %Z.impl_witness_table.loc9, @impl.266(constants.%E) [symbolic = @impl.266.%Z.impl_witness (constants.%Z.impl_witness.c98)]
  1552. // CHECK:STDOUT: %CC.decl: %CC.type = class_decl @CC [concrete = constants.%CC.generic] {
  1553. // CHECK:STDOUT: %D.patt: %pattern_type.5af = symbolic_binding_pattern D, 0 [concrete]
  1554. // CHECK:STDOUT: } {
  1555. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1556. // CHECK:STDOUT: %D.loc11_10.1: %Z.type = bind_symbolic_name D, 0 [symbolic = %D.loc11_10.2 (constants.%D)]
  1557. // CHECK:STDOUT: }
  1558. // CHECK:STDOUT: impl_decl @impl.497 [concrete] {
  1559. // CHECK:STDOUT: %E.patt: %pattern_type.98f = symbolic_binding_pattern E, 0 [concrete]
  1560. // CHECK:STDOUT: } {
  1561. // CHECK:STDOUT: %CC.ref: %CC.type = name_ref CC, file.%CC.decl [concrete = constants.%CC.generic]
  1562. // CHECK:STDOUT: %DD.ref: %DD.type = name_ref DD, file.%DD.decl [concrete = constants.%DD.generic]
  1563. // CHECK:STDOUT: %E.ref: type = name_ref E, %E.loc12_14.1 [symbolic = %E.loc12_14.2 (constants.%E)]
  1564. // CHECK:STDOUT: %DD.loc12_31.1: type = class_type @DD, @DD(constants.%E) [symbolic = %DD.loc12_31.2 (constants.%DD.296)]
  1565. // CHECK:STDOUT: %Z.facet.loc12_32.1: %Z.type = facet_value constants.%DD.296, (constants.%Z.lookup_impl_witness) [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.aae)]
  1566. // CHECK:STDOUT: %.loc12: %Z.type = converted %DD.loc12_31.1, %Z.facet.loc12_32.1 [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.aae)]
  1567. // CHECK:STDOUT: %CC.loc12_32.1: type = class_type @CC, @CC(constants.%Z.facet.aae) [symbolic = %CC.loc12_32.2 (constants.%CC.23e)]
  1568. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1569. // CHECK:STDOUT: %E.loc12_14.1: type = bind_symbolic_name E, 0 [symbolic = %E.loc12_14.2 (constants.%E)]
  1570. // CHECK:STDOUT: }
  1571. // CHECK:STDOUT: %Z.impl_witness_table.loc12 = impl_witness_table (), @impl.497 [concrete]
  1572. // CHECK:STDOUT: %Z.impl_witness.loc12: <witness> = impl_witness %Z.impl_witness_table.loc12, @impl.497(constants.%E) [symbolic = @impl.497.%Z.impl_witness (constants.%Z.impl_witness.b58)]
  1573. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1574. // CHECK:STDOUT: }
  1575. // CHECK:STDOUT:
  1576. // CHECK:STDOUT: interface @Z {
  1577. // CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1578. // CHECK:STDOUT:
  1579. // CHECK:STDOUT: !members:
  1580. // CHECK:STDOUT: .Self = %Self
  1581. // CHECK:STDOUT: witness = ()
  1582. // CHECK:STDOUT: }
  1583. // CHECK:STDOUT:
  1584. // CHECK:STDOUT: impl @impl.a6b: %EE.ref as %Z.ref {
  1585. // CHECK:STDOUT: !members:
  1586. // CHECK:STDOUT: witness = file.%Z.impl_witness.loc6
  1587. // CHECK:STDOUT: }
  1588. // CHECK:STDOUT:
  1589. // CHECK:STDOUT: generic impl @impl.266(%E.loc9_14.1: type) {
  1590. // CHECK:STDOUT: %E.loc9_14.2: type = bind_symbolic_name E, 0 [symbolic = %E.loc9_14.2 (constants.%E)]
  1591. // CHECK:STDOUT: %DD.loc9_28.2: type = class_type @DD, @DD(%E.loc9_14.2) [symbolic = %DD.loc9_28.2 (constants.%DD.296)]
  1592. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table.loc9, @impl.266(%E.loc9_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.c98)]
  1593. // CHECK:STDOUT:
  1594. // CHECK:STDOUT: !definition:
  1595. // CHECK:STDOUT:
  1596. // CHECK:STDOUT: impl: %DD.loc9_28.1 as %Z.ref {
  1597. // CHECK:STDOUT: !members:
  1598. // CHECK:STDOUT: witness = file.%Z.impl_witness.loc9
  1599. // CHECK:STDOUT: }
  1600. // CHECK:STDOUT: }
  1601. // CHECK:STDOUT:
  1602. // CHECK:STDOUT: generic impl @impl.497(%E.loc12_14.1: type) {
  1603. // CHECK:STDOUT: %E.loc12_14.2: type = bind_symbolic_name E, 0 [symbolic = %E.loc12_14.2 (constants.%E)]
  1604. // CHECK:STDOUT: %DD.loc12_31.2: type = class_type @DD, @DD(%E.loc12_14.2) [symbolic = %DD.loc12_31.2 (constants.%DD.296)]
  1605. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %DD.loc12_31.2, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
  1606. // CHECK:STDOUT: %Z.facet.loc12_32.2: %Z.type = facet_value %DD.loc12_31.2, (%Z.lookup_impl_witness) [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.aae)]
  1607. // CHECK:STDOUT: %CC.loc12_32.2: type = class_type @CC, @CC(%Z.facet.loc12_32.2) [symbolic = %CC.loc12_32.2 (constants.%CC.23e)]
  1608. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table.loc12, @impl.497(%E.loc12_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.b58)]
  1609. // CHECK:STDOUT:
  1610. // CHECK:STDOUT: !definition:
  1611. // CHECK:STDOUT:
  1612. // CHECK:STDOUT: impl: %CC.loc12_32.1 as %Z.ref {
  1613. // CHECK:STDOUT: !members:
  1614. // CHECK:STDOUT: witness = file.%Z.impl_witness.loc12
  1615. // CHECK:STDOUT: }
  1616. // CHECK:STDOUT: }
  1617. // CHECK:STDOUT:
  1618. // CHECK:STDOUT: class @EE {
  1619. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1620. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1621. // CHECK:STDOUT: complete_type_witness = %complete_type
  1622. // CHECK:STDOUT:
  1623. // CHECK:STDOUT: !members:
  1624. // CHECK:STDOUT: .Self = constants.%EE
  1625. // CHECK:STDOUT: }
  1626. // CHECK:STDOUT:
  1627. // CHECK:STDOUT: generic class @DD(%E.loc8_10.1: type) {
  1628. // CHECK:STDOUT: %E.loc8_10.2: type = bind_symbolic_name E, 0 [symbolic = %E.loc8_10.2 (constants.%E)]
  1629. // CHECK:STDOUT:
  1630. // CHECK:STDOUT: !definition:
  1631. // CHECK:STDOUT:
  1632. // CHECK:STDOUT: class {
  1633. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1634. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1635. // CHECK:STDOUT: complete_type_witness = %complete_type
  1636. // CHECK:STDOUT:
  1637. // CHECK:STDOUT: !members:
  1638. // CHECK:STDOUT: .Self = constants.%DD.296
  1639. // CHECK:STDOUT: }
  1640. // CHECK:STDOUT: }
  1641. // CHECK:STDOUT:
  1642. // CHECK:STDOUT: generic class @CC(%D.loc11_10.1: %Z.type) {
  1643. // CHECK:STDOUT: %D.loc11_10.2: %Z.type = bind_symbolic_name D, 0 [symbolic = %D.loc11_10.2 (constants.%D)]
  1644. // CHECK:STDOUT:
  1645. // CHECK:STDOUT: !definition:
  1646. // CHECK:STDOUT:
  1647. // CHECK:STDOUT: class {
  1648. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1649. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  1650. // CHECK:STDOUT: complete_type_witness = %complete_type
  1651. // CHECK:STDOUT:
  1652. // CHECK:STDOUT: !members:
  1653. // CHECK:STDOUT: .Self = constants.%CC.a2f
  1654. // CHECK:STDOUT: }
  1655. // CHECK:STDOUT: }
  1656. // CHECK:STDOUT:
  1657. // CHECK:STDOUT: fn @F() {
  1658. // CHECK:STDOUT: !entry:
  1659. // CHECK:STDOUT: %CC.ref: %CC.type = name_ref CC, file.%CC.decl [concrete = constants.%CC.generic]
  1660. // CHECK:STDOUT: %DD.ref: %DD.type = name_ref DD, file.%DD.decl [concrete = constants.%DD.generic]
  1661. // CHECK:STDOUT: %EE.ref: type = name_ref EE, file.%EE.decl [concrete = constants.%EE]
  1662. // CHECK:STDOUT: %DD: type = class_type @DD, @DD(constants.%EE) [concrete = constants.%DD.689]
  1663. // CHECK:STDOUT: %Z.facet.loc15_12: %Z.type = facet_value constants.%DD.689, (constants.%Z.impl_witness.0e8) [concrete = constants.%Z.facet.a96]
  1664. // CHECK:STDOUT: %.loc15_12: %Z.type = converted %DD, %Z.facet.loc15_12 [concrete = constants.%Z.facet.a96]
  1665. // CHECK:STDOUT: %CC: type = class_type @CC, @CC(constants.%Z.facet.a96) [concrete = constants.%CC.402]
  1666. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1667. // CHECK:STDOUT: %Z.facet.loc15_14: %Z.type = facet_value constants.%CC.402, (constants.%Z.impl_witness.db1) [concrete = constants.%Z.facet.49b]
  1668. // CHECK:STDOUT: %.loc15_14: %Z.type = converted %CC, %Z.facet.loc15_14 [concrete = constants.%Z.facet.49b]
  1669. // CHECK:STDOUT: return
  1670. // CHECK:STDOUT: }
  1671. // CHECK:STDOUT:
  1672. // CHECK:STDOUT: specific @DD(constants.%E) {
  1673. // CHECK:STDOUT: %E.loc8_10.2 => constants.%E
  1674. // CHECK:STDOUT: }
  1675. // CHECK:STDOUT:
  1676. // CHECK:STDOUT: specific @impl.266(constants.%E) {
  1677. // CHECK:STDOUT: %E.loc9_14.2 => constants.%E
  1678. // CHECK:STDOUT: %DD.loc9_28.2 => constants.%DD.296
  1679. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.c98
  1680. // CHECK:STDOUT:
  1681. // CHECK:STDOUT: !definition:
  1682. // CHECK:STDOUT: }
  1683. // CHECK:STDOUT:
  1684. // CHECK:STDOUT: specific @CC(constants.%D) {
  1685. // CHECK:STDOUT: %D.loc11_10.2 => constants.%D
  1686. // CHECK:STDOUT: }
  1687. // CHECK:STDOUT:
  1688. // CHECK:STDOUT: specific @CC(constants.%Z.facet.aae) {
  1689. // CHECK:STDOUT: %D.loc11_10.2 => constants.%Z.facet.aae
  1690. // CHECK:STDOUT: }
  1691. // CHECK:STDOUT:
  1692. // CHECK:STDOUT: specific @impl.497(constants.%E) {
  1693. // CHECK:STDOUT: %E.loc12_14.2 => constants.%E
  1694. // CHECK:STDOUT: %DD.loc12_31.2 => constants.%DD.296
  1695. // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness
  1696. // CHECK:STDOUT: %Z.facet.loc12_32.2 => constants.%Z.facet.aae
  1697. // CHECK:STDOUT: %CC.loc12_32.2 => constants.%CC.23e
  1698. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.b58
  1699. // CHECK:STDOUT: }
  1700. // CHECK:STDOUT:
  1701. // CHECK:STDOUT: specific @DD(constants.%EE) {
  1702. // CHECK:STDOUT: %E.loc8_10.2 => constants.%EE
  1703. // CHECK:STDOUT: }
  1704. // CHECK:STDOUT:
  1705. // CHECK:STDOUT: specific @impl.266(constants.%EE) {
  1706. // CHECK:STDOUT: %E.loc9_14.2 => constants.%EE
  1707. // CHECK:STDOUT: %DD.loc9_28.2 => constants.%DD.689
  1708. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.0e8
  1709. // CHECK:STDOUT:
  1710. // CHECK:STDOUT: !definition:
  1711. // CHECK:STDOUT: }
  1712. // CHECK:STDOUT:
  1713. // CHECK:STDOUT: specific @CC(constants.%Z.facet.a96) {
  1714. // CHECK:STDOUT: %D.loc11_10.2 => constants.%Z.facet.a96
  1715. // CHECK:STDOUT: }
  1716. // CHECK:STDOUT:
  1717. // CHECK:STDOUT: specific @impl.497(constants.%EE) {
  1718. // CHECK:STDOUT: %E.loc12_14.2 => constants.%EE
  1719. // CHECK:STDOUT: %DD.loc12_31.2 => constants.%DD.689
  1720. // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.impl_witness.0e8
  1721. // CHECK:STDOUT: %Z.facet.loc12_32.2 => constants.%Z.facet.a96
  1722. // CHECK:STDOUT: %CC.loc12_32.2 => constants.%CC.402
  1723. // CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.db1
  1724. // CHECK:STDOUT:
  1725. // CHECK:STDOUT: !definition:
  1726. // CHECK:STDOUT: }
  1727. // CHECK:STDOUT: