deduce.carbon 131 KB

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