import_generic.carbon 60 KB

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