deduce.carbon 135 KB

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