File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -7727,8 +7727,6 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
7727
7727
}
7728
7728
}
7729
7729
7730
- diagnoseIsolatedDeinitInValueTypes (attr);
7731
-
7732
7730
if (auto VD = dyn_cast<ValueDecl>(D)) {
7733
7731
// 'nonisolated(unsafe)' is meaningless for computed properties, functions etc.
7734
7732
auto var = dyn_cast<VarDecl>(VD);
@@ -7763,8 +7761,6 @@ void AttributeChecker::visitGlobalActorAttr(GlobalActorAttr *attr) {
7763
7761
return ;
7764
7762
}
7765
7763
7766
- diagnoseIsolatedDeinitInValueTypes (attr);
7767
-
7768
7764
(void )nominal->isGlobalActor ();
7769
7765
}
7770
7766
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ struct CS: ~Copyable {
19
19
}
20
20
21
21
struct DS : ~ Copyable {
22
- nonisolated deinit { } // expected-error {{only classes and actors can have isolated deinit}}
22
+ nonisolated deinit { }
23
23
}
24
24
25
25
struct ES: ~ Copyable {
@@ -47,7 +47,7 @@ enum CE: ~Copyable {
47
47
enum DE : ~ Copyable {
48
48
case dummy
49
49
// expected-error@+1 {{deinitializers are not yet supported on noncopyable enums}}
50
- nonisolated deinit { } // expected-error {{only classes and actors can have isolated deinit}}
50
+ nonisolated deinit { }
51
51
}
52
52
53
53
enum EE : ~ Copyable {
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift -swift-version 5 %s -strict-concurrency=complete -target %target-swift-5.1-abi-triple
2
+
3
+ // REQUIRES: concurrency
4
+ // REQUIRES: OS=macosx
5
+
6
+ class NotSendable { }
7
+
8
+ @MainActor class C {
9
+ var x : Int = 0
10
+
11
+ nonisolated deinit {
12
+ print ( x)
13
+ }
14
+ }
15
+
16
+ // expected-note@+1{{add '@available' attribute to enclosing class}}
17
+ @MainActor class C2 {
18
+ var x : Int = 0
19
+
20
+ isolated deinit { // expected-error{{isolated deinit is only available in macOS 15.4.0 or newer}}
21
+ print ( x)
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments