deduce.carbon 127 KB

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