deduce.carbon 125 KB

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