We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4497c70 + 666f036 commit c961cc1Copy full SHA for c961cc1
validation-test/SILOptimizer/issue-73859.swift
@@ -0,0 +1,37 @@
1
+// RUN: %target-run-simple-swift | %FileCheck %s
2
+
3
+// REQUIRES: executable_test
4
5
+class Object {
6
+ deinit { print("deinit object") }
7
+}
8
9
+struct Noncopyable: ~Copyable {
10
+ deinit { print("deinit noncopyable") }
11
12
13
+func testDeinitAfterConsume() {
14
+ do {
15
+ let object = Object()
16
+ // CHECK: before consume
17
+ print("before consume")
18
+ // CHECK: deinit object
19
+ _ = consume object
20
+ // CHECK: after consume
21
+ print("after consume")
22
+ }
23
24
+ print()
25
26
27
+ let noncopyable = Noncopyable()
28
29
30
+ // CHECK: deinit noncopyable
31
+ _ = consume noncopyable
32
33
34
35
36
37
+testDeinitAfterConsume()
0 commit comments