fail_extend_impl_scope.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/destroy.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/fail_extend_impl_scope.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_extend_impl_scope.carbon
  14. // --- fail_extend_impl_file_scope.carbon
  15. library "[[@TEST_NAME]]";
  16. interface I {}
  17. // CHECK:STDERR: fail_extend_impl_file_scope.carbon:[[@LINE+4]]:1: error: `extend impl` can only be used in a class [ExtendImplOutsideClass]
  18. // CHECK:STDERR: extend impl () as I {}
  19. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  20. // CHECK:STDERR:
  21. extend impl () as I {}
  22. // --- fail_extend_impl_function_scope.carbon
  23. library "[[@TEST_NAME]]";
  24. interface J {}
  25. fn F() {
  26. // CHECK:STDERR: fail_extend_impl_function_scope.carbon:[[@LINE+4]]:3: error: `extend impl` can only be used in a class [ExtendImplOutsideClass]
  27. // CHECK:STDERR: extend impl {} as J {}
  28. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  29. // CHECK:STDERR:
  30. extend impl {} as J {}
  31. }
  32. // --- fail_extend_impl_self_interface.carbon
  33. library "[[@TEST_NAME]]";
  34. interface Z {
  35. fn Zero();
  36. // CHECK:STDERR: fail_extend_impl_self_interface.carbon:[[@LINE+4]]:15: error: `impl as` can only be used in a class [ImplAsOutsideClass]
  37. // CHECK:STDERR: extend impl as Z {
  38. // CHECK:STDERR: ^~
  39. // CHECK:STDERR:
  40. extend impl as Z {
  41. fn Zero() {}
  42. }
  43. }
  44. class Point {
  45. extend impl as Z {
  46. fn Zero() {}
  47. }
  48. }
  49. fn F() {
  50. // Even if the `extend impl` is diagnosed above, we must not add the impl of
  51. // the interface to itself in a way that allows it to be used during impl
  52. // lookup, or we end up with infinite impl lookup recursion here.
  53. ({} as Point).Zero();
  54. }
  55. // CHECK:STDOUT: --- fail_extend_impl_file_scope.carbon
  56. // CHECK:STDOUT:
  57. // CHECK:STDOUT: constants {
  58. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  59. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
  60. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  61. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  62. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
  63. // CHECK:STDOUT: }
  64. // CHECK:STDOUT:
  65. // CHECK:STDOUT: imports {
  66. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  67. // CHECK:STDOUT: import Core//prelude
  68. // CHECK:STDOUT: import Core//prelude/...
  69. // CHECK:STDOUT: }
  70. // CHECK:STDOUT: }
  71. // CHECK:STDOUT:
  72. // CHECK:STDOUT: file {
  73. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  74. // CHECK:STDOUT: .Core = imports.%Core
  75. // CHECK:STDOUT: .I = %I.decl
  76. // CHECK:STDOUT: }
  77. // CHECK:STDOUT: %Core.import = import Core
  78. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  79. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.I.impl [concrete] {} {
  80. // CHECK:STDOUT: %.loc9_14.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  81. // CHECK:STDOUT: %.loc9_14.2: type = converted %.loc9_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  82. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  83. // CHECK:STDOUT: }
  84. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.I.impl [concrete]
  85. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  86. // CHECK:STDOUT: }
  87. // CHECK:STDOUT:
  88. // CHECK:STDOUT: interface @I {
  89. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: !members:
  92. // CHECK:STDOUT: .Self = %Self
  93. // CHECK:STDOUT: witness = ()
  94. // CHECK:STDOUT:
  95. // CHECK:STDOUT: !requires:
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT:
  98. // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc9_14.2 as %I.ref {
  99. // CHECK:STDOUT: !members:
  100. // CHECK:STDOUT: witness = <error>
  101. // CHECK:STDOUT: }
  102. // CHECK:STDOUT:
  103. // CHECK:STDOUT: --- fail_extend_impl_function_scope.carbon
  104. // CHECK:STDOUT:
  105. // CHECK:STDOUT: constants {
  106. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  107. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic]
  108. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  109. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  110. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  111. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  112. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @F.%J.impl_witness_table [concrete]
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT:
  115. // CHECK:STDOUT: imports {
  116. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  117. // CHECK:STDOUT: import Core//prelude
  118. // CHECK:STDOUT: import Core//prelude/...
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT: }
  121. // CHECK:STDOUT:
  122. // CHECK:STDOUT: file {
  123. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  124. // CHECK:STDOUT: .Core = imports.%Core
  125. // CHECK:STDOUT: .J = %J.decl
  126. // CHECK:STDOUT: .F = %F.decl
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT: %Core.import = import Core
  129. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  130. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT:
  133. // CHECK:STDOUT: interface @J {
  134. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  135. // CHECK:STDOUT:
  136. // CHECK:STDOUT: !members:
  137. // CHECK:STDOUT: .Self = %Self
  138. // CHECK:STDOUT: witness = ()
  139. // CHECK:STDOUT:
  140. // CHECK:STDOUT: !requires:
  141. // CHECK:STDOUT: }
  142. // CHECK:STDOUT:
  143. // CHECK:STDOUT: impl @empty_struct_type.as.J.impl: %.loc10_16.2 as %J.ref {
  144. // CHECK:STDOUT: !members:
  145. // CHECK:STDOUT: witness = <error>
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: fn @F() {
  149. // CHECK:STDOUT: !entry:
  150. // CHECK:STDOUT: impl_decl @empty_struct_type.as.J.impl [concrete] {} {
  151. // CHECK:STDOUT: %.loc10_16.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  152. // CHECK:STDOUT: %.loc10_16.2: type = converted %.loc10_16.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  153. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  154. // CHECK:STDOUT: }
  155. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @empty_struct_type.as.J.impl [concrete]
  156. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  157. // CHECK:STDOUT: return
  158. // CHECK:STDOUT: }
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: --- fail_extend_impl_self_interface.carbon
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: constants {
  163. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  164. // CHECK:STDOUT: %Self.3b3: %Z.type = symbolic_binding Self, 0 [symbolic]
  165. // CHECK:STDOUT: %Z.Zero.type: type = fn_type @Z.Zero [concrete]
  166. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  167. // CHECK:STDOUT: %Z.Zero: %Z.Zero.type = struct_value () [concrete]
  168. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  169. // CHECK:STDOUT: %assoc0.534: %Z.assoc_type = assoc_entity element0, @Z.%Z.Zero.decl [concrete]
  170. // CHECK:STDOUT: %<error>.as.Z.impl.Zero.type: type = fn_type @<error>.as.Z.impl.Zero, @<error>.as.Z.impl(%Self.3b3) [symbolic]
  171. // CHECK:STDOUT: %<error>.as.Z.impl.Zero: %<error>.as.Z.impl.Zero.type = struct_value () [symbolic]
  172. // CHECK:STDOUT: %Point: type = class_type @Point [concrete]
  173. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness @Point.%Z.impl_witness_table [concrete]
  174. // CHECK:STDOUT: %Point.as.Z.impl.Zero.type: type = fn_type @Point.as.Z.impl.Zero [concrete]
  175. // CHECK:STDOUT: %Point.as.Z.impl.Zero: %Point.as.Z.impl.Zero.type = struct_value () [concrete]
  176. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %Point, (%Z.impl_witness) [concrete]
  177. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  178. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  179. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  180. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  181. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  182. // CHECK:STDOUT: %Point.val: %Point = struct_value () [concrete]
  183. // CHECK:STDOUT: %.672: type = fn_type_with_self_type %Z.Zero.type, %Z.facet [concrete]
  184. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  185. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  186. // CHECK:STDOUT: %facet_value: %type_where = facet_value %Point, () [concrete]
  187. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d92: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  188. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.73b: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d92 = struct_value () [concrete]
  189. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.73b, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT:
  192. // CHECK:STDOUT: imports {
  193. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  194. // CHECK:STDOUT: .Destroy = %Core.Destroy
  195. // CHECK:STDOUT: import Core//prelude
  196. // CHECK:STDOUT: import Core//prelude/...
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: file {
  202. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  203. // CHECK:STDOUT: .Core = imports.%Core
  204. // CHECK:STDOUT: .Z = %Z.decl
  205. // CHECK:STDOUT: .Point = %Point.decl
  206. // CHECK:STDOUT: .F = %F.decl
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT: %Core.import = import Core
  209. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  210. // CHECK:STDOUT: %Point.decl: type = class_decl @Point [concrete = constants.%Point] {} {}
  211. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT:
  214. // CHECK:STDOUT: interface @Z {
  215. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.3b3]
  216. // CHECK:STDOUT: %Z.Zero.decl: %Z.Zero.type = fn_decl @Z.Zero [concrete = constants.%Z.Zero] {} {}
  217. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, %Z.Zero.decl [concrete = constants.%assoc0.534]
  218. // CHECK:STDOUT: impl_decl @<error>.as.Z.impl [concrete] {} {
  219. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  220. // CHECK:STDOUT: }
  221. // CHECK:STDOUT:
  222. // CHECK:STDOUT: !members:
  223. // CHECK:STDOUT: .Self = %Self
  224. // CHECK:STDOUT: .Zero = %assoc0
  225. // CHECK:STDOUT: .Z = <poisoned>
  226. // CHECK:STDOUT: witness = (%Z.Zero.decl)
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: !requires:
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: generic impl @<error>.as.Z.impl(@Z.%Self: %Z.type) {
  232. // CHECK:STDOUT: !definition:
  233. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.3b3)]
  234. // CHECK:STDOUT: %<error>.as.Z.impl.Zero.type: type = fn_type @<error>.as.Z.impl.Zero, @<error>.as.Z.impl(%Self) [symbolic = %<error>.as.Z.impl.Zero.type (constants.%<error>.as.Z.impl.Zero.type)]
  235. // CHECK:STDOUT: %<error>.as.Z.impl.Zero: @<error>.as.Z.impl.%<error>.as.Z.impl.Zero.type (%<error>.as.Z.impl.Zero.type) = struct_value () [symbolic = %<error>.as.Z.impl.Zero (constants.%<error>.as.Z.impl.Zero)]
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: impl: <error> as %Z.ref {
  238. // CHECK:STDOUT: %<error>.as.Z.impl.Zero.decl: @<error>.as.Z.impl.%<error>.as.Z.impl.Zero.type (%<error>.as.Z.impl.Zero.type) = fn_decl @<error>.as.Z.impl.Zero [symbolic = @<error>.as.Z.impl.%<error>.as.Z.impl.Zero (constants.%<error>.as.Z.impl.Zero)] {} {}
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: !members:
  241. // CHECK:STDOUT: .Zero = %<error>.as.Z.impl.Zero.decl
  242. // CHECK:STDOUT: witness = <error>
  243. // CHECK:STDOUT: }
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: impl @Point.as.Z.impl: %Self.ref as %Z.ref {
  247. // CHECK:STDOUT: %Point.as.Z.impl.Zero.decl: %Point.as.Z.impl.Zero.type = fn_decl @Point.as.Z.impl.Zero [concrete = constants.%Point.as.Z.impl.Zero] {} {}
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: !members:
  250. // CHECK:STDOUT: .Zero = %Point.as.Z.impl.Zero.decl
  251. // CHECK:STDOUT: witness = @Point.%Z.impl_witness
  252. // CHECK:STDOUT: }
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: class @Point {
  255. // CHECK:STDOUT: impl_decl @Point.as.Z.impl [concrete] {} {
  256. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Point [concrete = constants.%Point]
  257. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (@Point.as.Z.impl.%Point.as.Z.impl.Zero.decl), @Point.as.Z.impl [concrete]
  260. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness]
  261. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  262. // CHECK:STDOUT: complete_type_witness = %complete_type
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: !members:
  265. // CHECK:STDOUT: .Self = constants.%Point
  266. // CHECK:STDOUT: .Z = <poisoned>
  267. // CHECK:STDOUT: .Zero = <poisoned>
  268. // CHECK:STDOUT: extend @Point.as.Z.impl.%Z.ref
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT:
  271. // CHECK:STDOUT: generic fn @Z.Zero(@Z.%Self: %Z.type) {
  272. // CHECK:STDOUT: fn();
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: generic fn @<error>.as.Z.impl.Zero(@Z.%Self: %Z.type) {
  276. // CHECK:STDOUT: !definition:
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: fn() {
  279. // CHECK:STDOUT: !entry:
  280. // CHECK:STDOUT: return
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT: }
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: fn @Point.as.Z.impl.Zero() {
  285. // CHECK:STDOUT: !entry:
  286. // CHECK:STDOUT: return
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: fn @F() {
  290. // CHECK:STDOUT: !entry:
  291. // CHECK:STDOUT: %.loc25_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  292. // CHECK:STDOUT: %Point.ref: type = name_ref Point, file.%Point.decl [concrete = constants.%Point]
  293. // CHECK:STDOUT: %.loc25_5.2: ref %Point = temporary_storage
  294. // CHECK:STDOUT: %.loc25_5.3: init %Point = class_init (), %.loc25_5.2 [concrete = constants.%Point.val]
  295. // CHECK:STDOUT: %.loc25_5.4: ref %Point = temporary %.loc25_5.2, %.loc25_5.3
  296. // CHECK:STDOUT: %.loc25_7: ref %Point = converted %.loc25_5.1, %.loc25_5.4
  297. // CHECK:STDOUT: %Zero.ref: %Z.assoc_type = name_ref Zero, @Z.%assoc0 [concrete = constants.%assoc0.534]
  298. // CHECK:STDOUT: %impl.elem0: %.672 = impl_witness_access constants.%Z.impl_witness, element0 [concrete = constants.%Point.as.Z.impl.Zero]
  299. // CHECK:STDOUT: %Point.as.Z.impl.Zero.call: init %empty_tuple.type = call %impl.elem0()
  300. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc25_5.4, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.73b
  301. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.73b, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  302. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc25_5.4, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  303. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%.loc25_5.4)
  304. // CHECK:STDOUT: return
  305. // CHECK:STDOUT: }
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: specific @Z.Zero(constants.%Self.3b3) {}
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: specific @<error>.as.Z.impl(constants.%Self.3b3) {
  310. // CHECK:STDOUT: !definition:
  311. // CHECK:STDOUT: %Self => constants.%Self.3b3
  312. // CHECK:STDOUT: %<error>.as.Z.impl.Zero.type => constants.%<error>.as.Z.impl.Zero.type
  313. // CHECK:STDOUT: %<error>.as.Z.impl.Zero => constants.%<error>.as.Z.impl.Zero
  314. // CHECK:STDOUT: }
  315. // CHECK:STDOUT:
  316. // CHECK:STDOUT: specific @<error>.as.Z.impl.Zero(constants.%Self.3b3) {}
  317. // CHECK:STDOUT:
  318. // CHECK:STDOUT: specific @Z.Zero(constants.%Z.facet) {}
  319. // CHECK:STDOUT: