import_generic.carbon 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_generic.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_generic.carbon
  10. // --- import_generic.carbon
  11. library "[[@TEST_NAME]]";
  12. class C {}
  13. interface I(T:! type) {}
  14. // Has both declaration and definition.
  15. impl forall [T:! type] C as I(T);
  16. impl forall [T:! type] C as I(T) {}
  17. // Only has definition.
  18. impl forall [T:! type] C as I(T*) {}
  19. // --- fail_import_generic.impl.carbon
  20. impl library "[[@TEST_NAME]]";
  21. // CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  22. // CHECK:STDERR: impl forall [T:! type] C as I(T);
  23. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. // CHECK:STDERR:
  25. impl forall [T:! type] C as I(T);
  26. // CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  27. // CHECK:STDERR: impl forall [T:! type] C as I(T) {}
  28. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  29. // CHECK:STDERR:
  30. impl forall [T:! type] C as I(T) {}
  31. // CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  32. // CHECK:STDERR: impl forall [T:! type] C as I(T*);
  33. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  34. // CHECK:STDERR:
  35. impl forall [T:! type] C as I(T*);
  36. // CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  37. // CHECK:STDERR: impl forall [T:! type] C as I(T*) {}
  38. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39. // CHECK:STDERR:
  40. impl forall [T:! type] C as I(T*) {}
  41. // --- fail_import_generic_decl.carbon
  42. library "[[@TEST_NAME]]";
  43. class D {}
  44. interface J(T:! type) {}
  45. // CHECK:STDERR: fail_import_generic_decl.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition]
  46. // CHECK:STDERR: impl forall [T:! type] D as J(T);
  47. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. // CHECK:STDERR:
  49. impl forall [T:! type] D as J(T);
  50. // CHECK:STDERR: fail_import_generic_decl.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition]
  51. // CHECK:STDERR: impl forall [T:! type] D as J(T*);
  52. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  53. // CHECK:STDERR:
  54. impl forall [T:! type] D as J(T*);
  55. // --- fail_import_generic_decl.impl.carbon
  56. impl library "[[@TEST_NAME]]";
  57. // CHECK:STDERR: fail_import_generic_decl.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  58. // CHECK:STDERR: impl forall [T:! type] D as J(T);
  59. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  60. // CHECK:STDERR:
  61. impl forall [T:! type] D as J(T);
  62. // CHECK:STDERR: fail_import_generic_decl.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  63. // CHECK:STDERR: impl forall [T:! type] D as J(T) {}
  64. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  65. // CHECK:STDERR:
  66. impl forall [T:! type] D as J(T) {}
  67. // CHECK:STDERR: fail_import_generic_decl.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  68. // CHECK:STDERR: impl forall [T:! type] D as J(T*);
  69. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  70. // CHECK:STDERR:
  71. impl forall [T:! type] D as J(T*);
  72. // CHECK:STDERR: fail_import_generic_decl.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  73. // CHECK:STDERR: impl forall [T:! type] D as J(T*) {}
  74. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  75. // CHECK:STDERR:
  76. impl forall [T:! type] D as J(T*) {}
  77. // CHECK:STDOUT: --- import_generic.carbon
  78. // CHECK:STDOUT:
  79. // CHECK:STDOUT: constants {
  80. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  81. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  82. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  83. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  84. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  85. // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [concrete]
  86. // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [concrete]
  87. // CHECK:STDOUT: %I.type.325: type = facet_type <@I, @I(%T)> [symbolic]
  88. // CHECK:STDOUT: %Self.209: %I.type.325 = bind_symbolic_name Self, 1 [symbolic]
  89. // CHECK:STDOUT: %impl_witness.eff: <witness> = impl_witness (), @impl.084(%T) [symbolic]
  90. // CHECK:STDOUT: %require_complete.cfe: <witness> = require_complete_type %I.type.325 [symbolic]
  91. // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
  92. // CHECK:STDOUT: %I.type.0e2: type = facet_type <@I, @I(%ptr)> [symbolic]
  93. // CHECK:STDOUT: %Self.fb4: %I.type.0e2 = bind_symbolic_name Self, 1 [symbolic]
  94. // CHECK:STDOUT: %require_complete.0e6: <witness> = require_complete_type %I.type.0e2 [symbolic]
  95. // CHECK:STDOUT: %impl_witness.465: <witness> = impl_witness (), @impl.cd2(%T) [symbolic]
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT:
  98. // CHECK:STDOUT: file {
  99. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  100. // CHECK:STDOUT: .C = %C.decl
  101. // CHECK:STDOUT: .I = %I.decl
  102. // CHECK:STDOUT: }
  103. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  104. // CHECK:STDOUT: %I.decl: %I.type.dac = interface_decl @I [concrete = constants.%I.generic] {
  105. // CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt)]
  106. // CHECK:STDOUT: } {
  107. // CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T)]
  108. // CHECK:STDOUT: }
  109. // CHECK:STDOUT: impl_decl @impl.084 [concrete] {
  110. // CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  111. // CHECK:STDOUT: } {
  112. // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
  113. // CHECK:STDOUT: %I.ref.loc8: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  114. // CHECK:STDOUT: %T.ref.loc8: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)]
  115. // CHECK:STDOUT: %I.type.loc8_32.1: type = facet_type <@I, @I(constants.%T)> [symbolic = %I.type.loc8_32.2 (constants.%I.type.325)]
  116. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  117. // CHECK:STDOUT: }
  118. // CHECK:STDOUT: %impl_witness.loc8: <witness> = impl_witness (), @impl.084(constants.%T) [symbolic = @impl.084.%impl_witness (constants.%impl_witness.eff)]
  119. // CHECK:STDOUT: impl_decl @impl.084 [concrete] {
  120. // CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  121. // CHECK:STDOUT: } {
  122. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [concrete = constants.%C]
  123. // CHECK:STDOUT: %I.ref.loc9: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  124. // CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc9 [symbolic = %T.loc8_14.2 (constants.%T)]
  125. // CHECK:STDOUT: %I.type.loc9: type = facet_type <@I, @I(constants.%T)> [symbolic = %I.type.loc8_32.2 (constants.%I.type.325)]
  126. // CHECK:STDOUT: %T.loc9: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT: impl_decl @impl.cd2 [concrete] {
  129. // CHECK:STDOUT: %T.patt.loc12_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt)]
  130. // CHECK:STDOUT: } {
  131. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  132. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  133. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_14.1 [symbolic = %T.loc12_14.2 (constants.%T)]
  134. // CHECK:STDOUT: %ptr.loc12_32.1: type = ptr_type %T.ref [symbolic = %ptr.loc12_32.2 (constants.%ptr)]
  135. // CHECK:STDOUT: %I.type.loc12_33.1: type = facet_type <@I, @I(constants.%ptr)> [symbolic = %I.type.loc12_33.2 (constants.%I.type.0e2)]
  136. // CHECK:STDOUT: %T.loc12_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.2 (constants.%T)]
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT: %impl_witness.loc12: <witness> = impl_witness (), @impl.cd2(constants.%T) [symbolic = @impl.cd2.%impl_witness (constants.%impl_witness.465)]
  139. // CHECK:STDOUT: }
  140. // CHECK:STDOUT:
  141. // CHECK:STDOUT: generic interface @I(%T.loc5_13.1: type) {
  142. // CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T)]
  143. // CHECK:STDOUT: %T.patt.loc5_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt)]
  144. // CHECK:STDOUT:
  145. // CHECK:STDOUT: !definition:
  146. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T.loc5_13.2)> [symbolic = %I.type (constants.%I.type.325)]
  147. // CHECK:STDOUT: %Self.2: @I.%I.type (%I.type.325) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209)]
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: interface {
  150. // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.325) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209)]
  151. // CHECK:STDOUT:
  152. // CHECK:STDOUT: !members:
  153. // CHECK:STDOUT: .Self = %Self.1
  154. // CHECK:STDOUT: witness = ()
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: generic impl @impl.084(%T.loc8_14.1: type) {
  159. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  160. // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  161. // CHECK:STDOUT: %I.type.loc8_32.2: type = facet_type <@I, @I(%T.loc8_14.2)> [symbolic = %I.type.loc8_32.2 (constants.%I.type.325)]
  162. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.084(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness.eff)]
  163. // CHECK:STDOUT:
  164. // CHECK:STDOUT: !definition:
  165. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.084.%I.type.loc8_32.2 (%I.type.325) [symbolic = %require_complete (constants.%require_complete.cfe)]
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: impl: %C.ref.loc8 as %I.type.loc8_32.1 {
  168. // CHECK:STDOUT: !members:
  169. // CHECK:STDOUT: witness = file.%impl_witness.loc8
  170. // CHECK:STDOUT: }
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT:
  173. // CHECK:STDOUT: generic impl @impl.cd2(%T.loc12_14.1: type) {
  174. // CHECK:STDOUT: %T.loc12_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.2 (constants.%T)]
  175. // CHECK:STDOUT: %T.patt.loc12_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt)]
  176. // CHECK:STDOUT: %ptr.loc12_32.2: type = ptr_type %T.loc12_14.2 [symbolic = %ptr.loc12_32.2 (constants.%ptr)]
  177. // CHECK:STDOUT: %I.type.loc12_33.2: type = facet_type <@I, @I(%ptr.loc12_32.2)> [symbolic = %I.type.loc12_33.2 (constants.%I.type.0e2)]
  178. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.cd2.%I.type.loc12_33.2 (%I.type.0e2) [symbolic = %require_complete (constants.%require_complete.0e6)]
  179. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.cd2(%T.loc12_14.2) [symbolic = %impl_witness (constants.%impl_witness.465)]
  180. // CHECK:STDOUT:
  181. // CHECK:STDOUT: !definition:
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: impl: %C.ref as %I.type.loc12_33.1 {
  184. // CHECK:STDOUT: !members:
  185. // CHECK:STDOUT: witness = file.%impl_witness.loc12
  186. // CHECK:STDOUT: }
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT:
  189. // CHECK:STDOUT: class @C {
  190. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  191. // CHECK:STDOUT: complete_type_witness = %complete_type
  192. // CHECK:STDOUT:
  193. // CHECK:STDOUT: !members:
  194. // CHECK:STDOUT: .Self = constants.%C
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT:
  197. // CHECK:STDOUT: specific @I(constants.%T) {
  198. // CHECK:STDOUT: %T.loc5_13.2 => constants.%T
  199. // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.patt
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: !definition:
  202. // CHECK:STDOUT: %I.type => constants.%I.type.325
  203. // CHECK:STDOUT: %Self.2 => constants.%Self.209
  204. // CHECK:STDOUT: }
  205. // CHECK:STDOUT:
  206. // CHECK:STDOUT: specific @I(%T.loc5_13.2) {}
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: specific @impl.084(constants.%T) {
  209. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  210. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T.patt
  211. // CHECK:STDOUT: %I.type.loc8_32.2 => constants.%I.type.325
  212. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.eff
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT:
  215. // CHECK:STDOUT: specific @I(@impl.084.%T.loc8_14.2) {}
  216. // CHECK:STDOUT:
  217. // CHECK:STDOUT: specific @impl.084(%T.loc8_14.2) {}
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: specific @I(constants.%ptr) {
  220. // CHECK:STDOUT: %T.loc5_13.2 => constants.%ptr
  221. // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.patt
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: !definition:
  224. // CHECK:STDOUT: %I.type => constants.%I.type.0e2
  225. // CHECK:STDOUT: %Self.2 => constants.%Self.fb4
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: specific @impl.cd2(constants.%T) {
  229. // CHECK:STDOUT: %T.loc12_14.2 => constants.%T
  230. // CHECK:STDOUT: %T.patt.loc12_14.2 => constants.%T.patt
  231. // CHECK:STDOUT: %ptr.loc12_32.2 => constants.%ptr
  232. // CHECK:STDOUT: %I.type.loc12_33.2 => constants.%I.type.0e2
  233. // CHECK:STDOUT: %require_complete => constants.%require_complete.0e6
  234. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.465
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: specific @I(@impl.cd2.%ptr.loc12_32.2) {}
  238. // CHECK:STDOUT:
  239. // CHECK:STDOUT: specific @impl.cd2(%T.loc12_14.2) {}
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: --- fail_import_generic.impl.carbon
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: constants {
  244. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  245. // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [concrete]
  246. // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [concrete]
  247. // CHECK:STDOUT: %I.type.325: type = facet_type <@I, @I(%T)> [symbolic]
  248. // CHECK:STDOUT: %Self.209: %I.type.325 = bind_symbolic_name Self, 1 [symbolic]
  249. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  250. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  251. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  252. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  253. // CHECK:STDOUT: %impl_witness.eff58b.1: <witness> = impl_witness (), @impl.08450a.1(%T) [symbolic]
  254. // CHECK:STDOUT: %require_complete.cfe: <witness> = require_complete_type %I.type.325 [symbolic]
  255. // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
  256. // CHECK:STDOUT: %I.type.0e2: type = facet_type <@I, @I(%ptr)> [symbolic]
  257. // CHECK:STDOUT: %require_complete.0e6: <witness> = require_complete_type %I.type.0e2 [symbolic]
  258. // CHECK:STDOUT: %impl_witness.46542c.1: <witness> = impl_witness (), @impl.cd2fdc.1(%T) [symbolic]
  259. // CHECK:STDOUT: %Self.fb4: %I.type.0e2 = bind_symbolic_name Self, 1 [symbolic]
  260. // CHECK:STDOUT: %impl_witness.eff58b.2: <witness> = impl_witness (), @impl.08450a.2(%T) [symbolic]
  261. // CHECK:STDOUT: %impl_witness.eff58b.3: <witness> = impl_witness (), @impl.08450a.3(%T) [symbolic]
  262. // CHECK:STDOUT: %impl_witness.46542c.2: <witness> = impl_witness (), @impl.cd2fdc.2(%T) [symbolic]
  263. // CHECK:STDOUT: %impl_witness.46542c.3: <witness> = impl_witness (), @impl.cd2fdc.3(%T) [symbolic]
  264. // CHECK:STDOUT: }
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: imports {
  267. // CHECK:STDOUT: %Main.C: type = import_ref Main//import_generic, C, loaded [concrete = constants.%C]
  268. // CHECK:STDOUT: %Main.I: %I.type.dac = import_ref Main//import_generic, I, loaded [concrete = constants.%I.generic]
  269. // CHECK:STDOUT: %Main.import_ref.5ab3ec.1: type = import_ref Main//import_generic, loc5_13, loaded [symbolic = @I.%T (constants.%T)]
  270. // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//import_generic, inst30 [no loc], unloaded
  271. // CHECK:STDOUT: %Main.import_ref.003 = import_ref Main//import_generic, loc8_33, unloaded
  272. // CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//import_generic, loc4_10, loaded [concrete = constants.%complete_type]
  273. // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//import_generic, inst15 [no loc], unloaded
  274. // CHECK:STDOUT: %Main.import_ref.5ab3ec.2: type = import_ref Main//import_generic, loc8_14, loaded [symbolic = @impl.08450a.1.%T (constants.%T)]
  275. // CHECK:STDOUT: %Main.import_ref.29aca8.1: type = import_ref Main//import_generic, loc8_24, loaded [concrete = constants.%C]
  276. // CHECK:STDOUT: %Main.import_ref.4be: type = import_ref Main//import_generic, loc8_32, loaded [symbolic = @impl.08450a.1.%I.type (constants.%I.type.325)]
  277. // CHECK:STDOUT: %Main.import_ref.4e1 = import_ref Main//import_generic, loc12_35, unloaded
  278. // CHECK:STDOUT: %Main.import_ref.5ab3ec.3: type = import_ref Main//import_generic, loc12_14, loaded [symbolic = @impl.cd2fdc.1.%T (constants.%T)]
  279. // CHECK:STDOUT: %Main.import_ref.29aca8.2: type = import_ref Main//import_generic, loc12_24, loaded [concrete = constants.%C]
  280. // CHECK:STDOUT: %Main.import_ref.3e2: type = import_ref Main//import_generic, loc12_33, loaded [symbolic = @impl.cd2fdc.1.%I.type (constants.%I.type.0e2)]
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: file {
  284. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  285. // CHECK:STDOUT: .C = imports.%Main.C
  286. // CHECK:STDOUT: .I = imports.%Main.I
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT: %default.import.loc2_30.1 = import <none>
  289. // CHECK:STDOUT: %default.import.loc2_30.2 = import <none>
  290. // CHECK:STDOUT: impl_decl @impl.08450a.2 [concrete] {
  291. // CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  292. // CHECK:STDOUT: } {
  293. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
  294. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, imports.%Main.I [concrete = constants.%I.generic]
  295. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)]
  296. // CHECK:STDOUT: %I.type.loc8_32.1: type = facet_type <@I, @I(constants.%T)> [symbolic = %I.type.loc8_32.2 (constants.%I.type.325)]
  297. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  298. // CHECK:STDOUT: }
  299. // CHECK:STDOUT: %impl_witness.loc8: <witness> = impl_witness (), @impl.08450a.2(constants.%T) [symbolic = @impl.08450a.2.%impl_witness (constants.%impl_witness.eff58b.2)]
  300. // CHECK:STDOUT: impl_decl @impl.08450a.3 [concrete] {
  301. // CHECK:STDOUT: %T.patt.loc14_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)]
  302. // CHECK:STDOUT: } {
  303. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
  304. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, imports.%Main.I [concrete = constants.%I.generic]
  305. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc14_14.1 [symbolic = %T.loc14_14.2 (constants.%T)]
  306. // CHECK:STDOUT: %I.type.loc14_32.1: type = facet_type <@I, @I(constants.%T)> [symbolic = %I.type.loc14_32.2 (constants.%I.type.325)]
  307. // CHECK:STDOUT: %T.loc14_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T)]
  308. // CHECK:STDOUT: }
  309. // CHECK:STDOUT: %impl_witness.loc14: <witness> = impl_witness (), @impl.08450a.3(constants.%T) [symbolic = @impl.08450a.3.%impl_witness (constants.%impl_witness.eff58b.3)]
  310. // CHECK:STDOUT: impl_decl @impl.cd2fdc.2 [concrete] {
  311. // CHECK:STDOUT: %T.patt.loc20_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)]
  312. // CHECK:STDOUT: } {
  313. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
  314. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, imports.%Main.I [concrete = constants.%I.generic]
  315. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc20_14.1 [symbolic = %T.loc20_14.2 (constants.%T)]
  316. // CHECK:STDOUT: %ptr.loc20_32.1: type = ptr_type %T.ref [symbolic = %ptr.loc20_32.2 (constants.%ptr)]
  317. // CHECK:STDOUT: %I.type.loc20_33.1: type = facet_type <@I, @I(constants.%ptr)> [symbolic = %I.type.loc20_33.2 (constants.%I.type.0e2)]
  318. // CHECK:STDOUT: %T.loc20_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc20_14.2 (constants.%T)]
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT: %impl_witness.loc20: <witness> = impl_witness (), @impl.cd2fdc.2(constants.%T) [symbolic = @impl.cd2fdc.2.%impl_witness (constants.%impl_witness.46542c.2)]
  321. // CHECK:STDOUT: impl_decl @impl.cd2fdc.3 [concrete] {
  322. // CHECK:STDOUT: %T.patt.loc26_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)]
  323. // CHECK:STDOUT: } {
  324. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
  325. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, imports.%Main.I [concrete = constants.%I.generic]
  326. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc26_14.1 [symbolic = %T.loc26_14.2 (constants.%T)]
  327. // CHECK:STDOUT: %ptr.loc26_32.1: type = ptr_type %T.ref [symbolic = %ptr.loc26_32.2 (constants.%ptr)]
  328. // CHECK:STDOUT: %I.type.loc26_33.1: type = facet_type <@I, @I(constants.%ptr)> [symbolic = %I.type.loc26_33.2 (constants.%I.type.0e2)]
  329. // CHECK:STDOUT: %T.loc26_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc26_14.2 (constants.%T)]
  330. // CHECK:STDOUT: }
  331. // CHECK:STDOUT: %impl_witness.loc26: <witness> = impl_witness (), @impl.cd2fdc.3(constants.%T) [symbolic = @impl.cd2fdc.3.%impl_witness (constants.%impl_witness.46542c.3)]
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT:
  334. // CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.5ab3ec.1: type) [from "import_generic.carbon"] {
  335. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  336. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  337. // CHECK:STDOUT:
  338. // CHECK:STDOUT: !definition:
  339. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.325)]
  340. // CHECK:STDOUT: %Self: @I.%I.type (%I.type.325) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.209)]
  341. // CHECK:STDOUT:
  342. // CHECK:STDOUT: interface {
  343. // CHECK:STDOUT: !members:
  344. // CHECK:STDOUT: .Self = imports.%Main.import_ref.884
  345. // CHECK:STDOUT: witness = ()
  346. // CHECK:STDOUT: }
  347. // CHECK:STDOUT: }
  348. // CHECK:STDOUT:
  349. // CHECK:STDOUT: generic impl @impl.08450a.1(imports.%Main.import_ref.5ab3ec.2: type) [from "import_generic.carbon"] {
  350. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  351. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  352. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.325)]
  353. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.08450a.1(%T) [symbolic = %impl_witness (constants.%impl_witness.eff58b.1)]
  354. // CHECK:STDOUT:
  355. // CHECK:STDOUT: !definition:
  356. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.08450a.1.%I.type (%I.type.325) [symbolic = %require_complete (constants.%require_complete.cfe)]
  357. // CHECK:STDOUT:
  358. // CHECK:STDOUT: impl: imports.%Main.import_ref.29aca8.1 as imports.%Main.import_ref.4be {
  359. // CHECK:STDOUT: !members:
  360. // CHECK:STDOUT: witness = imports.%Main.import_ref.003
  361. // CHECK:STDOUT: }
  362. // CHECK:STDOUT: }
  363. // CHECK:STDOUT:
  364. // CHECK:STDOUT: generic impl @impl.cd2fdc.1(imports.%Main.import_ref.5ab3ec.3: type) [from "import_generic.carbon"] {
  365. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  366. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  367. // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic = %ptr (constants.%ptr)]
  368. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%ptr)> [symbolic = %I.type (constants.%I.type.0e2)]
  369. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.cd2fdc.1.%I.type (%I.type.0e2) [symbolic = %require_complete (constants.%require_complete.0e6)]
  370. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.cd2fdc.1(%T) [symbolic = %impl_witness (constants.%impl_witness.46542c.1)]
  371. // CHECK:STDOUT:
  372. // CHECK:STDOUT: !definition:
  373. // CHECK:STDOUT:
  374. // CHECK:STDOUT: impl: imports.%Main.import_ref.29aca8.2 as imports.%Main.import_ref.3e2 {
  375. // CHECK:STDOUT: !members:
  376. // CHECK:STDOUT: witness = imports.%Main.import_ref.4e1
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT: }
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: generic impl @impl.08450a.2(%T.loc8_14.1: type) {
  381. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  382. // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  383. // CHECK:STDOUT: %I.type.loc8_32.2: type = facet_type <@I, @I(%T.loc8_14.2)> [symbolic = %I.type.loc8_32.2 (constants.%I.type.325)]
  384. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.08450a.2(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness.eff58b.2)]
  385. // CHECK:STDOUT:
  386. // CHECK:STDOUT: impl: %C.ref as %I.type.loc8_32.1;
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT:
  389. // CHECK:STDOUT: generic impl @impl.08450a.3(%T.loc14_14.1: type) {
  390. // CHECK:STDOUT: %T.loc14_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T)]
  391. // CHECK:STDOUT: %T.patt.loc14_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)]
  392. // CHECK:STDOUT: %I.type.loc14_32.2: type = facet_type <@I, @I(%T.loc14_14.2)> [symbolic = %I.type.loc14_32.2 (constants.%I.type.325)]
  393. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.08450a.3.%I.type.loc14_32.2 (%I.type.325) [symbolic = %require_complete (constants.%require_complete.cfe)]
  394. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.08450a.3(%T.loc14_14.2) [symbolic = %impl_witness (constants.%impl_witness.eff58b.3)]
  395. // CHECK:STDOUT:
  396. // CHECK:STDOUT: !definition:
  397. // CHECK:STDOUT:
  398. // CHECK:STDOUT: impl: %C.ref as %I.type.loc14_32.1 {
  399. // CHECK:STDOUT: !members:
  400. // CHECK:STDOUT: witness = file.%impl_witness.loc14
  401. // CHECK:STDOUT: }
  402. // CHECK:STDOUT: }
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: generic impl @impl.cd2fdc.2(%T.loc20_14.1: type) {
  405. // CHECK:STDOUT: %T.loc20_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc20_14.2 (constants.%T)]
  406. // CHECK:STDOUT: %T.patt.loc20_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)]
  407. // CHECK:STDOUT: %ptr.loc20_32.2: type = ptr_type %T.loc20_14.2 [symbolic = %ptr.loc20_32.2 (constants.%ptr)]
  408. // CHECK:STDOUT: %I.type.loc20_33.2: type = facet_type <@I, @I(%ptr.loc20_32.2)> [symbolic = %I.type.loc20_33.2 (constants.%I.type.0e2)]
  409. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.cd2fdc.2(%T.loc20_14.2) [symbolic = %impl_witness (constants.%impl_witness.46542c.2)]
  410. // CHECK:STDOUT:
  411. // CHECK:STDOUT: impl: %C.ref as %I.type.loc20_33.1;
  412. // CHECK:STDOUT: }
  413. // CHECK:STDOUT:
  414. // CHECK:STDOUT: generic impl @impl.cd2fdc.3(%T.loc26_14.1: type) {
  415. // CHECK:STDOUT: %T.loc26_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc26_14.2 (constants.%T)]
  416. // CHECK:STDOUT: %T.patt.loc26_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)]
  417. // CHECK:STDOUT: %ptr.loc26_32.2: type = ptr_type %T.loc26_14.2 [symbolic = %ptr.loc26_32.2 (constants.%ptr)]
  418. // CHECK:STDOUT: %I.type.loc26_33.2: type = facet_type <@I, @I(%ptr.loc26_32.2)> [symbolic = %I.type.loc26_33.2 (constants.%I.type.0e2)]
  419. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.cd2fdc.3.%I.type.loc26_33.2 (%I.type.0e2) [symbolic = %require_complete (constants.%require_complete.0e6)]
  420. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.cd2fdc.3(%T.loc26_14.2) [symbolic = %impl_witness (constants.%impl_witness.46542c.3)]
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: !definition:
  423. // CHECK:STDOUT:
  424. // CHECK:STDOUT: impl: %C.ref as %I.type.loc26_33.1 {
  425. // CHECK:STDOUT: !members:
  426. // CHECK:STDOUT: witness = file.%impl_witness.loc26
  427. // CHECK:STDOUT: }
  428. // CHECK:STDOUT: }
  429. // CHECK:STDOUT:
  430. // CHECK:STDOUT: class @C [from "import_generic.carbon"] {
  431. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
  432. // CHECK:STDOUT:
  433. // CHECK:STDOUT: !members:
  434. // CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: specific @I(constants.%T) {
  438. // CHECK:STDOUT: %T => constants.%T
  439. // CHECK:STDOUT: %T.patt => constants.%T.patt
  440. // CHECK:STDOUT:
  441. // CHECK:STDOUT: !definition:
  442. // CHECK:STDOUT: %I.type => constants.%I.type.325
  443. // CHECK:STDOUT: %Self => constants.%Self.209
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: specific @I(%T) {}
  447. // CHECK:STDOUT:
  448. // CHECK:STDOUT: specific @impl.08450a.1(constants.%T) {
  449. // CHECK:STDOUT: %T => constants.%T
  450. // CHECK:STDOUT: %T.patt => constants.%T.patt
  451. // CHECK:STDOUT: %I.type => constants.%I.type.325
  452. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.eff58b.1
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: specific @I(@impl.08450a.1.%T) {}
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: specific @impl.08450a.1(%T) {}
  458. // CHECK:STDOUT:
  459. // CHECK:STDOUT: specific @I(constants.%ptr) {
  460. // CHECK:STDOUT: %T => constants.%ptr
  461. // CHECK:STDOUT: %T.patt => constants.%T.patt
  462. // CHECK:STDOUT:
  463. // CHECK:STDOUT: !definition:
  464. // CHECK:STDOUT: %I.type => constants.%I.type.0e2
  465. // CHECK:STDOUT: %Self => constants.%Self.fb4
  466. // CHECK:STDOUT: }
  467. // CHECK:STDOUT:
  468. // CHECK:STDOUT: specific @impl.cd2fdc.1(constants.%T) {
  469. // CHECK:STDOUT: %T => constants.%T
  470. // CHECK:STDOUT: %T.patt => constants.%T.patt
  471. // CHECK:STDOUT: %ptr => constants.%ptr
  472. // CHECK:STDOUT: %I.type => constants.%I.type.0e2
  473. // CHECK:STDOUT: %require_complete => constants.%require_complete.0e6
  474. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.46542c.1
  475. // CHECK:STDOUT: }
  476. // CHECK:STDOUT:
  477. // CHECK:STDOUT: specific @I(@impl.cd2fdc.1.%ptr) {}
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: specific @impl.cd2fdc.1(%T) {}
  480. // CHECK:STDOUT:
  481. // CHECK:STDOUT: specific @impl.08450a.2(constants.%T) {
  482. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  483. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T.patt
  484. // CHECK:STDOUT: %I.type.loc8_32.2 => constants.%I.type.325
  485. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.eff58b.2
  486. // CHECK:STDOUT: }
  487. // CHECK:STDOUT:
  488. // CHECK:STDOUT: specific @I(@impl.08450a.2.%T.loc8_14.2) {}
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: specific @impl.08450a.2(%T.loc8_14.2) {}
  491. // CHECK:STDOUT:
  492. // CHECK:STDOUT: specific @impl.08450a.3(constants.%T) {
  493. // CHECK:STDOUT: %T.loc14_14.2 => constants.%T
  494. // CHECK:STDOUT: %T.patt.loc14_14.2 => constants.%T.patt
  495. // CHECK:STDOUT: %I.type.loc14_32.2 => constants.%I.type.325
  496. // CHECK:STDOUT: %require_complete => constants.%require_complete.cfe
  497. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.eff58b.3
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: specific @I(@impl.08450a.3.%T.loc14_14.2) {}
  501. // CHECK:STDOUT:
  502. // CHECK:STDOUT: specific @impl.08450a.3(%T.loc14_14.2) {}
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: specific @impl.cd2fdc.2(constants.%T) {
  505. // CHECK:STDOUT: %T.loc20_14.2 => constants.%T
  506. // CHECK:STDOUT: %T.patt.loc20_14.2 => constants.%T.patt
  507. // CHECK:STDOUT: %ptr.loc20_32.2 => constants.%ptr
  508. // CHECK:STDOUT: %I.type.loc20_33.2 => constants.%I.type.0e2
  509. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.46542c.2
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT:
  512. // CHECK:STDOUT: specific @I(@impl.cd2fdc.2.%ptr.loc20_32.2) {}
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: specific @impl.cd2fdc.2(%T.loc20_14.2) {}
  515. // CHECK:STDOUT:
  516. // CHECK:STDOUT: specific @impl.cd2fdc.3(constants.%T) {
  517. // CHECK:STDOUT: %T.loc26_14.2 => constants.%T
  518. // CHECK:STDOUT: %T.patt.loc26_14.2 => constants.%T.patt
  519. // CHECK:STDOUT: %ptr.loc26_32.2 => constants.%ptr
  520. // CHECK:STDOUT: %I.type.loc26_33.2 => constants.%I.type.0e2
  521. // CHECK:STDOUT: %require_complete => constants.%require_complete.0e6
  522. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.46542c.3
  523. // CHECK:STDOUT: }
  524. // CHECK:STDOUT:
  525. // CHECK:STDOUT: specific @I(@impl.cd2fdc.3.%ptr.loc26_32.2) {}
  526. // CHECK:STDOUT:
  527. // CHECK:STDOUT: specific @impl.cd2fdc.3(%T.loc26_14.2) {}
  528. // CHECK:STDOUT:
  529. // CHECK:STDOUT: --- fail_import_generic_decl.carbon
  530. // CHECK:STDOUT:
  531. // CHECK:STDOUT: constants {
  532. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  533. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  534. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  535. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  536. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  537. // CHECK:STDOUT: %J.type.2b8: type = generic_interface_type @J [concrete]
  538. // CHECK:STDOUT: %J.generic: %J.type.2b8 = struct_value () [concrete]
  539. // CHECK:STDOUT: %J.type.b72: type = facet_type <@J, @J(%T)> [symbolic]
  540. // CHECK:STDOUT: %Self: %J.type.b72 = bind_symbolic_name Self, 1 [symbolic]
  541. // CHECK:STDOUT: %impl_witness.0ef: <witness> = impl_witness (), @impl.199(%T) [symbolic]
  542. // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
  543. // CHECK:STDOUT: %J.type.628: type = facet_type <@J, @J(%ptr)> [symbolic]
  544. // CHECK:STDOUT: %impl_witness.b80: <witness> = impl_witness (), @impl.dfd(%T) [symbolic]
  545. // CHECK:STDOUT: }
  546. // CHECK:STDOUT:
  547. // CHECK:STDOUT: file {
  548. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  549. // CHECK:STDOUT: .D = %D.decl
  550. // CHECK:STDOUT: .J = %J.decl
  551. // CHECK:STDOUT: }
  552. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  553. // CHECK:STDOUT: %J.decl: %J.type.2b8 = interface_decl @J [concrete = constants.%J.generic] {
  554. // CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt)]
  555. // CHECK:STDOUT: } {
  556. // CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T)]
  557. // CHECK:STDOUT: }
  558. // CHECK:STDOUT: impl_decl @impl.199 [concrete] {
  559. // CHECK:STDOUT: %T.patt.loc11_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt)]
  560. // CHECK:STDOUT: } {
  561. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  562. // CHECK:STDOUT: %J.ref: %J.type.2b8 = name_ref J, file.%J.decl [concrete = constants.%J.generic]
  563. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_14.1 [symbolic = %T.loc11_14.2 (constants.%T)]
  564. // CHECK:STDOUT: %J.type.loc11_32.1: type = facet_type <@J, @J(constants.%T)> [symbolic = %J.type.loc11_32.2 (constants.%J.type.b72)]
  565. // CHECK:STDOUT: %T.loc11_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_14.2 (constants.%T)]
  566. // CHECK:STDOUT: }
  567. // CHECK:STDOUT: %impl_witness.loc11: <witness> = impl_witness (), @impl.199(constants.%T) [symbolic = @impl.199.%impl_witness (constants.%impl_witness.0ef)]
  568. // CHECK:STDOUT: impl_decl @impl.dfd [concrete] {
  569. // CHECK:STDOUT: %T.patt.loc17_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc17_14.2 (constants.%T.patt)]
  570. // CHECK:STDOUT: } {
  571. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  572. // CHECK:STDOUT: %J.ref: %J.type.2b8 = name_ref J, file.%J.decl [concrete = constants.%J.generic]
  573. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc17_14.1 [symbolic = %T.loc17_14.2 (constants.%T)]
  574. // CHECK:STDOUT: %ptr.loc17_32.1: type = ptr_type %T.ref [symbolic = %ptr.loc17_32.2 (constants.%ptr)]
  575. // CHECK:STDOUT: %J.type.loc17_33.1: type = facet_type <@J, @J(constants.%ptr)> [symbolic = %J.type.loc17_33.2 (constants.%J.type.628)]
  576. // CHECK:STDOUT: %T.loc17_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc17_14.2 (constants.%T)]
  577. // CHECK:STDOUT: }
  578. // CHECK:STDOUT: %impl_witness.loc17: <witness> = impl_witness (), @impl.dfd(constants.%T) [symbolic = @impl.dfd.%impl_witness (constants.%impl_witness.b80)]
  579. // CHECK:STDOUT: }
  580. // CHECK:STDOUT:
  581. // CHECK:STDOUT: generic interface @J(%T.loc5_13.1: type) {
  582. // CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T)]
  583. // CHECK:STDOUT: %T.patt.loc5_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt)]
  584. // CHECK:STDOUT:
  585. // CHECK:STDOUT: !definition:
  586. // CHECK:STDOUT: %J.type: type = facet_type <@J, @J(%T.loc5_13.2)> [symbolic = %J.type (constants.%J.type.b72)]
  587. // CHECK:STDOUT: %Self.2: @J.%J.type (%J.type.b72) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  588. // CHECK:STDOUT:
  589. // CHECK:STDOUT: interface {
  590. // CHECK:STDOUT: %Self.1: @J.%J.type (%J.type.b72) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  591. // CHECK:STDOUT:
  592. // CHECK:STDOUT: !members:
  593. // CHECK:STDOUT: .Self = %Self.1
  594. // CHECK:STDOUT: witness = ()
  595. // CHECK:STDOUT: }
  596. // CHECK:STDOUT: }
  597. // CHECK:STDOUT:
  598. // CHECK:STDOUT: generic impl @impl.199(%T.loc11_14.1: type) {
  599. // CHECK:STDOUT: %T.loc11_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_14.2 (constants.%T)]
  600. // CHECK:STDOUT: %T.patt.loc11_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt)]
  601. // CHECK:STDOUT: %J.type.loc11_32.2: type = facet_type <@J, @J(%T.loc11_14.2)> [symbolic = %J.type.loc11_32.2 (constants.%J.type.b72)]
  602. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.199(%T.loc11_14.2) [symbolic = %impl_witness (constants.%impl_witness.0ef)]
  603. // CHECK:STDOUT:
  604. // CHECK:STDOUT: impl: %D.ref as %J.type.loc11_32.1;
  605. // CHECK:STDOUT: }
  606. // CHECK:STDOUT:
  607. // CHECK:STDOUT: generic impl @impl.dfd(%T.loc17_14.1: type) {
  608. // CHECK:STDOUT: %T.loc17_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc17_14.2 (constants.%T)]
  609. // CHECK:STDOUT: %T.patt.loc17_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc17_14.2 (constants.%T.patt)]
  610. // CHECK:STDOUT: %ptr.loc17_32.2: type = ptr_type %T.loc17_14.2 [symbolic = %ptr.loc17_32.2 (constants.%ptr)]
  611. // CHECK:STDOUT: %J.type.loc17_33.2: type = facet_type <@J, @J(%ptr.loc17_32.2)> [symbolic = %J.type.loc17_33.2 (constants.%J.type.628)]
  612. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.dfd(%T.loc17_14.2) [symbolic = %impl_witness (constants.%impl_witness.b80)]
  613. // CHECK:STDOUT:
  614. // CHECK:STDOUT: impl: %D.ref as %J.type.loc17_33.1;
  615. // CHECK:STDOUT: }
  616. // CHECK:STDOUT:
  617. // CHECK:STDOUT: class @D {
  618. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  619. // CHECK:STDOUT: complete_type_witness = %complete_type
  620. // CHECK:STDOUT:
  621. // CHECK:STDOUT: !members:
  622. // CHECK:STDOUT: .Self = constants.%D
  623. // CHECK:STDOUT: }
  624. // CHECK:STDOUT:
  625. // CHECK:STDOUT: specific @J(constants.%T) {
  626. // CHECK:STDOUT: %T.loc5_13.2 => constants.%T
  627. // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.patt
  628. // CHECK:STDOUT: }
  629. // CHECK:STDOUT:
  630. // CHECK:STDOUT: specific @J(%T.loc5_13.2) {}
  631. // CHECK:STDOUT:
  632. // CHECK:STDOUT: specific @impl.199(constants.%T) {
  633. // CHECK:STDOUT: %T.loc11_14.2 => constants.%T
  634. // CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%T.patt
  635. // CHECK:STDOUT: %J.type.loc11_32.2 => constants.%J.type.b72
  636. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.0ef
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT:
  639. // CHECK:STDOUT: specific @J(@impl.199.%T.loc11_14.2) {}
  640. // CHECK:STDOUT:
  641. // CHECK:STDOUT: specific @impl.199(%T.loc11_14.2) {}
  642. // CHECK:STDOUT:
  643. // CHECK:STDOUT: specific @J(constants.%ptr) {
  644. // CHECK:STDOUT: %T.loc5_13.2 => constants.%ptr
  645. // CHECK:STDOUT: %T.patt.loc5_13.2 => constants.%T.patt
  646. // CHECK:STDOUT: }
  647. // CHECK:STDOUT:
  648. // CHECK:STDOUT: specific @impl.dfd(constants.%T) {
  649. // CHECK:STDOUT: %T.loc17_14.2 => constants.%T
  650. // CHECK:STDOUT: %T.patt.loc17_14.2 => constants.%T.patt
  651. // CHECK:STDOUT: %ptr.loc17_32.2 => constants.%ptr
  652. // CHECK:STDOUT: %J.type.loc17_33.2 => constants.%J.type.628
  653. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.b80
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT:
  656. // CHECK:STDOUT: specific @J(@impl.dfd.%ptr.loc17_32.2) {}
  657. // CHECK:STDOUT:
  658. // CHECK:STDOUT: specific @impl.dfd(%T.loc17_14.2) {}
  659. // CHECK:STDOUT:
  660. // CHECK:STDOUT: --- fail_import_generic_decl.impl.carbon
  661. // CHECK:STDOUT:
  662. // CHECK:STDOUT: constants {
  663. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  664. // CHECK:STDOUT: %J.type.2b8: type = generic_interface_type @J [concrete]
  665. // CHECK:STDOUT: %J.generic: %J.type.2b8 = struct_value () [concrete]
  666. // CHECK:STDOUT: %J.type.b72: type = facet_type <@J, @J(%T)> [symbolic]
  667. // CHECK:STDOUT: %Self.252: %J.type.b72 = bind_symbolic_name Self, 1 [symbolic]
  668. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  669. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  670. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  671. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  672. // CHECK:STDOUT: %impl_witness.0ef94b.1: <witness> = impl_witness (), @impl.199bba.1(%T) [symbolic]
  673. // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
  674. // CHECK:STDOUT: %J.type.628: type = facet_type <@J, @J(%ptr)> [symbolic]
  675. // CHECK:STDOUT: %impl_witness.b80f53.1: <witness> = impl_witness (), @impl.dfd2f7.1(%T) [symbolic]
  676. // CHECK:STDOUT: %impl_witness.0ef94b.2: <witness> = impl_witness (), @impl.199bba.2(%T) [symbolic]
  677. // CHECK:STDOUT: %require_complete.287: <witness> = require_complete_type %J.type.b72 [symbolic]
  678. // CHECK:STDOUT: %impl_witness.0ef94b.3: <witness> = impl_witness (), @impl.199bba.3(%T) [symbolic]
  679. // CHECK:STDOUT: %impl_witness.b80f53.2: <witness> = impl_witness (), @impl.dfd2f7.2(%T) [symbolic]
  680. // CHECK:STDOUT: %Self.fbe: %J.type.628 = bind_symbolic_name Self, 1 [symbolic]
  681. // CHECK:STDOUT: %require_complete.c60: <witness> = require_complete_type %J.type.628 [symbolic]
  682. // CHECK:STDOUT: %impl_witness.b80f53.3: <witness> = impl_witness (), @impl.dfd2f7.3(%T) [symbolic]
  683. // CHECK:STDOUT: }
  684. // CHECK:STDOUT:
  685. // CHECK:STDOUT: imports {
  686. // CHECK:STDOUT: %Main.D: type = import_ref Main//import_generic_decl, D, loaded [concrete = constants.%D]
  687. // CHECK:STDOUT: %Main.J: %J.type.2b8 = import_ref Main//import_generic_decl, J, loaded [concrete = constants.%J.generic]
  688. // CHECK:STDOUT: %Main.import_ref.5ab3ec.1: type = import_ref Main//import_generic_decl, loc5_13, loaded [symbolic = @J.%T (constants.%T)]
  689. // CHECK:STDOUT: %Main.import_ref.ff5 = import_ref Main//import_generic_decl, inst30 [no loc], unloaded
  690. // CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//import_generic_decl, loc4_10, loaded [concrete = constants.%complete_type]
  691. // CHECK:STDOUT: %Main.import_ref.cab = import_ref Main//import_generic_decl, inst15 [no loc], unloaded
  692. // CHECK:STDOUT: %Main.import_ref.5ab3ec.2: type = import_ref Main//import_generic_decl, loc11_14, loaded [symbolic = @impl.199bba.1.%T (constants.%T)]
  693. // CHECK:STDOUT: %Main.import_ref.aa9f8a.1: type = import_ref Main//import_generic_decl, loc11_24, loaded [concrete = constants.%D]
  694. // CHECK:STDOUT: %Main.import_ref.ded: type = import_ref Main//import_generic_decl, loc11_32, loaded [symbolic = @impl.199bba.1.%J.type (constants.%J.type.b72)]
  695. // CHECK:STDOUT: %Main.import_ref.5ab3ec.3: type = import_ref Main//import_generic_decl, loc17_14, loaded [symbolic = @impl.dfd2f7.1.%T (constants.%T)]
  696. // CHECK:STDOUT: %Main.import_ref.aa9f8a.2: type = import_ref Main//import_generic_decl, loc17_24, loaded [concrete = constants.%D]
  697. // CHECK:STDOUT: %Main.import_ref.0d3: type = import_ref Main//import_generic_decl, loc17_33, loaded [symbolic = @impl.dfd2f7.1.%J.type (constants.%J.type.628)]
  698. // CHECK:STDOUT: }
  699. // CHECK:STDOUT:
  700. // CHECK:STDOUT: file {
  701. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  702. // CHECK:STDOUT: .D = imports.%Main.D
  703. // CHECK:STDOUT: .J = imports.%Main.J
  704. // CHECK:STDOUT: }
  705. // CHECK:STDOUT: %default.import.loc2_35.1 = import <none>
  706. // CHECK:STDOUT: %default.import.loc2_35.2 = import <none>
  707. // CHECK:STDOUT: impl_decl @impl.199bba.2 [concrete] {
  708. // CHECK:STDOUT: %T.patt.loc8_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  709. // CHECK:STDOUT: } {
  710. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%Main.D [concrete = constants.%D]
  711. // CHECK:STDOUT: %J.ref: %J.type.2b8 = name_ref J, imports.%Main.J [concrete = constants.%J.generic]
  712. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.1 [symbolic = %T.loc8_14.2 (constants.%T)]
  713. // CHECK:STDOUT: %J.type.loc8_32.1: type = facet_type <@J, @J(constants.%T)> [symbolic = %J.type.loc8_32.2 (constants.%J.type.b72)]
  714. // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  715. // CHECK:STDOUT: }
  716. // CHECK:STDOUT: %impl_witness.loc8: <witness> = impl_witness (), @impl.199bba.2(constants.%T) [symbolic = @impl.199bba.2.%impl_witness (constants.%impl_witness.0ef94b.2)]
  717. // CHECK:STDOUT: impl_decl @impl.199bba.3 [concrete] {
  718. // CHECK:STDOUT: %T.patt.loc14_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)]
  719. // CHECK:STDOUT: } {
  720. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%Main.D [concrete = constants.%D]
  721. // CHECK:STDOUT: %J.ref: %J.type.2b8 = name_ref J, imports.%Main.J [concrete = constants.%J.generic]
  722. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc14_14.1 [symbolic = %T.loc14_14.2 (constants.%T)]
  723. // CHECK:STDOUT: %J.type.loc14_32.1: type = facet_type <@J, @J(constants.%T)> [symbolic = %J.type.loc14_32.2 (constants.%J.type.b72)]
  724. // CHECK:STDOUT: %T.loc14_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T)]
  725. // CHECK:STDOUT: }
  726. // CHECK:STDOUT: %impl_witness.loc14: <witness> = impl_witness (), @impl.199bba.3(constants.%T) [symbolic = @impl.199bba.3.%impl_witness (constants.%impl_witness.0ef94b.3)]
  727. // CHECK:STDOUT: impl_decl @impl.dfd2f7.2 [concrete] {
  728. // CHECK:STDOUT: %T.patt.loc20_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)]
  729. // CHECK:STDOUT: } {
  730. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%Main.D [concrete = constants.%D]
  731. // CHECK:STDOUT: %J.ref: %J.type.2b8 = name_ref J, imports.%Main.J [concrete = constants.%J.generic]
  732. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc20_14.1 [symbolic = %T.loc20_14.2 (constants.%T)]
  733. // CHECK:STDOUT: %ptr.loc20_32.1: type = ptr_type %T.ref [symbolic = %ptr.loc20_32.2 (constants.%ptr)]
  734. // CHECK:STDOUT: %J.type.loc20_33.1: type = facet_type <@J, @J(constants.%ptr)> [symbolic = %J.type.loc20_33.2 (constants.%J.type.628)]
  735. // CHECK:STDOUT: %T.loc20_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc20_14.2 (constants.%T)]
  736. // CHECK:STDOUT: }
  737. // CHECK:STDOUT: %impl_witness.loc20: <witness> = impl_witness (), @impl.dfd2f7.2(constants.%T) [symbolic = @impl.dfd2f7.2.%impl_witness (constants.%impl_witness.b80f53.2)]
  738. // CHECK:STDOUT: impl_decl @impl.dfd2f7.3 [concrete] {
  739. // CHECK:STDOUT: %T.patt.loc26_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)]
  740. // CHECK:STDOUT: } {
  741. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%Main.D [concrete = constants.%D]
  742. // CHECK:STDOUT: %J.ref: %J.type.2b8 = name_ref J, imports.%Main.J [concrete = constants.%J.generic]
  743. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc26_14.1 [symbolic = %T.loc26_14.2 (constants.%T)]
  744. // CHECK:STDOUT: %ptr.loc26_32.1: type = ptr_type %T.ref [symbolic = %ptr.loc26_32.2 (constants.%ptr)]
  745. // CHECK:STDOUT: %J.type.loc26_33.1: type = facet_type <@J, @J(constants.%ptr)> [symbolic = %J.type.loc26_33.2 (constants.%J.type.628)]
  746. // CHECK:STDOUT: %T.loc26_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc26_14.2 (constants.%T)]
  747. // CHECK:STDOUT: }
  748. // CHECK:STDOUT: %impl_witness.loc26: <witness> = impl_witness (), @impl.dfd2f7.3(constants.%T) [symbolic = @impl.dfd2f7.3.%impl_witness (constants.%impl_witness.b80f53.3)]
  749. // CHECK:STDOUT: }
  750. // CHECK:STDOUT:
  751. // CHECK:STDOUT: generic interface @J(imports.%Main.import_ref.5ab3ec.1: type) [from "fail_import_generic_decl.carbon"] {
  752. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  753. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  754. // CHECK:STDOUT:
  755. // CHECK:STDOUT: !definition:
  756. // CHECK:STDOUT: %J.type: type = facet_type <@J, @J(%T)> [symbolic = %J.type (constants.%J.type.b72)]
  757. // CHECK:STDOUT: %Self: @J.%J.type (%J.type.b72) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.252)]
  758. // CHECK:STDOUT:
  759. // CHECK:STDOUT: interface {
  760. // CHECK:STDOUT: !members:
  761. // CHECK:STDOUT: .Self = imports.%Main.import_ref.ff5
  762. // CHECK:STDOUT: witness = ()
  763. // CHECK:STDOUT: }
  764. // CHECK:STDOUT: }
  765. // CHECK:STDOUT:
  766. // CHECK:STDOUT: generic impl @impl.199bba.1(imports.%Main.import_ref.5ab3ec.2: type) [from "fail_import_generic_decl.carbon"] {
  767. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  768. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  769. // CHECK:STDOUT: %J.type: type = facet_type <@J, @J(%T)> [symbolic = %J.type (constants.%J.type.b72)]
  770. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.199bba.1(%T) [symbolic = %impl_witness (constants.%impl_witness.0ef94b.1)]
  771. // CHECK:STDOUT:
  772. // CHECK:STDOUT: impl: imports.%Main.import_ref.aa9f8a.1 as imports.%Main.import_ref.ded;
  773. // CHECK:STDOUT: }
  774. // CHECK:STDOUT:
  775. // CHECK:STDOUT: generic impl @impl.dfd2f7.1(imports.%Main.import_ref.5ab3ec.3: type) [from "fail_import_generic_decl.carbon"] {
  776. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  777. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  778. // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic = %ptr (constants.%ptr)]
  779. // CHECK:STDOUT: %J.type: type = facet_type <@J, @J(%ptr)> [symbolic = %J.type (constants.%J.type.628)]
  780. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.dfd2f7.1(%T) [symbolic = %impl_witness (constants.%impl_witness.b80f53.1)]
  781. // CHECK:STDOUT:
  782. // CHECK:STDOUT: impl: imports.%Main.import_ref.aa9f8a.2 as imports.%Main.import_ref.0d3;
  783. // CHECK:STDOUT: }
  784. // CHECK:STDOUT:
  785. // CHECK:STDOUT: generic impl @impl.199bba.2(%T.loc8_14.1: type) {
  786. // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.2 (constants.%T)]
  787. // CHECK:STDOUT: %T.patt.loc8_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_14.2 (constants.%T.patt)]
  788. // CHECK:STDOUT: %J.type.loc8_32.2: type = facet_type <@J, @J(%T.loc8_14.2)> [symbolic = %J.type.loc8_32.2 (constants.%J.type.b72)]
  789. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.199bba.2(%T.loc8_14.2) [symbolic = %impl_witness (constants.%impl_witness.0ef94b.2)]
  790. // CHECK:STDOUT:
  791. // CHECK:STDOUT: impl: %D.ref as %J.type.loc8_32.1;
  792. // CHECK:STDOUT: }
  793. // CHECK:STDOUT:
  794. // CHECK:STDOUT: generic impl @impl.199bba.3(%T.loc14_14.1: type) {
  795. // CHECK:STDOUT: %T.loc14_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T)]
  796. // CHECK:STDOUT: %T.patt.loc14_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)]
  797. // CHECK:STDOUT: %J.type.loc14_32.2: type = facet_type <@J, @J(%T.loc14_14.2)> [symbolic = %J.type.loc14_32.2 (constants.%J.type.b72)]
  798. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.199bba.3.%J.type.loc14_32.2 (%J.type.b72) [symbolic = %require_complete (constants.%require_complete.287)]
  799. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.199bba.3(%T.loc14_14.2) [symbolic = %impl_witness (constants.%impl_witness.0ef94b.3)]
  800. // CHECK:STDOUT:
  801. // CHECK:STDOUT: !definition:
  802. // CHECK:STDOUT:
  803. // CHECK:STDOUT: impl: %D.ref as %J.type.loc14_32.1 {
  804. // CHECK:STDOUT: !members:
  805. // CHECK:STDOUT: witness = file.%impl_witness.loc14
  806. // CHECK:STDOUT: }
  807. // CHECK:STDOUT: }
  808. // CHECK:STDOUT:
  809. // CHECK:STDOUT: generic impl @impl.dfd2f7.2(%T.loc20_14.1: type) {
  810. // CHECK:STDOUT: %T.loc20_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc20_14.2 (constants.%T)]
  811. // CHECK:STDOUT: %T.patt.loc20_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_14.2 (constants.%T.patt)]
  812. // CHECK:STDOUT: %ptr.loc20_32.2: type = ptr_type %T.loc20_14.2 [symbolic = %ptr.loc20_32.2 (constants.%ptr)]
  813. // CHECK:STDOUT: %J.type.loc20_33.2: type = facet_type <@J, @J(%ptr.loc20_32.2)> [symbolic = %J.type.loc20_33.2 (constants.%J.type.628)]
  814. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.dfd2f7.2(%T.loc20_14.2) [symbolic = %impl_witness (constants.%impl_witness.b80f53.2)]
  815. // CHECK:STDOUT:
  816. // CHECK:STDOUT: impl: %D.ref as %J.type.loc20_33.1;
  817. // CHECK:STDOUT: }
  818. // CHECK:STDOUT:
  819. // CHECK:STDOUT: generic impl @impl.dfd2f7.3(%T.loc26_14.1: type) {
  820. // CHECK:STDOUT: %T.loc26_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc26_14.2 (constants.%T)]
  821. // CHECK:STDOUT: %T.patt.loc26_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)]
  822. // CHECK:STDOUT: %ptr.loc26_32.2: type = ptr_type %T.loc26_14.2 [symbolic = %ptr.loc26_32.2 (constants.%ptr)]
  823. // CHECK:STDOUT: %J.type.loc26_33.2: type = facet_type <@J, @J(%ptr.loc26_32.2)> [symbolic = %J.type.loc26_33.2 (constants.%J.type.628)]
  824. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.dfd2f7.3.%J.type.loc26_33.2 (%J.type.628) [symbolic = %require_complete (constants.%require_complete.c60)]
  825. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl.dfd2f7.3(%T.loc26_14.2) [symbolic = %impl_witness (constants.%impl_witness.b80f53.3)]
  826. // CHECK:STDOUT:
  827. // CHECK:STDOUT: !definition:
  828. // CHECK:STDOUT:
  829. // CHECK:STDOUT: impl: %D.ref as %J.type.loc26_33.1 {
  830. // CHECK:STDOUT: !members:
  831. // CHECK:STDOUT: witness = file.%impl_witness.loc26
  832. // CHECK:STDOUT: }
  833. // CHECK:STDOUT: }
  834. // CHECK:STDOUT:
  835. // CHECK:STDOUT: class @D [from "fail_import_generic_decl.carbon"] {
  836. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
  837. // CHECK:STDOUT:
  838. // CHECK:STDOUT: !members:
  839. // CHECK:STDOUT: .Self = imports.%Main.import_ref.cab
  840. // CHECK:STDOUT: }
  841. // CHECK:STDOUT:
  842. // CHECK:STDOUT: specific @J(constants.%T) {
  843. // CHECK:STDOUT: %T => constants.%T
  844. // CHECK:STDOUT: %T.patt => constants.%T.patt
  845. // CHECK:STDOUT:
  846. // CHECK:STDOUT: !definition:
  847. // CHECK:STDOUT: %J.type => constants.%J.type.b72
  848. // CHECK:STDOUT: %Self => constants.%Self.252
  849. // CHECK:STDOUT: }
  850. // CHECK:STDOUT:
  851. // CHECK:STDOUT: specific @J(%T) {}
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: specific @impl.199bba.1(constants.%T) {
  854. // CHECK:STDOUT: %T => constants.%T
  855. // CHECK:STDOUT: %T.patt => constants.%T.patt
  856. // CHECK:STDOUT: %J.type => constants.%J.type.b72
  857. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.0ef94b.1
  858. // CHECK:STDOUT: }
  859. // CHECK:STDOUT:
  860. // CHECK:STDOUT: specific @J(@impl.199bba.1.%T) {}
  861. // CHECK:STDOUT:
  862. // CHECK:STDOUT: specific @impl.199bba.1(%T) {}
  863. // CHECK:STDOUT:
  864. // CHECK:STDOUT: specific @J(constants.%ptr) {
  865. // CHECK:STDOUT: %T => constants.%ptr
  866. // CHECK:STDOUT: %T.patt => constants.%T.patt
  867. // CHECK:STDOUT:
  868. // CHECK:STDOUT: !definition:
  869. // CHECK:STDOUT: %J.type => constants.%J.type.628
  870. // CHECK:STDOUT: %Self => constants.%Self.fbe
  871. // CHECK:STDOUT: }
  872. // CHECK:STDOUT:
  873. // CHECK:STDOUT: specific @impl.dfd2f7.1(constants.%T) {
  874. // CHECK:STDOUT: %T => constants.%T
  875. // CHECK:STDOUT: %T.patt => constants.%T.patt
  876. // CHECK:STDOUT: %ptr => constants.%ptr
  877. // CHECK:STDOUT: %J.type => constants.%J.type.628
  878. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.b80f53.1
  879. // CHECK:STDOUT: }
  880. // CHECK:STDOUT:
  881. // CHECK:STDOUT: specific @J(@impl.dfd2f7.1.%ptr) {}
  882. // CHECK:STDOUT:
  883. // CHECK:STDOUT: specific @impl.dfd2f7.1(%T) {}
  884. // CHECK:STDOUT:
  885. // CHECK:STDOUT: specific @impl.199bba.2(constants.%T) {
  886. // CHECK:STDOUT: %T.loc8_14.2 => constants.%T
  887. // CHECK:STDOUT: %T.patt.loc8_14.2 => constants.%T.patt
  888. // CHECK:STDOUT: %J.type.loc8_32.2 => constants.%J.type.b72
  889. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.0ef94b.2
  890. // CHECK:STDOUT: }
  891. // CHECK:STDOUT:
  892. // CHECK:STDOUT: specific @J(@impl.199bba.2.%T.loc8_14.2) {}
  893. // CHECK:STDOUT:
  894. // CHECK:STDOUT: specific @impl.199bba.2(%T.loc8_14.2) {}
  895. // CHECK:STDOUT:
  896. // CHECK:STDOUT: specific @impl.199bba.3(constants.%T) {
  897. // CHECK:STDOUT: %T.loc14_14.2 => constants.%T
  898. // CHECK:STDOUT: %T.patt.loc14_14.2 => constants.%T.patt
  899. // CHECK:STDOUT: %J.type.loc14_32.2 => constants.%J.type.b72
  900. // CHECK:STDOUT: %require_complete => constants.%require_complete.287
  901. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.0ef94b.3
  902. // CHECK:STDOUT: }
  903. // CHECK:STDOUT:
  904. // CHECK:STDOUT: specific @J(@impl.199bba.3.%T.loc14_14.2) {}
  905. // CHECK:STDOUT:
  906. // CHECK:STDOUT: specific @impl.199bba.3(%T.loc14_14.2) {}
  907. // CHECK:STDOUT:
  908. // CHECK:STDOUT: specific @impl.dfd2f7.2(constants.%T) {
  909. // CHECK:STDOUT: %T.loc20_14.2 => constants.%T
  910. // CHECK:STDOUT: %T.patt.loc20_14.2 => constants.%T.patt
  911. // CHECK:STDOUT: %ptr.loc20_32.2 => constants.%ptr
  912. // CHECK:STDOUT: %J.type.loc20_33.2 => constants.%J.type.628
  913. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.b80f53.2
  914. // CHECK:STDOUT: }
  915. // CHECK:STDOUT:
  916. // CHECK:STDOUT: specific @J(@impl.dfd2f7.2.%ptr.loc20_32.2) {}
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: specific @impl.dfd2f7.2(%T.loc20_14.2) {}
  919. // CHECK:STDOUT:
  920. // CHECK:STDOUT: specific @impl.dfd2f7.3(constants.%T) {
  921. // CHECK:STDOUT: %T.loc26_14.2 => constants.%T
  922. // CHECK:STDOUT: %T.patt.loc26_14.2 => constants.%T.patt
  923. // CHECK:STDOUT: %ptr.loc26_32.2 => constants.%ptr
  924. // CHECK:STDOUT: %J.type.loc26_33.2 => constants.%J.type.628
  925. // CHECK:STDOUT: %require_complete => constants.%require_complete.c60
  926. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.b80f53.3
  927. // CHECK:STDOUT: }
  928. // CHECK:STDOUT:
  929. // CHECK:STDOUT: specific @J(@impl.dfd2f7.3.%ptr.loc26_32.2) {}
  930. // CHECK:STDOUT:
  931. // CHECK:STDOUT: specific @impl.dfd2f7.3(%T.loc26_14.2) {}
  932. // CHECK:STDOUT: