fail_extend_impl_scope.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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 an interface or 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 an interface or 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 @empty_tuple.type.as.I.impl.%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: }
  85. // CHECK:STDOUT:
  86. // CHECK:STDOUT: interface @I {
  87. // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  88. // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
  89. // CHECK:STDOUT:
  90. // CHECK:STDOUT: !members:
  91. // CHECK:STDOUT: .Self = %Self
  92. // CHECK:STDOUT: witness = ()
  93. // CHECK:STDOUT:
  94. // CHECK:STDOUT: !requires:
  95. // CHECK:STDOUT: }
  96. // CHECK:STDOUT:
  97. // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc9_14.2 as %I.ref {
  98. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.I.impl [concrete]
  99. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
  100. // CHECK:STDOUT:
  101. // CHECK:STDOUT: !members:
  102. // CHECK:STDOUT: witness = <error>
  103. // CHECK:STDOUT: }
  104. // CHECK:STDOUT:
  105. // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {}
  106. // CHECK:STDOUT:
  107. // CHECK:STDOUT: --- fail_extend_impl_function_scope.carbon
  108. // CHECK:STDOUT:
  109. // CHECK:STDOUT: constants {
  110. // CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
  111. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic]
  112. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  113. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  114. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  115. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  116. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness @empty_struct_type.as.J.impl.%J.impl_witness_table [concrete]
  117. // CHECK:STDOUT: }
  118. // CHECK:STDOUT:
  119. // CHECK:STDOUT: imports {
  120. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  121. // CHECK:STDOUT: import Core//prelude
  122. // CHECK:STDOUT: import Core//prelude/...
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: }
  125. // CHECK:STDOUT:
  126. // CHECK:STDOUT: file {
  127. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  128. // CHECK:STDOUT: .Core = imports.%Core
  129. // CHECK:STDOUT: .J = %J.decl
  130. // CHECK:STDOUT: .F = %F.decl
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT: %Core.import = import Core
  133. // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
  134. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: interface @J {
  138. // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  139. // CHECK:STDOUT: %J.WithSelf.decl = interface_with_self_decl @J [concrete]
  140. // CHECK:STDOUT:
  141. // CHECK:STDOUT: !members:
  142. // CHECK:STDOUT: .Self = %Self
  143. // CHECK:STDOUT: witness = ()
  144. // CHECK:STDOUT:
  145. // CHECK:STDOUT: !requires:
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: impl @empty_struct_type.as.J.impl: %.loc10_16.2 as %J.ref {
  149. // CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @empty_struct_type.as.J.impl [concrete]
  150. // CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
  151. // CHECK:STDOUT:
  152. // CHECK:STDOUT: !members:
  153. // CHECK:STDOUT: witness = <error>
  154. // CHECK:STDOUT: }
  155. // CHECK:STDOUT:
  156. // CHECK:STDOUT: fn @F() {
  157. // CHECK:STDOUT: !entry:
  158. // CHECK:STDOUT: impl_decl @empty_struct_type.as.J.impl [concrete] {} {
  159. // CHECK:STDOUT: %.loc10_16.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  160. // CHECK:STDOUT: %.loc10_16.2: type = converted %.loc10_16.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  161. // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
  162. // CHECK:STDOUT: }
  163. // CHECK:STDOUT: return
  164. // CHECK:STDOUT: }
  165. // CHECK:STDOUT:
  166. // CHECK:STDOUT: specific @J.WithSelf(constants.%Self) {}
  167. // CHECK:STDOUT:
  168. // CHECK:STDOUT: --- fail_extend_impl_self_interface.carbon
  169. // CHECK:STDOUT:
  170. // CHECK:STDOUT: constants {
  171. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  172. // CHECK:STDOUT: %Self.c59: %Z.type = symbolic_binding Self, 0 [symbolic]
  173. // CHECK:STDOUT: %Z.WithSelf.Zero.type.e4a: type = fn_type @Z.WithSelf.Zero, @Z.WithSelf(%Self.c59) [symbolic]
  174. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  175. // CHECK:STDOUT: %Z.WithSelf.Zero.3f4: %Z.WithSelf.Zero.type.e4a = struct_value () [symbolic]
  176. // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete]
  177. // CHECK:STDOUT: %assoc0.cc0: %Z.assoc_type = assoc_entity element0, @Z.WithSelf.%Z.WithSelf.Zero.decl [concrete]
  178. // CHECK:STDOUT: %<error>.as.Z.impl.Zero.type: type = fn_type @<error>.as.Z.impl.Zero, @<error>.as.Z.impl(%Self.c59) [symbolic]
  179. // CHECK:STDOUT: %<error>.as.Z.impl.Zero: %<error>.as.Z.impl.Zero.type = struct_value () [symbolic]
  180. // CHECK:STDOUT: %Point: type = class_type @Point [concrete]
  181. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness @Point.as.Z.impl.%Z.impl_witness_table [concrete]
  182. // CHECK:STDOUT: %Point.as.Z.impl.Zero.type: type = fn_type @Point.as.Z.impl.Zero [concrete]
  183. // CHECK:STDOUT: %Point.as.Z.impl.Zero: %Point.as.Z.impl.Zero.type = struct_value () [concrete]
  184. // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %Point, (%Z.impl_witness) [concrete]
  185. // CHECK:STDOUT: %Z.WithSelf.Zero.type.bb1: type = fn_type @Z.WithSelf.Zero, @Z.WithSelf(%Z.facet) [concrete]
  186. // CHECK:STDOUT: %Z.WithSelf.Zero.22c: %Z.WithSelf.Zero.type.bb1 = struct_value () [concrete]
  187. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  188. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  189. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  190. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  191. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  192. // CHECK:STDOUT: %Point.val: %Point = struct_value () [concrete]
  193. // CHECK:STDOUT: %.fcf: ref %Point = temporary invalid, %Point.val [concrete]
  194. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  195. // CHECK:STDOUT: %Point.type.facet: %type = facet_value %Point, () [concrete]
  196. // CHECK:STDOUT: %Z.WithSelf.Zero.type.15e: type = fn_type @Z.WithSelf.Zero, @Z.WithSelf(%Point.type.facet) [concrete]
  197. // CHECK:STDOUT: %Z.WithSelf.Zero.55b: %Z.WithSelf.Zero.type.15e = struct_value () [concrete]
  198. // CHECK:STDOUT: %.c1b: type = fn_type_with_self_type %Z.WithSelf.Zero.type.bb1, %Z.facet [concrete]
  199. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  200. // CHECK:STDOUT: }
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: imports {
  203. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  204. // CHECK:STDOUT: .Destroy = %Core.Destroy
  205. // CHECK:STDOUT: import Core//prelude
  206. // CHECK:STDOUT: import Core//prelude/...
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: file {
  212. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  213. // CHECK:STDOUT: .Core = imports.%Core
  214. // CHECK:STDOUT: .Z = %Z.decl
  215. // CHECK:STDOUT: .Point = %Point.decl
  216. // CHECK:STDOUT: .F = %F.decl
  217. // CHECK:STDOUT: }
  218. // CHECK:STDOUT: %Core.import = import Core
  219. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  220. // CHECK:STDOUT: %Point.decl: type = class_decl @Point [concrete = constants.%Point] {} {}
  221. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: interface @Z {
  225. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.c59]
  226. // CHECK:STDOUT: %Z.WithSelf.decl = interface_with_self_decl @Z [concrete]
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: !with Self:
  229. // CHECK:STDOUT: %Z.WithSelf.Zero.decl: @Z.WithSelf.%Z.WithSelf.Zero.type (%Z.WithSelf.Zero.type.e4a) = fn_decl @Z.WithSelf.Zero [symbolic = @Z.WithSelf.%Z.WithSelf.Zero (constants.%Z.WithSelf.Zero.3f4)] {} {}
  230. // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, %Z.WithSelf.Zero.decl [concrete = constants.%assoc0.cc0]
  231. // CHECK:STDOUT: impl_decl @<error>.as.Z.impl [concrete] {} {
  232. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: !members:
  236. // CHECK:STDOUT: .Self = %Self
  237. // CHECK:STDOUT: .Z = <poisoned>
  238. // CHECK:STDOUT: .Zero = @Z.WithSelf.%assoc0
  239. // CHECK:STDOUT: .Z = <poisoned>
  240. // CHECK:STDOUT: witness = (@Z.WithSelf.%Z.WithSelf.Zero.decl)
  241. // CHECK:STDOUT:
  242. // CHECK:STDOUT: !requires:
  243. // CHECK:STDOUT: }
  244. // CHECK:STDOUT:
  245. // CHECK:STDOUT: generic impl @<error>.as.Z.impl(@Z.%Self: %Z.type) {
  246. // CHECK:STDOUT: !definition:
  247. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.c59)]
  248. // 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)]
  249. // 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)]
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: impl: <error> as %Z.ref {
  252. // 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)] {} {}
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: !members:
  255. // CHECK:STDOUT: .Zero = %<error>.as.Z.impl.Zero.decl
  256. // CHECK:STDOUT: witness = <error>
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: impl @Point.as.Z.impl: %Self.ref as %Z.ref {
  261. // 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] {} {}
  262. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%Point.as.Z.impl.Zero.decl), @Point.as.Z.impl [concrete]
  263. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness]
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: !members:
  266. // CHECK:STDOUT: .Zero = %Point.as.Z.impl.Zero.decl
  267. // CHECK:STDOUT: witness = %Z.impl_witness
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: class @Point {
  271. // CHECK:STDOUT: impl_decl @Point.as.Z.impl [concrete] {} {
  272. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Point [concrete = constants.%Point]
  273. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  274. // CHECK:STDOUT: }
  275. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  276. // CHECK:STDOUT: complete_type_witness = %complete_type
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: !members:
  279. // CHECK:STDOUT: .Self = constants.%Point
  280. // CHECK:STDOUT: .Z = <poisoned>
  281. // CHECK:STDOUT: .Zero = <poisoned>
  282. // CHECK:STDOUT: extend @Point.as.Z.impl.%Z.ref
  283. // CHECK:STDOUT: }
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: generic fn @Z.WithSelf.Zero(@Z.%Self: %Z.type) {
  286. // CHECK:STDOUT: fn();
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: generic fn @<error>.as.Z.impl.Zero(@Z.%Self: %Z.type) {
  290. // CHECK:STDOUT: !definition:
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: fn() {
  293. // CHECK:STDOUT: !entry:
  294. // CHECK:STDOUT: return
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT: }
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: fn @Point.as.Z.impl.Zero() {
  299. // CHECK:STDOUT: !entry:
  300. // CHECK:STDOUT: return
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: fn @F() {
  304. // CHECK:STDOUT: !entry:
  305. // CHECK:STDOUT: %.loc25_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  306. // CHECK:STDOUT: %Point.ref: type = name_ref Point, file.%Point.decl [concrete = constants.%Point]
  307. // CHECK:STDOUT: %.loc25_5.2: ref %Point = temporary_storage
  308. // CHECK:STDOUT: %.loc25_5.3: init %Point to %.loc25_5.2 = class_init () [concrete = constants.%Point.val]
  309. // CHECK:STDOUT: %.loc25_7.1: init %Point = converted %.loc25_5.1, %.loc25_5.3 [concrete = constants.%Point.val]
  310. // CHECK:STDOUT: %.loc25_7.2: ref %Point = temporary %.loc25_5.2, %.loc25_7.1 [concrete = constants.%.fcf]
  311. // CHECK:STDOUT: %Zero.ref: %Z.assoc_type = name_ref Zero, @Z.WithSelf.%assoc0 [concrete = constants.%assoc0.cc0]
  312. // CHECK:STDOUT: %impl.elem0: %.c1b = impl_witness_access constants.%Z.impl_witness, element0 [concrete = constants.%Point.as.Z.impl.Zero]
  313. // CHECK:STDOUT: %Point.as.Z.impl.Zero.call: init %empty_tuple.type = call %impl.elem0()
  314. // CHECK:STDOUT: return
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %Point) = "no_op";
  318. // CHECK:STDOUT:
  319. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Self.c59) {
  320. // CHECK:STDOUT: !definition:
  321. // CHECK:STDOUT: %Self => constants.%Self.c59
  322. // CHECK:STDOUT: %Z.WithSelf.Zero.type => constants.%Z.WithSelf.Zero.type.e4a
  323. // CHECK:STDOUT: %Z.WithSelf.Zero => constants.%Z.WithSelf.Zero.3f4
  324. // CHECK:STDOUT: }
  325. // CHECK:STDOUT:
  326. // CHECK:STDOUT: specific @Z.WithSelf.Zero(constants.%Self.c59) {}
  327. // CHECK:STDOUT:
  328. // CHECK:STDOUT: specific @<error>.as.Z.impl(constants.%Self.c59) {
  329. // CHECK:STDOUT: !definition:
  330. // CHECK:STDOUT: %Self => constants.%Self.c59
  331. // CHECK:STDOUT: %<error>.as.Z.impl.Zero.type => constants.%<error>.as.Z.impl.Zero.type
  332. // CHECK:STDOUT: %<error>.as.Z.impl.Zero => constants.%<error>.as.Z.impl.Zero
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: specific @<error>.as.Z.impl.Zero(constants.%Self.c59) {}
  336. // CHECK:STDOUT:
  337. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Z.facet) {
  338. // CHECK:STDOUT: !definition:
  339. // CHECK:STDOUT: %Self => constants.%Z.facet
  340. // CHECK:STDOUT: %Z.WithSelf.Zero.type => constants.%Z.WithSelf.Zero.type.bb1
  341. // CHECK:STDOUT: %Z.WithSelf.Zero => constants.%Z.WithSelf.Zero.22c
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: specific @Z.WithSelf.Zero(constants.%Z.facet) {}
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Point.type.facet) {
  347. // CHECK:STDOUT: !definition:
  348. // CHECK:STDOUT: %Self => constants.%Point.type.facet
  349. // CHECK:STDOUT: %Z.WithSelf.Zero.type => constants.%Z.WithSelf.Zero.type.15e
  350. // CHECK:STDOUT: %Z.WithSelf.Zero => constants.%Z.WithSelf.Zero.55b
  351. // CHECK:STDOUT: }
  352. // CHECK:STDOUT: